Skip to content

GIPSL Allow set operations on many references attributes#355

Open
MarkBeB wants to merge 37 commits intomasterfrom
feature/gipsl-access-many-references
Open

GIPSL Allow set operations on many references attributes#355
MarkBeB wants to merge 37 commits intomasterfrom
feature/gipsl-access-many-references

Conversation

@MarkBeB
Copy link
Collaborator

@MarkBeB MarkBeB commented Mar 13, 2026

This PR will also resolve #331

It will now be possible to work with attributes that have a multiplicity of 0..* (many).
These attributes will be treated as collections, in the same way as mapping.mappingId or types.typeId, and will support the arrow operator ->, and thus operations like filter, sum, etc. pp.

Tests can be found here: Echtzeitsysteme/gips-tests#137

// e.g., accumulate some values over all child nodes
constraint with ContextType {
   context.variables.accumulator == mappings.patternWithContextAndChild
         -> join( parent ) 
         -> sum( element.nodes.oneChildNode.variables.valueSpecificToChild )
}

// Can be written as 
constraint with ContextType {  
  context.variables.accumulator == context.allChildNodes-> sum( element.variables.valueSpecificToChild )
}
constraint with ContextType {
  // e.g., ensure that exactly one node out of a group of nodes 'somewhere else' is assigned to the context node
  context.referenceToAnotherNode.someMoreNodes -> sum ( element.variables.assignedTo == context.id ) == 1
}

@MarkBeB MarkBeB requested a review from maxkratz March 13, 2026 15:45
@MarkBeB MarkBeB marked this pull request as ready for review March 13, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: GIPSL: type extension: access to variables via a type reference with multiplicity 0..*

1 participant