W3C home > Mailing lists > Public > public-rif-wg@w3.org > September 2010

Re: XML-Data (mapping object-style XML to frames)

From: Dave Reynolds <dave.e.reynolds@gmail.com>
Date: Tue, 07 Sep 2010 22:11:40 +0100
To: Sandro Hawke <sandro@w3.org>
Cc: Christian De Sainte Marie <csma@fr.ibm.com>, public-rif-wg <public-rif-wg@w3.org>, Eric Prud'hommeaux <eric@w3.org>
Message-ID: <1283893900.2282.5.camel@dave-desktop>
On Tue, 2010-09-07 at 16:51 -0400, Sandro Hawke wrote: 
> Eric Prud'hommeaux and I just spent some time talking through the
> issues, and we settled on the following design, for your consideration.
> I kept this in the form he and I discussed; I hope the relationship to
> rule form is clear enough.   (Eric says Hi.)
> 
> The XML document (no default namespace):
>         
>         <Person tel="x531" 
>                 x:bday="Tuesday"
>                 xmlns:x="http://example.org/2">
>           <name>Eric</name>
>           <x:bday>1966-11-08</x:bday>
>         </Person>
>         
> maps to:
>         
>            _#<http://www.w3.org/ns/none#Person>[
>                <http://www.w3.org/ns/none#tel> -> "x531"
>                <http://example.org/2bday> -> "Tuesday"
>                <http://www.w3.org/ns/none#name> -> "Eric"
>                <http://example.org/2bday> -> "1966-11-08"
>            ]
>         
> and with a default namespace:
>         
>         <Person tel="x531" 
>                 x:bday="Tuesday"
>         	xmlns="http://example.org/1"
>                 xmlns:x="http://example.org/2">
>           <name>Eric</name>
>           <x:bday>1966-11-08</x:bday>
>         </Person>
>         
> it maps to:
>         
>            _#<http://example/1Person>[
>                <http://example/1tel> -> "x531"
>                <http://example.org/2bday> -> "Tuesday"
>                <http://example/1name> -> "Eric"
>                <http://example.org/2bday> -> "1966-11-08"
>            ]
>         
> Several notes:
> 
> 1. Attribute and elements are mapped to IRIs in the same
>    way, so you can't distinguish between them.  We suggest
>    there are very few practical cases where you need to
>    distinguish.  (And things are much nicer this way.)
>    (If you need to translate to some construct (eg in jrules) that
>    does distinguish, you can turn it into an OR of the two
>    forms.)

Is there any evidence this is not a practical issue?

I thought XML folk were quite concerned about attribute/element
distinction.  Certainly one use case for XML-data in RIF is to be able
do "lift" of XML to RDF using rules and the existing XML->RDF lift
systems I known take some care to avoid overloading element/attribute
namespaces.

Dave

> 
> 2. The IRI is constructed by simply concatenating the namespace and
>    the local part of the name, so you get the slightly odd looking
>    http://example.org/2bday and http://example/1tel.  Since people
>    wont usually see these, it should not be a problem.
> 
> 3. Attributes with no namespace are treated as if they had the
>    namespace of their element.  (Again, we lose some ability to
>    distinguish between certainl XML documents, but it should be fine.)
> 
> 4. Elements with no namespace are treated as if they had the namespace
>    "http://www.w3.org/ns/none#".
> 
> This seems to us to be pretty easy to use, about the same implementation
> difficulty, and only excluding a few XML documents that would otherwise
> be processable.   (You were already excluding the ones where order
> matter, right?  If not, we'd need to bring in lists.)
> 
>       -- Sandro
> 
> 
Received on Tuesday, 7 September 2010 21:12:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 7 September 2010 21:12:17 GMT