More RDF ambiguities

While scanning through what you all anonymously threw at my Prolog-based
RDF parser, I found the following (abstracted and simplified a lot):

<?xml version="1.0" encoding="UTF-8"?>

<ImageDataset>
  <ImageClass>
    <ImageClass>		<!--1-->
      <Image name="foo"/>
    </ImageClass>
    <ImageClass>		<!--2-->
      <Image name="bar"/>
    </ImageClass>
  </ImageClass>
</ImageDataset>

I *think* this is correctly rejected as invalid. To parse this,
<ImageDataset> is a typedNode, making the outer <ImageClass> a
propertyElt, leaving only the first [6.12] production to interpret both
--1-- and --2-- as a value. This cannot be done.  So I only need a
sensible error message rather then Prolog's favorite `No'!

While analysing the example, I stripped it down to:

<ImageDataset>
  <ImageClass>
    <ImageClass>		<!--1-->
      <Image name="foo"/>
    </ImageClass>
  </ImageClass>
</ImageDataset>

Now the parser agrees, producing:

{'Description__1', rdf:type,	 'ImageDataset'}
{'Description__1', 'ImageClass', 'Description__2'}
{'Description__2', rdf:type,	 'ImageClass'}
{'Description__2', 'Image',	 'Description__3'}
{'Description__3', name,	 literal(foo)}

This puzzled me. I tried the SiRPAC parser, who dosn't like it at all
and the Pro Solutions parser which says

'genid2' 'name' literal('foo')
'genid2' 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' 'Image'
'genid0' 'ImageClass') resource('genid2')
'genid0' 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' 'ImageClass'

This is not ok either as it says nothing about <ImageDataset>

It does however give the anonymous <Image> resource the type
'Image'.  This looks nice and logical, but I can't find how to
interpret this from the specs.

A real guru with the correct solution (and why :-) around?

	Thanks --- Jan

P.s.	Most other bugs encountered in the things thrown at the
	parser have been fixed.  To update, please see the CVS
	service.  You also need to update parser.c from the
	XML/SGML parser, which contained a DTD-handling error.

	See

	http://www.swi.psy.uva.nl/projects/SWI-Prolog/packages/sgml/online.html

P.s.s.	What about a standard or at least reserved naming schema for
        anonymous resources?  I'm now using <Type>__<N>, with is nice
	for debugging. We also see genid<N>, but none of this is
	reserved!

Received on Wednesday, 3 May 2000 11:09:07 UTC