[英]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 但是,我没有看到给它一个上下文的方法
I tried providing a context inside the jsonld file like this (see https://gist.github.com/VladimirAlexiev/6ab60b6a0e1ab32a2f3980c57b005d8f ): 我尝试在jsonld文件中提供这样的上下文(请参阅https://gist.github.com/VladimirAlexiev/6ab60b6a0e1ab32a2f3980c57b005d8f ):
{"@context":"gvp-context.jsonld", "@graph":[...]} {“@ context”:“gvp-context.jsonld”,“@ graph”:[...]}
But it's ignored and it makes its own context. 但它被忽略了,它创造了自己的背景。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.