Re: Version 0 of the 'RIF+XML data' document "nouvelle maniere"

Gary Hallmark wrote:
> 
>>
>> That is right, indeed. The only place where the fact that everything 
>> in XDM is a sequence would be used is if multiple element children 
>> with the same name were retrieved as a list (preserving the document 
>> order). But that would be contradictory with frame slots being 
>> multi-valued.
> It's not contradictory. You simply have a choice to import the multiple 
> child elements as a multi-valued slot or a single list-valued slot. This 
> is similar to rdf:parseType=collection and rif:ordered="yes". This 
> suggests some kind of extra metadata argument to the Import directive to 
> guide which representation to use.
> 
> One high-level comment is that because RIF Frames are almost exactly the 
> same as RDF triples, probably all the issues in Importing XML to RIF 
> have already been investigated in the guise of XML<->RDF translation. 
> Sandro knows a lot about this.
> 
> We have never discussed an alternative: Import XML documents as 
> Predicate/function terms. E.g.
> 
> <shiporder orderid="889923"
>            xmlns="http://example.org"
>            orderperson="John Smith">
>   <shipto>
>     <name>Ola Nordmann</name>
>     <address>Langgt 23</address>
>     <city>4000 Stavanger</city>
>     <country>Norway</country>
>   </shipto>
>   <item>
>     <title>Empire Burlesque</title>
>     <note>Special Edition</note>
>     <quantity>1</quantity>
>     <price>10.90</price>
>   </item>
>   <item>
>     <title>Hide your heart</title>
>     <quantity>1</quantity>
>     <price>9.90</price>
>   </item>
> </shiporder> 
> 
> Import (embed in RIF) as follows:
> 
> Prefix(ns, <http://example.org/>
> ns:shiporder(orderid(88923), orderperson("John Smith"),
>   ns:shipto(ns:name("Ola Nordmann"), ns:address("Langgt 23"), 
> ns:city("4000 Stavanger"), ns:country("Norway"))
>   ns:item(ns:title("Empire Burlesque"), ...)
>   ns:item(...)
> )
> 
> Yes, I know this comes with a different set of issues, not the least of 
> which is that it isn't Core. But for many applications I can imagine 
> that it is a more natural mapping than frames. E.g. it preserves 
> document order. Again, some extra argument to Import might guide the 
> mapping toward using this style.

As I see it one important motivation for using frames in the mapping is 
the same as that for RDF - you want to support semi-structured data. It 
is pretty common to have optional sub-elements. With predicates each 
arity is a different predicate and so any rules would have to be 
replicated to cover each of the combinations of optional elements, even 
the ones that don't care about those elements. This might have been 
solved by named-argument-predicates if we had chosen a different 
semantics for those but as it stands they have the same problem.

Dave
-- 
Hewlett-Packard Limited
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

Received on Tuesday, 28 July 2009 08:12:22 UTC