ESIPFed / sweet

Official repository for Semantic Web for Earth and Environmental Terminology (SWEET) Ontologies
Other
119 stars 33 forks source link

Address erroneous usage of punning - a name can only be used for one kind of property #169

Closed lewismc closed 4 years ago

lewismc commented 4 years ago

SWEET makes extensive use of OWL2 punning but does not comply with the restrictions of OWL2 DL.

An example is the initial definition of property hasIntegerValue

https://github.com/ESIPFed/sweet/blob/4a5378cb048b6f493cfe57fdb85cf4c90f30baa4/src/relaMath.ttl#L472-L475
###  http://sweetontology.net/relaMath/hasIntegerValue
rela:hasIntegerValue rdf:type owl:DatatypeProperty ;
                     rdfs:range xsd:integer ;
                     rdfs:label "has integer value"@en .

... and then the pun, where the same IRI is redefined as follows

https://github.com/ESIPFed/sweet/blob/4a5378cb048b6f493cfe57fdb85cf4c90f30baa4/src/stateStorm.ttl#L39-L40
###  http://sweetontology.net/relaMath/hasIntegerValue
mrela:hasIntegerValue rdf:type owl:AnnotationProperty .

Further, In this example, the DatatypeProperty is used to define of NamedIndividuals (which is absolutely fine). The point here is however that the AnnotationProperty is never used.

However it is stated that...

...OWL 2 DL still imposes certain restrictions: it requires that a name cannot be used for both a class and a datatype and that a name can only be used for one kind of property.

This issue is pervasive.

dr-shorthair commented 4 years ago

Are they mostly like the case you explain here - i.e. datatype<->annotation properties? Are the annotation properties done thoughtfully/intentionally, or is it a bit crufty? If all those cnflicts were resolved as datatype proeprties, how many clashes woudl be left?

lewismc commented 4 years ago

Are they mostly like the case you explain here - i.e. datatype<->annotation properties?

No there are loads of AnnotationProperty<->ObjectProperty illegal declarated puns as well.

Are the annotation properties done thoughtfully/intentionally, or is it a bit crufty?

It would appear that they don't make much sense... so the latter.

If all those cnflicts were resolved as datatype proeprties, how many clashes woudl be left?

I can't tell right now. I would need to go out on a fishing trip here... I don't really want to do that with #165 still open because I'm going to create a mountain-worth of conflicts.

lewismc commented 4 years ago

protege.log

grepping the attached file, it looks like there are over 3000 such WARN log statements. I think this is going to be a big task as well.

ignazio1977 commented 4 years ago

I will create a pull request that will amend most of these bad punnings, but there are some that require domain expert knowledge:

hasLowerQuantity in relasci.ttl is delcared as both data and object property. hasQuantity in relasci.ttl is delcared as both data and object property. hasUpperQuantity in relasci.ttl is delcared as both data and object property. rangeOf in relasci.ttl is delcared as both data and object property.

Edit: these have been fixed.

ignazio1977 commented 4 years ago

Pull request #171 leaves only the issues in relasci.ttl open.

ignazio1977 commented 4 years ago

I found another illegal construct, that forces a property to be both object and data:

sorelm:hasDimension is declared as data property and used as such everywhere except in this declaration. Here, allValuesFrom soreps:Space forces it to be considered an object property. Possibly the restriction should be a data range instead of a class?

###  http://sweetontology.net/reprSpaceReferenceSystem/SpatialReferenceSystem
sorepsrs:SpatialReferenceSystem rdf:type owl:Class ;
                       rdfs:subClassOf sorep:ReferenceFrame ,
                                       [ rdf:type owl:Restriction ;
                                         owl:onProperty sorelm:hasDimension ;
                                         owl:allValuesFrom soreps:Space
                                       ]
lewismc commented 4 years ago

Addressed in #171