Is there a way to convert JSON-LD to N-Quads format?

Raghav salotra Source

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

If there is a graph db which has JSON-LD data format or if there is way to convert JSON-LD format to N-Quads/Turtle format?



answered 7 months ago Gregg Kellogg #1

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

answered 6 months ago Raghav salotra #2

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

# normalize a document using the RDF Dataset Normalization Algorithm
# (URDNA2015), see:
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:

comments powered by Disqus