RDF considered optional

David Megginson david at megginson.com
Wed Mar 17 22:56:49 GMT 1999


Jeffrey E. Sussna writes:

 > The RDF syntax spec states that "The RDF element is optional if the
 > content can be known to be RDF from the application context."
 > 
 > Can anyone clarify exactly what is meant by "application context"? 

That means that if you know in advance what you're reading, you don't
need to have an rdf:RDF element.  For example, if I define an
RDF-based format for exchanging Flight-Simulator scenery information
(FSML), and I never intend to embed this in a web page, etc., I can
just use something like this:

  <?xml version="1.0"?>

  <!-- Yes, Virginia, this is RDF-conformant! -->

  <fsml:Building xmlns:fsml="http://flightsim.com/ns/fsml#">
   <fsml:name>Lennox Generating Station</fsml:name>
   <fsml:latitude>N44*8'33"</fsml:latitude>
   <fsml:longitude>W76*51'9"</fsml:longitude>
   <fsml:length>300m</fsml:length>
   <fsml:width>150m</fsml:width>
  </fsml:Building>

What's really entertaining is that I can do this, and be
RDF-conformant, without even declaring the RDF namespace.

The most recent version of SiRPAC that I saw still chokes on this
example, but I consider that a bug in SiRPAC (or at least, a
deliberate implementation choice).

For the curious, here's the basic serialisation syntax for the same
thing:

  <?xml version="1.0"?>

  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
           xmlns:fsml="http://flightsim.com/ns/fsml#">

  <rdf:Description>
   <rdf:type resource="http://flightsim.com/ns/fsml#Building"/>
   <fsml:name>Lennox Generating Station</fsml:name>
   <fsml:latitude>N44*8'33"</fsml:latitude>
   <fsml:longitude>W76*51'9"</fsml:longitude>
   <fsml:length>300m</fsml:length>
   <fsml:width>150m</fsml:width>
  </rdf:Description>

  </rdf:RDF>

Actually, this is *not* exactly identical because the RDF spec has a
bizarre requirement that when you use rdf:Description explicitly the
processor has to build about a zillion extra tuples for reification
purposes, whether you want them or not.  Go figure.


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list