W3C home > Mailing lists > Public > www-rdf-interest@w3.org > September 2000

Re: Enumerations

From: Ross Judson <ross@ManagedObjects.com>
Date: Tue, 26 Sep 2000 13:50:25 -0400
Message-ID: <001701c027e2$3fec5940$221a37ce@mosol.com>
To: <www-rdf-interest@w3.org>
I have been dealing with the enumeration problem as well.  I have the
additional complexity of having a great deal of CORBA-based code that I am
moving to an RDF basis.  What I've done is something like this:

[s is rdfs, rdf is rdf, f is our product]


<s:Class rdf:about="&f;Enumeration">
    <s:subClassOf rdf:resource="&f;Object"/>
    <rdf:label>Enumeration</rdf:label>
</s:Class>

and then:

<s:Class rdf:about="&f;RelationKind">
    <s:subClassOf rdf:resource="&f;Enumeration"/>
    <rdf:label>RelationKind</rdf:label>
</s:Class>

...which defines the enumeration class...i then create instances of the
enumeration like this:

<f:RelationKind rdf:about="&f;RelationKind_relChildren" rdf:label="NAM"
f:ordinal="0" />
<f:RelationKind rdf:about="&f;RelationKind_relToplogy" rdf:label="TOP"
f:ordinal="1" />

...and so forth.  I have a precompiler that reads an RDF schema definition
and emits CORBA-like Java stubs for all enumerations, plus a bunch of other
stuff.  It is very useful to have URIs that represent enumerated values,
rather than use literals.  I expect that something like it will be
standardized at some point in the future, but I couldn't wait (products
don't wait :).

RJ
Received on Tuesday, 26 September 2000 13:51:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:44 GMT