[X3D-Ecosystem] Planned X3D JSON schema (X3DJSONLD) updates.
John Carlson
yottzumm at gmail.com
Sun Dec 29 09:12:44 PST 2024
I also realize that changing X3DUOM to make ProtoInstance.name required
also affects the X3DUOM to X3D JSON schema mapping (the mapping is the
product, not the schema) I did some time ago. If there are interested
parties, I can redo the mapping. The new mapping will possibly include
changes for the X_ITE component, but I still need to undo changes I made to
the Tangent node’s component (I switched it to X_ITE from Rendering).
Plus, I need to check for X3DUOM updates from Holger.
I believe the mapping lives here:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/index.html
The mapping generator lives here:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/schemamapping.py
In general, X3DJSONLD beyond X3D JSON schema needs to be upgraded for X_ITE
Material node extensions.
I also need to work on handling this:
https://github.com/KhronosGroup/glTF-Sample-Assets/
<https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models>
Instead of this:
https://github.com/KhronosGroup/glTF-Sample-Models
This will ensure that X3D JSON schema can handle nearly .x3dj that
Holger’s x3d-tidy produces from glTF (yes, I realize converting JSON to
JSON is weird).
If anyone wants to add their special nodes to X3D JSON schema, please let
me know.
John
On Sun, Dec 29, 2024 at 9:43 AM John Carlson <yottzumm at gmail.com> wrote:
> Apologies that this comes in the middle of the holidays!
>
> Don, tread with care when applying the ProtoInstance.name being a required
> change.
>
> I don't plan to apply the change to x3dvalidate until the end of February
> for those who are relying on it. I still need to test changes in
> X3DJSONLD. This is an advance warning!
>
> On Sun, Dec 29, 2024 at 8:05 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Don, thanks for responding.
>>
>> 1. I will try to make name required in ProtoInstance, pending your
>> changes to validation.
>>
>
> Upon review, it looks like there are errors in not requiring @name in both
> ProtoInstance subschemas of X3D JSON schema 4.0. What I did was make
> ProtoInstance's field /name/ have use="required" in X3DUOM, V4.0. I don't
> know what will happen with X3D 3.0-3.3 yet. Initial changes
> indicated that @name is required with nodes without @USE. I made changes
> to the python to accommodate the ProtoInstance @USE subschema, requiring
> both @USE and @name for X3D V4.0.
>
> Original X3D JSON schema 4.0:
>
> "ProtoInstance": {
> "type": "object",
> "oneOf": [
> {
> "type": "object",
> "properties": {
> "@class": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@name": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@USE": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "-children": {
> "type": "array",
> "minItems": 1,
> "items": {
> "type": "object",
> "properties": {
> "#comment": {
> "type": "string",
> "$comment": "#comment statements are the only allowed
> in -children node when using a USE field"
> }
> },
> "additionalProperties": false
> }
> }
> },
> "required": [
> "@USE"
> ],
> "additionalProperties": false
> },
> {
> "type": "object",
> "properties": {
> "-children": {
> "type": "array",
> "minItems": 1,
> "items": {
> "type": "object",
> "properties": {
> "#comment": {
> "type": "string"
> }
> },
> "additionalProperties": false
> }
> },
> "fieldValue": {
> "$ref": "#/$defs/fieldValue"
> },
> "IS": {
> "$ref": "#/$defs/IS"
> },
> "-metadata": {
> "$ref": "#/$defs/-X3DMetadataObjectSFNode"
> },
> "@name": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@DEF": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@class": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@id": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@style": {
> "$comment": "SFString inputOutput",
> "type": "string"
> }
> },
> "additionalProperties": false
> }
> ]
> },
>
> Here's the new result (Only for X3D V4.0, I will have to edit the python
> to include other versions). Note that @name is now *required* in all
> cases, even if @USE is provided.
>
>
> "ProtoInstance": {
> "type": "object",
> "oneOf": [
> {
> "type": "object",
> "properties": {
> "@class": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@name": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@USE": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "-children": {
> "type": "array",
> "minItems": 1,
> "items": {
> "type": "object",
> "properties": {
> "#comment": {
> "type": "string",
> "$comment": "#comment statements are the only allowed
> in -children node when using a USE field"
> }
> },
> "additionalProperties": false
> }
> }
> },
> "required": [
> "@name",
> "@USE"
> ],
> "additionalProperties": false
> },
> {
> "type": "object",
> "properties": {
> "-children": {
> "type": "array",
> "minItems": 1,
> "items": {
> "type": "object",
> "properties": {
> "#comment": {
> "type": "string"
> }
> },
> "additionalProperties": false
> }
> },
> "fieldValue": {
> "$ref": "#/$defs/fieldValue"
> },
> "IS": {
> "$ref": "#/$defs/IS"
> },
> "-metadata": {
> "$ref": "#/$defs/-X3DMetadataObjectSFNode"
> },
> "@name": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@DEF": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@class": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@id": {
> "$comment": "SFString inputOutput",
> "type": "string"
> },
> "@style": {
> "$comment": "SFString inputOutput",
> "type": "string"
> }
> },
> "required": [
> "@name"
> ],
> "additionalProperties": false
> }
> ]
> },
>
> Since this change is a breaking change, and may invalidate some X3D JSON
> files, I will wait an amount of time before I implement this change in my
> repositories, realizing that I may need to check my code in due to a
> service call on my machine. I suggested *not* upgrading x3dvalidate and
> X3DJSONLD until you've had a chance to test your JSON.
>
> Thanks,
>
> John
>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20241229/97be95cf/attachment-0001.html>
More information about the X3D-Ecosystem
mailing list