[x3d-public] X3D Ontology representation of enumerations

Don Brutzman brutzman at nps.edu
Tue May 5 00:00:04 PDT 2020



On 5/4/2020 10:06 AM, Don Brutzman wrote:
> X3D Semantic Web working group meeting, 4 May 2020.
> 
> Attendees: Jakub Flotyński, John Carlson, Don Brutzman.
> 
> Jakub had improvements to the following representation of enumeration types from X3DUOM in X3D Ontology.
> 
> On 4/26/2020 11:32 PM, Don Brutzman wrote:
>> -------
>>
>> c. X3D Ontology
>> https://www.web3d.org/x3d/content/semantics/semantics.html
>> - simple-type enumeration lists added, excerpt follows
>> - typing of fields now reflects these simple types
>> - name attribute typing is also stricter, e.g. some names are NMTOKEN
>> - found feature in protege for diagnosing error lines in turtle .ttl
>> - ready for further work on accessType representations, continuing prior efforts
>>
>> :closureTypeChoices rdf:type rdfs:Datatype ;
>>    rdfs:label "closureTypeChoices" ;
>>    dc:description "closureTypeChoices are strictly allowed enumeration values for ArcClose2D closureType field" ;
>>    rdfs:range xs:NMTOKEN ;
>>    rdfs:domain [ owl:unionOf ( 'PIE' 'CHORD' ) ] .
>> # PIE "Connects arc endpoints to center, forming a pie wedge"
>> # CHORD "Connects arc endpoints directly to each other, as in chord on a circle"
> 
> References:
> 
> * https://www.w3.org/TR/owl-ref/#EnumeratedDatatype
note superceded, more below

> Important note in recommendation regarding lists:
> 
>> NOTE: Enumerated datatypes are not part of OWL Lite. 
> 
> We should document the X3D Ontology correspondingly.  We are striving for correctness and completeness so this is not considered a limitation.

When we look at the revised references below, such a restriction is not called out via NOTE.

Rather than haphazard documentation, have not added this superceded note.

When the X3D Ontology appears fully robust, an analysis of various version levels will be more appropriate.

> Next. As design patterns, please look at the next two excerpts.
> 
> * https://github.com/w3c/omn/blob/master/omnlib/import/owl.ttl
> 
> [line 88] (Jakub will check further on whether this is the final version)
> 
>> owl:DataRange
>>
>>     a rdfs:Class ;
>>
>>     rdfs:comment "The class of OWL data ranges, which are special kinds of datatypes. Note: The use of the IRI owl:DataRange has been deprecated as of OWL 2. The IRI rdfs:Datatype SHOULD be used instead." ;
>>
>>     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
>>
>>     rdfs:label "DataRange" ;
>>
>>     rdfs:subClassOf rdfs:Datatype .
> 
> [line 493]
> 
>> owl:oneOf
>>
>>     a rdf:Property ;
>>
>>     rdfs:comment "The property that determines the collection of individuals or data values that build an enumeration." ;
>>
>>     rdfs:domain rdfs:Class ;
>>
>>     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
>>
>>     rdfs:label "oneOf" ;
>>
>>     rdfs:range rdf:List .

Here is a head start, Jakub.  Updated references:

[1] OWL 2 Web Ontology Language
     Document Overview (Second Edition)
     W3C Recommendation 11 December 2012
     https://www.w3.org/TR/owl2-overview

[2] OWL 2 Web Ontology Language
     Quick Reference Guide (Second Edition)
     W3C Recommendation 11 December 2012
     2.4 Data Ranges
     https://www.w3.org/TR/2012/REC-owl2-quick-reference-20121211/#Data_Ranges

Data Range Expressions

Language Feature	Functional Syntax	RDF Syntax
[...]
literal enumeration	DataOneOf(v1 … vn)	_:x rdf:type rdfs:Datatype.
						_:x owl:oneOf ( v1 … vn ).

> This leads us to a new pattern:
> ====================================
> :accessTypeChoices rdf:type rdfs:Datatype ;
>      owl:oneOf ( 'initializeOnly' 'inputOnly' 'outputOnly' 'inputOutput' ).
> 
> :accessType rdfs:range :accessTypeChoices.
> ====================================

this pattern still looks good with respect to the preceding specification prose.

> Jakub will check latest-greatest W3C Recommendation, Don will apply this pattern in X3D Ontology.  This pattern will pertain to all of the enumeration Choices listed in the ontology.

i have applied the pattern but it does NOT pass Protege.  Offending construct:

	owl:oneOf ( 'initializeOnly' 'inputOnly' 'outputOnly' 'inputOutput' ) .

Troubleshooting by inspection, made it closer to prior form by wrapping rdfs:domain [ ] as follows:

	rdfs:domain [ owl:oneOf ( 'initializeOnly' 'inputOnly' 'outputOnly' 'inputOutput' ) ] .

This revised pattern passed Protege checks.  Actual change summary is pretty minimal: "owl:unionOf" modified as "owl:oneOf".

Please confirm.  Examples of new forms:
======================

