NLP2RDF/ontologies

nif:lang has multiple domains

Opened this issue · 4 comments

nif-core.ttl defines nif:lang to have two domains:

# in manchester: "String and not Context"
rdfs:domain nif:String ;
# additional constraint, must not be used on a nif:Context.
rdfs:domain [ rdf:type owl:Class ; owl:complementOf nif:Context ] . 
# too complex: rdfs:domain [ owl:intersectionOf (  nif:String 
    #                         [ rdf:type owl:Class ; owl:complementOf nif:Context ]     ) ] . 

Unfortunately this doesn't work: rather than constraining the subject of nif:lang, it will infer said subject to have both types. So either:

  1. Use the "too complex" definition.
  2. Use just nif:String and leave the rest to a RDFUnit test case.
    I favor 2.

For 1, you should mention it's an owl:Class as follows.

     rdfs:domain [ rdf:type owl:Class ;
                   owl:intersectionOf ( nif:String
                                        [ rdf:type owl:Class ;
                                          owl:complementOf nif:Context ])].

Don't know if it's critical but you can verify it by converting this Manchester notation to Turtle using this convertor

Prefix: nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
Class: nif:String
Class: nif:Context
ObjectProperty: nif:lang
    Domain: 
        nif:String and not nif:Context

Ok, good feedback:

  • we will keep nif:predLang rdfs:domain nif:Context
  • we will do rdfs:domain nif:String for nif:lang
  • 3 new test cases in RDF Unit
    -- checking nif:Context for predLang
    -- checking not nif:Context for lang
    -- checking "page" in URI

@neradis could you update the ontology?
@SandroCoelho after that could you create the test cases?

"checking not nif:Context for lang" will fail in case of RDFS reasoning, because nif:Context is subclass of nif:String.

using RDF Unit should work:

?s a nif:String
FILTER (not exists {?s a nif:Context} )

how did this conversation just got to my email???