[x3d-public] X3D Semantic Web minutes 21 OCT 2019: outreach, parent/child relationships, X3D-Tidy, comprehensive unit testing
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Mon Oct 21 10:11:56 PDT 2019
Attendees: Jakub Flotyński, Athanasios Malamos, Don Brutzman. Minutes follow.
The X3D Semantic Web Working Group mission is to publish models to the Web using X3D in order to best gain Web interoperability and enable intelligent 3D applications, feature-based 3D model querying, and reasoning over 3D scenes.
https://www.web3d.org/working-groups/x3d-semantic-web
We held our weekly meeting Monday 21 OCT 2019 at regular time, 0800-0900 pacific.
https://www.web3d.org/member/teleconference-information
Prior minutes:
[x3d-public] X3D Semantic Web agenda 14 OCT 2019: paper plans, mailing lists, X3D examples unit testing, X3D Ontology
http://web3d.org/pipermail/x3d-public_web3d.org/2019-October/011348.html
http://web3d.org/pipermail/semantics-public_web3d.org/2019-October/000004.html
=========================
1. *Outreach: book chapter and conference publication planning*
We discussed progress of work. It is great that we are working to publish simultaneous with building actual ontology capabilities, this tandem work is helping to propel the work forward in an expeditious manner.
a. Thanos shared a draft chapter "Recent Advances in Web3D Semantic Modeling" for review. He is currently working on structural review before proofreading. He will also share document for review with other co-authors.
b. Regarding SemanticWebPro in Paris, we are hoping that Christophe Mouton can give the presentation with others dialing in. It will be an adapted version of our Web3D 2019 conference presentation.
Semantic Web Pro (SemWeb.Pro) conference, Paris
http://semweb.pro/semwebpro-2019.html
"The Semantic Web3D: towards comprehensive representation of 3D content on the semantic web"
Flotyński, Brutzman, Carlson, Hamza-Lup, Malamos, Mouton, Petit, Polys, Sikos
presentation at 1630 on Tuesday 3 December 2019
Abstract: http://semweb.pro/semwebpro-2019.html#p23
=========================
2. *X3D to Turtle Conversions Example Archive Updates*
Last week we discussed addition of x3do:hasParent and x3d:hasSomeNodeField relationships to the X3dToTurtle.xslt model converter.
These have now been successfully added, deployed and tested.
X3D Ontology for Semantic Web
https://www.web3d.org/x3d/content/semantics/semantics.html
Progress: we are now consistent about x3d: and x3do: prefixes in both the turtle conversions and the SPARQL queries.
@prefix x3d: <https://www.web3d.org/specifications/x3d-4.0.xsd#> .
@prefix x3do: <https://www.web3d.org/semantics/ontologies/X3dOntology4.0#> .
Example and excerpts:
Hello World knowledge base: turtle source and excerpted triples
https://www.web3d.org/x3d/content/semantics/examples/HelloWorld.ttl
> :Group_2_2 a owl:NamedIndividual, x3do:Group ;
> x3do:hasParent :Scene ;
> x3do:hasChildren [ owl:unionOf ( :ViewUpClose :Transform_2_2_2 :Transform_2_2_3 ) ] .
>
> :ViewUpClose a owl:NamedIndividual, x3do:Viewpoint ;
> x3do:hasParent :Group_2_2 ;
> x3do:centerOfRotation "0 -1 0" ;
> x3do:description "Hello world!" ;
> x3do:position "0 -1 7" .
>
> :Transform_2_2_2 a owl:NamedIndividual, x3do:Transform ;
> x3do:hasParent :Group_2_2 ;
> x3do:hasChildren :Shape_2_2_2_1 ;
> x3do:rotation "0 1 0 3" .
>
> :Shape_2_2_2_1 a owl:NamedIndividual, x3do:Shape ;
> x3do:hasParent :Transform_2_2_2 ;
> x3do:hasGeometry :Sphere_2_2_2_1_1 ;
> x3do:hasAppearance :Appearance_2_2_2_1_2 .
Note that :X3D :head and :Scene are always singletons, and hence do not get any positional suffix.
Note that we expect x3do:hasChild to be inferred by the reasoner, since x3do:hasParent is defined. Thus x3do:hasChild is implicit, haven't bothered to redefine it everywhere.
We should come up with corresponding SPARQL queries that exercise a reasoner and all interdependent relations (x3do::hasChild x3do::hasParent x3do::hasDescendant and x3do:hasAncestor) together at one time.
TODO: Don will add a x3do:hasChild (and x3do:hasAncestor and x3do:hasDescendant) queries to confirm that relationship is working.
=========================
3. *Parent and child field relationships*
We next had an in-depth discussion contrasting parent-child graph relationships with named field relationships.
Notice that we have type-specific SFNode and MFNode child information present, prefixed by "has" before field name. For example, for the "children" and "geometry" and "appearance" fields (in Group, Shape and Shape respectively) above, we see the following definitions.
x3do:hasChildren, x3do:hasGeometry, x3do:hasAppearance
Thus the turtle form (i.e. knowledge base) not only allows us to infer parent-child relationships, but also discover typed-field relationships between parent nodes and child nodes.
a. Note that "children" is a common field in X3D for X3DGrouping node types, but there is no "child" field in the X3D scene graph.
b. Also note that sometimes X3D nodes have multiple node children with different roles, which need to be disambiguated. For example, a Collision node might contain a proxy Shape which is not rendered, as opposed to other children nodes which are rendered... these are different roles. So there only a few cases, but they do need to be distinguished.
c. Therefore it is important that both x3do:hasChild (general property) and x3do:hasChildren (type-specific property) need to be defined, and they are semantically distinct.
d. The current mapping achieves both.
Question under consideration: is owl:unionOf the correct construct for MFNode fields? Jakub made quick work of that one. The answer is no... the W3C specification says that owl:unionOf is for classes, not specific instances.
OWL Web Ontology Language Reference
W3C Recommendation 10 February 2004
3.1.3.2 owl:unionOf
https://www.w3.org/TR/owl-ref/#unionOf-def
This should be an rdf relationship of some sort... hmmm. Specified multiple times, it would look like:
:Group_2_2 a owl:NamedIndividual, x3do:Group ;
x3do:hasParent :Scene ;
x3do:hasChildren :ViewUpClose ;
x3do:hasChildren :Transform_2_2_2 ;
x3do:hasChildren :Transform_2_2_3 .
TODO: Jakub will figure out if an even better relationship is possible, instead of the repeated properties above. An ordered list of some type is preferable because the order of children nodes can be important... For example, both Switch and LOD have order-dependent children for their functionality to work properly.
This is an RDF question... as partial answer, it looks like there is an RDF construct to apply. Jakub found:
OWL Web Ontology Language Reference
6.2 Enumerated datatype
https://www.w3.org/TR/owl-ref/#EnumeratedDatatype
Whoa, the construct there looks pretty gnarly... hopefully we can find a corresponding .ttl representation that is simpler... whatever works. Still a TODO item.
=========================
4. *X3D to Turtle Conversions Example Archive Updates*
Next. Here is an initial query to test the original turtle conversion above:
https://www.web3d.org/x3d/content/semantics/queries/X3dHelloWorldQuery_01.rq.txt
> SELECT ?ShapeNodesFound ?parentNode ?grandParentNode
>
> WHERE
> {
> ?shape a x3do:Shape ; # Shorthand expression: a = rdf:type
> x3do:hasParent ?parent .
> ?parent x3do:hasParent ?grandParent .
>
> # https://stackoverflow.com/questions/11234371/sparql-query-results-without-namespace
> BIND (strafter(xsd:string(?shape),"#") AS ?ShapeNodesFound)
> BIND (strafter(xsd:string(?parent),"#") AS ?parentNode)
> BIND (strafter(xsd:string(?grandParent),"#") AS ?grandParentNode)
> }
> ORDER BY (?ShapeNodesFound) # alphabetic order results in scene-graph order given by each name
>
> ###############################################
> ---------------------------------------------------------
> | ShapeNodesFound | parentNode | grandParentNode |
> =========================================================
> | "Shape_2_2_2_1" | "Transform_2_2_2" | "Group_2_2" |
> | "Shape_2_2_3_1" | "Transform_2_2_3" | "Group_2_2" |
> ---------------------------------------------------------
Interestingly, note that no changes to X3D Ontology were needed for modifying our turtle conversions or performing this query.
=========================
5. *Improved DEF/USE representation possibilities*
/Next question/. Wondering: when we define nodes that have a DEF or USE, should we also define owl:sameAs for the regular naming convention of individuals that indicates graph position in the original scene graph?
For example, current form
:ViewUpClose a owl:NamedIndividual, x3do:Viewpoint ; # current
x3do:hasParent :Group_2_2 ;
x3do:centerOfRotation "0 -1 0" ;
x3do:description "Hello world!" ;
x3do:position "0 -1 7" .
would become
:Viewpoint_2_2_1 a owl:NamedIndividual, x3do:Viewpoint ; # proposed
owl:sameAs :ViewUpClose ; # DEF
x3do:hasParent :Group_2_2 ;
x3do:centerOfRotation "0 -1 0" ;
x3do:description "Hello world!" ;
x3do:position "0 -1 7" .
Similarly considering USE nodes, we might further elaborate these relationships by describing equivalence of numbered-label with USE name and with original DEF node... Current form:
:MaterialLightBlue a owl:NamedIndividual, x3do:Material ; # current
x3do:hasParent :Appearance_2_2_2_1_2 ;
x3do:diffuseColor "0.1 0.5 1" .
would become:
:Material_2_2_3_1_2_1 a owl:NamedIndividual, x3do:Material ; # proposed
owl:sameAs :MaterialLightBlue ; # USE
owl:sameAs :MaterialLightBlue-USE-1 ; # USE
x3do:hasParent :Appearance_2_2_3_1_2 .
However, if we are going to call them owl:sameAs, they might not be sufficiently distinguished from the original DEF. Perhaps subclassOf is a better relationship?
Please consider. I will apply next pattern to all examples for further testing.
=========================
4. *X3D-Tidy addition of WorldInfo nodes*
The default query against X3D Example Archive models lists title of WorldInfo node, if present.
As it turns out, only some of the X3D examples had WorldInfo included.
X3D Resources, Examples: Scene Archives for X3D
https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
Seems like a good practice for a model to describe itself as well, also good to have explicit (rather than implicit) SPARQL query test results.
Thus added an option to X3D-Tidy that adds WorldInfo at top of scene if not already present (using meta title if found). Applied X3D-Tidy to all scenes in the archives (nearly 4000 total). Incidentally X3D-Tidy also cleaned up all web3d.org url addresses as https://www.web3d.org (for XML schema, doctype, online url links etc.)
X3D Tidy for Scene Cleanup, Corrections and Modifications
https://www.web3d.org/x3d/stylesheets/X3dTidy.html
Updated, tested and uploaded all models. Regression test results similarly updated at
https://www.web3d.org/x3d/content/examples/build.turtle.all.log.txt
Randomly chosen example:
X3D Example Archives: VRML 2 Sourcebook, Chapter 06 Rotating Shapes, Figure 06 1 2Desk Lamp Base Two Arms
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter06RotatingShapes/Figure06_12DeskLampBaseTwoArmsIndex.html
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter06RotatingShapes/Figure06_12DeskLampBaseTwoArms.x3d
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter06RotatingShapes/Figure06_12DeskLampBaseTwoArms.ttl
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter06RotatingShapes/Figure06_12DeskLampBaseTwoArms.rq.txt
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX owl: <http://www.w3.org/2002/07/owl#>
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> PREFIX x3d: <https://www.web3d.org/specifications/x3d-4.0.xsd#>
> PREFIX x3do: <https://www.web3d.org/semantics/ontologies/X3dOntology4.0#>
>
> # X3dHelloWorldQuery_03.rq Query HelloWorld.ttl to show title given to model within a WorldInfo node.
>
> ###############################################
>
> SELECT ?WorldInfoNode ?title ?parentNode
> WHERE
> {
> ?WorldInfo rdf:type x3do:WorldInfo ;
> x3do:title ?title ;
> x3do:hasParent ?parent.
>
> BIND (strafter(xsd:string(?WorldInfo),"#") AS ?WorldInfoNode)
> BIND (strafter(xsd:string(?parent),"#") AS ?parentNode)
> }
>
> ###############################################
> -----------------------------------------------------------------------
> | WorldInfoNode | title | parentNode |
> =======================================================================
> | "WorldInfo_2_1" | "Figure06_12DeskLampBaseTwoArms.x3d" | "Scene" |
> -----------------------------------------------------------------------
So yes, we are satisfactorily improving and testing at scale.
=========================
Making steady progress (and having fun!) with X3D Semantic Web. 8)
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