Skip to content

Commit

Permalink
make structure instance's type optional
Browse files Browse the repository at this point in the history
  • Loading branch information
melaasar committed Jul 24, 2024
1 parent 458bb8e commit df46fb7
Show file tree
Hide file tree
Showing 40 changed files with 199 additions and 81 deletions.
2 changes: 1 addition & 1 deletion io.opencaesar.oml.api.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="io.opencaesar.oml.api.feature"
label="%featureName"
version="2.7.2"
version="2.7.3"
provider-name="%providerName">

<description>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.api.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.api.feature</artifactId>
<packaging>eclipse-feature</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="io.opencaesar.oml.dsl.feature"
label="%featureName"
version="2.7.2"
version="2.7.3"
provider-name="%providerName">

<description>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.dsl.feature</artifactId>
<packaging>eclipse-feature</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: io.opencaesar.oml.dsl.ide
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-SymbolicName: io.opencaesar.oml.dsl.ide; singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ide/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.dsl.ide</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ui.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: io.opencaesar.oml.dsl.ui.tests
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-SymbolicName: io.opencaesar.oml.dsl.ui.tests; singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.dsl.ui.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: io.opencaesar.oml.dsl.ui
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-SymbolicName: io.opencaesar.oml.dsl.ui; singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.dsl.ui</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: io.opencaesar.oml.dsl
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-SymbolicName: io.opencaesar.oml.dsl; singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.dsl</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.dsl/src/io/opencaesar/oml/dsl/Oml.xtext
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ AnonymousInstance:
AnonymousRelationInstance;

StructureInstance:
':' type=[Structure|Ref] '['
{StructureInstance} (':' type=[Structure|Ref])? '['
ownedPropertyValues+=PropertyValueAssertion*
']';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ protected void _format(RelationInstance instance, IFormattableDocument doc) {
}

