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

Check of EL profile fails when defining datatype #1160

Open
tobiaswjohn opened this issue Nov 28, 2024 · 0 comments
Open

Check of EL profile fails when defining datatype #1160

tobiaswjohn opened this issue Nov 28, 2024 · 0 comments

Comments

@tobiaswjohn
Copy link

I noticed an error when checking if an ontology complies with the OWL 2 EL profile. The error occurs, when a datatype is defined. Defining your own datatypes is allowed in EL but one is not allowed to use it as a data range (DL Profiles 2.2.4 ).
This minimal example shows the issue:

Prefix(:=<http://www.example.org/reasonerTester#>)

Ontology(
    Declaration(Datatype ( :mydatatype ))
    DatatypeDefinition( :mydatatype rdfs:Literal)
)

Processing this ontology by the EL profiler OWL2ELProfile() returns a violation although it is in the profile as :mydatatype is never used as a data range.

I think the root of the problem is in ProfileVisitor l.203, where checking if a datatype is allowed in EL is mapped to checking if it is an allowed data range. This is fine if the datatype occurs outside a datatype definition but not if it is inside of it. However, this context is lost, when the function is called from the corresponding function in StructureWalker.

For reproduction, here is a minimal program to reproduce this issue:

OWLOntologyDocumentSource source = new FileDocumentSource(ontFile, new FunctionalSyntaxDocumentFormat());
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
ont = manager.loadOntologyFromOntologyDocument(source);


OWLProfileReport profileReport = new OWL2ELProfile().checkOntology(ont);
List<OWLProfileViolation> violations = profileReport.getViolations();
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

1 participant