| ## X3D Unified Object Model (X3DUOM) |

The X3D Unified Object Model (X3DUOM) is a full set of object-oriented interfaces for all nodes, fields and statements in the X3D Architecture Specification.

> Description | Design and Production | Glossary | Implementation and Evaluation | Java assets | Python assets | X3D Ontology assets | Future work: C, C++, C# assets and JavaScript assets | X3D 4.0 Architecture | Contact

## Description

The X3D Unified Object Model (X3DUOM) is a full set of object-oriented interfaces for all nodes, fields and statements in the X3D Architecture Specification. Available source:

- Current: X3dUnifiedObjectModel-4.0.xml (version control)
- Related: X3dUnifiedObjectModel-3.3.xml (version control) and earlier X3D versions are also available.
- Validity: corresponding X3dUnifiedObjectModel.xsd validation schema.

X3DUOM provides a validatable expression of X3D relationships that can be applied to implement various X3D file encodings and programming-language bindings.

## Design and Production

To build the X3DUOM, first the X3D XML Schema is annotated to include all object-oriented information for X3D nodes and fields. All fields are included regardless of accessType (`initializeOnly`, `inputOutput`, `inputOnly`, `outputOnly`). The schema is then read and converted into a simple XML file that fully lists the object-oriented characteristics of all X3D nodes, statements and attributes.

- X3D Specification Relationships diagram shows how various X3D file-format and language-binding standards all align together. Each file-format and programming-language standard has equivalent expressive power to the ISO/IEC 19775-1 X3D Architecture abstract reference model and this X3D Unified Object Model (X3DUOM).
- Diagram X3D Unified Object Model (X3DUOM) Creation illustrates how the X3DUOM build process works.
- X3D Specifications: Schema and DOCTYPE Validation provide multiple tools for validating X3D files consistently with X3DUOM.
- X3D Tooltips provide additional detail on content-model parent-child relationships and attribute data typing.
- All information in X3DUOM is automatically generated from definitions in the x3d-4.0.xsd XML Schema (documentation)
- Conversions are performed using the BuildX3dUnifiedObjectModelXmlFile.xslt stylesheet.
- Design tutorial: ObjectModelForX3dMasterClassWeb3dConference2017June7.pdf
- X3D Regular Expressions (regexes) provides documentation for the regexes used in X3DUOM, X3D schemas, X3DJSAIL etc.

The availability of X3DUOM as a parsable XML file means that matching codebases in different programming languages can all be created for producing and manipulating valid X3D models.

X3DUOM source for all versions of X3D:

- X3dUnifiedObjectModel-4.0.xml (current)
- X3dUnifiedObjectModel-3.3.xml (strict backwards compatibility)
- X3dUnifiedObjectModel-3.2.xml (strict backwards compatibility)
- X3dUnifiedObjectModel-3.1.xml (strict backwards compatibility)
- X3dUnifiedObjectModel-3.0.xml (strict backwards compatibility)

Also available: .json version (experimental).

This project was originally named Object Model for X3D (OM4X3D). It has been renamed as X3DUOM to better describe the unified nature of common X3D APIs across multiple programming languages.

### Glossary

The X3D 4.0 Architecture is ISO/IEC International Standard (IS) ISO/IEC 19775-1 includes Clause 3 Definitions, acronyms, and abbreviated terms

Both acronyms and glossary terms have been codified and included in the X3D XML Schema and X3DUOM. Available at

- glossary.xsd excerpted from X3D 4.0 XML Schema, with documentation for acronymChoices and glossaryChoices
- glossary.xml excerpted from X3DUOM 4.0
- glossary.html produced by stylesheet X3duomGlossaryToHtml.xslt via build.xml
- Corresponding programming-language versions can be found in X3DJSAIL (Java). TODO: X3DPSAIL (Python), and X3D Ontology (Turtle).

We expect further conversions to support work by Metaverse Standards Register (MSR) Working Group at Metaverse Standards Forum (MSF).

## Implementation and Evaluation

As described on the Web3D Consortium Recommended Standards page, Extensible 3D (X3D) Graphics provides a coordinated set of steadily evolving ISO standards.

Tandem work on Java, JavaScript and Python by Don Brutzman and John Carlson is expected to provide multiple implementation confirmations and possibly small revisions to multiple specifications including the governing ISO/IEC 19775-2 X3D Scene Access Interface (SAI) abstract specification.

Development efforts for each of the following programming-language bindings are providing the full capabilities of the X3D Architecture in language-specific ways. Once complete, this body of work will provide unparalleled breadth and portability for export and utilization of Web-based 3D graphics.

