[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [RDDL] Java Object Model

  • From: Ken MacLeod <ken@b...>
  • To: xml-dev@l...
  • Date: Sun, 28 Jan 2001 13:35:35 -0600

java object model
Jonathan Borden <jborden@m...> writes:

> I've updated the RDDL java implementation and begun a short
> description of the Java object model at
> http://www.rddl.org/RDDL-JOM.html
> 
> Notably a namespace is defined as a container of resources. Each
> resource is indexed by an identifier which is an XPointer which
> locates the rddl:resource within the RDDL document. A container is a
> general mapping of URIs to Resources and is derived from a Namespace
> (a Namespace may also be seen as a restriction of a Container --
> whose URI part is the namespace)
> 
> The code is also available at: http://www.rddl.org/rddl.jar
> Javadoc is available at http://www.rddl.org/docs/

Here is a quick translation to the sort-of grovish perspective that
I've been implementing in Orchard[1], a Grovish Model, if you will :-).

  Namespace
  ---------
  resources      -- a vector/list of Resources
  uri
  document       -- a DOM Document with the original RDDL content

  Resource
  --------
  xlink:arcrole  -- the purpose of the resource
  xlink:role     -- the nature of the resource
  xml:base
  xlink:href
  id
  fragment-id    -- either the id of the resource or a child seq
  uri
  xml:lang
  xlink:title

In RDDL-JOM, Namespace has several query methods.  In Orchard, I
expect to be able to use XPath-like queries over nodes and their
properties, so the equivalent queries would look like below.  In turn,
these queries can be re-attached as helper methods that are aliases
for the queries.  The context is an instance of Namespace.

  getResourcesFromNature     /resources[@xlink:role="nature"]
  getResourcesFromPurpose    /resources[@xlink:arcrole="purpose"]
  getResourcesFromHref       /resources[@xlink:href="href"]
  getResourcesFromTitle      /resources[@xlink:title="title"]
  getResourcesFromLang       /resources[@xml:lang="lang"]
  getResourcesFromId         /resources[id("id or id-list")]

(These XPath-like queries are just conceptual, the mapping of queries
into nodes is not complete yet, and there are some semantic
differences between trees of elements and attributes, and trees of
arbitrary nodes.)

An example usage of Orchard RDDL would look like this, in Python:

  from Orchard import RDDL

  namespace = RDDL.get('http://www.rddl.org/')

  xlink = "http://www.w3.org/1999/xlink"

  for resource in namespace.resources:
    print "URI:     " + resource.uri
    print "Title:   " + resource[(xlink, 'title')]
    print "Nature:  " + resource[(xlink, 'role')]
    print "Purpose: " + resource[(xlink, 'arcrole')]
    print

These short snippets[2] of Orchard use don't tell a whole story.  Much
of Orchard's capabilities are in working with many different types of
property sets in a consistent fashion and with shared tools, rather
than in how any one particular property set is implemented.  This
"bigger picture" won't really be visible until somewhere between
version 1.0 (in a few weeks) and hopefully 2.0 (a few months).

  -- Ken

[1] <http://casbah.org/~kmacleod/orchard/>
[2] <http://casbah.org/pipermail/devel/Week-of-Mon-20000911/000750.html>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.