I load Jena with two ontologies. They both have a Person class defined. They both have a person name John. They are not the "same" John; different person, different prefix, different IRI. Without changing original ontologies, is there a system (say adding a triple to the store) so that they could be equivalent. An rdfs:subClassOf builtin?
Asked
Active
Viewed 322 times
1
-
2The title of the question asks about SPARQL, but the question seems to be about OWL or RDFS. In OWL you can say that john1 owl:sameAs john2. If you want to treat them as "equivalent" in a SPARQL query, you'll need to provide more context. You could, for instance, add the owl:sameAs triple, and then user some property paths that include owl:sameAs, and so be able to treat john1 and john2 as sort of the same. – Joshua Taylor Oct 07 '14 at 20:38
-
1Can you add an example of the data you want to link? Is there any label or common information that you could match? This would help you to do what @JoshuaTaylor suggests, which is the best way to solve your problem. – magnudae Oct 08 '14 at 07:04
1 Answers
0
As stated in the comments one solution is to define the resources as equivalent via owl:sameAs and run a reasoner. This will define the proper union of properties for each, meaning that each resource will have the same properties and values.
If running a reasoner isn't what you're looking for then you can run the equivalent SPARQL to insert the data:
CONSTRUCT {
<person1> ?p2 ?o2
<person2> ?p1 ?o1 .
}
WHERE {
<person1> ?p1 ?o1 .
<person2> ?p2 ?o2 .
}
This returns the set of triples that are constructed, i.e. those that do not already exist, and therefore gives you the same union that an OWL reasoner will.
If you only need to do this one at data load, then simply insert that data using the same query pattern:
INSERT {
GRAPH <graph-uri> {
<person1> ?p2 ?o2
<person2> ?p1 ?o1 .
}
}
WHERE {
<person1> ?p1 ?o1 .
<person2> ?p2 ?o2 .
}

scotthenninger
- 3,921
- 1
- 15
- 24