Skip to content

Commit 572cb58

Browse files
committed
Merge branch 'main' into 2.2.x
2 parents ff50f57 + 1213c30 commit 572cb58

File tree

307 files changed

+6483
-2548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+6483
-2548
lines changed

AUTHORS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Authors
1+
# Authors
22

33
The following people have contributed to this repository:
44

55
* Birgit Boss, Robert Bosch GmbH
66
* Daniel Ewert, Robert Bosch GmbH, [email protected]
7-
* Dennis Melzer, Robert Bosch GmbH, georg.schmidt-dumont@de.bosch.com
7+
* Dennis Melzer, Robert Bosch GmbH, Dennis.Melzer@de.bosch.com
88
* Misecka Rastislav, Systecs Informationssysteme GmbH
99
* Fethuallah Misir, Robert Bosch GmbH, [email protected]
1010
* Michele Santoro
1111
* Andreas Schilling, [email protected]
12-
* Georg Schmidt-Dumont, Robert Bosch GmbH, [email protected]
13-
* David Schmitt, Systecs Informationssysteme GmbH
12+
* Georg Schmidt-Dumont, Robert Bosch GmbH, [email protected]
13+
* David Schmitt, Robert Bosch GmbH, [email protected]
1414
* Andreas Textor, [email protected]
1515
* Peter Triebe, [email protected]
16-
* Julian Walbrecht, ulian[email protected]
16+
* Julian Walbrecht, Julian[email protected]
1717
* Sven Walter, [email protected]
1818
* Sven Erik Jeroschewski, Bosch.IO GmbH
1919
* Lukas Römer, Bosch.IO GmbH, [email protected]