### Java assets

- X3D Java Scene Access Interface Library (X3DJSAIL) implements the entire X3DUOM as an open-source Java library.
- X3DJSAIL supports programmers with standards-based X3D Java interfaces and objects, all as open source. Current work has achieved good design patterns and full coverage for source code.
- Production chain:
  - Ant build.xml targets `create.X3DJSAIL` and `test.X3DJSAIL` pertain.
  - XSLT stylesheet CreateX3dSceneAccessInterfaceJava.xslt processes the X3DUOM.xml file, producing the full library.
- Draft standard available on Web3D Consortium Member-only GitHub: ISO/IEC 19777-2 X3D Language Bindings for Java

### Python assets

- X3D Python Scene Access Interface Library (X3DPSAIL) implements the entire X3DUOM as an open-source Python library, published as x3d.py package on the widely used Python Packaging Index (PyPI).
- X3DPSAIL supports programmers with standards-based X3D Python interfaces and objects, all as open source. Current work has achieved good design patterns and full coverage for source code.
- Production chain:
  - Ant build.xml targets `create.X3DPSAIL` and `test.X3DPSAIL` pertain.
  - XSLT stylesheet X3duomToX3dPythonPackage.xslt processes the X3DUOM.xml file, producing the full library.
- Prior work: Pyjnius (source) is a Python library for accessing Java classes. Developed in tandem with X3DJSAIL Java-based implementation, X3DJSAIL pyjnius package (alternatively pythonSAI codebase at https://github.com/coderextreme/pythonSAI) reads X3D files and generates Python source code, allowing programmers to access Java classes from Python. Unfortunately parts of the Pyjnius mapping apparently were unable to correctly use reflection to utilize X3DJSAIL completely. We eventually abandoned this approach as problematic, opting instead to further adapt X3DUOM and generate native Python source instead.

### X3D Ontology assets

- X3D Ontology for Semantic Web provides terms of reference for semantic query of X3D graphics models, including interactive 3D geometry, multimedia, and metadata.
- Current work is has achieved good design patterns and full coverage supporting the X3D Ontology.
- Production chain:
  - Ant build.xml target `BuildX3dOntologyFromX3duom.saxon` pertain.
  - XSLT stylesheet X3duomToX3dOntology.xslt processes the X3DUOM.xml file, producing the full library.

## Future work

We plan to continue these multiple-language library generation techniques to make open-source X3D software libraries even more broadly available.

Please see the X3D Graphics Standards Relationships figure to see how a common X3D Architecture can be implemented with consistent semantics for X3D scene graphs.

Future efforts under consideration follow.

### C, C++, C# assets

- Design and implementation of language bindings for C, C++ and C# are being pursued by Myeong Won Lee with early contributions by Roy Walmsley.
- Draft standard available on Web3D Consortium Member-only Github: draft ISO/IEC 19777-3,4,5 X3D Language Bindings for C, C++ and C
- Draft bindings have been submitted to ISO/IEC by Web3D Consortium as a New Work Item Proposal (NWIP).
- Slideset presentation X3D C/C++/C# Language Bindings (Updates) by Myeong Won Lee at Web3D Korea Chapter Meeting January 2019
- Current work is focused on achieving good design patterns and full coverage for source code.
- TODO: draft specification prose for ISO/IEC 19776-6 and submit corresponding NWIP through Web3D to ISO.

### JavaScript (ECMAScript) assets

- Finalization of X3D to JSON Conversion is awaiting the long-pending standardization of a JSON Schema.
- An example implementation is X3DJSONLD codebase at https://github.com/coderextreme/X3DJSONLD
- X3D JSON Loader Tutorial with Object Model integration by John Carlson (yottzumm@gmail.com)
- Draft standard available on Web3D Consortium Member-only Github: ISO/IEC 19777-1 X3D Language Bindings for ECMAScript
- Related work has achieved good design patterns and full coverage for X3D JavaScript Object Notation (JSON) encoding. Next steps await completion of JSON Schema IETF draft-08.
- Further work to follow is confirming similar support for JavaScript source code.

## Contact

> Available online at https://www.web3d.org/specifications/X3DUOM.html

> Discussion regarding X3D Unified Object Model (X3DUOM) takes place on x3d-public at web3D.org mailing list (subscribe).

> Questions, suggestions, additions and comments about this X3D Unified Object Model (X3DUOM) page are welcome. Please send them to Don Brutzman (brutzman at nps.edu).

> Version control of these assets is maintained at https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/specifications/X3DUOM

> Updated: 2 February 2024