Hi Team,
Following the doc- Importing JSON and CSV Files | Stardog Documentation Latest
I am trying to write the mapping document for my JSON input file. Please find my input below and help me to resolve the error.
Also please share any detailed document which can guide me to write the mapping documents for different json data.
INPUT JSON-
{
"resourceType": "Patient",
"id": "123",
"active": true,
"name": "sam"
"gender": "male",
"birthDate": "1996"
}
Mapping -
PREFIX : <http://example.com/>
MAPPING
FROM JSON {
{
"resourceType" : "?resourceType",
"id" : "?id",
"active" : "?active",
"gender" : "?gender",
"name" : "?name",
"birthDate" : "?birthDate"
}
}
TO {
?block a :Block ;
:resourceType ?resourceType ;
:birthDate ?dateTime ;
:id ?id ;
:gender ?gender ;
:name ?name;
:active ?boolean.
}
WHERE {
bind(xsd:dateTime(?birthDate) as ?dateTime)
bind(xsd:boolean(?active) as ?boolean)
}
Error -
jess
(Jess Balint)
August 13, 2021, 8:05pm
2
Hi Raja,
Can you try specifying the --format sms2
similar to the last example in stardog-admin virtual import
?
Jess
jess
(Jess Balint)
August 13, 2021, 8:10pm
3
My apologies. It appears the syntax error is in the JSON file. The comma is missing after "sam"
.
Jess
Hi Jess,
Thanks for the quick reply.
I am successfully able to execute the command but unable to see any data in the database.
Also please share any reference document for creating a json mapping file.
Note - I am referring doc - Importing JSON and CSV Files | Stardog Documentation Latest to create a mapping file but the document is not in detail which can help me to create mapping for a complex JSON data.
jess
(Jess Balint)
August 16, 2021, 5:14am
5
This displayed triple count is an approximation and is updated when the database statistics are recomputed. Can you try to retrieve the data using a SPARQL query?
I am trying this query but unable to see any values. Please correct me if the query is wrong.
PREFIX : http://example.com/
SELECT *
WHERE {
?block :id ?id
}
jess
(Jess Balint)
August 16, 2021, 5:27am
7
I see you haven't provided any binding for ?block
in your mappings. Please try to add:
bind(template("http://example.com/block/{id}") as ?block)
system
(system)
Closed
August 30, 2021, 5:28am
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.