Re: rdf:RDF required

On Fri, 29 Aug 2003 00:20:05 -0400
Mark Baker <distobj@acm.org> wrote:

> 
> On Thu, Aug 28, 2003 at 04:27:34PM -0400, Ryan Lee wrote:
> > The spec has changed
> > to now claim that serialized RDF/XML "must be contained inside an rdf:RDF
> > XML element." [2]
> 
> Eek!  I can't believe I didn't notice this.

The correct reference is in 7.2.1 of RDF/XML Syntax Specification (Revised)

  If the RDF/XML is a standalone XML document (known by having been
  given the RDF MIME Type) then the grammar starts with Root Event doc.

  If the content is known to be RDF/XML by context, such as when
  RDF/XML is embedded inside other XML content, then the grammar can
  either start at Element Event RDF (only when an element is legal at
  that point in the XML) or at production nodeElementList (only when
  element content is legal, since this is a list of elements).

  -- http://www.w3.org/TR/rdf-syntax-grammar/#start

   [Aside: In the next version, Paragraph 1 has been reworded to: 

    If the RDF/XML is a standalone XML document (identified by
    presentation as an application/rdf+xml RDF MIME type object, or
    by some other means) then the grammar starts with Root Event doc.
   ]


What *context* means is really outside of a description of a document
format.  It could mean that the protocol that delivered the document
provided the RDF/XML mime type application/rdf+xml (being registered,
it is on its 3rd internet draft) or the file system maps ".rdf"
suffixed files to RDF/XML.

It could also mean that the application just knows.  Most RDF/XML
parsers let you give it a flag that allows you to tell it to assume
the content is RDF/XML - this is the flag that Ryan mentioned above.

It could be that you have another XML format that says "RDF/XML is
inside <metadata> here" so that for example you could have
  <foo>
    <metadata>
      ... RDF/XML content, no rdf:RDF needed
    </metadata>
    ...
  </foo>

For conformance of RDF/XML and on a public validator, I think this
assumption should be off by default.  It probably should be around
somewhere but maybe under advanced options on another page.

> Aesthetically, I think this is an awful idea.  I had been using the
> fact that some "vanilla XML" was already RDF, as a selling point for
> RDF in my latest project - and it helped.  It also allowed me to talk
> talk about the difference between the same bytes interpreted as XML,
> versus as RDF, for a real apples-to-apples to comparison; and that was
> a *huge* help, really.

If you know that your vanilla XML is already RDF/XML (not RDF, that
has no syntax, it is a conceptual model) then you can set the
"assume RDF/XML" flag on.  So your XML can remain RDF/XML.
 
> Is there an upside to requiring it?

You really should have a single document element for an XML format.

You can possibly recognise RDF/XML by heuristics inside some unknown XML
or some general XML mime type (application/xml, text/xml, text/plain :).
The use of the RDF namespace URI at the start of the document isn't
always enough.

Dave

Received on Friday, 29 August 2003 06:20:46 UTC