JSDAI Express Compiler details

Data models, described in the EXPRESS modeling language (ISO 10303-11), can be made available for SDAI with the JSDAI Express Compiler.

The JSDAI Express Compiler parses EXPRESS schemas and generates corresponding Java packages with interface and class files for the schemas. These are needed for the early binding feature of JSDAI.

In addition, the EXPRESS models are converted into a population of the SDAI_dictionary_schema. This is a meta schema describing the structure of the EXPRESS language itself. This dictionary data is necessary both for the late binding as well as for early binding support of JSDAI.

Generated classes and interfaces

For the early binding implementation each entity in the original EXPRESS schema "xxx" needs to be converted into a Java interface "EXxx", an implementing Java class "CXxx" and an additional Java class for the aggregate of that entity "AXxx".

The interface and its implementing class contain early binding methods to test, get, set or create and unset attributes of that entity. Access methods for explicit and inverse attributes are fully supported, test and get methods for derived attributes throw "not available" exception at the present time.

The entity classes also have static methods for early binding implementation of the Find entity instance used in SDAI operations. Furthermore static methods are created to get corresponding Attribute instances in the dictionary data. Thus early binding and late binding concepts are linked together.

Aggregate classes are generated to deal with members of entity instances or defined types. Classes for nested aggregates are also generated as far as the EXPRESS schema.

The compiler also generates a Java interface for each defined type found in the EXPRESS schema, if its underlying type is not SELECT or ENUMERATION. For ENUMERATION types Java classes are generated. SELECT types do not need interfaces or classes at all. Aggregate classes are generated for SELECTs, however, if such SELECT types are base types of aggregates in the EXPRESS schema.

One special class per schema is generated, too, allowing to identify a particular EXPRESS schema in early binding mode. The schema class is needed, e.g. for the repository method createSdaiModel().

Please note that the resultant Java classes and interfaces are generated as source code. To make them available to JSDAI they need to be compiled into the Java class files. For this any Java compiler can be used.

Meta information in the Dictionary

JSDAI also requires dictionary information for every supported EXPRESS schema. The dictonary is a Meta schema defined by the SDAI_dictionary_schema containing entities like schema_definition, entity_definition, attribute, etc. Populating this schema is an alternative way to represent an EXPRESS schema, other than in the usual EXPRESS notation. The dictionary is essential for the late-binding implementation but is also required to make the early binding working. Typical late binding applications are such, which are not specific to a particular EXPRESS schema.

Late binding examples available for JSDAI are:

  • SdaiTerm: Allow to operate JSDAI in a terminal mode
  • SdaiView: Windows program to scan through STEP data
  • Example12: Generates of a simple AP203 p21-file.
  • GenerateExpress: Regenerates of EXPRESS from dictionary information
  • GenerateDoc: Generating HTML documentation from the dictionary

The SDAI_dictionary_schema is not a complete description of EXPRESS. It does mainly lack the subtype constraints and the EXPRESS functions, expressions and constants. We are working on extending the SDAI_dictionary_schema so that it covers EXPRESS completely.

Support of Short and Long form schemas

The JSDAI EXPRESS compiler supports both Long and Short form EXPRESS schemas. In the case of Short form schemas, a separate java package is generated for each schema. The compiler also provides information to populate the multi-model dictionary.

Complex types, Short names, ...

Needed complex entity types have to be specified as special "complex" entities as defined in ISO 10303-22:A.1.3. The compiler also supports short entity names. They must be provided in a separate file for each schema.