简体   繁体   English

RDFlib中的rdf:ID等效什么?

[英]what is the equivalent of rdf:ID in RDFlib?

I tried g.add(foo,RDF.ID,boo) but it didn't work. 我尝试了g.add(foo,RDF.ID,boo)但是没有用。 In the other hand RDF.type and RDF.about seems to work. 另一方面, RDF.typeRDF.about似乎可以工作。 how can i use rdf:ID in rdflib ? 如何在rdflib中使用rdf:ID?

You can't. 你不能 rdf:ID is not an RDF property (neither is rdf:about , by the way), it's merely a syntactical device of the RDF/XML syntax. rdf:ID不是RDF属性(顺便说一句rdf:about也不是),它只是RDF / XML语法的句法设备。 Just like angle brackets < and > are syntactical devices. 就像尖括号<>是语法设备一样。

In RDF/XML, rdf:ID is used to identify the subject of one or more RDF statements. 在RDF / XML中, rdf:ID用于标识一个或多个RDF语句的主题。 For example: 例如:

<rdf:Description rdf:ID="p1">
      <rdf:type rdf:resource="#Person">
      <rdfs:label>John</rdfs:label>
</rdf:Description>

is a bit of RDF/XML that contains two RDF statements. 是包含两个RDF语句的RDF / XML的一部分。 The subject for both of these statements is p1 . 这两个语句的主题均为p1 The first statement says that p1 is of type Person . 第一条语句说p1Person类型。 The second statement says that the label of p1 is "John". 第二条语句说p1的标签是“ John”。

The trick, when working with RDFLib or any other RDF tool, is to think in terms of the RDF graph (that is, the collection of statements). 使用RDFLib或任何其他RDF工具时,技巧是根据RDF图(即语句的集合)进行思考。 Forget you ever saw what RDF/XML looked like. 忘了您曾经看到过RDF / XML的外观。

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

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