0

We have a requirement where we will be storing data in JSON-LD format for maintaining a catalog and data from the catalog will be pulled in batches to a graph database which supports the RDF data format. We have been looking at Cayley and DBgraph for this purpose, but these databases support N-Quads as their data format.

Is there a graph database which has the JSON-LD data format or is there a way to convert the JSON-LD format to the N-Quads/Turtle format?

3
  • 1
    Apache Jena, of course, is able to parse JSON-LD, see the docs Commented Jan 16, 2018 at 7:06
  • @AKSW we are in process of evaluating Cayley for building knowledge graph. Any suggestions or views on that? Commented Jan 16, 2018 at 7:30
  • 1
    Please note that tool recommendations is considered off-topic on StackOverflow. That said, most triplestores/frameworks/parsing toolkits should be able to do this. Commented Jan 17, 2018 at 7:56

2 Answers 2

2

Converting JSON-LD to N-Quads (and back) are core algorithms described in the JSON-LD API specification. Any conforming JSON-LD processor supports this.

Sign up to request clarification or add additional context in comments.

Comments

0

Pyld provides an option to normalise jsonld to other RDF formats.

# normalize a document using the RDF Dataset Normalization Algorithm
# (URDNA2015), see: http://json-ld.github.io/normalization/spec/
normalized = jsonld.normalize(
    doc, {'algorithm': 'URDNA2015', 'format': 'application/nquads'})
# normalized is a string that is a canonical representation of the document
# that can be used for hashing, comparison, etc.

Below is the link:

https://github.com/digitalbazaar/pyld

2 Comments

this doesn't seem to work when the doc has a remote context. Any idea how to solve it?
@Ann You might want to take a look into this section github.com/digitalbazaar/pyld#document-loader

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.