Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML naming rules for named elements
UML naming rules for named elements [message #472978] Wed, 23 May 2007 17:35 Go to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Hi,
I am trying to find out what the allowable character set is for the
names of UML modeling elements, inother words for the (String typed)
values of the "name" attribute of instances of the UML metaclass
"NamedElement".

I did not find any restriction for names in the UML 2.1 Superstructure
spec. Which still means that I might have missed it ;-)

Does that mean that anything out of Unicode V4 is allowed ? How about
colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
within the name ?

Are there any escape mechanisms for characters not allowed?

Andy
Re: UML naming rules for named elements [message #472980 is a reply to message #472978] Wed, 23 May 2007 21:35 Go to previous messageGo to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hey Andy :)

If you look for the String datatype in the current MOF standard (in
which UML is defined) it says that "The format of the String is
defined by the XML Schema SimpleType corresponding to that dataType"

Looking in the current XMI specification.

"The String datatype is the data type for strings in the MOF model with
XML Schema data type of http://www.w3.org/2001/XMLSchema#string."

So looking at that site you go here.
http://www.w3.org/TR/xmlschema-2/#string

"The ·value space· of string is the set of finite-length sequences of
characters."

Ok now we need to find the definition for a character...

http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character

you can read it there but the BNF is

Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]

so in conclusion...

/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */


as you see I am bored, but hope that answers your question :)

Regards,
Andrew.


