[x3d-public] X3D JSON schema validation problems: geoSystem "UTM"

Roy Walmsley roy.walmsley at ntlworld.com
Mon Jul 10 08:37:28 PDT 2017


Don,

 

John is correct. Remove in all 32 instances of geosystem the “N” value, and the JSON encoded file passes validation.

 

This has been discussed in Mantis issue 938 (http://www.web3d.org/member-only/mantis/view.php?id=938 for Web3D members). The V3.3 of the standard only permits an optional “S” to indicate southern hemisphere. The northern hemisphere “N” is not permitted. It is assumed by default if there is no “S”.

 

While we may change this in V4.0 of X3D, the fact is that this is the case for V3.3. The JSON schema for V3.3 should, therefore, reflect the V3.3 standard. This problem was only identified because of the greater expressive power of JSON schema over the corresponding XML schema. The JSON schema was written to fully validate the geoSystem field in accordance with the standard. The Schematron should also be able to do this. Does it?

 

All the best,

 

Roy

 

From: John Carlson [mailto:yottzumm at gmail.com] 
Sent: 10 July 2017 16:13
To: Don Brutzman <brutzman at nps.edu>
Cc: X3D Graphics public mailing list <x3d-public at web3d.org>; Roy Walmsley <roy.walmsley at ntlworld.com>
Subject: Re: X3D JSON schema validation problems: geoSystem "UTM"

 

Again, your "N" or north will not pass schema.

 

John

 

On Jul 10, 2017 10:57 AM, "Don Brutzman" <brutzman at nps.edu <mailto:brutzman at nps.edu> > wrote:

Issue with geoSystem support for "UTM", example attached.  Troublesome line appears to be

<GeoOrigin DEF='ORIGIN' geoCoords='4342525.5 740604 0' geoSystem='"UTM" "Z10" "N"' rotateYUp='true'/>

"-geoOrigin":
  { "GeoOrigin":
        {
          "@DEF":"ORIGIN",
          "@geoCoords":[4342525.5,740604,0],
          "@geoSystem":["UTM","Z10","N"],
          "@rotateYUp":true
        }
  }

(perhaps other errors as well, this console error goes on for quite a ways.)  json schema validation excerpt follows:


--- BEGIN C:\x3d-code\www.web3d.org <http://www.web3d.org> \x3d\content\examples\Basic\Geospatial\Squaw.json---
validation: FAILURE
[ {
  "level" : "error",
  "schema" : {
    "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json# <http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json> ",
    "pointer" : "/definitions/@geoSystem"
  },
  "instance" : {
    "pointer" : "/X3D/Scene/-children/4/GeoViewpoint/-geoOrigin/GeoOrigin/@geoSystem"
  },
  "domain" : "validation",
  "keyword" : "oneOf",
  "message" : "instance failed to match exactly one schema (matched 0 out of 9)",
  "matched" : 0,
  "nrSchemas" : 9,
  "reports" : {
    "/definitions/@geoSystem/oneOf/0" : [ {
      "level" : "error",
      "schema" : {
        "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json# <http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json> ",
        "pointer" : "/definitions/@geoSystem/oneOf/0/items/0"
      },
      "instance" : {
        "pointer" : "/X3D/Scene/-children/4/GeoViewpoint/-geoOrigin/GeoOrigin/@geoSystem/0"
      },
      "domain" : "validation",
      "keyword" : "enum",
      "message" : "instance value (\"UTM\") not found in enum (possible values: [\"GD\",\"GDC\"])",
      "value" : "UTM",
      "enum" : [ "GD", "GDC" ]
    }, {
      "level" : "error",
      "schema" : {
        "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json# <http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json> ",
        "pointer" : "/definitions/@geoSystem/oneOf/0/items/1"
      },
      "instance" : {
        "pointer" : "/X3D/Scene/-children/4/GeoViewpoint/-geoOrigin/GeoOrigin/@geoSystem/1"
      },
      "domain" : "validation",
      "keyword" : "enum",
      "message" : "instance value (\"Z10\") not found in enum (possible values: [\"WGS84\"])",
      "value" : "Z10",
      "enum" : [ "WGS84" ]
    }, {
      "level" : "error",
      "schema" : {
        "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json# <http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json> ",
        "pointer" : "/definitions/@geoSystem/oneOf/0/additionalItems"
      },
      "instance" : {
        "pointer" : "/X3D/Scene/-children/4/GeoViewpoint/-geoOrigin/GeoOrigin/@geoSystem/2"
      },
      "domain" : "validation",
      "keyword" : "enum",
      "message" : "instance value (\"N\") not found in enum (possible values: [\"AM\",\"AN\",\"BN\",\"BR\",\"CC\",\"CD\",\"EA\",\"EB\",\"EC\",\"ED\",\"EE\",\"EF\",\"FA\",\"HE\",\"HO\",\"ID\",\"IN\",\"KA\",\"RF\",\"SA\",\"WD\",\"WE\"])",
      "value" : "N",
      "enum" : [ "AM", "AN", "BN", "BR", "CC", "CD", "EA", "EB", "EC", "ED", "EE", "EF", "FA", "HE", "HO", "ID", "IN", "KA", "RF", "SA", "WD", "WE" ]
    } ],

etc.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170710/d68bf6b3/attachment.html>


More information about the x3d-public mailing list