Re: a new way of thinking about RDF and RDF Schema

[Peter F. Patel-Schneider]
To: <bwm@hplb.hpl.hp.com>
Cc: <www-rdf-interest@w3.org>; <simeon@research.bell-labs.com>
Sent: Sunday, October 21, 2001 9:41 PM
Subject: Re: a new way of thinking about RDF and RDF Schema


> From: Brian McBride <bwm@hplb.hpl.hp.com>
> Subject: Re: a new way of thinking about RDF and RDF Schema
> Date: Sun, 21 Oct 2001 23:24:38 +0100
>
> > Peter F. Patel-Schneider wrote:
> >
> > [...]
> >
> > >>>
> > >>Most RDF parsers are built on a standard XML parser.  This is true of
SiRPAC,
> > >>RDFFilter, ARP and Redland's parser.
> > >
> > > How can this be?  RDF is not XML.
> >
> > RDF/XML (to name the xml syntax for RDF, not the RDF datamodel) is a
subset of
> > XML.  It conforms to XML syntax.  Parsers deal with syntax.
>
> RDF/XML is not a subset of XML.  parseType=literal is in M&S.  It has been
> in from the beginning.   parseType=literal requires that its context not
be
> processed by an XML parser

Not so.  The M&S says

"The value 'Literal' specifies that the element content is to be treated as
an RDF/XML literal; that is, the content must not be interpreted by an RDF
processor."

It's the RDF processor that is not supposed to try to interpret the value,
not the XML processor.  The XML syntax for RDF must of necessity comply with
XML 1.0.  It's no problem for an XML processor to grab the value - for
example, you could to it with xslt, using xsl:copy-of.  Of course, you may
not get the exact same character string as you started with, but the XML
will be equivalent for XML purposes.

>  parseType=literal elicits the most  puzzlement from XML people that
> I try to explain RDF to, even ignoring the current debate over its
details.

> > > > How do they handle parseType?  An RDF
> > > system that handles parseType has to get its hands on the raw bits,
before
> > > an XML parser sees them.
> >
> > That statement is not correct.  RDF parsers such as RDFFilter, ARP and
SiRPAC
> > are built on top of an XML parser.
> >
> > Typically they operate in streaming mode, where the XML parser outputs a
stream
> > of SAX events which are interpreted by the RDF parser.
>
> Then how can they handle parseType=literal?  I really don't understand
how.
>

Depends on the processor.  It's true that you cannot guarantee that you will
get the exact same string of characters (as I said above), since the parser
will replace entities and possibly normalize spaces, etc.  When I read that
part of the M&S, I assumed that since the intent was to use the XML as the
value of the literal, then equivalent XML would be acceptable.  Does anyone
think that is not correct, that the exact sequence of characters must be
preserved?

> > parseType="Literal" is something the RDFCore WG is, err ..., working on,
right
> > now.  Its not really clear exactly how to handle this.  Most parsers
currently
> > turn it into a Literal, but there is no agreement on exactly what
Literal.
> > Other suggestions include generating an RDF representation of the
infoset
> > representation of the embedded xml.
>
> Yes, but how?  Once XML parsing is done you no longer have the original
> bits to be turned into a literal.
>
> > But whatever the outcome of that discussion, I'd expect RDF parsers to
continue
> > to be built on XML parsers.  Am I missing something?
>
> I just don't see how there is any way that parsetype=literal can be done
> after XML processing.
>

Literally true at the character string level, but not true at the equivalent
XML level, as covered above.  You can't expect to  have an arbitrary
(non-XML) string in there because it might not be legal XML, and you are
talking about an XML syntax.

Cheers,

Tom P

Received on Monday, 22 October 2001 00:58:15 UTC