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:
- Each name formula must start with an equality sign ("=").
- A name formula can contain text with embedded variables. The text
characters must be valid name token characters.
Variables are enclosed by curly brackets. Variables consist of attribute
specifications, followed by one or several function specifications. Attributes
and functions are separated from each other by a slash ("/").
Attributes are derived from an information source that can either be an asset or
the model. The information source is determined automatically:
- Level2 display labels: the identifying asset.
- Asset display labels: the asset itself.
- Asset names: the identifying asset of the containing L2S if one
exists, the model otherwise.
- Arc roles: the target asset.
| 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" |
={@prefix/postfix("-")}{Product}
|
The namespace prefix of the source asset, followed by
"-" if not empty, followed always by noun "Product" |
Contact: info@aoModeling.org