:accessTypeChoices rdf:type rdfs:Datatype ;
   rdfs:label "accessTypeChoices" ;
   dc:description "accessTypeChoices are strictly allowed enumeration values for accessType, used when defining field declarations within a Script/ProtoDeclare/ExternProtoDeclare" ;
   rdfs:domain [ owl:oneOf ( 'initializeOnly' 'inputOnly' 'outputOnly' 'inputOutput' ) ] .
# initializeOnly "A field with accessType initializeOnly can be initialized, but cannot send or receive events."
# inputOnly "A field with accessType inputOnly cannot be initialized or included in a scene file, but can receive input event values via a ROUTE."
# outputOnly "A field with accessType outputOnly cannot be initialized or included in a scene file, but can send output event values via a ROUTE."
# inputOutput "A field with accessType inputOutput can be initialized, and can also send or receive events."

======================

:closureTypeChoices rdf:type rdfs:Datatype ;
   rdfs:label "closureTypeChoices" ;
   dc:description "closureTypeChoices are strictly allowed enumeration values for ArcClose2D closureType field" ;
   rdfs:domain [ owl:oneOf ( 'PIE' 'CHORD' ) ] .
# PIE "Connects arc endpoints to center, forming a pie wedge"
# CHORD "Connects arc endpoints directly to each other, as in chord on a circle"

======================

Jakub am I reading the Recommendation incorrectly?  Seems sensible to put "rdfs:domain [ ]" there, so perhaps we should report an erratum for W3C?

Also found the following warnings in the Protege log, apparently harmless but we should scrutinize further.  Looking at the OwlDoc for revised ontology,

    WARN  21:54:12  Illegal redeclarations of entities: reuse of entity http://www.web3d.org/specifications/X3dOntology4.0#IS in punning not allowed [DataProperty: IS, Class: IS]
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex2842 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex2882 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex2814 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex2808 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex1824 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex1228 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex1149 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex2820 is the new domain.
    WARN  21:54:12  Annotation property domain axiom turned to data property domain after parsing. This could introduce errors if the original domain was an anonymous expression: _:genid-nodeid-node1e7hiubeex1526 is the new domain.

> Assuming that works, we will again look at adding accessType information to every field definition in the X3D Ontology.

still pending discussion

> Also of interest: enumeration "Values" that are not restrictive but rather optional and extendible values.  I will use same pattern, we will continue scrutinizing these relationships.
> 
> ================================================
> :fontFamilyValues rdf:type rdfs:Datatype ;
>    rdfs:label "fontFamilyValues" ;
>    dc:description "fontFamilyValues are allowed enumeration values for FontStyle/ScreenFontStyle node family field" ;
>    rdfs:range :MFString ;
>    rdfs:domain [ owl:unionOf ( '"SANS"' '"SERIF"' '"TYPEWRITER"' ) ] .
> # "SANS" "default font family for sans-serif font such as Helvetica"
> # "SERIF" "default font family for serif font such as Times-Roman"
> # "TYPEWRITER" "default font family for a fixed-pitch font such as Courier"
> ================================================

revised:

:fontFamilyValues rdf:type rdfs:Datatype ;
   rdfs:label "fontFamilyValues" ;
   dc:description "fontFamilyValues are supported enumeration values for FontStyle/ScreenFontStyle node family field" ;
   owl:oneOf [ '"SANS"' '"SERIF"' '"TYPEWRITER"' ] .
# "SANS" "default font family for sans-serif font such as Helvetica"
# "SERIF" "default font family for serif font such as Times-Roman"
# "TYPEWRITER" "default font family for a fixed-pitch font such as Courier"

currently have the same structures defined for the datatype itself but probably should relax the use of that datatype, falling back to baseType instead.  this would avoid false validation warnings while allowing a semantic rule to see if alternate values were utilized... OK accomplished that, wherever appropriate the supported value SimpleType is listed in a comment instead.

example showing both forms, FontStyle family and justify:

:FontStyle a owl:Class ;
   rdfs:subClassOf :X3DFontStyleNode ;
   rdfs:label "FontStyle is an X3DFontStyleNode that defines the size, family, justification, and other styles used by Text nodes." .
:family a owl:DatatypeProperty ;
   rdfs:domain :FontStyle ;
   rdfs:range :MFString . # alternate enumerations allowed, supported values found in fontFamilyValues
:horizontal a owl:DatatypeProperty ;
   rdfs:domain :FontStyle ;
   rdfs:range :SFBool .
:justify a owl:DatatypeProperty ;
   rdfs:domain :FontStyle ;
   rdfs:range :justifyChoices .

> Future follow-on work:

a. Confirm enumerations representations, write a SPARQL query or two.
b. adding accessType information to every field definition in the X3D Ontology
c. SPARQL patterns for X3D event-routing chains: first listing correct chains, then diagnosing malformed event chains.
d. HAnim representations of parent-child relationships for HAnimJoint, HAnimSegment and HAnimSite.
> 
> Thanks (as ever) for steady progress today.  Have fun with X3D Ontology!   8)

Today's changes committed and deployed.

[3] X3D Ontology for Semantic Web
     https://www.web3d.org/x3d/content/semantics

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list