OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML Object Model Challenge: RDF vs. XMI

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: "XML Developers' List" <xml-dev@ic.ac.uk>
  • Date: Fri, 28 May 1999 17:51:48 -0400 (EDT)

I think that it would be very useful for someone to us to post the
same simple object model in both the W3C's RDF Schema and the OMG's
XMI, to help XML developers compare the two.  I've included some
simple Java classes and my attempt at an RDF Schema in this message;
any takers for writing the equivalent XMI?

Here's a very dumb object model as a set of Java classes (I'm using
variables for class attributes instead of get/set methods with
interfaces just to keep things short):

  public class Entity
  {
    public String name;
    public String startDate;
    public String endData;
  }

  public class Being extends Entity
  {
    public Being sire;
    public Being dame;
  }

  public class Person extends Being
  {
    public String nationality[];
  }

In RDF, I cannot express the fact that more than one nationality is
allowed for Person, but otherwise, here's my best attempt at a
bare-bones RDF Schema for the same object model:

  <?xml version="1.0"?>

  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	   xmlns:rdfs="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#">

  <rdfs:Class ID="Entity"/>

  <rdfs:Class ID="Being">
  <rdfs:subClassOf rdf:resource="#Entity"/>
  </rdfs:Class>

  <rdfs:Class ID="Person">
  <rdfs:subClassOf rdf:resource="#Being"/>
  </rdfs:Class>

  <rdf:Property ID="name">
  <rdfs:range rdf:resource="#Entity"/>
  <rdfs:domain 
    rdf:resource="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#Literal"/>
  </rdf:Property>

  <rdf:Property ID="startDate">
  <rdfs:range rdf:resource="#Entity"/>
  <rdfs:domain 
    rdf:resource="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#Literal"/>
  </rdf:Property>

  <rdf:Property ID="endDate">
  <rdfs:range rdf:resource="#Entity"/>
  <rdfs:domain 
    rdf:resource="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#Literal"/>
  </rdf:Property>

  <rdf:Property ID="sire">
  <rdfs:range rdf:resource="#Being"/>
  <rdfs:domain rdf:resource="#Being"/>
  </rdf:Property>

  <rdf:Property ID="dame">
  <rdfs:range rdf:resource="#Being"/>
  <rdfs:domain rdf:resource="#Being"/>
  </rdf:Property>

  <rdf:Property ID="nationality">
  <rdfs:range rdf:resource="#Person"/>
  <rdfs:domain 
    rdf:resource="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#Literal"/>
  </rdf:Property>

  </rdf:RDF>

I'd love to see the same thing in XMI.  Any takers?


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS