BIS Schema Validation

The variability and potential magnitude of schema rules lead to the need for quality control and long-term maintainability over BIS schemas.

BIS uses EC v3

BIS is defined using EC v3. EC v3 is a more clearly defined and rigorous version of the EC that has been used widely in Bentley over the past 10+ years.

BIS is modularized into a set of interrelated domains (each expressed in a separate ECSchema) that are consistent, coordinated and constrained to maximize the functionality of the entire BIS-based ecosystem. Some flexibility that is available in "raw" EC is not available in BIS. For example, all ECClasses defined in domain ECSchemas (other than BisCore itself) are required to sub-class from some ECClass in BisCore. Other BIS rules are documented at BIS Schema Validation.

Unless noted otherwise, all references to “schema”, “class” and “property” in this document refer to ECSchema, ECClass and ECProperty.

Validation Rules

BIS Schemas are validated against a set of rules. If one rule is violated, the whole schema will fail validation.

The rules are broken into the different parts of the Schema they are validated against.

General (Schema) Rules

BIS-001

A schema must load and pass EC3.1 spec validation. XXXX NEED LINK

BIS-002

A schema's ECXML version must be at least, 3.1.

BIS-003

A schema may not reference any EC2 or EC3.0 schemas.

BIS-004

A schema must specify a three-part version number

  • The version number must be in the format RR.WW.mm (that is, Read.Write.Minor).
  • Each version component must be zero-padded to two digits (e.g. 01.02.00).

BIS-005

A schema reference must specify a three-part version number (in the same format described above).

BIS-006

If the schema contains 'dynamic' (case-insensitive) in its name it must apply the CoreCA:DynamicSchema custom attribute.

BIS-007

Classes within the same schema cannot have the same display label.

BIS-008

Classes may not use custom attributes that are deprecated.

BIS-009

Classes not within the BisCore, Functional, or Generic schema cannot applied bis:ClassHasHandler.

BIS-010

An alias in the schema reference must be the same as the alias defined by the schema.

Custom Attribute Classes

BIS-400

Custom Attribute classes must not have base classes.

Entity Class Rules

BIS-600

Entity classes must derive from the BIS hierarchy.

BIS-601

Entity classes may only derive from one base Entity class.

BIS-602

Entity classes may not inherit a property from more than one base class.

BIS-603

A mixin property cannot override an Entity property inherited from a base Entity class.

BIS-604

If any aspect (ECClass which derives from bis:ElementMultiAspect) exists, there must be a relationship that derives from the bis:ElementOwnsMultiAspects relationship with this class supported as a target constraint.

  • Treated as warning if the schema has the CoreCA:DynamicSchema CA applied.

BIS-605

If any aspect (ECClass which derives from bis:ElementUniqueAspect) exists, there must be a relationship that derives from the bis:ElementOwnsUniqueAspect relationship with this class supported as a target constraint.

  • Treated as warning if the schema has the CoreCA:DynamicSchema CA applied.

BIS-606

Entity classes cannot implement both bis:IParentElement and bis:ISubModeledElement.

BIS-607

Entity classes cannot subclass the following classes:

  • bis:PhysicalModel
  • bis:SpatialLocationModel
  • bis:GroupInformationModel
  • bis:InformationRecordModel
  • bis:DefinitionModel
    • bis:DictionaryModel and bis:RepositoryModel are the only classes allowed to subclass bis:DefinitionModel
  • bis:DocumentListModel
  • bis:LinkModel

BIS-608

Property overrides cannot change the persistence unit.

BIS-609

Subclasses of bis:Model cannot have additional properties defined outside of BisCore.

BIS-610

Entity classes may not subclass deprecated classes.

KindOfQuantities

BIS-700

Kind Of Quantities must not use 'PERCENTAGE' or other unitless ratios.

BIS-1000

Kind Of Quantities must use an SI Unit for their persistence unit.

Mixin Rules

BIS-1100

Mixin classes may not override an inherited property.

Properties

BIS-1300

Properties should not be of type long. These properties should be navigation properties if they represent a FK or be of type int or double if they represent a number.

BIS-1301

Properties within the same class and category cannot have the same display label.

BIS-1302

Properties must use the following supported ExtendedTypes:

  • BeGuid
  • GeometryStream
  • Json

BIS-1303

Properties must not use CustomAttribute bis:CustomHandledProperty unless CustomAttribute bis:ClassHasHandler is defined on their parent class (not derived from a base class).

Relationship Classes

BIS-1500

Relationship classes must not use the holding strength.

BIS-1501

Relationship classes must not have a source constraint multiplicity upper bound greater than 1 if the strength is embedding and the direction is forward.

BIS-1502

Relationship classes must not have a target constraint multiplicity upper bound greater than 1 if the strength is embedding and the direction is backward.

BIS-1503

Relationship classes must not have an abstract constraint if there is only one concrete constraint set.

BIS-1504

Relationship classes must not have an bis:ElementAspect target constraint (or source constraint if direction is backwards), unless they derive from bis:ElementOwnsUniqueAspect or bis:ElementOwnsMultiAspects.

BIS-1505

Embedding relationships should not have 'Has' in the class name.

Struct Classes

BIS-1700

Struct classes must not have base classes.


Next: BIS Glossary

Last Updated: 13 August, 2019