[x3d-public] renewed development of X3D JSON support
John Carlson
yottzumm at gmail.com
Wed Oct 13 23:06:17 PDT 2021
X3dXml4.0SchemaConvertedToJson2020-12Schema.json has many XML'isms:
X3DJSONLD/src/main/schema$ grep xs:
X3dXml4.0SchemaConvertedToJson2020-12Schema.json |sort -u
"$ref": "#/$defs/xs:ID"
"$ref": "#/$defs/xs:IDREF"
"$ref": "#/$defs/xs:NMTOKEN"
"$ref": "#/$defs/xs:NMTOKENS"
"xs:ID": {
"xs:IDREF": {
"xs:NMTOKEN": {
"xs:NMTOKENS": {
What should I do?
My schema does not contain any xs: tags.
Here are how these types are defined in
X3dXml4.0SchemaConvertedToJson2020-12Schema.json
"xs:ID": {^M
"pattern":
"^([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-<200c>-<200d>⁰-Ⰰ-、->豈-﷏ﷰ-�𐀀-][\\d\\--\\.A-Z_a-z·À-ÖØ-öø-ͽͿ-ٟ٪-ۯۺ-ߊ-॥॰-ৰ-ੰ-૰-୰-௰---൰--๏๚--༟༪-ဿ၊-ႏႚ--᠏-᥅ᥐ-᧚-᩿--᭚-ᮯᮺ-᰿-ᱏᱚ-<200c>-<200d>‿-⁀⁰-Ⰰ-、-ꘟꘪ-꣏-ꤊ-ꧏ-ꧯꧺ---﷏ﷰ-/:-�𐀀--𑁥𑁰--𑅀-𑇏𑇚--𑑏𑑚----𑜺-𑣟𑣪-𑱚---𝠀--]*)$",^M
"type": "string"^M
},^M
"xs:IDREF": {^M
"pattern":
"^([A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-<200c>-<200d>⁰-Ⰰ-、->豈-﷏ﷰ-�𐀀-][\\d\\--\\.A-Z_a-z·À-ÖØ-öø-ͽͿ-ٟ٪-ۯۺ-ߊ-॥॰-ৰ-ੰ-૰-୰-௰---൰--๏๚--༟༪-ဿ၊-ႏႚ--᠏-᥅ᥐ-᧚-᩿--᭚-ᮯᮺ-᰿-ᱏᱚ-<200c>-<200d>‿-⁀⁰-Ⰰ-、-ꘟꘪ-꣏-ꤊ-ꧏ-ꧯꧺ---﷏ﷰ-/:-�𐀀--𑁥𑁰--𑅀-𑇏𑇚--𑑏𑑚----𑜺-𑣟𑣪-𑱚---𝠀--]*)$",^M
"type": "string"^M
},^M
"xs:NMTOKEN": {^M
"pattern":
"^([\\d\\--\\.\\:A-Z_a-z·À-ÖØ-öø-ͽͿ-ٟ٪-ۯۺ-ߊ-॥॰-ৰ-ੰ-૰-୰-௰---൰--๏๚--༟༪-ဿ၊-ႏႚ--᠏-᥅ᥐ-᧚-᩿--᭚-ᮯᮺ-᰿-ᱏᱚ-<200c>-<200d>‿-⁀⁰Ⰰ-、-ꘟꘪ-꣏-ꤊ-ꧏ-ꧯꧺ---豈-﷏ﷰ-/:-�𐀀--𑁥𑁰--𑅀-𑇏𑇚--𑑏𑑚----𑜺-𑣟𑣪-𑱚---𝠀--]+)$",^M
"type": "string"^M
},^M
"xs:NMTOKENS": {^M
"items": {^M
"pattern":
"^([\\d\\--\\.\\:A-Z_a-z·À-ÖØ-öø-ͽͿ-ٟ٪-ۯۺ-ߊ-॥॰-ৰ-ੰ-૰-୰-௰---൰--๏๚--༟༪-ဿ၊-ႏႚ--᠏-᥅ᥐ-᧚-᩿--᭚-ᮯᮺ-᰿-ᱏᱚ-<200c>-<2d>‿-⁀⁰-Ⰰ-、-ꘟꘪ-꣏-ꤊ-ꧏ-ꧯꧺ---豈-﷏ﷰ-/:-�𐀀--𑁥𑁰--𑅀-𑇏𑇚--𑑏𑑚----𑜺-𑣟𑣪-𑱚---𝠀--]+)$",^M
"type": "string"^M
},^M
"type": "array"^M
}^M
Here's a summary of X3DUOM:
$ grep xs: X3dUnifiedObjectModel-4.0.xml|sort -u
baseType="xs:ID"
baseType="xs:IDREF"
baseType="xs:NMTOKEN"
baseType="xs:NMTOKEN"/>
baseType="xs:NMTOKEN">
baseType="xs:NMTOKEN"
baseType="xs:NMTOKENS"
<containerField default="acousticProperties"
type="xs:NMTOKEN"/>
<containerField default="appearance" type="xs:NMTOKEN"/>
<containerField default="attrib" type="xs:NMTOKEN"/>
<containerField default="bodies" type="xs:NMTOKEN">
<containerField default="children" type="xs:NMTOKEN"/>
<containerField default="collider" type="xs:NMTOKEN"/>
<containerField default="contacts" type="xs:NMTOKEN"/>
<containerField default="coord" type="xs:NMTOKEN"/>
<containerField default="displacers" type="xs:NMTOKEN"/>
<containerField default="emitter" type="xs:NMTOKEN"/>
<containerField default="fillProperties" type="xs:NMTOKEN"/>
<containerField default="fogCoord" type="xs:NMTOKEN"/>
<containerField default="fontStyle" type="xs:NMTOKEN"/>
<containerField default="geometry" type="xs:NMTOKEN"/>
<containerField default="geoOrigin" type="xs:NMTOKEN"/>
<containerField default="joints" type="xs:NMTOKEN"/>
<containerField default="layers" type="xs:NMTOKEN"/>
<containerField default="layout" type="xs:NMTOKEN"/>
<containerField default="lineProperties" type="xs:NMTOKEN"/>
<containerField default="material" type="xs:NMTOKEN"/>
<containerField default="motions" type="xs:NMTOKEN"/>
<containerField default="periodicWave" type="xs:NMTOKEN"/>
<containerField default="physics" type="xs:NMTOKEN"/>
<containerField default="pointProperties" type="xs:NMTOKEN"/>
<containerField default="programs" type="xs:NMTOKEN"/>
<containerField default="renderStyle" type="xs:NMTOKEN"/>
<containerField default="shaders" type="xs:NMTOKEN"/>
<containerField default="texCoord" type="xs:NMTOKEN"/>
<containerField default="textureProperties" type="xs:NMTOKEN"/>
<containerField default="textureTransform" type="xs:NMTOKEN"/>
<containerField default="texture" type="xs:NMTOKEN"/>
<containerField default="trimmingContour" type="xs:NMTOKEN"/>
<containerField default="viewport" type="xs:NMTOKEN"/>
<!-- For schema xs:simpleType with contained xs:enumeration
definitions, follow naming convention of name ending in 'Type',
'Choices' (for strict enumeration set) or 'Values' (for suggested
tokens). -->
<Inheritance baseType="xs:boolean"/>
<Inheritance baseType="xs:double"/>
<Inheritance baseType="xs:float"/>
<Inheritance baseType="xs:integer"/>
<Inheritance baseType="xs:string"/>
containerField is not mentioned at all in my schema. xs: is not
mentioned in my schema generator.
I cannot extract patterns from X3DUOM if they don't exist. I can add
patterns to my schema generator, if someone puts them into JSON
encoding. I can add these patterns as text.
There's even a good opportunity to reduce the number of patterns in
X3dXml4.0SchemaConvertedToJson2020-12Schema.json:
(venv) coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/schema$
jsonlint X3dXml4.0SchemaConvertedToJson2020-12Schema.json|grep pattern|wc
96 192 39020
(venv) coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/schema$
jsonlint X3dXml4.0SchemaConvertedToJson2020-12Schema.json|grep
pattern|sort -u|wc
25 50 6183
John
On 10/13/21 7:36 PM, Brutzman, Donald (Don) (CIV) wrote:
>
> The Altova XML Spy generated schema is not a solution, it is an
> example showing design patterns that may be useful.
>
> converted X3D JSON schema, would be my guess.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211014/8d56b227/attachment.html>
More information about the x3d-public
mailing list