VariamosPLE allows, from the abstract syntax and the concrete syntax of the language, to style relationships according to the selected value of a property.
Take for example the feature language where you want the relationship between two features to be represented differently according to the type of relationship (Mandatory, Optional, Includes, etc.) as shown in the following figure.
To do this, in the abstract language, the property (in this case Type) with the possible values (Mandatory,Optional,Includes,Excludes,IndividualCardinality) must be defined in the relationship between the characteristics.
"relationships": {
...
"RootFeature_Feature": {
"max": 9999999,
"min": 1,
"source": "RootFeature",
"target": [
"AbstractFeature",
"ConcreteFeature"
],
"properties": [
...
{
"name": "Type",
"type": "String",
"possibleValues": "Mandatory,Optional,Includes,Excludes,IndividualCardinality"
}
...
]
}
}
Next, in the concrete language, the style of the relationship must be defined using the linked property (Type) of the concrete language just defined.
A style must be created for each possible value (Mandatory,Optional,Includes,Excludes,IndividualCardinality) of the (Type) property. For example, when the value of the Type property is Mandatory, a line ending in a filled oval will be drawn.
If you want the label of the relationship to be the selected value of the property, you must set the input “label_property”: “Type” where Type is the property you want to bind.
"relationships": {
...
"RootFeature_Feature": {
"styles": [
{
"style": "strokeColor=#446E79;strokeWidth=2;endArrow=oval;endFill=1;endSize=12;",
"linked_value": "Mandatory",
"linked_property": "Type"
},
{
"style": "strokeColor=#446E79;strokeWidth=2;endArrow=oval;endFill=0;endSize=12;",
"linked_value": "Optional",
"linked_property": "Type"
},
{
"style": "strokeColor=#446E79;strokeWidth=2;endArrow=open;",
"linked_value": "Includes",
"linked_property": "Type"
},
{
"style": "strokeColor=#446E79;strokeWidth=2;startArrow=open;endArrow=open;",
"linked_value": "Excludes",
"linked_property": "Type"
},
{
"style": "strokeColor=#446E79;strokeWidth=2;endArrow=none;",
"linked_value": "IndividualCardinality",
"linked_property": "Type"
},
{
"style": "strokeColor=#446E79;strokeWidth=2;"
}
],
"label_property": "Type"
}
...
}