0

I try to add a bit of ontology to a (public) RDF dataset (wordnet), specifically I need to differentiate between LexicalEntries for Verbs and Nouns, separated as two subclasses. Following examples on the web and in the OWL standard, I assumed that

:LexicalEntryNoun a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty wn:part_of_speech ;
      owl:hasValue wn:noun
    ] .

should build a class LexicalEntryNoun, but the query (in jena fuseki)

prefix  :  <http://gerastree.at/2017/litonto#> 
   SELECT *  
WHERE { 
   ?s a  :LexicalEntryNoun.
 } 

gives an empty result. The two URI which should be returned are included in the class represented by a blank node, which stands for the restriction, but are not reported as LexicalEntryNoun as reported in other queries.

i am new to OWL and do not find many examples of OWL in turtle syntax. Where is my error? Thank you for help!

I constructed a very small subset of data which is loaded together with the OWL reasoner http://jena.hpl.hp.com/2003/OWLFBRuleReasoner:

@prefix wn31:  <http://wordnet-rdf.princeton.edu/wn31> .
@prefix lemon: <http://lemon-model.net/lemon#> .
@prefix nlp:   <http://gerastree.at/nlp_2015#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix lit:   <http://gerastree.at/lit_2014#> .
@prefix wn:    <http://wordnet-rdf.princeton.edu/ontology#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ns:   <http://www.example.org/ns#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix  :  <http://gerastree.at/2017/litonto#> .

<http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n>
        a                    _:b0 , owl:Thing , rdfs:Resource , lemon:LexicalEntry ;
        lemon:canonicalForm  <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n#CanonicalForm> ;
        lemon:sense          <http://www.lexvo.org/page/wordnet/30/noun/%27s_gravenhage_1_15_00> , <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n#1-n> ;
        wn:part_of_speech    wn:noun ;
        owl:sameAs           <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n> .

<http://wordnet-rdf.princeton.edu/wn31/%27hood-n>
        a                    _:b0 , owl:Thing , rdfs:Resource , lemon:LexicalEntry ;
        lemon:canonicalForm  <http://wordnet-rdf.princeton.edu/wn31/%27hood-n#CanonicalForm> ;
        lemon:sense          <http://www.lexvo.org/page/wordnet/30/noun/%27hood_1_15_00> , <http://wordnet-rdf.princeton.edu/wn31/%27hood-n#1-n> ;
        wn:part_of_speech    wn:noun ;
        owl:sameAs           <http://wordnet-rdf.princeton.edu/wn31/%27hood-n> .

:LexicalEntryNoun a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty wn:part_of_speech ;
      owl:hasValue wn:noun
    ] .
user855443
  • 2,596
  • 3
  • 25
  • 37
  • Your query is trying to get instances of the class `LexicalEntryNoun`. In your data I can't see any such instance. SPARQL is a pattern matching language, it doesn't match any data in your example. – UninformedUser Dec 12 '17 at 07:33
  • If you want to get the super class of `LexicalEntryNoun`, you have to do this by triple patterns. Use your Turtle snippet, and replace what you want to get by variables. That is exactly how pattern matching works. – UninformedUser Dec 12 '17 at 07:35
  • I understand how to match patterns in SPARQL, but I assumed that the OWL definition of `LexicalEntryNoun` by a restriction on values would create, by inference, a class which I can then use in pattern matching. Why is the OWL definition not working? – user855443 Dec 12 '17 at 14:50
  • Just to clarify: your query is looking for triples matching the pattern `?s rdf:type :LexicalEntryNoun .` Does such data exist in your sample? – UninformedUser Dec 12 '17 at 15:08
  • What do you expect from the reasoner? I don't get it. The SubClassOf axiom is stating that if some individual `:x` belongs to class `:LexicalEntryNoun`, then a triple `:x wn:part_of_speech wn:noun .` can be inferred. I still don't see how this would match your query. – UninformedUser Dec 12 '17 at 15:08
  • Maybe you can explain what you're planning to get inferred by the OWL axiom? At least instances of the class `:LexicalEntryNoun` aren't inferred by this single axiom. – UninformedUser Dec 12 '17 at 15:20
  • There is also some discussion about this question on the Apache Jena Users mailing list: http://jena.markmail.org/search/#query:+page:1+mid:bas7xe2u53grqejj+state:results – Barry NL Dec 12 '17 at 18:12

1 Answers1

1

as already posted on the Apache Jena Users mailing list, the answer is:

Change the subclassof to an equivalence. Since both resources:

http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n

http://wordnet-rdf.princeton.edu/wn31/%27hood-n

would fall inside the :LexicalEntryNoun class and show up in his SPARQL query.

Regards, Barry

Barry NL
  • 963
  • 1
  • 9
  • 16