for ex:
my mongo have
collections:
users
_id: ?userId
username: ?username
groups
_id: ?groupId
name: ?groupName
parentGroupId: ?groupId
groupmembers
_id: doesn't matter
groupId: ?groupId
userId: ?userId
i'm trying to write something like this and click save, but an error
"JSON template must contain a single key indicating the MongoDB document collection"
PREFIX : <http://kim.jong.un/onto#>
MAPPING
FROM JSON {
"users": {
"_id": "?userId",
"username": "?username",
"role": "?role"
},
"groupmembers": {
"_id": "?groupMemberId",
"groupId": "?groupId",
"userId": "?userId"
}
}
TO {
?user a :User;
:username ?username;
:role ?role .
}
WHERE {
BIND (template("http://kim.jong.un/onto#{userId}") AS ?user)
BIND (template("http://kim.jong.un/onto#{groupMemberId}") AS ?groupmember)
}
it looks we have a video for sql
if i follow the syntax from video
the relation description should put into separate sms block like
MAPPING
FROM {}
TO {}
WHERE {}
MAPPING
FROM {}
TO {}
WHERE {}
MAPPING
FROM {}
TO {}
WHERE {}
MAPPING
FROM {}
TO {}
WHERE {}
but i still can't figure out how to make it works.
the primary key and foreign key variable looks scoped if its not write in same block
how to indicate its same key(field, ?variable)
my excepted sparql result is like
(user.username)._id <- userId groupId -> (group.Id).name
[username] [groupName]
:jess :stardog