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

[Task] Model with contradicting Constraint on Set/OrderedSet should not be allowed #267

Closed chris-volk closed 7 months ago

chris-volk commented 8 months ago

Describe the bug Create a Model with a Set based on a finite Base Characteristic (Boolean or Enumeration) and add a lenghtConstraint declaring a minValue for the number of elements which is larger than the number of elements in the base characteristic (e.g. 3 for Boolean). Expectation: Should be recognized as invalid since no payload can exist without creating (forbidden) duplicates.

Where Any aspect model, e .g.


@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 "3"^^xsd:nonNegativeInteger .

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

chris-volk commented 8 months ago

See also https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/issues/288