Skip to content

[mirror] OWL target: optionally encode ISO 19150-2 enumerations as OWL 2 datatype definitions - #5

Open
jdsika wants to merge 1 commit into
nextfrom
feat/owl-enumeration-datatype-definition
Open

jdsika wants to merge 1 commit into
nextfrom
feat/owl-enumeration-datatype-definition

Conversation

@jdsika

@jdsika jdsika commented Sep 26, 2026

Copy link
Copy Markdown

Mirror of upstream ShapeChange#800.

rule-owl-cls-iso191502Enumeration adds owl:oneOf directly to the named
rdfs:Datatype of an enumeration. The OWL 2 mapping to RDF does not read
that pattern as a data range, so OWL 2 tools do not see the literals of
the enumeration. The OWL API reads it as EquivalentClasses(DT
ObjectOneOf()), and its OWL 2 DL profile check reports EmptyOneOfAxiom,
DatatypeIRIAlsoUsedAsClassIRI and UseOfUndeclaredClass.

The new target parameter iso191502EnumerationAsDatatypeDefinition
(default false, so the output is unchanged) encodes the enumeration as
the datatype definition DatatypeDefinition( DT DataOneOf( lt1 ... ltn ) )
of the OWL 2 Structural Specification, Sec. 9.4: the named rdfs:Datatype
is owl:equivalentClass to an anonymous rdfs:Datatype that carries the
owl:oneOf list (OWL 2 Mapping to RDF Graphs, Sec. 2.1, Table 1). OWL 2
DL requires such a definition for every datatype that is not built in
(Sec. 11.2).

The documentation of the rule and of the new parameter describes both
forms. It also names the two cases that stay outside OWL 2 DL with the
parameter set: an enumeration without literals, which DataOneOf cannot
express, and an enumeration that a stereotype or type conversion
parameter makes a subclass, since OWL 2 has no subclass relation
between datatypes.

The new integration test testOwl_iso191502EnumerationAsDatatypeDefinition
runs the model of testOwl_enumerationDatatypeProperty with the parameter
set. That existing test pins the default form and the new one the
datatype definition, so one of them fails if the parameter is ignored
or always applied. Under the OWL API 5.5.0 OWL2DLProfile, the five
violations that the enumeration causes in the default reference are
gone from the new one, which the OWL API reads as
DatatypeDefinition(ex:ExampleEnumeration DataOneOf("alpha" "beta" "gamma")).

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
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

Successfully merging this pull request may close these issues.

1 participant