Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a semantic custom-attribute for TypeDefinition relationships. #310

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Domains/0-Core/BisCore.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ECSchema schemaName="BisCore" alias="bis" version="01.00.17" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2" displayLabel="BIS Core" description="The BIS core schema contains classes that all other domain schemas extend.">

<ECSchemaReference name="CoreCustomAttributes" version="01.00.03" alias="CoreCA"/>
<ECSchemaReference name="BisCustomAttributes" version="01.00.00" alias="bisCA"/>
<ECSchemaReference name="BisCustomAttributes" version="01.00.01" alias="bisCA"/>
<ECSchemaReference name="ECDbMap" version="02.00.00" alias="ecdbmap"/>
<ECSchemaReference name="ECDbSchemaPolicies" version="01.00.00" alias="ecdbpol"/>

Expand Down Expand Up @@ -675,6 +675,9 @@

<ECRelationshipClass typeName="GeometricElement2dHasTypeDefinition" strength="referencing" modifier="Abstract">
<!-- @see GeometricElement2d.TypeDefinition ECNavigationProperty -->
<ECCustomAttributes>
<TypeDefinitionRelationship xmlns="BisCustomAttributes.01.00.01"/>
</ECCustomAttributes>
<Source multiplicity="(0..*)" roleLabel="is of type" polymorphic="true">
<Class class="GeometricElement2d" />
</Source>
Expand All @@ -694,6 +697,9 @@

<ECRelationshipClass typeName="GeometricElement3dHasTypeDefinition" strength="referencing" modifier="Abstract">
<!-- @see GeometricElement3d.TypeDefinition ECNavigationProperty -->
<ECCustomAttributes>
<TypeDefinitionRelationship xmlns="BisCustomAttributes.01.00.01"/>
</ECCustomAttributes>
<Source multiplicity="(0..*)" roleLabel="is of type" polymorphic="true">
<Class class="GeometricElement3d" />
</Source>
Expand Down
5 changes: 4 additions & 1 deletion Domains/0-Core/Functional.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ECSchema schemaName="Functional" alias="func" version="01.00.05" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2" description="The Functional schema defines common base classes to be used by discipline-specific functional domains.">

<ECSchemaReference name="CoreCustomAttributes" version="01.00.04" alias="CoreCA"/>
<ECSchemaReference name="BisCustomAttributes" version="01.00.00" alias="bisCA"/>
<ECSchemaReference name="BisCustomAttributes" version="01.00.01" alias="bisCA"/>
<ECSchemaReference name="BisCore" version="01.00.15" alias="bis"/>
<ECSchemaReference name="ECDbMap" version="02.00.00" alias="ecdbmap"/>

Expand Down Expand Up @@ -93,6 +93,9 @@
</ECEntityClass>

<ECRelationshipClass typeName="FunctionalElementIsOfType" strength="referencing" modifier="None" description="A type-instance relation; one that indicates that the specific func:FunctionalElement is an instance of the defined func:FunctionalType.">
<ECCustomAttributes>
<TypeDefinitionRelationship xmlns="BisCustomAttributes.01.00.01"/>
</ECCustomAttributes>
<Source multiplicity="(0..*)" roleLabel="is of type" polymorphic="true">
<Class class="FunctionalElement" />
</Source>
Expand Down
2 changes: 1 addition & 1 deletion SchemaInventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4663,7 +4663,7 @@
"name": "BisCustomAttributes",
"path": "Standard\\BisCustomAttributes.ecschema.xml",
"released": false,
"version": "01.00.00",
"version": "01.00.01",
"comment": "Working Copy",
"sha1": "",
"author": "Diego.Diaz",
Expand Down
4 changes: 3 additions & 1 deletion Standard/BisCustomAttributes.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
| * See LICENSE.md in the project root for license terms and full copyright notice.
======================================================================================= -->
<ECSchema schemaName="BisCustomAttributes" alias="bisCA" version="01.00.00" description="Custom attributes to indicate BIS concepts." displayLabel="BIS Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
<ECSchema schemaName="BisCustomAttributes" alias="bisCA" version="01.00.01" description="Custom attributes to indicate BIS concepts." displayLabel="BIS Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
<ECEnumeration typeName="SchemaLayer" backingTypeName="string" isStrict="true" description="Defines the layers in the BIS schema hierarchy.">
<ECEnumerator name="Core" displayLabel="Core" value="Core" description="Layer for schemas that define the most fundamental concepts and key organizational strategies for all other BIS schemas."/>
<ECEnumerator name="Common" displayLabel="Common" value="Common" description="Layer for schemas that define abstract concepts and patterns used by multiple disciplines."/>
Expand All @@ -15,4 +15,6 @@
<ECCustomAttributeClass typeName="SchemaLayerInfo" appliesTo="Schema" modifier="Sealed" description="Declares the target layer in the BIS schema hierarchy for a schema.">
<ECProperty propertyName="Value" typeName="SchemaLayer" description="Layer in the BIS schema hierarchy that a schema targets." />
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="TypeDefinitionRelationship" appliesTo="RelationshipClass" description="Identifies a relationship class that associates Elements with their corresponding TypeDefinition instance." displayLabel="Type-Definition Relationship" modifier="Sealed"/>
</ECSchema>
8 changes: 7 additions & 1 deletion Standard/BisCustomAttributes.remarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ Other technology-specific schemas not meant to be referenced by other schemas be

### SchemaLayerInfo

BIS schemas should be tagged with the `SchemaLayerInfo` `CustomAttribute` to enable validation and error checking related to schema-references.
BIS schemas should be tagged with the `SchemaLayerInfo` `CustomAttribute` to enable validation and error checking related to schema-references.

### TypeDefinitionRelationship

Under this _type definition_ semantics, the element at the source end of the relationship is subclassified by the element at the target end (its Type-Definition). That is, the latter provides a finer classification of the former than what its _element class_ targets. Furthermore, any business properties and their values captured by the element at the target end of the relationship are considered shared among all the elements at the source of the relationship.

Note that the `TypeDefinitionRelationship` `CustomAttribute` implies that a relationship tagged with it uses a _referencing_ **strenght**, has a _0..*_ **multiplicity** on its source end, and a _0..1_ **multiplicity** on its target end-point.
Loading