Asset Oriented Modeling (AOM)

- Name Formula -

Name formulas can occur in L2S and asset display labels, in asset names, and in arc roles.

A name formula adheres to the following syntax:

Variables are enclosed by curly brackets. A variable consist of an optional path specification, an attribute specification, followed by one or several function specifications. Path, attributes, and functions are separated from each other by a slash ("/"). Attributes are prefixed with the at-character ("@").

The origin of the path is computed as follows:

The path specifies the attribute host. If no path is specified, a default attribute host is computed as follows:

Type Description Default
Attribute
The information to be retrieved. Attributes are prefixed by a '@'.
@name
Assets: name
Model: name
@prefix
Assets: namespace prefix
Model: empty string
@href
Assets: Asset namespace href
Model: Default namespace href
@label
Assets: The asset's first display label or the asset name if none exists
Model: empty string
@labeln
Assets: The asset's n-th display label (n=1...9). If this does not exist, the last display label. If none exists, the asset name.
Model: empty string
Defaults to @name
Function

Functions can be concatenated by separating the individual functions with a slash ("/").

A function modifies the retrieved information:
l()
Convert to lower case
l1()
Convert first character to lower case
u()
Convert to upper case
u1()
Convert first character to upper case
substring(n)
Substring from position n to the end of the given string. Counting begins at 1. If n is negative, the position is determined from the end of the string.
substring(n,m)
Substring from position n in the length of at least m characters. If n is negative, the position is determined from the end of the string. If m is negative, 
camel(n)
This function identifies tokens within a string. It combines the n-th until the last token in one CamelCase string. Each token consists of letters or digits, beginning with a letter. In the original string, tokens are separated either by special characters, or by a change from lower case to upper case.
camel(n,m)
Same as above but at most m tokens beginning from the n-th token are combined.
substring-before("s")
The substring before string "s". If the original string does not contain "s" the function returns the empty string.
substring-after("s")
The substring after string "s". If the original string does not contain "s" the function returns the empty string.
prefix("s")
Prefixes the original string with "s" if the original string is not empty.
postfix("s")
Suffixes the original string with "s" if the original string is not empty.
-

After a name formula has been evaluated, all characters that do not belong to a proper nametoken are removed from the result.

Examples:

={}
The unmodified name of the source asset or model
={@label/l()}Role
The first label or the name of the source asset in lower case followed by the noun "Role"
={embodiedIn/@name}Type
The name of the target asset of the arc with the role name "embodiedIn", followed by the noun "Type"
={@prefix/postfix("-")}{Product}
The namespace prefix of the source asset, followed by "-" if not empty, followed always by noun "Product"
 

 

 
 

 

Home Definition Step-by-Step Examples Downloads

Contact: support 'at' aoModeling.org