eclipse-esmf / esmf-semantic-aspect-meta-model

Formal and textual specification of the Semantic Aspect Meta Model (SAMM)
https://eclipse-esmf.github.io/samm-specification/snapshot/index.html
Mozilla Public License 2.0
46 stars 9 forks source link

[BUG] Sample payload with duplicates in Set (triggered by lengthconstraint minvalue?) #287

Closed Yauhenikapl closed 5 months ago

Yauhenikapl commented 5 months ago

Create a model with a Set and minvalue in lengthconstraint

The sample payload generator could stay within the minvalue and create (e.g. for a Set of 2 booleans) a valid Set (e.g. {true,false}), but often exceeds the minimum and violates the uniqueness of a Set E.g. { "property1": [ true, false, true, false, false, true ]} generated from:

@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> .
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> .
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> .
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <urn:samm:org.eclipse.examples:1.0.0#> .

:AspectDefault a samm:Aspect ;
   samm:properties ( :property1 ) ;
   samm:operations ( ) ;
   samm:events ( ) .

:property1 a samm:Property ;
   samm:characteristic :Property1Trait .

:Property1Trait a samm-c:Trait ;
   samm-c:baseCharacteristic :Set ;
   samm-c:constraint :TwoOrMore .

:Set a samm-c:Set ;
   samm-c:elementCharacteristic samm-c:Boolean .

:TwoOrMore a samm-c:LengthConstraint ;
   samm-c:minValue "2"^^xsd:nonNegativeInteger .
atextor commented 5 months ago

Duplicate of #288