W3C home > Mailing lists > Public > public-cwm-talk@w3.org > January to March 2006

Re: New XML and XPath built-ins for CWM

From: Tim Berners-Lee <timbl@w3.org>
Date: Fri, 10 Mar 2006 20:55:31 -0500
Message-Id: <5CBE1DC0-A1C2-4B49-9119-2AA0D86C1B56@w3.org>
Cc: "'cwm'" <public-cwm-talk@w3.org>, "'Dan Connolly'" <connolly@w3.org>
To: Waleed K.Abdulla <waleed_abdulla@xrules.org>

Waleed,

Ah. Sorry I didn't before understand what you mean.  I think you need  
two things.

1. To have XML DOMs in the system. The way I would implement this  
would be as a new datatype: an XML DOM.

As it happens its not really new, when you think that RDF has an XML  
literal datatype which we just have not implemented in cwm.

The internal representation would be just the DOM tree as a value on  
a cwm literal object.

Now, where to put it? As a subclass of literal.

(Unless it can contain variables within the DOM tree, in which case  
subclass compound type.  The latter gets much more complicated as one  
would have to do unification between XML structures just as with  
unification between lists or formulae. This would be much more  
complicated!)

2. To have a named resource stand for a given object.  The moment you  
put cwm into identity-aware mode then you can say

:xml  = """<order>.........</order>"""^^xsd:xmlLiteral  or whatever  
the dt URI is

and the resource :xml will be smushed with the literal. This means a  
redirect will be set up so that all arcs about :xml is attached to  
the literal.

Tim






On Mar 10, 2006, at 15:07, Waleed K. Abdulla wrote:

> Tim,
>     My question was about computed 'resources' (as opposed to computed
> properties). My early implementation of XPath built-ins is at:
>
> http://www.xrules.org/cwm/default.aspx
>
>
>     This implementation is limited because I couldn't find support for
> computed resources in CWM. To explain the need for computed resources,
> see this example:
>
> ("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item")
> xpath:selectSingleNode :node .
>
>
>     The problem with this is that each time I use the property I  
> have to
> pass the whole XML document as a string and have it parsed. This is,
> obviously, not practical for big XML documents. It would be great if I
> can load and parse the XML document once, and then from that point
> forward, treat it as a resource (object) inside CWM. My code will,  
> then,
> look like this:
>
>
> "<Order>...</Order>"	x:parseAsXmlDocument		:xml .
>
> (:xml "/Order/Item")	xpath:selectSingleNode 		:node .
>
>
> where, :xml is of type x:XmlDocument and :node is of type x:XmlNode.
>
>
>     So, :xml is treated as a resource in CWM, yet a reference to an
> external implementation (a DOM in this case) is available that can be
> used by properties such as xpath:selectSingleNode to execute XPath
> expressions.
>
>     There might be support for this in CWM already, but I couldn't  
> find
> it!!
>
> Regards,
> Waleed
>
>
>
> -----Original Message-----
> From: public-cwm-talk-request@w3.org
> [mailto:public-cwm-talk-request@w3.org] On Behalf Of Tim Berners-Lee
> Sent: Thursday, March 09, 2006 11:40 AM
> To: Waleed Abdulla
> Cc: cwm; Dan Connolly
> Subject: Re: New XML and XPath built-ins for CWM
>
>
> Waleed,
>
> Juts came across your question a year ago asking about cwm built-ins.
>
> Yes, cwm does support computed properties.
>
> Did you get anywhere with making XPath builtins and XML dom data  
> types?
>
> Tim BL
Received on Saturday, 11 March 2006 02:05:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:02 GMT