简体   繁体   English

Jena RIOT的JSON-LD?

[英]JSON-LD in Jena RIOT?

I got Jena 2.12.1 (2014-10-02) from the Apache Jena Releases page. 我从Apache Jena Releases页面获得了Jena 2.12.1(2014-10-02)。 It's supposed to have JSON-LD support, according to Reading and Writing RDF in Apache Jena . 根据Apache Jena的阅读和写作RDF,它应该具有JSON-LD支持。 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.): 但是当我尝试使用具有JSON-LD输出格式的riot时,我得到一个错误(对于大小写,连字符等变体也会出现同样的情况):

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? 我怎样才能用JSON-LD写?

It has correctly identified JSON-LD. 它已正确识别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. JSON-LD不是流输出语言(编写者在调用jsonld-java代码之前需要所有可用数据)而riot是流解析器(它可以处理任何大小的文件)并且需要以流方式编写。

The tool to read in the data into memory and write it out is rdfcat . 将数据读入内存并将其写出的工具是rdfcat

rdfcat -out JSONLD NIF-example2.ttl

More recent RIOT versions (since late 2015) support JSONLD. 最近的RIOT版本(自2015年底以来)支持JSONLD。 However, I don't see a way to give it a context 但是,我没有看到给它一个上下文的方法

But it's ignored and it makes its own context. 但它被忽略了,它创造了自己的背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM