[x3d-public] X3D JSON Schema warnings and validation automation progress

Don Brutzman brutzman at nps.edu
Sun Mar 27 09:22:30 PDT 2016


... continuing from before:

On 3/26/2016 6:39 PM, Don Brutzman wrote:
> [...]
> 5. This X3D JSON Schema validation is also now integrated into the full examples build when converting .x3d scenes to .json.  Regression testing in progress, will post results later.

The build completed successfully - took about 6 hours to convert and validate everything. Results updated at

	http://www.web3d.org/x3d/content/examples/build.json.out

6. Example X3D JSON Validation error report:

C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/Geospatial//Mars.x3d processing with X3dToJson stylesheet
C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/Geospatial//Mars.json error checking with jslint
C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/Geospatial//Mars.json error checking with json-schema-validator
--- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\Geospatial\Mars.json---
validation: FAILURE
[ {
"level" : "error",
"schema" : {
"loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json#",
"pointer" : "/definitions/GeoViewpoint"
},
"instance" : {
"pointer" : "/X3D/Scene/-children/4/GeoViewpoint"
},
"domain" : "validation",
"keyword" : "additionalProperties",
"message" : "object instance has properties which are not allowed by the schema: [\"@headlight\"]",
"unwanted" : [ "@headlight" ]
} ]
--- END C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\Geospatial\Mars.json---

Meanwhile X3D Validator error report:

--------- Commence validation checks for Mars.x3d ---------

Performing well-formed XML check...
Checking file:/C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/Geospatial/Mars.x3d...
Well-formed XML check: pass

Performing DOCTYPE check...
[X3dDoctypeChecker] success: valid XML declaration found; success: final X3D 3.0 DOCTYPE found.

Performing DTD validation...
Checking file:/C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/Geospatial/Mars.x3d...
XML DTD validation: pass

Performing X3D schema validation...
Checking file:/C:/x3d-code/www.web3d.org/x3d/content/examples/Basic/Geospatial/Mars.x3d...
XML schema validation: pass

Performing X3D regular expression (regex) values check...

Performing X3dToClassicVrml.xslt conversion check...

Performing X3D Schematron check...
<GeoOrigin DEF='ORIGIN'/> geoCoords='0 0 0', instead needs actual location value [/X3D/Scene/GeoViewpoint/GeoOrigin, warning]
<Group DEF=''/> element has no child node [/X3D/Scene/Group/Group/Group[1], warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[1]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[1]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[1]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[2]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[2]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[2]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[3]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[3]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[3]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[4]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[4]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[4]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[5]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[5]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[5]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[6]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[6]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[6]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[7]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[7]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[7]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child2Url [/X3D/Scene/Group/Group/Group[2]/Group[8]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child3Url [/X3D/Scene/Group/Group/Group[2]/Group[8]/GeoLOD, warning]
<GeoLOD DEF=''/> has no child4Url [/X3D/Scene/Group/Group/Group[2]/Group[8]/GeoLOD, warning]

--------- Validation checks complete for Mars.x3d ---------


7. So, a couple of things for this model.

a. GeoViewpoint had headlight and navType fields for X3D v3.0 through v3.2 , and we are validating using Roy's X3D JSON v3.3 schema. So this particular error will go away when we customize X3D JSON Schemas using autogenerated X3D Object Model and apply the correct version during validation.

Field signatures according to Version Content (Annex Z in the specification):
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/versionContent.html#GeoViewpoint

b. There are still plenty of loose ends in existing models.  Earlier X3D Geospatial models either should be upgraded or perhaps include meta hints if they are intentionally demonstrating an older approach to modeling.

c. Using GeoLOD for single/double children instead of quad children is allowed; will think about a more-informative warning.


8.  Here is another simple but interesting one.

C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/StudentProjects//IkeaBench.x3d processing with X3dToJson stylesheet
C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/StudentProjects//IkeaBench.json error checking with jslint
C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/StudentProjects//IkeaBench.json error checking with json-schema-validator
--- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\StudentProjects\IkeaBench.json---
validation: FAILURE
[ {
   "level" : "error",
   "schema" : {
     "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json#",
     "pointer" : "/definitions/ImageTexture/properties/@url/items"
   },
   "instance" : {
     "pointer" : "/X3D/Scene/-children/0/Transform/-children/0/Group/-children/16/Transform/-children/0/Group/-children/0/Shape/-appearance/Appearance/-texture/ImageTexture/@url/1"
   },
   "domain" : "validation",
   "keyword" : "format",
   "attribute" : "uri",
   "message" : "string \"http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/DoggyTransparent .png\" is not a valid URI",
   "value" : "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/DoggyTransparent .png"
}, {
   "level" : "error",
   "schema" : {
     "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json#",
     "pointer" : "/definitions/ImageTexture/properties/@url/items"
   },
   "instance" : {
     "pointer" : "/X3D/Scene/-children/0/Transform/-children/0/Group/-children/17/Transform/-children/0/Group/-children/0/Shape/-appearance/Appearance/-texture/ImageTexture/@url/1"
   },
   "domain" : "validation",
   "keyword" : "format",
   "attribute" : "uri",
   "message" : "string \"http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/KittyTransparent .png\" is not a valid URI",
   "value" : "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/KittyTransparent .png"
} ]
--- END C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\StudentProjects\IkeaBench.json---
Java Result: 100

Notice that the JSON output is a bit ponderous, but a little inspection usually reveals the complaint.

So what was the actual problem here?  It found embedded spaces within a url.  Cool!  Fixed original scene.  Also added this kind of check as TODO item for X3D Schematron and X3dTidy.

Upon fixing that problem, then rechecked with X3D Validator and noticed that IndexedFaceSet child Coordinate node wasn't validating.  Found an inadvertent deletion within a content model in the X3D v3.0 schema - fixed it, checked in.  For details can see dated entry (about 200 lines in) at

	http://www.web3d.org/specifications/x3d-schema-changelog.txt

26 March 2016, brutzman
- (v3.0) restore missing content model for X3DComposedGeometryNode

Version-control diffs are always available to assist updates/sleuthing too.  Seldom needed but sometimes vital.

	https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/specifications/
	https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/specifications/x3d-3.0.xsd
	"History" button:
	https://sourceforge.net/p/x3d/code/23092/log/?path=/www.web3d.org/specifications/x3d-3.0.xsd

8.  Will think about how the build logs might better indicate when a scene is a test scene:
- Filename starts or ends with "Test"
- Contains meta tag, name="error" or name="warning", content starts or ends with "Test"

So here we go, more improvements in X3D Quality Assurance (QA).  Plenty more errors in build.json.out to pursue.

Thanks again Roy for developing the X3D JSON Schema.

Have fun with X3D JSON!
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