Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON-LD in Jena RIOT?

Tags:

rdf

json-ld

jena

I got Jena 2.12.1 (2014-10-02) from the Apache Jena Releases page. It's supposed to have JSON-LD support, according to Reading and Writing RDF in Apache Jena. But when I try to use riot with an output format of JSON-LD, I get an error (and the same happens for variants in capitalization, hyphenation, etc.):

riot --out=JSON-LD NIF-example2.ttl

   Turtle
   N-Quads
   N-Triples
   TriG
   RDF_THRIFT
Not recognized as an streaming RDF language : 'JSON-LD'

How can I write in JSON-LD?

like image 619
Vladimir Alexiev Avatar asked Oct 09 '14 20:10

Vladimir Alexiev


People also ask

What is Jena API?

Apache Jena is an open source Semantic Web framework for Java. It provides an API to extract data from and write to RDF graphs. The graphs are represented as an abstract "model". A model can be sourced with data from files, databases, URLs or a combination of these. A model can also be queried through SPARQL 1.1.

What is Apache Jena Fuseki?

Apache Jena Fuseki is a SPARQL server. It can run as a operating system service, as a Java web application (WAR file), and as a standalone server.

What is Apache Jena used for?

Apache Jena (or Jena in short) is a free and open source Java framework for building semantic web and Linked Data applications. The framework is composed of different APIs interacting together to process RDF data.


1 Answers

It has correctly identified JSON-LD. JSON-LD is not a streaming output language (the writer needs all the data available before calling the jsonld-java code) and riot is a streaming parser (it can cope with files of any size) and needs to write in a streaming fashion.

The tool to read in the data into memory and write it out is rdfcat.

rdfcat -out JSONLD NIF-example2.ttl
like image 135
AndyS Avatar answered Dec 02 '22 15:12

AndyS