Here's the explanation of how enum works at the instance and schema levels that I promised below. It includes GXL and UML approximations, as there isn't an exact mapping between the two.
Susan
Susan Elliott Sim wrote:
OK, I've got an answer and it turns out that I've asked this question before- embarassingly.
At the instance level, GXL enums will only ever contain a single value, as in: <attr name= "mygreekletter"> <enum>alpha</enum> </attr>
The range of possible values for an enum is defined at the schema level. I've been avoiding describing usage of GXL at the schema level because it gets complicated. I think it's time that I gave that lecture, maybe next week.
At any rate, there are constructs as the schema level to specify the domain of attributes as in the quoted description below. Don't worry if it doesn't make a lot of sense. I will try to draw some UML and its corresponding GXL later today. Alternatively, you can some look at the poster in my office.
here we have one AttributeClass-node with name="mygreekletter" with some id="v1" one Enum-Node (id="v2") connected to v1 with v1 -hasDomain -> v2 lots of EnumVal Nodes (id="v3", "v4" ...) with value="alpha","beta" ... connected to v2 with v2 -containsValue-> v3,v4 ....
I realise that this doesn't actually answer your original question, but it does change the problem.
Cheers, Susan
Yuzo Kanomata wrote:
Hi Susan,
Oops, I saw Enumeration once a few weeks ago in XML Schema definitions, but I missed it when I was going back through. I think forwarding the question would be fine, but it should be edited a bit as this was aimed in scope as a group discussion point. I am stumped as to what GXL expects.
I have been inferring my questions from some things I recall seeing in PCDATA from other sources and thinking about how people interpret PCDATA. Err, maybe more of a thinking out loud exercise. So I am recalling old import data problems/headaches I've had. For example in a dtd where one sends a list of email addresses for export, there are may be defined in a dtd:
<!ELEMENT addresslist (#PCDATA)>
but different email clients do the following: 1. <addresslist>alice@uci.edu, bob@uci.edu, chuck@uci.edu</addresslist>
2. <addresslist>alice@uci.edu; bob@uci.edu; chuck@uci.edu</addresslist>
Each works fine IFF you are importing to and from clients of the same "type", but as to a seemingly easy export between different applications, well you'd have to do some hacking.
Having found 4 examples in the GXL Examples which had enum in them, and those being single values: <enum>from</enum>. I made the alpha-4-dist simple strings (the same punt that is in the xmlschema on the gupro site), but I felt a bit of discomfort looking at the def in the dtd which states values of enum.
It could be interpreted as each enum value exists as a separate enum element, but since you can have many attrs under a element you could have the enumeration list a, b, c listed as well:
<attr id="me"><enum>a
<attr id="next"><enum>b
<attr id="last"><enum>c
In which case you could easily and legally say
<attr id="a"><enum>a,b,c
these examples meaning I am "a" in a group of a, b, and c.
So I am wondering if any tools or set of tools follow a certain convention in using enum. Since GXL calls it enum with PCDATA then XML Schema "enumeration" and my NMTOKENS proposals can be seen as logical successors, but I just don't know ...
Sort of a rehash of the original post, but a question in my mind.
Yuzo
--On Thursday, August 19, 2004 4:41 PM -0700 Susan Elliott Sim <ses@ics.uci.edu> wrote:
Dear Yuzo,
I've looked over your proposal and I think you've made a reasonable choice from the available options that XML Schema provides. Moreover, it replicates the structure of the <enumeration> tag in XML Schema.
My question at this point is how does GXL expect <enum> data to be encoded? I've looked through my files and I can't find a definitive answer. (Rob: the example in the user manual is incorrect; my fault not yours.) There is some documentation on constraints in GXL, but it's in German and I don't have a copy of it.
We have a couple options. a) I can forward your question to GXL mailing list. b) You can join the GXL mailing list and post the question yourself. http://mailhost.uni-koblenz.de/mailman/listinfo/gxl
Susan
Attachment:
enum.pdf
Description: Adobe PDF document