W3C home > Mailing lists > Public > www-rdf-interest@w3.org > May 2000

Re: XML/RDF syntax equivalences

From: Perry A. Caro <caro@Adobe.COM>
Date: Fri, 26 May 2000 11:22:42 -0700
Message-ID: <392EC0F2.9C95F51D@corp.adobe.com>
To: www-rdf-interest@w3.org
Andrea Chiodi wrote:

> Let's take my XML form:
> (1)
> <author>
>     <name> Peppo </name>
>     <address>
>         <city> PeppoCity </city>
>         <state> PeppoLand </state>
>     </address>
> </author>
> I want to interpret it as RDF.

What you want is a profile (subset) of RDF that looks reasonably "XML like"
and that is regular enough to be controlled by an XML Schema.

I believe your chain of reasoning breaks down at step (4), at least as far
as the RDFMS goes.  I don't believe that (4) is well-formed RDF.  Rather
than try to recast your reasoning, I'll just jump to a solution that I think
fits your requirements.

Use the other abbreviated format, the one that uses
"rdf:parseType='Resource'" to achieve arbitrary nesting of properties.  Your
form can look like this:

<author>                 <!-- typed node, matches productions 6.3, 6.13 -->
 <name>Peppo</name>      <!-- "simple" property, 6.12 -->
 <address rdf:parseType='Resource'> <!-- abbreviation, 6.12 -->
  <city>PeppoCity</city> <!-- "simple" property, 6.12 -->
  <state>PeppoLand</state> <!-- "simple" property, 6.12 -->

With namespace qualification, the above would be both well-formed RDF and
something that looks more or less like regular XML.  Notice that the only
syntactic difference from your original form is that I added
rdf:parseType='Resource' to address!

The basic recipe is that at the top-level you emit a typed node.  You are
asserting that this is an anonymous Description resource of the specified
type (author), which may be further qualified by properties (it's
children).  The children of this typed node are either simple properties
that match the first alternative of 6.12, or abbreviated properties whose
values are implicit anonymous Description resources, matching the third
alternative of 6.12.  Each child of the abbreviated property can in turn be
a simple property, or an abbreviated property, and so on.  Remember that
with each abbreviated property what you are actually asserting in RDF is
that the value is an anonymous Description, which may be further qualified
with properties (it's children).  In the example above, the value of
"address" is a resource which has "city" and "state" properties.

Received on Friday, 26 May 2000 14:22:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:07:30 UTC