OntoDL Statement: set: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Semantics of the set-operator) |
(→Syntax) |
||
| Zeile 5: | Zeile 5: | ||
| style="width:10em" | ''SetStatement'' | | style="width:10em" | ''SetStatement'' | ||
| style="width:3em" | := | | style="width:3em" | := | ||
| − | | style="width:36em" | '''set''' [[OntoDL Syntax: InternalReference|''InternalReference'']] '' | + | | style="width:36em" | '''set''' [[OntoDL Syntax: InternalReference|''InternalReference'']] '''=''' ''SetModeQualifier''* ''AssignedValue'' |
| style="width:1em" | | | style="width:1em" | | ||
| <font face="arial" size="2"> </font> | | <font face="arial" size="2"> </font> | ||
| Zeile 27: | Zeile 27: | ||
| <font face="arial" size="2"></font> | | <font face="arial" size="2"></font> | ||
|- style="vertical-align:top" | |- style="vertical-align:top" | ||
| − | | '' | + | | ''SetModeQualifer'' |
| := | | := | ||
| − | | ''' | + | | '''[''' '''Mode''' '''=''' QualiferValueMode ''']''' |
| | | | ||
| − | |<font face="arial" size="2">controls the behavior of the set-statement | + | |<font face="arial" size="2">controls the overall behavior of the set-statement (see below)</font> |
| − | |||
|- style="vertical-align:top" | |- style="vertical-align:top" | ||
| − | | '' | + | | |
| + | | style="text-align:right" | | | ||
| + | | '''[''' '''Copy''' '''=''' QualiferValueCopy ''']''' | ||
| + | | | ||
| + | | <font face="arial" size="2">copy-by-value vs. copy-by-reference</font> | ||
| + | |- style="vertical-align:top" | ||
| + | | | ||
| + | | style="text-align:right" | | | ||
| + | | '''[''' '''Delimiter''' '''=''' ''Name'' ''']''' | ||
| + | | | ||
| + | | <font face="arial" size="2">for Mode=concat: insert a demiter between the concatenated strings</font> | ||
| + | |- style="vertical-align:top" | ||
| + | | | ||
| + | | style="text-align:right" | | | ||
| + | | '''[''' '''Valuetype''' '''=''' QualiferValueType ''']''' | ||
| + | | | ||
| + | | <font face="arial" size="2">for Mode=concat: string concatenation vs. numeric addition </font> | ||
| + | |- style="vertical-align:top" | ||
| + | | ''QualifierValueMode'' | ||
| + | | := | ||
| + | | '''default''' | '''overwrite''' | '''no-overwrite''' | '''concat''' | '''append''' | ||
| + | | | ||
| + | | | ||
| + | |- style="vertical-align:top" | ||
| + | | ''QualifierValueCopy'' | ||
| := | | := | ||
| − | | '''=''' | + | | '''default''' | '''value''' | '''reference''' |
| + | | | ||
| + | | | ||
| + | |- style="vertical-align:top" | ||
| + | | ''QualifierValueType'' | ||
| + | | := | ||
| + | | '''string''' | '''numeric''' | ||
| + | | | ||
| | | | ||
| − | |||
|} | |} | ||
</font> | </font> | ||
Version vom 8. September 2016, 11:09 Uhr
Syntax
| SetStatement | := | set InternalReference = SetModeQualifier* AssignedValue | ||
| AssignedValue | := | InternalReference | ||
| | | = QualifiedConcept | |||
| | | = Text | |||
| SetModeQualifer | := | [ Mode = QualiferValueMode ] | controls the overall behavior of the set-statement (see below) | |
| | | [ Copy = QualiferValueCopy ] | copy-by-value vs. copy-by-reference | ||
| | | [ Delimiter = Name ] | for Mode=concat: insert a demiter between the concatenated strings | ||
| | | [ Valuetype = QualiferValueType ] | for Mode=concat: string concatenation vs. numeric addition | ||
| QualifierValueMode | := | overwrite | no-overwrite | concat | append | ||
| QualifierValueCopy | := | value | reference | ||
| QualifierValueType | := | numeric |
Semantics of the set-operator
| Operator | Sematics | a=string b=string |
a=object b=object |
a=empty collection | a=collection b=string |
a=collection b=object |
|---|---|---|---|---|---|---|
| $= | String Concatenation: If a and b are strings, the result is a concatenation of both string. If a is a collection of strings, b will be appended to each element of the collection. Collection elements may be filtered by qualifiers (e.g. set me.Designation[Language=de] $= ($ (German) append the text "(German)" to all German designations in the collection. |
ab | error | { b } | {a1b, .. , anb} | error |
| -= | No Replacement: the set operation is only performed if a is empty. If a already carries a value or is a non-empty collection, the value of a will not be altered. | a | a | { b } | { a } | { a } |
| := | Overwrite: The value of a is overwritten by b. In case a is a collection, b will be set as the only element of the collection. Collection elements may be filtered by qualifiers (e.g. set me.Designation[Language=de] := NULL removes all German language designation from the list). |
b | b | { b } | { b } | { b } |
| += | Append to List: If a is a collection, b will be added to that collection. If a is a single object, a will be replaced by b. | error | error | { b } | { a1, .., an, b } | { a1, .., an, b } |
| = | The default behavior is Overwrite for single strings/objects and Append to List for collections | b | b | { b } | { a1, .., an, b } | { a1, .., an, b } |