当我声明财产如何使用时

当我声明财产如何使用时

本文介绍了当我声明财产如何使用时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用RDF/XML表示一些数据.

I use RDF/XML to represent some data.

首先,我想表明一个人认识另一个人,我声明财产,并使用以下代码指定标记知道katrin和katrin认识约翰

First of all i want to show that a person knows other person, i declare the property and i use the following code to specify that mark knows katrin and katrin knows john

PART 1
<rdf:Property rdf:about="Know">
     <rdfs:domain rdf:resource="#Person"/>
     <rdfs:range rdf:resource="#Person"/>
</rdf:Property>


PART2
<rdf:Description rdf:about="#Mark">
    <dc:Knows rdf:resource="#Katrin"/>
</rdf:Description>


<rdf:Description rdf:about="#Katrin">
    <dc:Knows rdf:resource="#John"/>
</rdf:Description>

现在,我想声明一个属性并代表更多东西.我的意思是.例如,我想说katrin拥有一只ID为10的狗,其中这只狗的颜色为黑色,名字叫彼得.上面我只有资源的属性和对象.现在,我不得不说更多,如何才能使它成为第2部分?

Now i want to declare a property and represent more things. What i mean. I want to say for example that katrin owns a dog with ID 10 where this dog has colour black and its name is Peter.Above i had only the resource the property and the object. Now that i have to say more how can i make it the part 2??

PART 1

<rdf:Property rdf:ID="Own">
     <rdfs:domain rdf:resource="#Person"/>
     <rdfs:range rdf:resource="#Dog"/>
</rdf:Property>

PART 2  ?????

预先感谢您的帮助.

推荐答案

与您之前的示例没什么不同

It's no different than your previous example

<rdf:Description rdf:about="http://example.org/Katrin">
   <ns:owns rdfs:resource="http://example.org/dog/10"/>
</rdf:Description>

<rdf:Description rdf:about="http://example.org/dog/10">
    <ns:name>Peter</ns:name>
    <ns:color>Black</ns:name>
</rdf:Description>

对于诸如knowsname的关系,您可以考虑使用通用词汇(例如FOAF).除了XML序列化之外,您还应该使用几乎所有其他RDF序列化 other ;它很难阅读,甚至更难写.我强烈建议龟.

You might consider using a common vocabulary, such as FOAF, for relations such as knows, or name. You should also use pretty much any other RDF serialization other than the XML serialization; it's hard to read and even harder to write. I strongly suggest Turtle.

这篇关于当我声明财产如何使用时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 18:09