protected void _format(StructureInstance instance, IFormattableDocument doc) {
doc.append(keyword(instance, oml.getStructureInstanceAccess().getColonKeyword_0()), oneSpace());
doc.append(keyword(instance, oml.getStructureInstanceAccess().getColonKeyword_1_0()), oneSpace());
doc.append(feature(instance, OmlPackage.Literals.STRUCTURE_INSTANCE__TYPE), oneSpace());
formatBrackets(instance, doc);
instance.getOwnedPropertyValues().forEach(i -> doc.prepend(doc.format(i), newLine()));
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.edit/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: io.opencaesar.oml.edit;singleton:=true
Automatic-Module-Name: io.opencaesar.oml.edit
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-ClassPath: .
Bundle-Activator: io.opencaesar.oml.provider.OmlEditPlugin$Implementation
Bundle-Vendor: %providerName
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.edit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.edit</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,16 @@ public String getText(Object object) {
valueLabel = getLiteralLabel(axiom.getLiteralValue()).toString();
} else if (axiom.getContainedValue() instanceof StructureInstance) {
var instance = (StructureInstance) axiom.getContainedValue();
valueLabel = getLabel(instance.getType(), instance);
var type = instance.getStructure();
if (type != null) {
valueLabel = getLabel(type, instance);
}
} else if (axiom.getContainedValue() instanceof AnonymousRelationInstance) {
var instance = (AnonymousRelationInstance) axiom.getContainedValue();
valueLabel = getLabel(instance.getTarget(), instance);
var type = instance.getRelationEntity();
if (type != null) {
valueLabel = getLabel(type, instance);
}
} else if (axiom.getReferencedValue() != null) {
valueLabel = getLabel(axiom.getReferencedValue(), axiom);
}
Expand Down Expand Up @@ -698,7 +704,7 @@ public String getText(Object object) {
} else if (instance.isRef()){
label.append("ref relation instance " + getLabel(instance.resolve(), instance));
} else {
label.append("relation instance" + getLabel(instance));
label.append("relation instance " + getLabel(instance));
}
if (!instance.getSources().isEmpty()) {
List<String> labels = instance.getSources().stream().map(i -> getLabel(i, instance)).collect(Collectors.toList());
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.editor/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: io.opencaesar.oml.editor;singleton:=true
Automatic-Module-Name: io.opencaesar.oml.editor
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-ClassPath: .
Bundle-Activator: io.opencaesar.oml.presentation.OmlEditorPlugin$Implementation
Bundle-Vendor: %providerName
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.editor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.editor</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.repository</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.sdk.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="io.opencaesar.oml.sdk.feature"
label="%featureName"
version="2.7.2"
version="2.7.3"
provider-name="%providerName">

<description>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.sdk.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.sdk.feature</artifactId>
<packaging>eclipse-feature</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,10 +1416,10 @@ The following example description defines three concept instances: *component1*

#### Structure Instance #### {#StructureInstance-LR}

A [structure instance](#StructureInstance-Syntax) is an anonymous instance that can be defined as a value of a structured property. Such value can either be specified in a [property value assertion](#PropertyValueAssertion-LR), defined in the context of some instance, or in a [property value restriction axiom](#PropertyValueRestrictionAxiom-LR) on some structured property in the context of some classifier. A structure instance is declared with a colon (`:`) followed by the IRI of a structure followed by a pair of square brackets (`[` `]`) that holds assertions about the instance.
A [structure instance](#StructureInstance-Syntax) is an anonymous instance that can be defined as a value of a structured property. Such value can either be specified in a [property value assertion](#PropertyValueAssertion-LR), defined in the context of some instance, or in a [property value restriction axiom](#PropertyValueRestrictionAxiom-LR) on some structured property in the context of some classifier. A structure instance is declared with an optional type, represented by a colon (`:`) followed by a structure IRI , followed by a pair of square brackets (`[` `]`) that holds assertions about the instance. Note that if a type is omitted, it will be inferred to be the range of the structure property that defines the structure instance.

<pre class="highlight highlight-html">
`:` [Structure|IRI] `[`
(`:` [Structure|IRI])? `[`
Assertion*
`]`
</pre>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.specification/src/main/textual-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
AnonymousRelationInstance

<a id="StructureInstance-Syntax">StructureInstance</a> ::=
":" [Structure|IRI] "["
(":" [Structure|IRI])? "["
PropertyValueAssertion*
"]"

Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml.target/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml.target</artifactId>
<packaging>eclipse-target-definition</packaging>
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: io.opencaesar.oml;singleton:=true
Automatic-Module-Name: io.opencaesar.oml
Bundle-Version: 2.7.2
Bundle-Version: 2.7.3
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion io.opencaesar.oml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.opencaesar.oml</groupId>
<artifactId>io.opencaesar.oml.parent</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</parent>
<artifactId>io.opencaesar.oml</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public interface AnonymousRelationInstance extends AnonymousInstance {
* @model kind="operation" unique="false"
* @generated
*/
RelationEntity getType();
RelationEntity getRelationEntity();

/**
* <!-- begin-user-doc -->
Expand Down
47 changes: 37 additions & 10 deletions io.opencaesar.oml/src-gen/io/opencaesar/oml/OmlPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6856,14 +6856,23 @@ public interface OmlPackage extends EPackage {
*/
int STRUCTURE_INSTANCE___GET_IS_VALUE_OF_PROPERTY = ANONYMOUS_INSTANCE___GET_IS_VALUE_OF_PROPERTY;

/**
* The operation id for the '<em>Get Structure</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int STRUCTURE_INSTANCE___GET_STRUCTURE = ANONYMOUS_INSTANCE_OPERATION_COUNT + 0;

/**
* The operation id for the '<em>Get Types</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int STRUCTURE_INSTANCE___GET_TYPES = ANONYMOUS_INSTANCE_OPERATION_COUNT + 0;
int STRUCTURE_INSTANCE___GET_TYPES = ANONYMOUS_INSTANCE_OPERATION_COUNT + 1;

/**
* The number of operations of the '<em>Structure Instance</em>' class.
Expand All @@ -6872,7 +6881,7 @@ public interface OmlPackage extends EPackage {
* @generated
* @ordered
*/
int STRUCTURE_INSTANCE_OPERATION_COUNT = ANONYMOUS_INSTANCE_OPERATION_COUNT + 1;
int STRUCTURE_INSTANCE_OPERATION_COUNT = ANONYMOUS_INSTANCE_OPERATION_COUNT + 2;

/**
* The meta object id for the '{@link io.opencaesar.oml.impl.AnonymousRelationInstanceImpl <em>Anonymous Relation Instance</em>}' class.
Expand Down Expand Up @@ -6957,13 +6966,13 @@ public interface OmlPackage extends EPackage {
int ANONYMOUS_RELATION_INSTANCE___GET_IS_VALUE_OF_PROPERTY = ANONYMOUS_INSTANCE___GET_IS_VALUE_OF_PROPERTY;

/**
* The operation id for the '<em>Get Type</em>' operation.
* The operation id for the '<em>Get Relation Entity</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ANONYMOUS_RELATION_INSTANCE___GET_TYPE = ANONYMOUS_INSTANCE_OPERATION_COUNT + 0;
int ANONYMOUS_RELATION_INSTANCE___GET_RELATION_ENTITY = ANONYMOUS_INSTANCE_OPERATION_COUNT + 0;

/**
* The operation id for the '<em>Get Types</em>' operation.
Expand Down Expand Up @@ -11629,6 +11638,16 @@ public interface OmlPackage extends EPackage {
*/
EReference getStructureInstance_Type();

/**
* Returns the meta object for the '{@link io.opencaesar.oml.StructureInstance#getStructure() <em>Get Structure</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Get Structure</em>' operation.
* @see io.opencaesar.oml.StructureInstance#getStructure()
* @generated
*/
EOperation getStructureInstance__GetStructure();

/**
* Returns the meta object for the '{@link io.opencaesar.oml.StructureInstance#getTypes() <em>Get Types</em>}' operation.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -11661,14 +11680,14 @@ public interface OmlPackage extends EPackage {
EReference getAnonymousRelationInstance_Target();

/**
* Returns the meta object for the '{@link io.opencaesar.oml.AnonymousRelationInstance#getType() <em>Get Type</em>}' operation.
* Returns the meta object for the '{@link io.opencaesar.oml.AnonymousRelationInstance#getRelationEntity() <em>Get Relation Entity</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Get Type</em>' operation.
* @see io.opencaesar.oml.AnonymousRelationInstance#getType()
* @return the meta object for the '<em>Get Relation Entity</em>' operation.
* @see io.opencaesar.oml.AnonymousRelationInstance#getRelationEntity()
* @generated
*/
EOperation getAnonymousRelationInstance__GetType();
EOperation getAnonymousRelationInstance__GetRelationEntity();

/**
* Returns the meta object for the '{@link io.opencaesar.oml.AnonymousRelationInstance#getTypes() <em>Get Types</em>}' operation.
Expand Down Expand Up @@ -14630,6 +14649,14 @@ interface Literals {
*/
EReference STRUCTURE_INSTANCE__TYPE = eINSTANCE.getStructureInstance_Type();

/**
* The meta object literal for the '<em><b>Get Structure</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation STRUCTURE_INSTANCE___GET_STRUCTURE = eINSTANCE.getStructureInstance__GetStructure();

/**
* The meta object literal for the '<em><b>Get Types</b></em>' operation.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -14657,12 +14684,12 @@ interface Literals {
EReference ANONYMOUS_RELATION_INSTANCE__TARGET = eINSTANCE.getAnonymousRelationInstance_Target();

/**
* The meta object literal for the '<em><b>Get Type</b></em>' operation.
* The meta object literal for the '<em><b>Get Relation Entity</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation ANONYMOUS_RELATION_INSTANCE___GET_TYPE = eINSTANCE.getAnonymousRelationInstance__GetType();
EOperation ANONYMOUS_RELATION_INSTANCE___GET_RELATION_ENTITY = eINSTANCE.getAnonymousRelationInstance__GetRelationEntity();

/**
* The meta object literal for the '<em><b>Get Types</b></em>' operation.
Expand Down
Loading

0 comments on commit df46fb7

Please sign in to comment.