NLP2RDF / ontologies

All ontologies used in NIF 2.0 (NIF-Core + vocabulary modules + helper modules)
http://nlp2rdf.org
36 stars 7 forks source link

nif:lang has multiple domains #8

Open VladimirAlexiev opened 9 years ago

VladimirAlexiev commented 9 years ago

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
kurzum commented 8 years ago

Ok, good feedback:

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

VladimirAlexiev commented 8 years ago

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

kurzum commented 8 years ago

using RDF Unit should work:

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

SandroCoelho commented 8 years ago

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