OntoDL Statement: set: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
(Semantics of the set-operator)
Zeile 44: Zeile 44:
 
|
 
|
 
| <font face="arial" size="2">for Mode=concat: insert a demiter between the concatenated strings</font>
 
| <font face="arial" size="2">for Mode=concat: insert a demiter between the concatenated strings</font>
|- style="vertical-align:top"
 
|
 
| style="text-align:right" | &#124;
 
| &nbsp;'''[''' '''Valuetype''' '''=''' QualiferValueType ''']'''
 
|
 
| <font face="arial" size="2">for Mode=concat: string concatenation vs. numeric addition </font>
 
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
| ''QualifierValueMode''  
 
| ''QualifierValueMode''  
 
| :=  
 
| :=  
| &nbsp; '''default''' &#124; '''overwrite''' &#124; '''no-overwrite''' &#124; '''concat''' &#124; '''append'''  
+
| &nbsp; '''default''' &#124; '''overwrite''' &#124; '''no-overwrite''' &#124; '''concat''' &#124; '''append''' &#124; '''add'''  
 
|
 
|
 
|
 
|
Zeile 60: Zeile 54:
 
| :=  
 
| :=  
 
| &nbsp; '''default''' &#124; '''value''' &#124; '''reference'''
 
| &nbsp; '''default''' &#124; '''value''' &#124; '''reference'''
|
 
|
 
|- style="vertical-align:top"
 
| ''QualifierValueType''
 
| :=
 
| &nbsp; '''string''' &#124; '''numeric'''
 
 
|
 
|
 
|
 
|
Zeile 83: Zeile 71:
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
| concat
 
| concat
| 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. <br><font face=courier>set me.Designation[Language=de] =[Mode=concat] ($ (German)</font><br> append the text "(German)" to all German designations in the collection.<p>
+
| 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. <br><font face=courier>set me.Designation[Language=de] =[Mode=concat] ($ (German)</font><br> appends the text "(German)" to all German designations in the collection.<p>
If a and b are numeric and the ''Valuetype'' qualifier is set to ''numeric'', the result is the sum of a and b. If a is a collection of numeric strings, b will be added to each number element of the collection. 
 
 
| ab
 
| ab
 
| ''error''
 
| ''error''
 
| { b }
 
| { b }
 
| {a<sub>1</sub>b,&nbsp;..&nbsp;,&nbsp;a<sub>n</sub>b}
 
| {a<sub>1</sub>b,&nbsp;..&nbsp;,&nbsp;a<sub>n</sub>b}
 +
| ''error''
 +
|- style="vertical-align:top"
 +
| add
 +
| a and b must be strings representing a numeric value. The result is a string holding the arithmetic sum of a and b. If a is a collection of numeric strings, b will be added to each number element of the collection. 
 +
| a+b
 +
| ''error''
 +
| { b }
 +
| {a<sub>1</sub>+b,&nbsp;..&nbsp;,&nbsp;a<sub>n</sub>+b}
 
| ''error''
 
| ''error''
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"

Version vom 10. September 2016, 09:46 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
QualifierValueMode := overwrite | no-overwrite | concat | append | add
QualifierValueCopy := value | reference


Semantics of the set modes

Mode Sematics a=string
b=string
a=object
b=object
a=empty collection a=collection
b=string
a=collection
b=object
concat 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] =[Mode=concat] ($ (German)
appends the text "(German)" to all German designations in the collection.

ab error { b } {a1b, .. , anb} error
add a and b must be strings representing a numeric value. The result is a string holding the arithmetic sum of a and b. If a is a collection of numeric strings, b will be added to each number element of the collection. a+b error { b } {a1+b, .. , an+b} error
no-overwrite 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] =[Mode=overwrite] NULL
removes all German language designation from the list).
b b { b } { b } { b }
append If a is a collection, b will be appended to that collection. error error { b } { a1, .., an, b } { a1, .., an, b }
default The default behavior is Overwrite for single strings/objects and Append to List for collections b b { b } { a1, .., an, b } { a1, .., an, b }

If no Mode qualifier is given, the behavior of the set-statement is like [Mode=default].