问题
I use RDF/XML to represent some data.
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>
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 ?????
Thank you in advance for your help.
回答1:
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>
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.
来源:https://stackoverflow.com/questions/22775427/when-i-declare-property-how-to-use-it