[x3d-public] gltf metadata

Andreas Plesch andreasplesch at gmail.com
Fri Feb 1 13:02:59 PST 2019


Yeah, I had to look up how containerfield works for metadata. It is
one of the few cases where the default containerfield value
('metadata') often does not apply but still makes most sense as
default.

There is only 'metadata' or 'value' available as containerfield
values. 'children' is not a possible value, since Metadata nodes
cannot be children.

containerfield='value' only applies to content of MetadataSet nodes.
However, MetadataSet may be the most common Metadata node describing
metadata for something in the scene.

<Something>
<MetadataSet name='authoringRecord' value='metadata' containerField='metadata'>
  <MetadataString name='recording' value='scanned' containerField='value'/>
  ..
</MetadataSet>

This makes the MetadataString part of the MetadataSet record.

Somewhat confusingly, it is also possible to define metadata for metadata (!):

<Something>
<MetadataSet name='authoringRecord' value='metadata' containerField='metadata'>
  <MetadataString name='metaSystem' value='ABMDatabase'
containerField='metadata'/>
  <MetadataString name='recording' value='scanned' containerField='value'/>
..
</MetadataSet>

Here, the 'ABMDatabase' would refer to a definition of metadata system
where authoringRecord has a meaning. I suspect that this usage is very
rare.

There could be additional levels of metadata embeddings. [ regions of
metaSystems or some such ].

I hope I got this right as it gets pretty abstract,

-Andreas

On Fri, Feb 1, 2019 at 11:26 AM John Carlson <yottzumm at gmail.com> wrote:
>
> JSON Schema has value.  OK.  I must have misunderstood.
>
>
>
> John
>
>
>
> Sent from Mail for Windows 10
>
>
>
> From: John Carlson
> Sent: Friday, February 1, 2019 10:04 AM
> To: Andreas Plesch; X3D Graphics public mailing list; Don Brutzman
> Subject: RE: [x3d-public] gltf metadata
>
>
>
> Re: containerField of value (oops)
>
>
>
> You might check the JSON schema, but I’m not sure “value” is the preferred name for a containerField. “children” may be preferred. That is, convert the X3D to JSON, and then check against the JSON 3.3 schema.  Generally “value” => 1 value and “children” =>  >1  value
>
>
>
> Sent from Mail for Windows 10
>
>
>
> From: Andreas Plesch
> Sent: Friday, February 1, 2019 9:43 AM
> To: X3D Graphics public mailing list
> Subject: [x3d-public] gltf metadata
>
>
>
> Here is how x3dom currently translates gltf metadata into x3d. Since
>
> x3dom translates the non-binary gltf data into dom and makes it
>
> (optionally) available as a dom node tree under the inline, translated
>
> metadata can then be accessed as well, to show somewhere or do
>
> whatever.
>
>
>
> gltf has the ability to provide unstructured or optionally structured
>
> metadata for the global asset and for each resource. This is similar
>
> to the Metadata nodes in x3d.
>
>
>
> glTF metadata can be provided in an 'extras' property which is
>
> available to each kind of node. In addition, the toplevel asset node
>
> contains metadata in defined properties.
>
>
>
> The asset node data is translated into a WorldInfo node in the following way.
>
>
>
> The copyright, generator, version, and minversion properties of the
>
> toplevel asset node go into WorldInfo as a MFString info field: '
>
> "copyright:(c)2020 sb" "version:2.0" ..' .The property name is joined
>
> together with its value by a colon. [ There are alternatives, such as
>
> property name followed by property value. ]
>
>
>
> extras of the toplevel asset node go into the WorldInfo metadata field
>
> packaged inside a MetadataSet holding node with name 'global':
>
>
>
> <WorldInfo info= ' "copyright:(c)2020 sb" "version:2.0" '
>
> title='asset.extras.title value if given'>
>
>   <MetadataSet name='global' containerfield='metadata'>
>
>     <MetadataSet name='asset-extras' containerfield='value'>
>
>       extras (see below)
>
>
>
> The asset extras metadata are named 'asset-extras'.
>
>
>
> There is no defined 'title' property in gltf but if there is an
>
> asset.extras.title string property it goes in the title field of
>
> WorldInfo.
>
>
>
> [ I am starting to think that it would be better to not use the info
>
> field and just have an additional entry into the global MetadataSet,
>
> an 'asset-properties' entry ].
>
>
>
> The 'global' holding node also contains the extras of the gltf scene node.
>
>
>
> <WorldInfo>
>
>   <MetadataSet name='global' containerfield='metadata'>
>
>     <MetadataSet name='asset-extras' containerfield='value'>
>
>       extras (see below)
>
>     <MetadataSet name='scene-extras' containerfield='value'>
>
>       extras (see below)
>
>
>
> The scene extras metadata are name 'scene-extras'.
>
>
>
> The scene metadata are put into WorldInfo metadata because X3D Scene
>
> itself cannot have a Metadata node (X3D Metadata nodes are not child
>
> nodes) and because using the META statements in the X3D header would
>
> then require managing the X3D header. Also, it seems logical to group
>
> all scene-wide data together.
>
>
>
> All other extras properties in nodes go into metadata nodes as
>
> required in the following way. The gltf extras json property can have
>
> any json value, including arrays and objects. It is recommended to use
>
> a json object as name:value map but any json value is allowed.
>
> A json string becomes a MetadataString.
>
> A json number becomes a MetadataFloat.
>
> A json boolean becomes a MetadataBoolean.
>
> A json array or object becomes a MetadataSet. An array is actually an
>
> object with numerical, ordered keys: {'0':v0, '1':v1 ..}. It can be
>
> treated as an object.
>
> The name field for each metadata node is 'extras' by default or the
>
> key name in case of values for MetadataSet.
>
> Here are examples:
>
> <Transform>
>
>   <MetadataString name='extras' value='extras_value_string'
>
> containerfield='metadata'/>
>
> ----
>
> <Transform>
>
>   <MetadataSet name='extras'  containerfield='metadata'>
>
>     <MetadataString name='component' value='rotor' containerfield='value'/>
>
>     <MetadataString name='warehouse' value='StarlingCity'
>
> containerfield='value'/>
>
> ----
>
> <WorldInfo>
>
>   <MetadataSet name='global' containerfield='metadata'>
>
>     <MetadataSet name='asset-extras' containerfield='value'>
>
>       <MetadataString name='created' value='2/3/2345' containerfield='value'/>
>
>       <MetadataString name='author' value='art artist' containerfield='value'/>
>
>       <MetadataString name='license' value='CC 4.0,
>
> http://license.org/CC' containerfield='value'/>
>
> -----
>
>
>
> This description is probably longer than the lines of code it takes to
>
> implement this kind of translation.
>
>
>
> Any input or feedback much appreciated while this effort is underway.
>
>
>
> -Andreas
>
>
>
>
>
> --
>
> Andreas Plesch
>
> Waltham, MA 02453
>
>
>
> _______________________________________________
>
> x3d-public mailing list
>
> x3d-public at web3d.org
>
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>
>



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list