[x3d-public] considering general conversion of metadata - comparison of represenations

Don Brutzman brutzman at nps.edu
Thu Apr 13 09:07:48 PDT 2017


Regarding generality, we are examining whether this approach can map the metadata hierarchy of name=value pairs across different encodings and language bindings.

Here is a comparison.

http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/CaffeinePubChem2519SticksColorIndex.html
Excerpt showing conversion of arbitrary metadata into strictly typed X3D Metadata nodes:

===============================================================================================
original .x3d from chimera export:

http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/originals/PubChem-2519-sticks-color.x3d

<X3D version='3.0' profile='Interchange'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
  xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'
  xmlns:chimera='http://www.cgl.ucsf.edu/chimera/'>
  <!-- X3D profile limits on number of elements/colors/etc. were ignored -->
  <head>
   <meta content='UCSF Chimera, http://www.cgl.ucsf.edu/chimera/' name='generator'/>
   <meta content='2015-05-05T15:13:36Z' name='created'/>
  </head>
  <Scene>
   <NavigationInfo type='"EXAMINE" "ANY"' headlight='false'/>
   <Background skyColor='1 1 1'/>
   <chimera:WindowSize width='512' height='512'/>

original (or maybe derived?) .wrl from 3D Print Exchange
http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/originals/PubChem-2519-sticks-color.wrl

... has no such metadata or comments.  (of note: we do have working VRML97 prototypes for the Metadata* nodes.)

===============================================================================================
.x3d XML encoding:
http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/CaffeinePubChem2519SticksColor.x3d
http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/CaffeinePubChem2519SticksColor.html#ModelMetadata

<WorldInfo DEF='ModelMetadata' title='CaffeinePubChem2519SticksColor.x3d'>
   <!-- xmlns:chimera='http://www.cgl.ucsf.edu/chimera' -->
   <!-- <chimera:WindowSize xmlns:chimera="http://www.cgl.ucsf.edu/chimera/" height='512' width='512' /> -->
   <!-- <chimera:DepthCue xmlns:chimera="http://www.cgl.ucsf.edu/chimera/" color='1 1 1' range='35.2169 40.437' /> -->
   <MetadataSet name='xmlns:chimera' reference='http://www.cgl.ucsf.edu/chimera'>
     <MetadataString containerField='value' name='comment' value='"X3D profile limits on number of elements/colors/etc. were ignored"'/>
     <MetadataSet containerField='value' name='chimera:WindowSize'>
       <MetadataInteger containerField='value' name='height' value='512'/>
       <MetadataInteger containerField='value' name='width' value='512'/>
     </MetadataSet>
     <MetadataSet containerField='value' name='chimera:DepthCue'>
       <MetadataFloat containerField='value' name='color' value='1 1 1'/>
       <MetadataFloat containerField='value' name='range' value='35.2169 40.437'/>
     </MetadataSet>
   </MetadataSet>
</WorldInfo>

===============================================================================================

.x3dv ClassicVRML encoding:
http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/CaffeinePubChem2519SticksColor.x3dv

DEF ModelMetadata WorldInfo {
   title "CaffeinePubChem2519SticksColor.x3d"
   # metadata
   MetadataSet {
     name "xmlns:chimera"
     reference "http://www.cgl.ucsf.edu/chimera"
     value [
       MetadataString {
         name "comment"
         value [ "X3D profile limits on number of elements/colors/etc. were ignored"  ]
       }
       MetadataSet {
         name "chimera:WindowSize"
         value [
           MetadataInteger {
             name "height"
             value [ 512 ]
           }
           MetadataInteger {
             name "width"
             value [ 512 ]
           }
         ]
       }
       MetadataSet {
         name "chimera:DepthCue"
         value [
           MetadataFloat {
             name "color"
             value [ 1 1 1 ]
           }
           MetadataFloat {
             name "range"
             value [ 35.2169 40.437 ]
           }
         ]
       }
     ]
   }
}
===============================================================================================

