<div dir="auto">Reference x3d standard for items. SFVec3f would be 3 items, I think in that Draft.</div><div dir="auto"><br></div><div dir="auto">I’m not sure if the x3d json 4.0 schema is quite right. prefixItems was introduced.</div><div dir="auto"><br></div><div dir="auto">getTemplate and getSchema both look useful in sagold</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Tue, May 2, 2023 at 5:24 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was able to use<br>
<a href="https://github.com/sagold/json-schema-library/tree/main#gettemplate" rel="noreferrer" target="_blank">https://github.com/sagold/json-schema-library/tree/main#gettemplate</a><br>
<br>
to generate a giant 3.3 MB x3d json template from the json schema:<br>
<br>
<a href="https://gist.github.com/andreasplesch/eb344010e0d292bca6181dfaf115b43e#file-x3d-3-3-jsonschema-template-json" rel="noreferrer" target="_blank">https://gist.github.com/andreasplesch/eb344010e0d292bca6181dfaf115b43e#file-x3d-3-3-jsonschema-template-json</a><br>
<br>
Not sure exactly what it generated but probably something which<br>
validates. Not sure how useful that will be. See<br>
<br>
Steps:<br>
<br>
execute<br>
<a href="https://github.com/sagold/json-schema-library/blob/main/dist/jsonSchemaLibrary.js" rel="noreferrer" target="_blank">https://github.com/sagold/json-schema-library/blob/main/dist/jsonSchemaLibrary.js</a><br>
<br>
This produces a global jlib variable.<br>
<br>
schema = JSON.parse( content from<br>
<a href="https://www.web3d.org/specifications/x3d-3.3-JSONSchema.json" rel="noreferrer" target="_blank">https://www.web3d.org/specifications/x3d-3.3-JSONSchema.json</a> )<br>
tool = new jlib.Draft04(schema)<br>
template = tool.getTemplate()<br>
<br>
Before that, I had to change the schema where it complained about<br>
undefined data:<br>
<br>
@Matrix3f items<br>
Extrusion.@orientation.items<br>
Viewpoint.@orientation.items<br>
<br>
These had less items than required (8, or 3) which did not seem right<br>
but may be intentional. I added an item to each. Not sure how the<br>
additionalItems is supposed to work.<br>
<br>
The changed schema is here:<br>
<br>
<a href="https://gist.github.com/andreasplesch/eb344010e0d292bca6181dfaf115b43e#file-x3d-3-3-jsonschema-ap-json" rel="noreferrer" target="_blank">https://gist.github.com/andreasplesch/eb344010e0d292bca6181dfaf115b43e#file-x3d-3-3-jsonschema-ap-json</a><br>
<br>
<br>
<br>
-Andreas<br>
<br>
On Tue, May 2, 2023 at 3:00 PM <<a href="mailto:x3d-public-request@web3d.org" target="_blank">x3d-public-request@web3d.org</a>> wrote:<br>
><br>
> Send x3d-public mailing list submissions to<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
> or, via email, send a message with subject or body 'help' to<br>
> <a href="mailto:x3d-public-request@web3d.org" target="_blank">x3d-public-request@web3d.org</a><br>
><br>
> You can reach the person managing the list at<br>
> <a href="mailto:x3d-public-owner@web3d.org" target="_blank">x3d-public-owner@web3d.org</a><br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of x3d-public digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
> 1. x3d document structure for autocomplete (Andreas Plesch)<br>
> 2. Re: x3d document structure for autocomplete (John Carlson)<br>
><br>
><br>
> ----------------------------------------------------------------------<br>
><br>
> Message: 1<br>
> Date: Tue, 2 May 2023 13:57:17 -0400<br>
> From: Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>><br>
> To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
> Subject: [x3d-public] x3d document structure for autocomplete<br>
> Message-ID:<br>
> <CAKdk67spDw9D5=<a href="mailto:Ji8ozko15t82xh2F5X%2Bq5S6Nf0xn9q5xE48w@mail.gmail.com" target="_blank">Ji8ozko15t82xh2F5X+q5S6Nf0xn9q5xE48w@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="UTF-8"<br>
><br>
> The editor which is used for<br>
><br>
> <a href="https://andreasplesch.github.io/Library/Viewer/index.html" rel="noreferrer" target="_blank">https://andreasplesch.github.io/Library/Viewer/index.html</a><br>
><br>
> has autocomplete functionality for xml. It is based on a json data<br>
> structure as a source to suggest completions. The json data looks like<br>
> this:<br>
><br>
> x3d_tags = {<br>
> X3D: {<br>
> children: ["Scene"]<br>
> },<br>
> Transform: {<br>
> attrs: {<br>
> rotation: ["0 1 0 0"],<br>
> scale: ["1 1 1"],<br>
> translation: ["0 0 0 0"]<br>
> }<br>
> },<br>
> Shape: {<br>
> children: ["Appearance", "IndexedLineSet", "Box",<br>
> "Extrusion"],<br>
> },<br>
> Appearance: {<br>
> children: ["Material", "ImageTexture", "PixelTexture"],<br>
> },<br>
> Material: {<br>
> attrs: {<br>
> "diffuseColor": ["0.8 0.8 0.8"],<br>
> "emissiveColor": ["0 0 0"],<br>
> "specularColor": ["0.1 0.1 0.1"],<br>
> "shininess": ["0.1"],<br>
> "transparency": ["0"]<br>
> }<br>
> }<br>
> };<br>
><br>
> Hopefully, this will not be mangled too badly. Possible tags are<br>
> listed as keys which then have possible attribute options and children<br>
> tag options as values.<br>
><br>
> What would be the closest x3d document structure definition to<br>
> construct a complete autocomplete from ?<br>
><br>
> Thanks, Andreas<br>
><br>
><br>
><br>
> --<br>
> Andreas Plesch<br>
> Waltham, MA 02453<br>
><br>
><br>
><br>
> ------------------------------<br>
><br>
> Message: 2<br>
> Date: Tue, 2 May 2023 13:27:16 -0500<br>
> From: John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>
> To: Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>><br>
> Cc: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
> Subject: Re: [x3d-public] x3d document structure for autocomplete<br>
> Message-ID:<br>
> <CAGC3UE=341i_Jdf=<a href="mailto:2Rz3i5BHUSpg256upmNDvKeG31VLR4_9hg@mail.gmail.com" target="_blank">2Rz3i5BHUSpg256upmNDvKeG31VLR4_9hg@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> It?s not JSON. Property names in JSON have double quotes.<br>
><br>
> My advice is to generate the JavaScript from X3DUOM. Examples are in<br>
> X3DJSONLD/src/main/python.<br>
><br>
> I realize this is using way too many languages. Please provide a<br>
> JavaScript generator instead of Python.<br>
><br>
> It kind of looks like you?re trying to duplicate JSON Schema. I believe<br>
> there are additional parts beyond JSON Schema core for creating GUIs.<br>
><br>
> Let?s continue the discussion.<br>
><br>
> John<br>
><br>
> On Tue, May 2, 2023 at 12:56 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>><br>
> wrote:<br>
><br>
> > The editor which is used for<br>
> ><br>
> > <a href="https://andreasplesch.github.io/Library/Viewer/index.html" rel="noreferrer" target="_blank">https://andreasplesch.github.io/Library/Viewer/index.html</a><br>
> ><br>
> > has autocomplete functionality for xml. It is based on a json data<br>
> > structure as a source to suggest completions. The json data looks like<br>
> > this:<br>
> ><br>
> > x3d_tags = {<br>
> > X3D: {<br>
> > children: ["Scene"]<br>
> > },<br>
> > Transform: {<br>
> > attrs: {<br>
> > rotation: ["0 1 0 0"],<br>
> > scale: ["1 1 1"],<br>
> > translation: ["0 0 0 0"]<br>
> > }<br>
> > },<br>
> > Shape: {<br>
> > children: ["Appearance", "IndexedLineSet", "Box",<br>
> > "Extrusion"],<br>
> > },<br>
> > Appearance: {<br>
> > children: ["Material", "ImageTexture", "PixelTexture"],<br>
> > },<br>
> > Material: {<br>
> > attrs: {<br>
> > "diffuseColor": ["0.8 0.8 0.8"],<br>
> > "emissiveColor": ["0 0 0"],<br>
> > "specularColor": ["0.1 0.1 0.1"],<br>
> > "shininess": ["0.1"],<br>
> > "transparency": ["0"]<br>
> > }<br>
> > }<br>
> > };<br>
> ><br>
> > Hopefully, this will not be mangled too badly. Possible tags are<br>
> > listed as keys which then have possible attribute options and children<br>
> > tag options as values.<br>
> ><br>
> > What would be the closest x3d document structure definition to<br>
> > construct a complete autocomplete from ?<br>
> ><br>
> > Thanks, Andreas<br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Andreas Plesch<br>
> > Waltham, MA 02453<br>
> ><br>
> > _______________________________________________<br>
> > x3d-public mailing list<br>
> > <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> > <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
> ><br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230502/41e30616/attachment-0001.html" rel="noreferrer" target="_blank">http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230502/41e30616/attachment-0001.html</a>><br>
><br>
> ------------------------------<br>
><br>
> Subject: Digest Footer<br>
><br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
><br>
><br>
> ------------------------------<br>
><br>
> End of x3d-public Digest, Vol 170, Issue 2<br>
> ******************************************<br>
<br>
<br>
<br>
--<br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>