Andreas Maier wrote:
> Hi,
> I am trying to find out what the allowable character set is for the
> names of UML modeling elements, inother words for the (String typed)
> values of the "name" attribute of instances of the UML metaclass
> "NamedElement".
>
> I did not find any restriction for names in the UML 2.1 Superstructure
> spec. Which still means that I might have missed it ;-)
>
> Does that mean that anything out of Unicode V4 is allowed ? How about
> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
> within the name ?
>
> Are there any escape mechanisms for characters not allowed?
>
> Andy
UML naming rules for named elements [message #472983 is a reply to message #472980] Thu, 24 May 2007 07:20 Go to previous messageGo to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Hi Andrew!

I am specifically after the rules for UML Package names. I agree that
Unicode is the basis for all names in UML. However, I think there are
likely some restrictions on top of that. For example, package names are
used in package paths in XMI where the package names are separated by
two colons, and the entire path is in double quotes. That tells me that
there ought to be some rules as far as colons go, and double quotes.

Also, the UML tool I use strips away leading and trailing blanks from
any name, including package names, plus it does not let me insert
whitespace other than blanks. It does support blanks in the middle of a
name, though. Now that may be tools specific, but I assume that this is
not the only tool that does that. So whitespace in package names is
another area I need to get clarity about.

Bottom line, I think there are probably some additional restrictions on
top of the Unicode basis, which I try to understand. In case they are
not documented in the UML specs, I'd maintain that the UML tools de
facto introduce these restrictions and that it were better to have a
normative statement about what they are, as opposed to leaving that to
each tool's discretion.

My group has defined a mapping of CIM (Common Information Model,
www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
any element names. In the case of class names and their owned elements,
the allowable character set in CIM is a subset of the allowable
character set in UML, so we are fine. We are just introducing packages
in CIM by means of package path locations for classes and other indirect
means, so I think we can live with basically any naming rules for UML
packages, but we need to understand them in order to be able to validate
correctness of a UML model representing a CIM model.

Do you or does anyone else have insight into such additional
restrictions for package names ?

Andy


Andrew Carton wrote:
> Hey Andy :)
>
> If you look for the String datatype in the current MOF standard (in
> which UML is defined) it says that "The format of the String is
> defined by the XML Schema SimpleType corresponding to that dataType"
>
> Looking in the current XMI specification.
>
> "The String datatype is the data type for strings in the MOF model with
> XML Schema data type of http://www.w3.org/2001/XMLSchema#string."
>
> So looking at that site you go here.
> http://www.w3.org/TR/xmlschema-2/#string
>
> "The ·value space· of string is the set of finite-length sequences of
> characters."
>
> Ok now we need to find the definition for a character...
>
> http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character
>
> you can read it there but the BNF is
>
> Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
> | [#x10000-#x10FFFF]
>
> so in conclusion...
>
> /* any Unicode character, excluding the surrogate blocks, FFFE, and
> FFFF. */
>
>
> as you see I am bored, but hope that answers your question :)
>
> Regards,
> Andrew.
>
>
> Andreas Maier wrote:
>> Hi,
>> I am trying to find out what the allowable character set is for the
>> names of UML modeling elements, inother words for the (String typed)
>> values of the "name" attribute of instances of the UML metaclass
>> "NamedElement".
>>
>> I did not find any restriction for names in the UML 2.1 Superstructure
>> spec. Which still means that I might have missed it ;-)
>>
>> Does that mean that anything out of Unicode V4 is allowed ? How about
>> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
>> within the name ?
>>
>> Are there any escape mechanisms for characters not allowed?
>>
>> Andy
Re: UML naming rules for named elements [message #472985 is a reply to message #472983] Thu, 24 May 2007 10:24 Go to previous messageGo to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hey,

I see what you mean now. Might be worth having a look at the
"NamedElement" element in the UML2 source. Just a quick look and it
looks like the "SEPARATOR" is '::' which indicates a namespace in the
Qualified Name but other than that I don't see any other restrictions.

Regards,
Andrew.


Ar 24/05/2007 08:20, Scríobh Andreas Maier:
> Hi Andrew!
>
> I am specifically after the rules for UML Package names. I agree that
> Unicode is the basis for all names in UML. However, I think there are
> likely some restrictions on top of that. For example, package names are
> used in package paths in XMI where the package names are separated by
> two colons, and the entire path is in double quotes. That tells me that
> there ought to be some rules as far as colons go, and double quotes.
>
> Also, the UML tool I use strips away leading and trailing blanks from
> any name, including package names, plus it does not let me insert
> whitespace other than blanks. It does support blanks in the middle of a
> name, though. Now that may be tools specific, but I assume that this is
> not the only tool that does that. So whitespace in package names is
> another area I need to get clarity about.
>
> Bottom line, I think there are probably some additional restrictions on
> top of the Unicode basis, which I try to understand. In case they are
> not documented in the UML specs, I'd maintain that the UML tools de
> facto introduce these restrictions and that it were better to have a
> normative statement about what they are, as opposed to leaving that to
> each tool's discretion.
>
> My group has defined a mapping of CIM (Common Information Model,
> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
> any element names. In the case of class names and their owned elements,
> the allowable character set in CIM is a subset of the allowable
> character set in UML, so we are fine. We are just introducing packages
> in CIM by means of package path locations for classes and other indirect
> means, so I think we can live with basically any naming rules for UML
> packages, but we need to understand them in order to be able to validate
> correctness of a UML model representing a CIM model.
>
> Do you or does anyone else have insight into such additional
> restrictions for package names ?
>
> Andy
>
>
> Andrew Carton wrote:
>> Hey Andy :)
>>
>> If you look for the String datatype in the current MOF standard (in
>> which UML is defined) it says that "The format of the String is
>> defined by the XML Schema SimpleType corresponding to that dataType"
>>
>> Looking in the current XMI specification.
>>
>> "The String datatype is the data type for strings in the MOF model
>> with XML Schema data type of http://www.w3.org/2001/XMLSchema#string."
>>
>> So looking at that site you go here.
>> http://www.w3.org/TR/xmlschema-2/#string
>>
>> "The ·value space· of string is the set of finite-length sequences of
>> characters."
>>
>> Ok now we need to find the definition for a character...
>>
>> http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character
>>
>> you can read it there but the BNF is
>>
>> Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |
>> [#xE000-#xFFFD] | [#x10000-#x10FFFF]
>>
>> so in conclusion...
>>
>> /* any Unicode character, excluding the surrogate blocks, FFFE, and
>> FFFF. */
>>
>>
>> as you see I am bored, but hope that answers your question :)
>>
>> Regards,
>> Andrew.
>>
>>
>> Andreas Maier wrote:
>>> Hi,
>>> I am trying to find out what the allowable character set is for the
>>> names of UML modeling elements, inother words for the (String typed)
>>> values of the "name" attribute of instances of the UML metaclass
>>> "NamedElement".
>>>
>>> I did not find any restriction for names in the UML 2.1
>>> Superstructure spec. Which still means that I might have missed it ;-)
>>>
>>> Does that mean that anything out of Unicode V4 is allowed ? How about
>>> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
>>> within the name ?
>>>
>>> Are there any escape mechanisms for characters not allowed?
>>>
>>> Andy
Re: UML naming rules for named elements [message #472989 is a reply to message #472983] Thu, 24 May 2007 12:43 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andy,

The UML specification itself does not define any restrictions on what
characters may appear in a element's name. The only thing that comes close
to a restriction is that it does define a separator string (::) for
qualified names, so I suppose it's a good idea (though not formally a rule)
not to include the separator string in a name. Given that many (but not all)
tools use XML/XMI as a means of representing (persisting) UML models, it
follows that names (and any other character data for that matter) be
representable using legal XML/XMI syntax, but in most (if not all) cases,
problematic characters can be encoded/decoded in to/from an alternate legal
representation.

Kenn

"Andreas Maier" <maiera@de.ibm.com> wrote in message
news:f33ea9$gf7$1@build.eclipse.org...
> Hi Andrew!
>
> I am specifically after the rules for UML Package names. I agree that
> Unicode is the basis for all names in UML. However, I think there are
> likely some restrictions on top of that. For example, package names are
> used in package paths in XMI where the package names are separated by two
> colons, and the entire path is in double quotes. That tells me that there
> ought to be some rules as far as colons go, and double quotes.
>
> Also, the UML tool I use strips away leading and trailing blanks from any
> name, including package names, plus it does not let me insert whitespace
> other than blanks. It does support blanks in the middle of a name, though.
> Now that may be tools specific, but I assume that this is not the only
> tool that does that. So whitespace in package names is another area I need
> to get clarity about.
>
> Bottom line, I think there are probably some additional restrictions on
> top of the Unicode basis, which I try to understand. In case they are not
> documented in the UML specs, I'd maintain that the UML tools de facto
> introduce these restrictions and that it were better to have a normative
> statement about what they are, as opposed to leaving that to each tool's
> discretion.
>
> My group has defined a mapping of CIM (Common Information Model,
> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for any
> element names. In the case of class names and their owned elements, the
> allowable character set in CIM is a subset of the allowable character set
> in UML, so we are fine. We are just introducing packages in CIM by means
> of package path locations for classes and other indirect means, so I think
> we can live with basically any naming rules for UML packages, but we need
> to understand them in order to be able to validate correctness of a UML
> model representing a CIM model.
>
> Do you or does anyone else have insight into such additional restrictions
> for package names ?
>
> Andy
>
>
> Andrew Carton wrote:
>> Hey Andy :)
>>
>> If you look for the String datatype in the current MOF standard (in which
>> UML is defined) it says that "The format of the String is
>> defined by the XML Schema SimpleType corresponding to that dataType"
>>
>> Looking in the current XMI specification.
>>
>> "The String datatype is the data type for strings in the MOF model with
>> XML Schema data type of http://www.w3.org/2001/XMLSchema#string."
>>
>> So looking at that site you go here.
>> http://www.w3.org/TR/xmlschema-2/#string
>>
>> "The
Re: UML naming rules for named elements [message #472990 is a reply to message #472989] Thu, 24 May 2007 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kenn, Andy,

It is also worth noting that adjunct specifications such as OCL also impose
practical (though not formal) limitations on names in UML. For example,
OCL provides no standard means to reference names containing any of:

whitespace : . ; , ' / * - + [ ] { } ( ) < >

and probably more. So, it's probably not a good idea to use any of these
characters in names that might be used in OCL constraints.

Cheers,

Christian

Kenn Hussey wrote:

> Andy,
>
> The UML specification itself does not define any restrictions on what
> characters may appear in a element's name. The only thing that comes close
> to a restriction is that it does define a separator string (::) for
> qualified names, so I suppose it's a good idea (though not formally a
> rule) not to include the separator string in a name. Given that many (but
> not all) tools use XML/XMI as a means of representing (persisting) UML
> models, it follows that names (and any other character data for that
> matter) be representable using legal XML/XMI syntax, but in most (if not
> all) cases, problematic characters can be encoded/decoded in to/from an
> alternate legal representation.
>
> Kenn
>
> "Andreas Maier" <maiera@de.ibm.com> wrote in message
> news:f33ea9$gf7$1@build.eclipse.org...
>> Hi Andrew!
>>
>> I am specifically after the rules for UML Package names. I agree that
>> Unicode is the basis for all names in UML. However, I think there are
>> likely some restrictions on top of that. For example, package names are
>> used in package paths in XMI where the package names are separated by two
>> colons, and the entire path is in double quotes. That tells me that there
>> ought to be some rules as far as colons go, and double quotes.
>>
>> Also, the UML tool I use strips away leading and trailing blanks from any
>> name, including package names, plus it does not let me insert whitespace
>> other than blanks. It does support blanks in the middle of a name,
>> though. Now that may be tools specific, but I assume that this is not the
>> only tool that does that. So whitespace in package names is another area
>> I need to get clarity about.
>>
>> Bottom line, I think there are probably some additional restrictions on
>> top of the Unicode basis, which I try to understand. In case they are not
>> documented in the UML specs, I'd maintain that the UML tools de facto
>> introduce these restrictions and that it were better to have a normative
>> statement about what they are, as opposed to leaving that to each tool's
>> discretion.
>>
>> My group has defined a mapping of CIM (Common Information Model,
>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>> any element names. In the case of class names and their owned elements,
>> the allowable character set in CIM is a subset of the allowable character
>> set in UML, so we are fine. We are just introducing packages in CIM by
>> means of package path locations for classes and other indirect means, so
>> I think we can live with basically any naming rules for UML packages, but
>> we need to understand them in order to be able to validate correctness of
>> a UML model representing a CIM model.
>>
>> Do you or does anyone else have insight into such additional restrictions
>> for package names ?
>>
>> Andy

<snip>
Re: UML naming rules for named elements [message #473008 is a reply to message #472990] Sat, 26 May 2007 16:02 Go to previous messageGo to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Thanks to all who responded!

In CIM, names also cannot have any of the characters OCL excludes. It is
even somewhat more restricted in CIM. I guess we need to add a rule to
our UML to CIM mapping that restricts the valid UML packages names to
valid CIM names. That is certainly doable (and we have that for other
names already).

Remaining question: Does anyone think we should raise an UML2 issue to
introduce the OCL naming restrictions to UML names ?

Andy


Christian W. Damus wrote:
> Hi, Kenn, Andy,
>
> It is also worth noting that adjunct specifications such as OCL also impose
> practical (though not formal) limitations on names in UML. For example,
> OCL provides no standard means to reference names containing any of:
>
> whitespace : . ; , ' / * - + [ ] { } ( ) < >
>
> and probably more. So, it's probably not a good idea to use any of these
> characters in names that might be used in OCL constraints.
>
> Cheers,
>
> Christian
>
> Kenn Hussey wrote:
>
>> Andy,
>>
>> The UML specification itself does not define any restrictions on what
>> characters may appear in a element's name. The only thing that comes close
>> to a restriction is that it does define a separator string (::) for
>> qualified names, so I suppose it's a good idea (though not formally a
>> rule) not to include the separator string in a name. Given that many (but
>> not all) tools use XML/XMI as a means of representing (persisting) UML
>> models, it follows that names (and any other character data for that
>> matter) be representable using legal XML/XMI syntax, but in most (if not
>> all) cases, problematic characters can be encoded/decoded in to/from an
>> alternate legal representation.
>>
>> Kenn
>>
>> "Andreas Maier" <maiera@de.ibm.com> wrote in message
>> news:f33ea9$gf7$1@build.eclipse.org...
>>> Hi Andrew!
>>>
>>> I am specifically after the rules for UML Package names. I agree that
>>> Unicode is the basis for all names in UML. However, I think there are
>>> likely some restrictions on top of that. For example, package names are
>>> used in package paths in XMI where the package names are separated by two
>>> colons, and the entire path is in double quotes. That tells me that there
>>> ought to be some rules as far as colons go, and double quotes.
>>>
>>> Also, the UML tool I use strips away leading and trailing blanks from any
>>> name, including package names, plus it does not let me insert whitespace
>>> other than blanks. It does support blanks in the middle of a name,
>>> though. Now that may be tools specific, but I assume that this is not the
>>> only tool that does that. So whitespace in package names is another area
>>> I need to get clarity about.
>>>
>>> Bottom line, I think there are probably some additional restrictions on
>>> top of the Unicode basis, which I try to understand. In case they are not
>>> documented in the UML specs, I'd maintain that the UML tools de facto
>>> introduce these restrictions and that it were better to have a normative
>>> statement about what they are, as opposed to leaving that to each tool's
>>> discretion.
>>>
>>> My group has defined a mapping of CIM (Common Information Model,
>>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>>> any element names. In the case of class names and their owned elements,
>>> the allowable character set in CIM is a subset of the allowable character
>>> set in UML, so we are fine. We are just introducing packages in CIM by
>>> means of package path locations for classes and other indirect means, so
>>> I think we can live with basically any naming rules for UML packages, but
>>> we need to understand them in order to be able to validate correctness of
>>> a UML model representing a CIM model.
>>>
>>> Do you or does anyone else have insight into such additional restrictions
>>> for package names ?
>>>
>>> Andy
>
> <snip>
Re: UML naming rules for named elements [message #473016 is a reply to message #473008] Mon, 28 May 2007 13:27 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andy,

Yes, I think it does make sense to raise an OMG issue on this...

Kenn

"Andreas Maier" <maiera@de.ibm.com> wrote in message
news:f39lme$1gt$1@build.eclipse.org...
> Thanks to all who responded!
>
> In CIM, names also cannot have any of the characters OCL excludes. It is
> even somewhat more restricted in CIM. I guess we need to add a rule to our
> UML to CIM mapping that restricts the valid UML packages names to valid
> CIM names. That is certainly doable (and we have that for other names
> already).
>
> Remaining question: Does anyone think we should raise an UML2 issue to
> introduce the OCL naming restrictions to UML names ?
>
> Andy
>
>
> Christian W. Damus wrote:
>> Hi, Kenn, Andy,
>>
>> It is also worth noting that adjunct specifications such as OCL also
>> impose
>> practical (though not formal) limitations on names in UML. For example,
>> OCL provides no standard means to reference names containing any of:
>>
>> whitespace : . ; , ' / * - + [ ] { } ( ) < >
>>
>> and probably more. So, it's probably not a good idea to use any of these
>> characters in names that might be used in OCL constraints.
>>
>> Cheers,
>>
>> Christian
>>
>> Kenn Hussey wrote:
>>
>>> Andy,
>>>
>>> The UML specification itself does not define any restrictions on what
>>> characters may appear in a element's name. The only thing that comes
>>> close
>>> to a restriction is that it does define a separator string (::) for
>>> qualified names, so I suppose it's a good idea (though not formally a
>>> rule) not to include the separator string in a name. Given that many
>>> (but
>>> not all) tools use XML/XMI as a means of representing (persisting) UML
>>> models, it follows that names (and any other character data for that
>>> matter) be representable using legal XML/XMI syntax, but in most (if not
>>> all) cases, problematic characters can be encoded/decoded in to/from an
>>> alternate legal representation.
>>>
>>> Kenn
>>>
>>> "Andreas Maier" <maiera@de.ibm.com> wrote in message
>>> news:f33ea9$gf7$1@build.eclipse.org...
>>>> Hi Andrew!
>>>>
>>>> I am specifically after the rules for UML Package names. I agree that
>>>> Unicode is the basis for all names in UML. However, I think there are
>>>> likely some restrictions on top of that. For example, package names are
>>>> used in package paths in XMI where the package names are separated by
>>>> two
>>>> colons, and the entire path is in double quotes. That tells me that
>>>> there
>>>> ought to be some rules as far as colons go, and double quotes.
>>>>
>>>> Also, the UML tool I use strips away leading and trailing blanks from
>>>> any
>>>> name, including package names, plus it does not let me insert
>>>> whitespace
>>>> other than blanks. It does support blanks in the middle of a name,
>>>> though. Now that may be tools specific, but I assume that this is not
>>>> the
>>>> only tool that does that. So whitespace in package names is another
>>>> area
>>>> I need to get clarity about.
>>>>
>>>> Bottom line, I think there are probably some additional restrictions on
>>>> top of the Unicode basis, which I try to understand. In case they are
>>>> not
>>>> documented in the UML specs, I'd maintain that the UML tools de facto
>>>> introduce these restrictions and that it were better to have a
>>>> normative
>>>> statement about what they are, as opposed to leaving that to each
>>>> tool's
>>>> discretion.
>>>>
>>>> My group has defined a mapping of CIM (Common Information Model,
>>>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>>>> any element names. In the case of class names and their owned elements,
>>>> the allowable character set in CIM is a subset of the allowable
>>>> character
>>>> set in UML, so we are fine. We are just introducing packages in CIM by
>>>> means of package path locations for classes and other indirect means,
>>>> so
>>>> I think we can live with basically any naming rules for UML packages,
>>>> but
>>>> we need to understand them in order to be able to validate correctness
>>>> of
>>>> a UML model representing a CIM model.
>>>>
>>>> Do you or does anyone else have insight into such additional
>>>> restrictions
>>>> for package names ?
>>>>
>>>> Andy
>>
>> <snip>
Re: UML naming rules for named elements [message #617530 is a reply to message #472978] Wed, 23 May 2007 21:35 Go to previous message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hey Andy :)

If you look for the String datatype in the current MOF standard (in
which UML is defined) it says that "The format of the String is
defined by the XML Schema SimpleType corresponding to that dataType"

Looking in the current XMI specification.

"The String datatype is the data type for strings in the MOF model with
XML Schema data type of http://www.w3.org/2001/XMLSchema#string"

So looking at that site you go here.
http://www.w3.org/TR/xmlschema-2/#string

"The ·value space· of string is the set of finite-length sequences of
characters."

Ok now we need to find the definition for a character...

http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character

you can read it there but the BNF is

Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]

so in conclusion...

/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */


as you see I am bored, but hope that answers your question :)

Regards,
Andrew.


Andreas Maier wrote:
> Hi,
> I am trying to find out what the allowable character set is for the
> names of UML modeling elements, inother words for the (String typed)
> values of the "name" attribute of instances of the UML metaclass
> "NamedElement".
>
> I did not find any restriction for names in the UML 2.1 Superstructure
> spec. Which still means that I might have missed it ;-)
>
> Does that mean that anything out of Unicode V4 is allowed ? How about
> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
> within the name ?
>
> Are there any escape mechanisms for characters not allowed?
>
> Andy
UML naming rules for named elements [message #617540 is a reply to message #472980] Thu, 24 May 2007 07:20 Go to previous message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Hi Andrew!

I am specifically after the rules for UML Package names. I agree that
Unicode is the basis for all names in UML. However, I think there are
likely some restrictions on top of that. For example, package names are
used in package paths in XMI where the package names are separated by
two colons, and the entire path is in double quotes. That tells me that
there ought to be some rules as far as colons go, and double quotes.

Also, the UML tool I use strips away leading and trailing blanks from
any name, including package names, plus it does not let me insert
whitespace other than blanks. It does support blanks in the middle of a
name, though. Now that may be tools specific, but I assume that this is
not the only tool that does that. So whitespace in package names is
another area I need to get clarity about.

Bottom line, I think there are probably some additional restrictions on
top of the Unicode basis, which I try to understand. In case they are
not documented in the UML specs, I'd maintain that the UML tools de
facto introduce these restrictions and that it were better to have a
normative statement about what they are, as opposed to leaving that to
each tool's discretion.

My group has defined a mapping of CIM (Common Information Model,
www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
any element names. In the case of class names and their owned elements,
the allowable character set in CIM is a subset of the allowable
character set in UML, so we are fine. We are just introducing packages
in CIM by means of package path locations for classes and other indirect
means, so I think we can live with basically any naming rules for UML
packages, but we need to understand them in order to be able to validate
correctness of a UML model representing a CIM model.

Do you or does anyone else have insight into such additional
restrictions for package names ?

Andy


Andrew Carton wrote:
> Hey Andy :)
>
> If you look for the String datatype in the current MOF standard (in
> which UML is defined) it says that "The format of the String is
> defined by the XML Schema SimpleType corresponding to that dataType"
>
> Looking in the current XMI specification.
>
> "The String datatype is the data type for strings in the MOF model with
> XML Schema data type of http://www.w3.org/2001/XMLSchema#string"
>
> So looking at that site you go here.
> http://www.w3.org/TR/xmlschema-2/#string
>
> "The ·value space· of string is the set of finite-length sequences of
> characters."
>
> Ok now we need to find the definition for a character...
>
> http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character
>
> you can read it there but the BNF is
>
> Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
> | [#x10000-#x10FFFF]
>
> so in conclusion...
>
> /* any Unicode character, excluding the surrogate blocks, FFFE, and
> FFFF. */
>
>
> as you see I am bored, but hope that answers your question :)
>
> Regards,
> Andrew.
>
>
> Andreas Maier wrote:
>> Hi,
>> I am trying to find out what the allowable character set is for the
>> names of UML modeling elements, inother words for the (String typed)
>> values of the "name" attribute of instances of the UML metaclass
>> "NamedElement".
>>
>> I did not find any restriction for names in the UML 2.1 Superstructure
>> spec. Which still means that I might have missed it ;-)
>>
>> Does that mean that anything out of Unicode V4 is allowed ? How about
>> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
>> within the name ?
>>
>> Are there any escape mechanisms for characters not allowed?
>>
>> Andy
Re: UML naming rules for named elements [message #617545 is a reply to message #472983] Thu, 24 May 2007 10:24 Go to previous message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hey,

I see what you mean now. Might be worth having a look at the
"NamedElement" element in the UML2 source. Just a quick look and it
looks like the "SEPARATOR" is '::' which indicates a namespace in the
Qualified Name but other than that I don't see any other restrictions.

Regards,
Andrew.


Ar 24/05/2007 08:20, Scríobh Andreas Maier:
> Hi Andrew!
>
> I am specifically after the rules for UML Package names. I agree that
> Unicode is the basis for all names in UML. However, I think there are
> likely some restrictions on top of that. For example, package names are
> used in package paths in XMI where the package names are separated by
> two colons, and the entire path is in double quotes. That tells me that
> there ought to be some rules as far as colons go, and double quotes.
>
> Also, the UML tool I use strips away leading and trailing blanks from
> any name, including package names, plus it does not let me insert
> whitespace other than blanks. It does support blanks in the middle of a
> name, though. Now that may be tools specific, but I assume that this is
> not the only tool that does that. So whitespace in package names is
> another area I need to get clarity about.
>
> Bottom line, I think there are probably some additional restrictions on
> top of the Unicode basis, which I try to understand. In case they are
> not documented in the UML specs, I'd maintain that the UML tools de
> facto introduce these restrictions and that it were better to have a
> normative statement about what they are, as opposed to leaving that to
> each tool's discretion.
>
> My group has defined a mapping of CIM (Common Information Model,
> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
> any element names. In the case of class names and their owned elements,
> the allowable character set in CIM is a subset of the allowable
> character set in UML, so we are fine. We are just introducing packages
> in CIM by means of package path locations for classes and other indirect
> means, so I think we can live with basically any naming rules for UML
> packages, but we need to understand them in order to be able to validate
> correctness of a UML model representing a CIM model.
>
> Do you or does anyone else have insight into such additional
> restrictions for package names ?
>
> Andy
>
>
> Andrew Carton wrote:
>> Hey Andy :)
>>
>> If you look for the String datatype in the current MOF standard (in
>> which UML is defined) it says that "The format of the String is
>> defined by the XML Schema SimpleType corresponding to that dataType"
>>
>> Looking in the current XMI specification.
>>
>> "The String datatype is the data type for strings in the MOF model
>> with XML Schema data type of http://www.w3.org/2001/XMLSchema#string"
>>
>> So looking at that site you go here.
>> http://www.w3.org/TR/xmlschema-2/#string
>>
>> "The ·value space· of string is the set of finite-length sequences of
>> characters."
>>
>> Ok now we need to find the definition for a character...
>>
>> http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character
>>
>> you can read it there but the BNF is
>>
>> Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |
>> [#xE000-#xFFFD] | [#x10000-#x10FFFF]
>>
>> so in conclusion...
>>
>> /* any Unicode character, excluding the surrogate blocks, FFFE, and
>> FFFF. */
>>
>>
>> as you see I am bored, but hope that answers your question :)
>>
>> Regards,
>> Andrew.
>>
>>
>> Andreas Maier wrote:
>>> Hi,
>>> I am trying to find out what the allowable character set is for the
>>> names of UML modeling elements, inother words for the (String typed)
>>> values of the "name" attribute of instances of the UML metaclass
>>> "NamedElement".
>>>
>>> I did not find any restriction for names in the UML 2.1
>>> Superstructure spec. Which still means that I might have missed it ;-)
>>>
>>> Does that mean that anything out of Unicode V4 is allowed ? How about
>>> colons ? Double quotes ? Leading and trailing whitespace ? Whitespace
>>> within the name ?
>>>
>>> Are there any escape mechanisms for characters not allowed?
>>>
>>> Andy
Re: UML naming rules for named elements [message #617561 is a reply to message #472983] Thu, 24 May 2007 12:43 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andy,

The UML specification itself does not define any restrictions on what
characters may appear in a element's name. The only thing that comes close
to a restriction is that it does define a separator string (::) for
qualified names, so I suppose it's a good idea (though not formally a rule)
not to include the separator string in a name. Given that many (but not all)
tools use XML/XMI as a means of representing (persisting) UML models, it
follows that names (and any other character data for that matter) be
representable using legal XML/XMI syntax, but in most (if not all) cases,
problematic characters can be encoded/decoded in to/from an alternate legal
representation.

Kenn

"Andreas Maier" <maiera@de.ibm.com> wrote in message
news:f33ea9$gf7$1@build.eclipse.org...
> Hi Andrew!
>
> I am specifically after the rules for UML Package names. I agree that
> Unicode is the basis for all names in UML. However, I think there are
> likely some restrictions on top of that. For example, package names are
> used in package paths in XMI where the package names are separated by two
> colons, and the entire path is in double quotes. That tells me that there
> ought to be some rules as far as colons go, and double quotes.
>
> Also, the UML tool I use strips away leading and trailing blanks from any
> name, including package names, plus it does not let me insert whitespace
> other than blanks. It does support blanks in the middle of a name, though.
> Now that may be tools specific, but I assume that this is not the only
> tool that does that. So whitespace in package names is another area I need
> to get clarity about.
>
> Bottom line, I think there are probably some additional restrictions on
> top of the Unicode basis, which I try to understand. In case they are not
> documented in the UML specs, I'd maintain that the UML tools de facto
> introduce these restrictions and that it were better to have a normative
> statement about what they are, as opposed to leaving that to each tool's
> discretion.
>
> My group has defined a mapping of CIM (Common Information Model,
> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for any
> element names. In the case of class names and their owned elements, the
> allowable character set in CIM is a subset of the allowable character set
> in UML, so we are fine. We are just introducing packages in CIM by means
> of package path locations for classes and other indirect means, so I think
> we can live with basically any naming rules for UML packages, but we need
> to understand them in order to be able to validate correctness of a UML
> model representing a CIM model.
>
> Do you or does anyone else have insight into such additional restrictions
> for package names ?
>
> Andy
>
>
> Andrew Carton wrote:
>> Hey Andy :)
>>
>> If you look for the String datatype in the current MOF standard (in which
>> UML is defined) it says that "The format of the String is
>> defined by the XML Schema SimpleType corresponding to that dataType"
>>
>> Looking in the current XMI specification.
>>
>> "The String datatype is the data type for strings in the MOF model with
>> XML Schema data type of http://www.w3.org/2001/XMLSchema#string"
>>
>> So looking at that site you go here.
>> http://www.w3.org/TR/xmlschema-2/#string
>>
>> "The
Re: UML naming rules for named elements [message #617566 is a reply to message #472989] Thu, 24 May 2007 13:26 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kenn, Andy,

It is also worth noting that adjunct specifications such as OCL also impose
practical (though not formal) limitations on names in UML. For example,
OCL provides no standard means to reference names containing any of:

whitespace : . ; , ' / * - + [ ] { } ( ) < >

and probably more. So, it's probably not a good idea to use any of these
characters in names that might be used in OCL constraints.

Cheers,

Christian

Kenn Hussey wrote:

> Andy,
>
> The UML specification itself does not define any restrictions on what
> characters may appear in a element's name. The only thing that comes close
> to a restriction is that it does define a separator string (::) for
> qualified names, so I suppose it's a good idea (though not formally a
> rule) not to include the separator string in a name. Given that many (but
> not all) tools use XML/XMI as a means of representing (persisting) UML
> models, it follows that names (and any other character data for that
> matter) be representable using legal XML/XMI syntax, but in most (if not
> all) cases, problematic characters can be encoded/decoded in to/from an
> alternate legal representation.
>
> Kenn
>
> "Andreas Maier" <maiera@de.ibm.com> wrote in message
> news:f33ea9$gf7$1@build.eclipse.org...
>> Hi Andrew!
>>
>> I am specifically after the rules for UML Package names. I agree that
>> Unicode is the basis for all names in UML. However, I think there are
>> likely some restrictions on top of that. For example, package names are
>> used in package paths in XMI where the package names are separated by two
>> colons, and the entire path is in double quotes. That tells me that there
>> ought to be some rules as far as colons go, and double quotes.
>>
>> Also, the UML tool I use strips away leading and trailing blanks from any
>> name, including package names, plus it does not let me insert whitespace
>> other than blanks. It does support blanks in the middle of a name,
>> though. Now that may be tools specific, but I assume that this is not the
>> only tool that does that. So whitespace in package names is another area
>> I need to get clarity about.
>>
>> Bottom line, I think there are probably some additional restrictions on
>> top of the Unicode basis, which I try to understand. In case they are not
>> documented in the UML specs, I'd maintain that the UML tools de facto
>> introduce these restrictions and that it were better to have a normative
>> statement about what they are, as opposed to leaving that to each tool's
>> discretion.
>>
>> My group has defined a mapping of CIM (Common Information Model,
>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>> any element names. In the case of class names and their owned elements,
>> the allowable character set in CIM is a subset of the allowable character
>> set in UML, so we are fine. We are just introducing packages in CIM by
>> means of package path locations for classes and other indirect means, so
>> I think we can live with basically any naming rules for UML packages, but
>> we need to understand them in order to be able to validate correctness of
>> a UML model representing a CIM model.
>>
>> Do you or does anyone else have insight into such additional restrictions
>> for package names ?
>>
>> Andy

<snip>
Re: UML naming rules for named elements [message #618143 is a reply to message #472990] Sat, 26 May 2007 16:02 Go to previous message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Thanks to all who responded!

In CIM, names also cannot have any of the characters OCL excludes. It is
even somewhat more restricted in CIM. I guess we need to add a rule to
our UML to CIM mapping that restricts the valid UML packages names to
valid CIM names. That is certainly doable (and we have that for other
names already).

Remaining question: Does anyone think we should raise an UML2 issue to
introduce the OCL naming restrictions to UML names ?

Andy


Christian W. Damus wrote:
> Hi, Kenn, Andy,
>
> It is also worth noting that adjunct specifications such as OCL also impose
> practical (though not formal) limitations on names in UML. For example,
> OCL provides no standard means to reference names containing any of:
>
> whitespace : . ; , ' / * - + [ ] { } ( ) < >
>
> and probably more. So, it's probably not a good idea to use any of these
> characters in names that might be used in OCL constraints.
>
> Cheers,
>
> Christian
>
> Kenn Hussey wrote:
>
>> Andy,
>>
>> The UML specification itself does not define any restrictions on what
>> characters may appear in a element's name. The only thing that comes close
>> to a restriction is that it does define a separator string (::) for
>> qualified names, so I suppose it's a good idea (though not formally a
>> rule) not to include the separator string in a name. Given that many (but
>> not all) tools use XML/XMI as a means of representing (persisting) UML
>> models, it follows that names (and any other character data for that
>> matter) be representable using legal XML/XMI syntax, but in most (if not
>> all) cases, problematic characters can be encoded/decoded in to/from an
>> alternate legal representation.
>>
>> Kenn
>>
>> "Andreas Maier" <maiera@de.ibm.com> wrote in message
>> news:f33ea9$gf7$1@build.eclipse.org...
>>> Hi Andrew!
>>>
>>> I am specifically after the rules for UML Package names. I agree that
>>> Unicode is the basis for all names in UML. However, I think there are
>>> likely some restrictions on top of that. For example, package names are
>>> used in package paths in XMI where the package names are separated by two
>>> colons, and the entire path is in double quotes. That tells me that there
>>> ought to be some rules as far as colons go, and double quotes.
>>>
>>> Also, the UML tool I use strips away leading and trailing blanks from any
>>> name, including package names, plus it does not let me insert whitespace
>>> other than blanks. It does support blanks in the middle of a name,
>>> though. Now that may be tools specific, but I assume that this is not the
>>> only tool that does that. So whitespace in package names is another area
>>> I need to get clarity about.
>>>
>>> Bottom line, I think there are probably some additional restrictions on
>>> top of the Unicode basis, which I try to understand. In case they are not
>>> documented in the UML specs, I'd maintain that the UML tools de facto
>>> introduce these restrictions and that it were better to have a normative
>>> statement about what they are, as opposed to leaving that to each tool's
>>> discretion.
>>>
>>> My group has defined a mapping of CIM (Common Information Model,
>>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>>> any element names. In the case of class names and their owned elements,
>>> the allowable character set in CIM is a subset of the allowable character
>>> set in UML, so we are fine. We are just introducing packages in CIM by
>>> means of package path locations for classes and other indirect means, so
>>> I think we can live with basically any naming rules for UML packages, but
>>> we need to understand them in order to be able to validate correctness of
>>> a UML model representing a CIM model.
>>>
>>> Do you or does anyone else have insight into such additional restrictions
>>> for package names ?
>>>
>>> Andy
>
> <snip>
Re: UML naming rules for named elements [message #618160 is a reply to message #473008] Mon, 28 May 2007 13:27 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andy,

Yes, I think it does make sense to raise an OMG issue on this...

Kenn

"Andreas Maier" <maiera@de.ibm.com> wrote in message
news:f39lme$1gt$1@build.eclipse.org...
> Thanks to all who responded!
>
> In CIM, names also cannot have any of the characters OCL excludes. It is
> even somewhat more restricted in CIM. I guess we need to add a rule to our
> UML to CIM mapping that restricts the valid UML packages names to valid
> CIM names. That is certainly doable (and we have that for other names
> already).
>
> Remaining question: Does anyone think we should raise an UML2 issue to
> introduce the OCL naming restrictions to UML names ?
>
> Andy
>
>
> Christian W. Damus wrote:
>> Hi, Kenn, Andy,
>>
>> It is also worth noting that adjunct specifications such as OCL also
>> impose
>> practical (though not formal) limitations on names in UML. For example,
>> OCL provides no standard means to reference names containing any of:
>>
>> whitespace : . ; , ' / * - + [ ] { } ( ) < >
>>
>> and probably more. So, it's probably not a good idea to use any of these
>> characters in names that might be used in OCL constraints.
>>
>> Cheers,
>>
>> Christian
>>
>> Kenn Hussey wrote:
>>
>>> Andy,
>>>
>>> The UML specification itself does not define any restrictions on what
>>> characters may appear in a element's name. The only thing that comes
>>> close
>>> to a restriction is that it does define a separator string (::) for
>>> qualified names, so I suppose it's a good idea (though not formally a
>>> rule) not to include the separator string in a name. Given that many
>>> (but
>>> not all) tools use XML/XMI as a means of representing (persisting) UML
>>> models, it follows that names (and any other character data for that
>>> matter) be representable using legal XML/XMI syntax, but in most (if not
>>> all) cases, problematic characters can be encoded/decoded in to/from an
>>> alternate legal representation.
>>>
>>> Kenn
>>>
>>> "Andreas Maier" <maiera@de.ibm.com> wrote in message
>>> news:f33ea9$gf7$1@build.eclipse.org...
>>>> Hi Andrew!
>>>>
>>>> I am specifically after the rules for UML Package names. I agree that
>>>> Unicode is the basis for all names in UML. However, I think there are
>>>> likely some restrictions on top of that. For example, package names are
>>>> used in package paths in XMI where the package names are separated by
>>>> two
>>>> colons, and the entire path is in double quotes. That tells me that
>>>> there
>>>> ought to be some rules as far as colons go, and double quotes.
>>>>
>>>> Also, the UML tool I use strips away leading and trailing blanks from
>>>> any
>>>> name, including package names, plus it does not let me insert
>>>> whitespace
>>>> other than blanks. It does support blanks in the middle of a name,
>>>> though. Now that may be tools specific, but I assume that this is not
>>>> the
>>>> only tool that does that. So whitespace in package names is another
>>>> area
>>>> I need to get clarity about.
>>>>
>>>> Bottom line, I think there are probably some additional restrictions on
>>>> top of the Unicode basis, which I try to understand. In case they are
>>>> not
>>>> documented in the UML specs, I'd maintain that the UML tools de facto
>>>> introduce these restrictions and that it were better to have a
>>>> normative
>>>> statement about what they are, as opposed to leaving that to each
>>>> tool's
>>>> discretion.
>>>>
>>>> My group has defined a mapping of CIM (Common Information Model,
>>>> www.dmtf.org) to UML2, and in CIM we do have specific naming rules for
>>>> any element names. In the case of class names and their owned elements,
>>>> the allowable character set in CIM is a subset of the allowable
>>>> character
>>>> set in UML, so we are fine. We are just introducing packages in CIM by
>>>> means of package path locations for classes and other indirect means,
>>>> so
>>>> I think we can live with basically any naming rules for UML packages,
>>>> but
>>>> we need to understand them in order to be able to validate correctness
>>>> of
>>>> a UML model representing a CIM model.
>>>>
>>>> Do you or does anyone else have insight into such additional
>>>> restrictions
>>>> for package names ?
>>>>
>>>> Andy
>>
>> <snip>
Previous Topic:generate code from model
Next Topic:Element destruction
Goto Forum:
  


Current Time: Tue Apr 23 16:06:58 GMT 2024

Powered by FUDForum. Page generated in 0.04134 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top