Stardog data import from Json

Hi Team,

Can I add data from a json file directly into a stardog db.
I followed following steps:

  1. Create a db.
  2. stardog data add company C:\startdog\data\outputjson.json

It got the response:
Adding data from file: C:\startdog\data\outputjson.json
0 triples updated in 00:00:00.059

But no data got uploaded from the json. Am i missing something?

Thanks!
Best Regards,
Smrati

As far as I know, you have to load RDF data, in one of several RDF serialization syntaxes (check the man page at ‘stardog help data add’ for details). Plain JSON is not one of them. Now, JSON-LD is a JSON serialization for RDF, but I’d be curious if Stardog can parse that for data loading…

It absolutely can parse JSON-LD!

Thank you so much for the response!
I have very limited knowledge about jsonld but as per my understanding, jsonld is used in case of linked data. If the data is not linked and just a json object, then shall i convert it to rdf first?

Thanks!
Best Regards,
Smrati

That’s correct. To make a JSON document a JSON-LD document you would need to supply a @context or mark up the document with the appropriate JSON-LD annotations https://json-ld.org/

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.