.json JavaScript Object Notation:
http://x3dgraphics.com/examples/X3dForAdvancedModeling/AdditiveManufacturing/CaffeinePubChem2519SticksColor.json

{ "WorldInfo":
   {
	"@DEF":"ModelMetadata",
	"@title":"CaffeinePubChem2519SticksColor.x3d",
	"-children":[
	  {
		"#comment":"xmlns:chimera='http://www.cgl.ucsf.edu/chimera'"
	  },
	  {
		"#comment":"<chimera:WindowSize xmlns:chimera=\"http://www.cgl.ucsf.edu/chimera/\" height='512' width='512' />"
	  },
	  {
		"#comment":"<chimera:DepthCue xmlns:chimera=\"http://www.cgl.ucsf.edu/chimera/\" color='1 1 1' range='35.2169 40.437' />"
	  }
	],
	"-metadata":
	  { "MetadataSet":
		{
		  "@name":"xmlns:chimera",
		  "@reference":"http://www.cgl.ucsf.edu/chimera",
		  "-value":[
			{ "MetadataString":
			  {
				"@name":"comment",
				"@value":["X3D profile limits on number of elements/colors/etc. were ignored"]
			  }
			},
			{ "MetadataSet":
			  {
				"@name":"chimera:WindowSize",
				"-value":[
				  { "MetadataInteger":
					{
					  "@name":"height",
					  "@value":[512]
					}
				  },
				  { "MetadataInteger":
					{
					  "@name":"width",
					  "@value":[512]
					}
				  }
				]
			  }
			},
			{ "MetadataSet":
			  {
				"@name":"chimera:DepthCue",
				"-value":[
				  { "MetadataFloat":
					{
					  "@name":"color",
					  "@value":[1,1,1]
					}
				  },
				  { "MetadataFloat":
					{
					  "@name":"range",
					  "@value":[35.2169,40.437]
					}
				  }
				]
			  }
			}
		  ]
		}
	  }
   }
},

===============================================================================================

exemplar .java language binding:

  x3dModel = new X3DObject().setProfile("Interchange").setVersion("3.3")
   .setHead(new headObject()
     // .addMeta(new metaObject().setName("title").setContent("CaffeinePubChem2519SticksColor.x3d")) /* etc. */
     )
   .setScene(new SceneObject()
     .addChild(new NavigationInfoObject().setHeadlight(false))
     .addChild(new BackgroundObject().setSkyColor(new MFColorObject(new float[] {1.0f,1.0f,1.0f})))
     .addChild(new WorldInfoObject("ModelMetadata").setTitle("CaffeinePubChem2519SticksColor.x3d")
       .addComments(" xmlns:chimera='http://www.cgl.ucsf.edu/chimera' ")
       .addComments(" <chimera:WindowSize xmlns:chimera=\"http://www.cgl.ucsf.edu/chimera/\" height='512' width='512' /> ")
       .addComments(" <chimera:DepthCue xmlns:chimera=\"http://www.cgl.ucsf.edu/chimera/\" color='1 1 1' range='35.2169 40.437' /> ")
       .setMetadata(new MetadataSetObject().setName("xmlns:chimera").setReference("http://www.cgl.ucsf.edu/chimera")
         .addValue(new MetadataStringObject().setName("comment").setValue(new MFStringObject("\"X3D profile limits on number of elements/colors/etc. were ignored\"")))
         .addValue(new MetadataSetObject().setName("chimera:WindowSize")
           .addValue(new MetadataIntegerObject().setName("height").setValue(new int[] {512}))
           .addValue(new MetadataIntegerObject().setName("width").setValue(new int[] {512})))
         .addValue(new MetadataSetObject().setName("chimera:DepthCue")
           .addValue(new MetadataFloatObject().setName("color").setValue(new float[] {1.0f,1.0f,1.0f}))
           .addValue(new MetadataFloatObject().setName("range").setValue(new float[] {35.2169f,40.437f})))))

/* etc. */

===============================================================================================

So it would appear that it is possible to map the original metadata in the chimera scene, represented as XML namespace information, as persistent archival X3D metadata.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list