Parser seems to require actually-optional rdf:RDF root elements

View: New views
5 Messages — Rating Filter:   Alert me  

Parser seems to require actually-optional rdf:RDF root elements

by Barclay, Daniel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Parser seems to require actually-optional rdf:RDF root elements

(Reposting with problem-specific subject.)

report=The <rdf:RDF> is not always required, but the parser doesn't recognize any triples when the given XML document doesn't
have a root <rdf:RDF> element.

The RDF/XML specification currently at http://www.w3.org/TR/rdf-syntax-grammar/ says:

When there is only one top-level node element inside rdf:RDF, the rdf:RDF can be omitted ...



RDF=<?xml version="1.0">
<rdf:Description
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:dct="http://purl.org/dc/terms/"

     rdf:about="http://example.com/music#piece23">
   <dct:title>Machine</dct:title>
</rdf:Description>



--
(Plain text sometimes corrupted to HTML "courtesy" of Microsoft Exchange.) [F]




accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

by Barclay, Daniel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

I wrote:
> report=The <rdf:RDF> is not always required, but the parser doesn't
> recognize any triples when the given XML document doesn't
> have a root <rdf:RDF> element.
>
> The RDF/XML specification currently at
> http://www.w3.org/TR/rdf-syntax-grammar/ says:
>
> When there is only one top-level node element inside rdf:RDF, the
> rdf:RDF can be omitted ...
>
>
>
> RDF=<?xml version="1.0">
> <rdf:Description
>     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>     xmlns:dct="http://purl.org/dc/terms/"
>
>     rdf:about="http://example.com/music#piece23">
>   <dct:title>Machine</dct:title>
> </rdf:Description>

Someone pointed out the "RDF is NOT enclosed in <RDF>...</RDF> tags"
option on the Extended Interface page.

Getting the parser to accept all legal RDF/XML syntax should not
require the user to know ahead of time to go to the extended interface
page.

The first page should give that information (ideally explicitly, but
at least with a strong hint that the "more options" are not just
fancy output/display options, but involve a basic RDF/XML
conformance option).


Daniel
--
(Plain text sometimes corrupted to HTML "courtesy" of Microsoft Exchange.) [F]



Re: accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

by Danny Ayers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/8/10 Barclay, Daniel <daniel@...>:

> I wrote:
>> report=The <rdf:RDF> is not always required, but the parser doesn't
>> recognize any triples when the given XML document doesn't
>> have a root <rdf:RDF> element.
>>
>> The RDF/XML specification currently at
>> http://www.w3.org/TR/rdf-syntax-grammar/ says:
>>
>> When there is only one top-level node element inside rdf:RDF, the
>> rdf:RDF can be omitted ...
>>
>>
>>
>> RDF=<?xml version="1.0">
>> <rdf:Description
>>     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>     xmlns:dct="http://purl.org/dc/terms/"
>>
>>     rdf:about="http://example.com/music#piece23">
>>   <dct:title>Machine</dct:title>
>> </rdf:Description>
>
> Someone pointed out the "RDF is NOT enclosed in <RDF>...</RDF> tags"
> option on the Extended Interface page.
>
> Getting the parser to accept all legal RDF/XML syntax should not
> require the user to know ahead of time to go to the extended interface
> page.
>
> The first page should give that information (ideally explicitly, but
> at least with a strong hint that the "more options" are not just
> fancy output/display options, but involve a basic RDF/XML
> conformance option).

I don't disagree, well at least giving a stronger hint seems like a
reasonable UI move.

But I'm curious how the validator behaves with 'headless' RDF/XML
served from a URI as application/rdf+xml, or for that matter with
application/xml (with apologies for not testing myself - a case where
asking seems likely to be quicker).

Cheers,
Danny.

--
http://danny.ayers.name


RE: accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

by Houghton,Andrew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> From: www-rdf-validator-request@... [mailto:www-rdf-validator-
> request@...] On Behalf Of Danny Ayers
> Sent: Monday, August 10, 2009 4:03 PM
> To: Barclay, Daniel
> Cc: www-rdf-validator@...
> Subject: Re: accepting non-rdf:RDF root shouldn't require knowing to go
> to extended interface
>
> 2009/8/10 Barclay, Daniel <daniel@...>:
> > Getting the parser to accept all legal RDF/XML syntax should not
> > require the user to know ahead of time to go to the extended
> interface
> > page.
> >
> > The first page should give that information (ideally explicitly, but
> > at least with a strong hint that the "more options" are not just
> > fancy output/display options, but involve a basic RDF/XML
> > conformance option).
>
> I don't disagree, well at least giving a stronger hint seems like a
> reasonable UI move.
>
> But I'm curious how the validator behaves with 'headless' RDF/XML
> served from a URI as application/rdf+xml, or for that matter with
> application/xml (with apologies for not testing myself - a case where
> asking seems likely to be quicker).

I question whether there should be an option at all.  How hard is
it open an XML stream, look at the document element, determine
whether it's rdf:RDF and process it as RDF-XML, otherwise process
it as headless (striped) RDF-XML?

Andy.

Re: accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

by Barclay, Daniel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Re: accepting non-rdf:RDF root shouldn't require knowing to go to extended interface

Danny Ayers wrote:
...
> But I'm curious how the validator behaves with 'headless' RDF/XML
> served from a URI as application/rdf+xml, or for that matter with
> application/xml (with apologies for not testing myself - a case where
> asking seems likely to be quicker).

I have tried only with RDF/XML uploaded via the web form.

Do you thinkg it's likely that RDF/XML served from a URI would be treated
differently?


Daniel
--
(Plain text sometimes corrupted to HTML "courtesy" of Microsoft Exchange.) [F]