Use the wildcard underscore (_
) to match any node, regardless of its type. This is useful for defining property projections.
The following example will match any node because this result-view
has a match pattern with a wildcard (_
) that will tie it to any property of a business.
match {
_ (this) {
from-property: Business (business) {
min (Required)
max (One)
}
}
}
Here is another example:
match {
_(resultProperty) { // The underscore character ('_') is a wildcard to match any Concept type. For example: Gravity or Planet
from-property{
SpaceResort (spaceResort) {
min (Required)
max (One)
}
}
}
}
If a variable's value is unused within a match block, you do not have to specify it at all, even with the wildcard. This is a valid match pattern block:
match {
geo.NamedPoint {
...
}
}
Using geo.NamedPoint (_)
is unnecessary if the value of geo.NamedPoint
is not used.
from-input optional | Signifies that the child is an input to the parent |
from-output optional | Signifies that the parent is an output of the child |
from-property optional | Signifies that the parent is a property of the specified child concept |
from-role optional | Signifies that the parent is instantiating a role of the child |
max optional | Cardinality constraint determining how many instances of a given node are allowable |
min optional | Cardinality constraint determining if a single instance is required |
to-input optional | Signifies that the parent is an input to the child |
to-output optional | Signifies that the child is an output of the parent |
to-property optional | Signifies that the child is a property of the parent |
to-role optional | Signifies that the child is instantiating a role of the parent |