0

I'm practicing on Protégé with a small Ontology detailing the House of Noldor from Lord of the Ring. (Really, it's just a fancy family tree.) You can find it Here

Note: The class names are in italian, due to me having to present this to my university.

I'm pretty sure the Ontology is decently written, not the best thing around due to me being at my first attempt, and the Reasoner (HermiT 1.3.8.3) is giving me no errors.

Now I have been required to produce some SPARQL queries.

I have added the lines:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX genealogia <http://www.semanticweb.org/kayurin/ontologies/2015/1/casata_di_finwe#>

at the top of the SPARQL compiler tab and proceeded with the first query:

SELECT ?Individuo
{
?Individuo genealogia:haGenitore genealogia:Finwe
}

According to my sources, this was supposed to return me all the members in the class "Individuo" who had the property 'heGenitore Finwe'.

No result...

I tried then with

SELECT ?Individuo
{
?Individuo genealogia:haLegameFraterno genealogia:Caranthir
}

Again, it should have returned me all the members in the Class Individuo who had the property 'haLegameFraterno Caranthir'.

This was an incomplete success... It returned me almost all the members of the Class 'Individuo' which had the property 'haLegameFraterno' with Feanor but one. (The member known as Amrod.)

If I use it for another set of siblings (That's the meaning of the property.) it doesn't return me anything at all.

Pretty sure that the query are well written and the Ontology itself it's correct, or at least cannot see where I'm doing it wrong.

Thanks in advance for any help you'll give me to solve this mess...

EDIT

I managed to make things work, literally had to turn all the properties into asserted ones (By manual input.) because Protégé SPARQL query executor was taking into account only the inferred ones otherwise.

I have no access to other versions of the program (The older versions won't start on my windows 8.1.) but I wonder if this an issue of version, of the Reasonator or just something I did wrong with my Ontology.

Kay
  • 13
  • 3
  • Could you provide an RDF version of your ontology so that we can run SPARQL queries against it? – Joshua Taylor Feb 10 '15 at 18:45
  • Trying to do so... but if I go "Save as:" and select RDF/XML it still forces me to save it as OWL. Kinda new at this, there's something I'm missing? – Kay Feb 10 '15 at 18:53
  • [Here](http://digilander.libero.it/neonbgct/finwe.rdf) Can't really say if it worked. Had to select "all files" and add the .rdf myself. – Kay Feb 10 '15 at 18:56
  • I don't really care about the file extension. The link you provided in the question is an OWL/XML serialization of your ontology. SPARQL is an *RDF* query language, so it would be helpful to provide an RDF serialization (e.g., RDF/XML, N3, ...). The particular RDF format doesn't matter so much. – Joshua Taylor Feb 10 '15 at 19:22
  • An immediately important question, however, is whether or not the SPARQL queries in Protege make use of inferred information or not. Your ontology only uses haGenitore in a few places, and never in direct object property assertions. You've just got it in some subclass axioms with restrictions. If you go to the DL Query tab and do the equivalent query "haGenitore value Finwe", (and check the "Individuals" checkbox), do you get results when the reasoner is enabled? – Joshua Taylor Feb 10 '15 at 19:24
  • I think it's "Instances" rather than "Individuals" in 5.0, but with that (And "Subclasses" checkbox checked) yeah, it gives me all the offspring for Finwe. – Kay Feb 10 '15 at 19:33
  • It could well be "Instances"; I'm working from memory. :) What happens if the reasoner is *not* enabled? – Joshua Taylor Feb 10 '15 at 19:35
  • "No reasoner has been initialized so inference cannot proceed. Go to the Reasoner Menu and select Start Reasoner" error message. – Kay Feb 10 '15 at 19:53

0 Answers0