charon
charon

Reputation: 1

How can I add an annotation for a property between two individuals using rdflib

I'm using rdflib in python to build a graph, and how can i use it to add an annotation for a property between two individuals. For example, graph namespace is <http//:example.com/test#>, two individuals are <http//:example.com/test#a> and <http//:example.com/test#a>, one relation <http//:example.com/test#rel> between individual a and b. And an annotation property description for rel between a and b. The code in owl is shown below

<owl:NamedIndividual rdf:about="http//:example.com/test#a">
    <rel rdf:resource="http//:example.com/test#b"/>
</owl:NamedIndividual>
<owl:Axiom>
    <owl:annotatedSource rdf:resource="http//:example.com/test#a"/>
    <owl:annotatedProperty rdf:resource="http//:example.com/test#rel"/>
    <owl:annotatedTarget rdf:resource="http//:example.com/test#b"/>
    <description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">des</description>
</owl:Axiom>

And how can i use rdflib in python to build a graph like this.

Upvotes: 0

Views: 117

Answers (0)

Related Questions