Table of Contents
Metadata defined: in general, "data about data;" functionally, "structured data about data." Metadata includes data associated with either an information system or an information object for purposes of description, administration, legal requirements, technical functionality, use and usage, and preservation.
--Dublin Core Metadata Initiative (DCMI)
Metadata is the use of data to explain other data. In other words, the information provided in a document might have further descriptions that explain the origin or context of the information itself.
An X3D metadata node can be used to provide such information about any node in an X3D scene graph, and is placed as a child of the node that it describes. Metadata nodes are persistent, meaning that their values remain available and accessible after loading. Metadata nodes do not affect the visible rendering of a scene.
Other mechanisms to place information in a scene include meta tags, the WorldInfo node, and comments.
X3D documents are a growing and important part of the World Wide Web. Metadata strategies become important when X3D scenes might get reused, repurposed or improved. Since authoring good content takes time, and since one X3D motto states "content is king," it is often worth documenting the relevant resources that are used to construct the many details presented in an X3D scene.
There are four general mechanisms for adding metadata information in an X3D scene, listed as follows.
Meta tags are contained in the scene header and provide attribute-value pairs of information about the overall scene. They are not available after a scene is loaded.
A metadata node can be provided as the metadata field of any other X3D node.
A WorldInfo node contains a simple unstructured string of persistent information, but it's fields are not accessible outside of the node.
Comments are unstructured text that can provide helpful information to authors. They are not retained when an X3D scene is parsed, and not presentable to users when a scene is loaded.
Meta tags are discussed in Chapter 1, Technical Introduction, section 1.2.5.5.
The metadata nodes include MetadataDouble, MetadataFloat, MetadataInteger, MetadataString and MetadataSet. Each node can contain an array of named values, along with an optional reference that governs naming and semantic conventions. In each case, the data value is strongly typed to match the name of the node.
The WorldInfo node was defined in the original Virtual Reality Modeling Language (VRML97) specification and was the only way to persistently save metadata in such scenes. Because each WorldInfo node was able to include an array of arbitrary string values, it might seem that any type of metadata information might be included. However, without internal structure, and without the ability to read such strings at run time, WorldInfo has limited practical use from a metadata standpoint and is infrequently used.
Comment syntax and considerations appear in the next section. Abstract node type definitions and detailed node definitions follow.
Comments are commonly included by authors to explain the rationale for constructs of interest in a scene. Purpose, design decisions, sources of information and any other kind of information might be included.
Commenting styles vary widely. In general, it is good to be brief and factual. Comments should help an author who looks at the scene later. That author might be you, perhaps six or twelve months from now when you might remember the general flow of what you created but not all of the specific details. Thinking about what comments you like to find in other people's work provides a good guideline for how much detail to put in your work.
One good convention is to document unresolved problems or upcoming work by first putting the the phrase TODO in the comment. Some authoring tools look for such labels and flag them for authors, making it easier to later find the parts that need further work.
If the comments are documenting a signficant problem, then
another good practice is to put a <meta
name="error" description="..."/>
(or warning
or info
)
tag in the scene header. In this way, authors can immediately be
aware of showstopper difficulties in the scene.
The X3DMetadataObject type defines the minimum required fields for metadata nodes. It is part of the Core profile, meaning that it is integral to X3D.
All nodes of type X3DMetadataObject also include a value field, either as a simple type or as contained nodes. Field definitions are listed in Table 15.1.
Table 1. Field definitions for X3DMetadataObject
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core |
The name field lists the name of the metadata being provided. Metadata information is provided as name-value pairs so that each value is uniquely identified. The default value is an empty string array.
The reference field is optional and the default value is an empty string array. When used, it identifies the reference or standard defining the allowed values and semantic meaning of the metadata being provided.
If the reference field is not provided, authors are expected to deduce the meaning of the metadata from the name field.
A meta tag can be used to identify a metadata reference that is globally applicable to a scene.
The X3DInfoNode type implements the X3DChildNode interface, meaning that it can appear as a child node under a grouping node. Only the WorldInfo node implements the X3DInfoNode interface. Field definitions are listed in Table 15.2.
Table 2. Field Definitions for X3DInfoNode Type
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
The metadata field simply matches the requirements of the X3DNode interface, allowing such nodes to themselves include a single metadata node.
The WorldInfo node can provide a title for a scene as well as a simple string array providing arbitrary information. WorldInfo implements the X3DInfoObject type.
WorldInfo title information is helpful. A good authoring practice is to put a WorldInfo node with title information near the top of a scene so that it is easily found by an author.
The WorldInfo node is in the Interchange Profile. The Interchange Profile provides full support for all fields. The WorldInfo node has the fields defined in Table 15.3. Node syntax is shown in Table 15.4.
Table 3. Field Definitions for WorldInfo Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
MFString | initializeOnly | info | [ ] | Core | |
SFString | initializeOnly | title | "" | Core | |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 4. Node Syntax for WorldInfo Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<WorldInfo DEF="MyWorldInfo" info=' "String1" "String2" ' title="Example World"/> |
DEF MyWorldInfo WorldInfo { info ["String1" "String2"] title "Example World" } |
WorldInfo nodes can appear at the top level of the scene graph, and as a child under a grouping node.
WorldInfo is not an X3DMetadataObject and cannot appear as a child of other nodes where only metadata nodes are allowed.
The info field allows multi-element strings to be specified. Because info has accessType initializeOnly, it cannot be set or read during run time. This string array is not processed by X3D and exists to allow the creator to save human-readable information about the content in a scene file.
The title field allows a single-element string to be provided as the title for the model, possibly displayed in the browser's title bar.
Browsers and viewers are allowed to present titles in any way that they want. Thus a user may (or may not) see this information.
No rules are defined for cases when multiple titles are provided by multiple WorldInfo nodes.
The Browser class in the Scene Authoring Interface (SAI) can be used by Script nodes to set the title of a scene. Use of the SAI is beyond the scope of this book.
Setting the scene title using WorldInfo is a good practice. Otherwise use a metadata node instead of a WorldInfo node to save information about the scene.
The MetadataDouble node holds a value array of double-precision floating-point numbers. MetadataDouble implements the X3DMetadataObject type.
MetadataDouble is in the Core Profile. The node has the fields defined in Table 15.5. Node syntax is shown in Table 15.6.
Table 5. Field Definitions for MetadataDouble Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core | |
MFDouble | inputOutput | value | [ ] | Core | |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 6. Node Syntax for MetadataDouble Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<MetadataDouble DEF="MyMetadataDouble" name="Metadata_name" reference="Standard 1.2.3c" value='3.141592658, 2.71812181' </MetadataDouble> |
DEF MyMetadataDouble MetadataDouble { name "Metadata_name" reference "Standard 1.2.3c" value [3.141592658, 2.71812181] } |
The value of this metadata. MetadataDouble supports multiple-element array of double-precision numbers. Each element may be be any valid double-precision value.
The MetadataFloat node holds a value array of single-precision floating-point numbers. MetadataFloat implements the X3DMetadataObject type.
MetadataFloat is in the Core Profile. The node has the fields defined in Table 15.7. Node syntax is shown in Table 15.8.
Table 7. Field Definitions for MetadataFloat Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core | |
MFSFloat | inputOutput | value | [ ] | Core | |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 8. Node Syntax for MetadataFloat Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<MetadataFloat DEF="MyMetadataFloat" name="Metadata_name" reference="Standard 1.2.3c" value='9.8 6.023e+23' </MetadataString> |
DEF MyMetadataFloat MetadataFloat { name "Metadata_name" reference "Standard 1.2.3c" value [9.8 6.023e+23] } |
The value of this metadata. MetadataFloat supports multiple-element array of floats. Each element may be be any valid float value.
The MetadataInteger node holds a value array of integer values. MetadataInteger implements the X3DMetadataObject type.
MetadataInteger is in the Core Profile. The node has the fields defined in Table 15.9. Node syntax is shown in Table 15.10.
Table 9. Field Definitions for MetadataInteger Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core | |
MFInt32 | inputOutput | value | [ ] | Core | |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 10. Node Syntax for MetadataInteger Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<MetadataInteger DEF="MyMetadataInteger" name="Metadata_name" reference="Standard 1.2.3c" value='6, 28, 496' </MetadataString> |
DEF MyMetadataInteger MetadataInteger { name "Metadata_name" reference "Standard 1.2.3c" value [6, 28, 496] } |
The value of this metadata. MetadataInteger supports multiple-element array of integer. Each element may be be any valid integer value.
The MetadataString node holds a value array of string values. MetadataString implements the X3DMetadataObject type.
As discussed above, the Metadata nodes allow the storage of node-specific information in the scene graph. While the WorldInfo node does support the general issue of a "storage" node, it's fields are not accessible outside of the node, and WorldInfo does not support non-String datatypes. The Metadata nodes do support datatype specific information that is accessible in a structured manner.
The MetadataString node holds a value array string of information. It is possible to use this node to hold all information as a string, but using the other datatype-specific nodes is generally recommended for non-string data.
MetadataString is in the Core Profile. The node has the fields defined in Table 15.11. Node syntax is shown in Table 15.12.
Table 11. Field Definitions for MetadataString Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core | |
MFString | inputOutput | value | [ ] | Core | |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 12. Node Syntax for MetadataString Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<MetadataString DEF="MyMetadataString" name="Metadata_name" reference="Standard 1.2.3c" value=' "Part 27", "P27", "p27" ' </MetadataString> |
DEF MyMetadataString MetadataString { name "Metadata_name" reference "Standard 1.2.3c" value ["Part 27", "P27", "p27"] } |
The value of this metadata. MetadataString supports multiple-element array of strings. Each element may be be any valid string value.
MetadataString can be used to hold specially typed data such as enumerations or boolean values.
The MetadataSet node holds zero or more metadata nodes. This allows more complex structures than the simple parnet-child relationship available with the basic metadata nodes.
MetadataDouble implements the X3DMetadataObject type.
MetadataDouble is in the Core Profile. The node has the fields defined in Table 15.13. Node syntax is shown in Table 15.14.
Table 13. Field Definitions for MetadataSet Node
type | accessType | name | default | range | profile |
---|---|---|---|---|---|
SFString | inputOutput | name | "" | Core | |
SFString | inputOutput | reference | "" | Core | |
MFNode | inputOutput | value | [ ] | [X3DMetadataObject] | Core |
SFNode | inputOutput | metadata | NULL | [X3DMetadataObject] | Core |
Table 14. Node Syntax for MetadataSet Node
XML syntax (.x3d) | ClassicVRML syntax (.x3dv) |
---|---|
<MetadataSet DEF="MyMetadataSet" name="Metadata_name" reference="Standard 1.2.3c"> <MetadataString USE="MyMetadataString" containerField="value"/> <MetadataInteger USE="MyMetadataInteger" containerField="value"/> <MetadataFloat USE="MyMetadataFloat" containerField="value"/> <MetadataFloat name="coefficients" value="3.141592653 2.7128 1 0" containerField="value"/> </MetadataSet> |
DEF MyMetadataSet MetadataSet { name "Metadata_name" reference "Standard 1.2.3c" value [ use MyMetadataString use MyMetadataInteger use MyMetadataFloat MetadataFloat { name="coefficients" value [ 3.141592653 2.7128 1 0 ] } ] } |
Unlike the other metadata nodes which contain simple-type values, the value field of the MetadataSet node can contain multiple additional metadata nodes, including nested MetadataSet nodes. This is useful when a variety of metadata is needed to fully describe the significance of the parent node.
Reset containerField="value"
for
each contained metadata node that is part of the set of metadata
being collected.
MetadataSet nodes can contain MetadataSet nodes in order to create sophisticated metadata structures.
A MetadataSet node can contain a single metadata node
describing it. Set the default containerField="metadata"
in that special
node.
Meta tags provide information about a scene. Metadata nodes provided arrays of strongly typed data that is paired with a name and (optionally) a semantic reference. A WorldInfo node can provide a scene title. Comments let authors document scene construction but are not available at run time and not necessarily persistent after processing by some tools.
Chapter 1 Technical Introduction describes meta tags and a number of other scene-construction issues that are relevant to metadata structures in a scene.