README.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [esmf-aspect-static-meta-model](#esmf-aspect-static-meta-model)
1212
- [esmf-aspect-model-validator](#esmf-aspect-model-validator)
1313
- [Version Handling](#version-handling)
14-
- [SAMM Versioning](#samm-versioning)
14+
- [esmf-sdk Versioning](#esmf-sdk-versioning)
1515
- [SAMM Java Implementation Packaging](#samm-java-implementation-packaging)
1616
- [SAMM CLI](#samm-cli)
1717
- [Artifact Generation facilities](#artifact-generation-facilities)
@@ -37,17 +37,18 @@ code generators, validators etc.
3737
This document provides an overall overview of the SDK, and the concepts applied throughout it.
3838
Detailed documentation and concepts for each component can be found in the respective subfolders.
3939

40-
This repository contains a detailed developer documentation written in AsciiDoc. The source files
41-
(AsciiDoc) are located [here](documentation/developer-guide) and are built using
42-
[Antora](https://antora.org/) which generates the documentation as HTML files.
40+
This repository contains a detailed developer documentation written in AsciiDoc.
41+
The source files (AsciiDoc) are located [here](documentation/developer-guide) and are built using
42+
[Antora](https://antora.org/) which generates the documentation as HTML files. A site generated using Antora is self-contained and can be viewed entirely offline via a web browser without setting up a web server.
43+
To build the documentation locally, please check out and follow the instructions in [ESMF documentation repository](https://github.com/eclipse-esmf/eclipse-esmf.github.io).
4344

4445
## Getting help
4546

4647
Are you having trouble with ESMF SDK? We want to help!
4748

48-
* Check the [ESMF SDK developer documentation](https://openmanufacturingplatform.github.io/sds-documentation/sds-developer-guide/index.html)
49+
* Check the [ESMF SDK developer documentation](https://eclipse-esmf.github.io/esmf-developer-guide/index.html)
4950
* Ask a question the [community forum](https://www.eclipse.org/forums/index.php/f/617/).
50-
* Check the SAMM [specification](https://openmanufacturingplatform.github.io/sds-documentation/bamm-specification/snapshot/index.html)
51+
* Check the SAMM [specification](https://eclipse-esmf.github.io/samm-specification/snapshot/index.html)
5152
* Having issues with the ESMF SDK? Open a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk/issues).
5253

5354
## Build and contribute
@@ -124,30 +125,27 @@ The model validator is also available through the [SAMM CLI](#samm-cli).
124125

125126
## Version Handling
126127

127-
SAMM does evolve over time. While measures are made to do this in a non-breaking manner, some
128-
changes cannot be carried out without the need to define a new, breaking version. Due to this fact
129-
it is important to understand the versioning concept that is applied to the SAMM, APIs and SDK
128+
SAMM and its SDKs evolve over time. While measures are taken to do this in a non-breaking manner,
129+
some changes cannot be carried out without the need to define a new, breaking version. Due to this
130+
fact it is important to understand the versioning concept that is applied to the SAMM, APIs and SDK
130131
components that are derived from them.
131132

132-
In case of a prerelease there will be a postfix added and it will be released on Github. The way to
133-
access the artifact is described in [Github-Installing a
134-
package](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#installing-a-package)
133+
In case of a prerelease a postfix will be added to the version, such as `-M1`, and it will be
134+
released on Github. The way to access the artifact is described in the [Java Aspect Tooling
135+
Guide](https://eclipse-esmf.github.io/esmf-developer-guide/tooling-guide/java-aspect-tooling.html#versioning).
135136

136-
### SAMM Versioning
137+
### esmf-sdk Versioning
137138

138-
For SAMM, semantic versioning (`major.minor.micro`) is applied with the following rules:
139+
For the esmf-sdk, semantic versioning (`major.minor.micro`) is applied with the following rules:
139140

140-
* A breaking change increases the `major` part
141-
* Backwards compatible new features increase the `minor` part
142-
* Changes to existing features or bug fixes increase the `micro` part
141+
* The `major` part designates the supported SAMM major version
142+
* A breaking change increases the `minor` part
143+
* Backwards compatible new features, changes to existing features or bugfixes increase the `minor` part
143144

144-
A new SAMM version always comprises new releases of the SDK components that depend on SAMM, however
145-
not the other way round. New releases of SDK components may be crafted that are built on the
145+
A new SAMM version implies new releases of the SDK components that depend on this SAMM version,
146+
however not the other way round. New releases of SDK components may be released that are built on an
146147
existing SAMM version.
147148

148-
The SDK component versions are otherwise not tied to the SAMM version, i.e., they may differ in any
149-
part of the version.
150-
151149
### SAMM Java Implementation Packaging
152150

153151
Complex applications might have the need to be implemented against different versions of the SAMM,
@@ -238,7 +236,7 @@ GitHub](https://github.com/eclipse-esmf/esmf-sdk/releases).
238236

239237
For information regarding running the command line tool, the available commands and their
240238
description, please have a look at the
241-
[documentation](https://openmanufacturingplatform.github.io/sds-documentation/sds-developer-guide/tooling-guide/bamm-cli.html).
239+
[documentation](https://eclipse-esmf.github.io/esmf-developer-guide/tooling-guide/samm-cli.html).
242240

243241
## License
244242

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AbstractEntity.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,13 @@
1313

1414
package org.eclipse.esmf.metamodel;
1515

16-
import java.util.Collections;
17-
import java.util.List;
18-
1916
/**
2017
* Represents a generic domain specific concept which may have multiple specific variants.
2118
*
2219
* @since SAMM 2.0.0
2320
*/
2421
public interface AbstractEntity extends ComplexType {
2522

26-
/**
27-
* @return a {@link java.util.List} of {@link ComplexType}s which extend this Abstract Entity
28-
*/
29-
default List<ComplexType> getExtendingElements() {
30-
return Collections.emptyList();
31-
}
32-
3323
@Override
3424
default boolean isAbstractEntity() {
3525
return true;

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package org.eclipse.esmf.metamodel;
1515

1616
import java.util.Collection;
17+
import java.util.Collections;
1718
import java.util.List;
1819
import java.util.Optional;
1920
import java.util.stream.Collectors;
@@ -24,6 +25,13 @@
2425
*/
2526
public interface ComplexType extends Type, StructureElement {
2627

28+
/**
29+
* @return a {@link java.util.List} of {@link ComplexType}s which extend this Entity
30+
*/
31+
default List<ComplexType> getExtendingElements() {
32+
return Collections.emptyList();
33+
}
34+
2735
default boolean isAbstractEntity() {
2836
return false;
2937
}

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Property.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ default boolean isOptional() {
5353
* By default Properties are included in the runtime data.
5454
*
5555
* @see
56-
* <a href="https://openmanufacturingplatform.github.io/sds-bamm-aspect-meta-model/bamm-specification/snapshot/modeling-guidelines.html#declaring-enumerations">BAMM Aspect Meta Model
56+
* <a href="https://eclipse-esmf.github.io/samm-specification/2.0.0/modeling-guidelines.html#declaring-enumerations">Semantic Aspect Meta Model
5757
* Specification - Declaring Enumerations</a>
5858
* @since SAMM 1.0.0
5959
*/

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAbstractEntity.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,31 @@
1414
package org.eclipse.esmf.metamodel.impl;
1515

1616
import java.util.List;
17-
import java.util.Objects;
1817
import java.util.Optional;
19-
import java.util.stream.Collectors;
2018

2119
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
2220
import org.eclipse.esmf.metamodel.AbstractEntity;
2321
import org.eclipse.esmf.metamodel.ComplexType;
2422
import org.eclipse.esmf.metamodel.Property;
2523
import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes;
24+
import org.eclipse.esmf.metamodel.loader.ModelElementFactory;
2625
import org.eclipse.esmf.metamodel.visitor.AspectVisitor;
2726

2827
public class DefaultAbstractEntity extends DefaultComplexType implements AbstractEntity {
29-
30-
private final List<AspectModelUrn> extendingElements;
31-
3228
public static DefaultAbstractEntity createDefaultAbstractEntity(
3329
final MetaModelBaseAttributes metaModelBaseAttributes,
3430
final List<? extends Property> properties,
3531
final Optional<ComplexType> _extends,
3632
final List<AspectModelUrn> extendingElements ) {
37-
final DefaultAbstractEntity defaultAbstractEntity = new DefaultAbstractEntity( metaModelBaseAttributes, properties, _extends, extendingElements );
38-
instances.put( metaModelBaseAttributes.getUrn().get(), defaultAbstractEntity );
39-
return defaultAbstractEntity;
33+
return new DefaultAbstractEntity( metaModelBaseAttributes, properties, _extends, extendingElements, null );
4034
}
4135

42-
private DefaultAbstractEntity( final MetaModelBaseAttributes metaModelBaseAttributes,
36+
public DefaultAbstractEntity( final MetaModelBaseAttributes metaModelBaseAttributes,
4337
final List<? extends Property> properties,
4438
final Optional<ComplexType> _extends,
45-
final List<AspectModelUrn> extendingElements ) {
46-
super( metaModelBaseAttributes, properties, _extends );
47-
this.extendingElements = extendingElements;
48-
}
49-
50-
/**
51-
* @return all {@link ComplexType} instances from the {@link DefaultComplexType#instances} Map which extend this
52-
* Abstract Entity.
53-
*/
54-
@Override
55-
public List<ComplexType> getExtendingElements() {
56-
return extendingElements.stream().map( instances::get ).filter( Objects::nonNull ).collect( Collectors.toList() );
39+
final List<AspectModelUrn> extendingElements,
40+
final ModelElementFactory loadedElements ) {
41+
super( metaModelBaseAttributes, properties, _extends, extendingElements, loadedElements );
5742
}
5843

5944
/**

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultComplexType.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,33 @@
1414
package org.eclipse.esmf.metamodel.impl;
1515

1616
import java.util.ArrayList;
17-
import java.util.Collections;
1817
import java.util.List;
19-
import java.util.Map;
2018
import java.util.Optional;
21-
import java.util.WeakHashMap;
2219

2320
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
24-
import org.eclipse.esmf.metamodel.Aspect;
2521
import org.eclipse.esmf.metamodel.ComplexType;
2622
import org.eclipse.esmf.metamodel.Property;
2723
import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes;
24+
import org.eclipse.esmf.metamodel.loader.ModelElementFactory;
2825
import org.eclipse.esmf.metamodel.visitor.AspectVisitor;
2926

3027
public class DefaultComplexType extends ModelElementImpl implements ComplexType {
31-
32-
/**
33-
* Used to keep track of all {@link ComplexType} instances regardles of whether they are directly or indirectly
34-
* referenced in the {@link Aspect}.
35-
*/
36-
protected static WeakHashMap<AspectModelUrn, ComplexType> instances = new WeakHashMap<>();
37-
3828
private final List<Property> properties;
3929
private final Optional<ComplexType> _extends;
30+
private final List<AspectModelUrn> extendingElements;
31+
private final ModelElementFactory loadedElements;
4032

41-
protected static DefaultComplexType createDefaultComplexType( final MetaModelBaseAttributes metaModelBaseAttributes,
42-
final List<? extends Property> properties, final Optional<ComplexType> _extends ) {
43-
final DefaultComplexType defaultComplexType = new DefaultComplexType( metaModelBaseAttributes, properties, _extends );
44-
instances.put( metaModelBaseAttributes.getUrn().get(), defaultComplexType );
45-
return defaultComplexType;
46-
}
47-
48-
protected DefaultComplexType( final MetaModelBaseAttributes metaModelBaseAttributes, final List<? extends Property> properties,
49-
final Optional<ComplexType> _extends ) {
33+
protected DefaultComplexType(
34+
final MetaModelBaseAttributes metaModelBaseAttributes,
35+
final List<? extends Property> properties,
36+
final Optional<ComplexType> _extends,
37+
final List<AspectModelUrn> extendingElements,
38+
final ModelElementFactory loadedElements ) {
5039
super( metaModelBaseAttributes );
5140
this.properties = new ArrayList<>( properties );
5241
this._extends = _extends;
42+
this.extendingElements = extendingElements;
43+
this.loadedElements = loadedElements;
5344
}
5445

5546
/**
@@ -67,8 +58,15 @@ public Optional<ComplexType> getExtends() {
6758
return _extends;
6859
}
6960

70-
public static Map<AspectModelUrn, ComplexType> getInstances() {
71-
return Collections.unmodifiableMap( instances );
61+
/**
62+
* @return all {@link ComplexType} instances which extend this Abstract Entity.
63+
*/
64+
@Override
65+
public List<ComplexType> getExtendingElements() {
66+
if ( loadedElements == null ) {
67+
throw new RuntimeException( "No inheritance information is available." );
68+
}
69+
return loadedElements.getExtendingElements( extendingElements );
7270
}
7371

7472
@Override

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntity.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,38 @@
1212
*/
1313
package org.eclipse.esmf.metamodel.impl;
1414

15+
import java.util.Collections;
1516
import java.util.List;
1617
import java.util.Optional;
1718

19+
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
1820
import org.eclipse.esmf.metamodel.ComplexType;
1921
import org.eclipse.esmf.metamodel.Entity;
2022
import org.eclipse.esmf.metamodel.Property;
2123
import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes;
24+
import org.eclipse.esmf.metamodel.loader.ModelElementFactory;
2225
import org.eclipse.esmf.metamodel.visitor.AspectVisitor;
2326

2427
public class DefaultEntity extends DefaultComplexType implements Entity {
2528

2629
public static DefaultEntity createDefaultEntity( final MetaModelBaseAttributes metaModelBaseAttributes,
2730
final List<? extends Property> properties, final Optional<ComplexType> _extends ) {
28-
final DefaultEntity defaultEntity = new DefaultEntity( metaModelBaseAttributes, properties, _extends );
29-
instances.put( metaModelBaseAttributes.getUrn().get(), defaultEntity );
30-
return defaultEntity;
31+
return new DefaultEntity( metaModelBaseAttributes, properties, _extends, Collections.emptyList(), null );
3132
}
3233

33-
private DefaultEntity( final MetaModelBaseAttributes metaModelBaseAttributes,
34+
public DefaultEntity(
35+
final MetaModelBaseAttributes metaModelBaseAttributes,
36+
final List<? extends Property> properties ) {
37+
this( metaModelBaseAttributes, properties, Optional.empty(), Collections.emptyList(), null );
38+
}
39+
40+
public DefaultEntity(
41+
final MetaModelBaseAttributes metaModelBaseAttributes,
3442
final List<? extends Property> properties,
35-
final Optional<ComplexType> _extends ) {
36-
super( metaModelBaseAttributes, properties, _extends );
43+
final Optional<ComplexType> _extends,
44+
final List<AspectModelUrn> extendingElements,
45+
final ModelElementFactory loadedElements ) {
46+
super( metaModelBaseAttributes, properties, _extends, extendingElements, loadedElements );
3747
}
3848

3949
/**

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectModelLoader.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,27 @@
2727
import org.apache.jena.rdf.model.Resource;
2828
import org.apache.jena.rdf.model.Statement;
2929
import org.apache.jena.vocabulary.RDF;
30+
import org.eclipse.esmf.aspectmodel.UnsupportedVersionException;
31+
import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver;
3032
import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy;
33+
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidModelException;
34+
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidNamespaceException;
35+
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidRootElementCountException;
36+
import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel;
37+
import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService;
3138
import org.eclipse.esmf.aspectmodel.vocabulary.SAMM;
3239
import org.eclipse.esmf.metamodel.Aspect;
3340
import org.eclipse.esmf.metamodel.AspectContext;
3441
import org.eclipse.esmf.metamodel.ModelElement;
3542
import org.eclipse.esmf.metamodel.ModelNamespace;
3643
import org.eclipse.esmf.metamodel.NamedElement;
3744
import org.eclipse.esmf.metamodel.impl.DefaultModelNamespace;
45+
import org.eclipse.esmf.samm.KnownVersion;
3846
import org.slf4j.Logger;
3947
import org.slf4j.LoggerFactory;
4048

4149
import com.google.common.collect.ImmutableSet;
4250

43-
import org.eclipse.esmf.samm.KnownVersion;
44-
import org.eclipse.esmf.aspectmodel.UnsupportedVersionException;
45-
import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver;
46-
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidModelException;
47-
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidNamespaceException;
48-
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidRootElementCountException;
49-
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidVersionException;
50-
import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel;
51-
import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService;
52-
5351
import io.vavr.control.Try;
5452

5553
/**
@@ -218,7 +216,7 @@ public static Aspect getSingleAspectUnchecked( final VersionedModel versionedMod
218216
throw new AspectLoadingException( cause );
219217
} );
220218
}
221-
219+
222220
/**
223221
* Similar to {@link #getSingleAspect(VersionedModel)}, except that a predicate can be provided to select which of potentially
224222
* multiple aspects should be selected
@@ -228,7 +226,7 @@ public static Aspect getSingleAspectUnchecked( final VersionedModel versionedMod
228226
*/
229227
public static Try<Aspect> getSingleAspect( final VersionedModel versionedModel, final Predicate<Aspect> selector ) {
230228
return getAspects( versionedModel ).flatMap( allAspects -> {
231-
final List<Aspect> aspects = allAspects.stream().filter( selector::test ).toList();
229+
final List<Aspect> aspects = allAspects.stream().filter( selector ).toList();
232230
return switch ( aspects.size() ) {
233231
case 1 -> Try.success( aspects.iterator().next() );
234232
case 0 -> Try.failure( new InvalidRootElementCountException( "No Aspects were found in the model" ) );

0 commit comments

Comments
 (0)