Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should validate-profile recognize owl:onProperties? #1176

Open
ajnelson-nist opened this issue Jan 25, 2024 · 6 comments
Open

Should validate-profile recognize owl:onProperties? #1176

ajnelson-nist opened this issue Jan 25, 2024 · 6 comments

Comments

@ajnelson-nist
Copy link

I have been doing some testing of general OWL syntax, and came across a curiosity as I was enumerating usages of OWL "Sequences" from the document OWL 2 Web Ontology Language Mapping to RDF Graphs (Second Edition).

The predicate owl:onProperties occurs four times in that file. It maps the OWL construct DataAllValuesFrom and DataSomeValuesFrom from a single propertty to multiple properties in one owl:Restriction.

I tried writing an exemplar class to verify I was understanding the syntax, but I get an error from validate-profile, though things look consistent with the tables in that W3C document. From a quick grep over the ROBOT source, I don't see occurrences of onProperties, but I also couldn't catch onProperty by eye because [a|A]nnotationProperty happens to cover it too. Is this just a missed OWL property?

For issue reproduction, my input graph is:

@prefix ex: <http://example.org/ontology/example/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/kb>
	a owl:Ontology ;
	.

ex:Class-2017f153-97f3-417f-b611-096ca48b0025
	a owl:Class ;
	rdfs:subClassOf [
		a owl:Restriction ;
		owl:onProperty ex:DatatypeProperty-64bb66a5-798a-4e0b-874b-6d995ab784a2 ;
		owl:allValuesFrom xsd:integer ;
	] ;
	.

ex:Class-d7316c48-8616-4754-84b1-b17745f91e92
	a owl:Class ;
	rdfs:subClassOf [
		a owl:Restriction ;
		owl:onProperties (
			ex:DatatypeProperty-76981918-ac99-4423-aeb6-2ce760debc4a
			ex:DatatypeProperty-9e6f4b87-1fe4-4c9f-9a26-4e0a33d4ba99
		) ;
		owl:allValuesFrom xsd:integer ;
	] ;
	.

ex:DatatypeProperty-64bb66a5-798a-4e0b-874b-6d995ab784a2
	a owl:DatatypeProperty ;
	.

ex:DatatypeProperty-76981918-ac99-4423-aeb6-2ce760debc4a
	a owl:DatatypeProperty ;
	.

ex:DatatypeProperty-9e6f4b87-1fe4-4c9f-9a26-4e0a33d4ba99
	a owl:DatatypeProperty ;
	.

My test command with ROBOT version 1.9.5 is:

java -jar robot.jar \
  validate-profile \
  --input example.ttl \
  --profile DL

An example of my test output is:

2024-01-25 15:37:08,565 ERROR org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer - Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error1 for type Class
2024-01-25 15:37:08,579 ERROR org.obolibrary.robot.IOHelper - Input ontology contains 1 triple(s) that could not be parsed:
 - _:genid-nodeid-node1hl15edmgx2 <http://www.w3.org/2002/07/owl#onProperties> _:genid-nodeid-node1hl15edmgx3.

OWL 2 DL Profile Report: Ontology and imports closure NOT in profile. The following violations are present:
Use of undeclared class: <http://org.semanticweb.owlapi/error#Error1> [SubClassOf(<http://example.org/ontology/example/Class-d7316c48-8616-4754-84b1-b17745f91e92> <http://org.semanticweb.owlapi/error#Error1>) in OntologyID(OntologyIRI(<http://example.org/kb>) VersionIRI(<null>))]

PROFILE VIOLATION ERROR http://example.org/kb violates profile DL
For details see: http://robot.obolibrary.org/validate-profile#profile-violation-error
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.

I am fine with this test input being added to unit tests, and I do not require crediting. All the same, acknowledgement would be appreciated.

@matentzn
Copy link
Contributor

Wow, indeed! This is very interesting - ROBOT ownly wraps OWL API, so it will have to be raised there.. But just searching through the OWL API https://github.com/owlcs/owlapi repo shows no mention of owl:onProperties - and I have to be honest, despite working extensively with OWL over the last 10 years, I didnt even know of its existence.

@matthewhorridge @ignazio1977 maybe you have some insight?

@ignazio1977
Copy link
Contributor

Rings a bell, need to Google a bit.

@ignazio1977
Copy link
Contributor

So, the thing I had in mind was datatype n-arity - the OWL specs say that owl:onProperties is to be used to map restrictions with multiple properties, and those are defined as restrictions where the number of properties matches the n-arity of the datatype.

But, there's no defined datatype with n-arity more than 1 (to my knowledge - it's been a few years since last time I looked it up). Integers certainly are not.

The error reported is because of a parsing failure, not because of an actual recognised violation. I'm not sure if owl:onProperties would be accepted, but it won't work with integers, I believe. So, as is, I think the owlapi is failing, but that input shouldn't pass anyway.
It's failing wrongly, so to speak.

@ajnelson-nist
Copy link
Author

Thank you @ignazio1977 , I'd only guessed at what datatype to use from syntactic form.

Would something like a latitude-longitude coordinate pair work?

@ajnelson-nist
Copy link
Author

Ah, perhaps it's not possible to demonstrate owl:onProperties, if a datatype of arity ≥ 2 is needed? I'm a little fuzzy on "Data range" vs "datatype" in light of OWL 2 deprecating owl:DataRange.

Implementations are not required to support the IRI owl:onProperties, but may support it in order to realize n-ary dataranges with arity ≥ 2 (see Sections 7 and 8.4 of the OWL 2 Structural Specification [OWL 2 Specification] for further information).

Source: https://www.w3.org/TR/2012/REC-owl2-rdf-based-semantics-20121211/#Vocabulary_Terms

Each data range is associated with a positive arity, which determines the size of the tuples in the data range. All datatypes have arity one. This specification currently does not define data ranges of arity more than one; however, by allowing for n-ary data ranges, the syntax of OWL 2 provides a "hook" allowing implementations to introduce extensions such as comparisons and arithmetic.

Source: https://www.w3.org/TR/2012/REC-owl2-syntax-20121211/#Data_Ranges

Emphasis added.

@ajnelson-nist
Copy link
Author

Actually, the rest of Section 7, "Data Ranges" looks less gloomy for this property than I thought. Please pardon my last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants