rdfland rdfproc:添加RDF文本
在rdfproc/redland中,如何添加类型化文字?手册页上说:rdfland rdfproc:添加RDF文本,rdf,redland,Rdf,Redland,在rdfproc/redland中,如何添加类型化文字?手册页上说: add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT] Add the triple with the datatyped literal object to the graph, in the optional Redland context if CONTEXT is given. 我的rdf文件: $ xmll
add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT]
Add the triple with the datatyped literal object to the graph, in the optional Redland context if CONTEXT is given.
我的rdf文件:
$ xmllint test.rdf
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
</rdf:RDF>
但出现以下错误:
rdfproc: cannot have missing triple parts for add-typed
简单的“添加”就可以了
$ rdfproc --storage file test.rdf add "http://my/subject" "http://my/predicate" "2015-50-17T15:50:00" && xmllint test.rdf
rdfproc: Added triple to the graph
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xml:base="file:///home/lindenb/path/test.rdf">
<rdf:Description rdf:about="http://my/subject">
<ns0:predicate xmlns:ns0="http://my/">2015-50-17T15:50:00</ns0:predicate>
</rdf:Description>
</rdf:RDF>
不能同时指定语言和数据类型 若要省略其中一项,请在命令行上提供
-
。例如:
rdfproc -n --storage sqlite test.sq add-typed "http://my/subject" "http://my/predicate" "2015-50-17T15:50:00" - "http://www.w3.org/2001/XMLSchema#dateTime"
我将存储类型更改为sqlite,并添加了创建新存储的选项
-n
-文件存储会产生另一个错误rdfproc:Warning-模型不支持上下文rdfproc:未能将三元组添加到图形中
,并且我没有阅读足够的源代码以了解如何修复该错误。我不知道该工具您正在使用,但数据类型化文字没有语言标记,因此我认为您不应该同时指定“fr”和“xsd:dateTime”,尽管我不确定您将用什么替换“fr”,是的,我知道lang+type:但我尝试了许多组合,我尝试了空字符串,但没有“-”。检查:输出现在为:`rdfproc--storage file test.rdf add typed”““2015-50-17T15:50:00”“--”“rdfproc:Warning-模型不支持上下文rdfproc:未能将三元组添加到图形中`这不起作用(v 1.0.16):rdfproc:Warning-模型不支持上下文rdfproc:未能将三元组添加到图形中
Yes-这是另一个问题。它适用于其他一些存储设备。
$ rdfproc -version
1.0.14
rdfproc -n --storage sqlite test.sq add-typed "http://my/subject" "http://my/predicate" "2015-50-17T15:50:00" - "http://www.w3.org/2001/XMLSchema#dateTime"