Is Protege (or SPARQL) misinterpreting an anonymous individual?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is Protege (or SPARQL) misinterpreting an anonymous individual?

Steve Wartik

I think either Protégé (version 4.2.0, build 295) or the SPARQL plugin is misinterpreting its model. Load the attached ontology, which as you can see has two triples with an anonymous subject. Then execute the following SPARQL:

 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX prov: <http://www.w3c.org/ns/prov#>

SELECT DISTINCT *

WHERE {

  ?s rdf:type prov:Entity .

  ?s ?p ?o .

}

 

One of the results is the row:

 

s

p

o

<urn:AnonId:…>

rdf:type

owl:NamedIndividual

 

The triple’s object shouldn’t be owl:NamedIndividual, should it?

 

I wrote a small test harness around OWL API that loads the ontology and retrieves entities. My program reports that OWL API translates the node into an anonymous individual, and that the ontology has no named individuals.  The individual doesn’t show up in Protégé’s Individuals tab, so perhaps the problem lies in the SPARQL plugin.

 

Steve Wartik


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

benefit.owl (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Is Protege (or SPARQL) misinterpreting an anonymous individual?

Timothy Redmond

Yes this is a problem.  The fix might simply involve removing some logic from the mapping between OWL ontologies and RDF graphs. 

The problem is that I didn't trust Sesame to always give the same temporary name for an anonymous resource.  In the case of anonymous individuals, I need to know the mapping between RDF resources and the OWL ontology anonymous individuals so that I can properly handle add and remove axiom operations involving those anonymous individuals.  So before sending axioms to Sesame I would convert the anonymous individuals to named individuals and I would keep track of the mapping.

I didn't immediately figure out how Sesame names anonymous resources and wondered if the answer might be triple store backend specific.  I did not do very much testing of how Sesame handled anonymous resources because I wanted to use a "documented" solution.  It is possible that Sesame provides guarantees that it always names an anonymous individual in the same way.  If this was true then this conversion of anonymous individuals to named individuals is unnecessary and this logic could be removed.

-Timothy




On 04/11/2013 11:01 AM, Wartik, Steven P "Steve" wrote:

I think either Protégé (version 4.2.0, build 295) or the SPARQL plugin is misinterpreting its model. Load the attached ontology, which as you can see has two triples with an anonymous subject. Then execute the following SPARQL:

 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX prov: <http://www.w3c.org/ns/prov#>

SELECT DISTINCT *

WHERE {

  ?s rdf:type prov:Entity .

  ?s ?p ?o .

}

 

One of the results is the row:

 

s

p

o

<urn:AnonId:…>

rdf:type

owl:NamedIndividual

 

The triple’s object shouldn’t be owl:NamedIndividual, should it?

 

I wrote a small test harness around OWL API that loads the ontology and retrieves entities. My program reports that OWL API translates the node into an anonymous individual, and that the ontology has no named individuals.  The individual doesn’t show up in Protégé’s Individuals tab, so perhaps the problem lies in the SPARQL plugin.

 

Steve Wartik



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Is Protege (or SPARQL) misinterpreting an anonymous individual?

Alan Ruttenberg-2



On Mon, Apr 15, 2013 at 10:42 AM, Timothy Redmond <[hidden email]> wrote:

Yes this is a problem.  The fix might simply involve removing some logic from the mapping between OWL ontologies and RDF graphs. 

The problem is that I didn't trust Sesame to always give the same temporary name for an anonymous resource. 
In the case of anonymous individuals, I need to know the mapping between RDF resources and the OWL ontology anonymous individuals so that I can properly handle add and remove axiom operations involving those anonymous individuals.  So before sending axioms to Sesame I would convert the anonymous individuals to named individuals and I would keep track of the mapping.

Instead, add a protege specific annotation to the axioms and individuals that you need to keep track of. 
 
I didn't immediately figure out how Sesame names anonymous resources and wondered if the answer might be triple store backend specific. 

It should be unspecified. BTW, does the triple store/sparql understand OWL semantics?
 
I did not do very much testing of how Sesame handled anonymous resources because I wanted to use a "documented" solution.  It is possible that Sesame provides guarantees that it always names an anonymous individual in the same way.  If this was true then this conversion of anonymous individuals to named individuals is unnecessary and this logic could be removed.

-Timothy





On 04/11/2013 11:01 AM, Wartik, Steven P "Steve" wrote:

I think either Protégé (version 4.2.0, build 295) or the SPARQL plugin is misinterpreting its model. Load the attached ontology, which as you can see has two triples with an anonymous subject. Then execute the following SPARQL:

 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX prov: <http://www.w3c.org/ns/prov#>

SELECT DISTINCT *

WHERE {

  ?s rdf:type prov:Entity .

  ?s ?p ?o .

}

 

One of the results is the row:

 

s

p

o

<urn:AnonId:…>

rdf:type

owl:NamedIndividual

 

The triple’s object shouldn’t be owl:NamedIndividual, should it?

 

I wrote a small test harness around OWL API that loads the ontology and retrieves entities. My program reports that OWL API translates the node into an anonymous individual, and that the ontology has no named individuals.  The individual doesn’t show up in Protégé’s Individuals tab, so perhaps the problem lies in the SPARQL plugin.

 

Steve Wartik



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Is Protege (or SPARQL) misinterpreting an anonymous individual?

Steve Wartik

Alan,

 

<snip>

Instead, add a protege specific annotation to the axioms and individuals that you need to keep track of.

<snip>

 

By “annotation”, did you mean an OWL annotation property and corresponding triples? I would not be wild about that. My SPARQL queries already contain more than enough FILTER clauses to get rid of extraneous crud.

 

(Sorry if I’m misreading your intended solution.)

 

Regards,

 

Steve Wartik


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Is Protege (or SPARQL) misinterpreting an anonymous individual?

Alan Ruttenberg-2



On Tue, Apr 16, 2013 at 10:46 AM, Wartik, Steven P "Steve" <[hidden email]> wrote:

Alan,

 

<snip>

Instead, add a protege specific annotation to the axioms and individuals that you need to keep track of.

<snip>

 

By “annotation”, did you mean an OWL annotation property and corresponding triples?

Yes. 

I would not be wild about that. My SPARQL queries already contain more than enough FILTER clauses to get rid of extraneous crud.

It is feasible that the could be filtered out from responses before you see them.
-Alan 

 

(Sorry if I’m misreading your intended solution.)

 

Regards,

 

Steve Wartik


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback