History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: RIO-35
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Arjohn Kampman
Reporter: Alexandre Passant
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Rio

Parsing attributes on properties

Created: 13/Dec/05 05:24 PM   Updated: 07/Feb/06 12:00 PM
Component/s: RDF/XML parser
Affects Version/s: 1.0.6
Fix Version/s: None

Environment: GNU/Linux
JDK 1.5
Sesame 2 CVS


 Description   
Rio does not allow to parse statements that use attributes on properties for nodes that are not bnode.

eg:

<rdf:RDF>
  <sioc:Site rdf:about="http://rdfs.org">
    <sioc:name>rdfs.org - Home of SIOC</sioc:name>
    <sioc:host_of rdfs:label="SIOC Forum">
      <sioc:Forum rdf:about="http://rdfs.org/sioc/forums">
        <rdfs:seeAlso rdf:resource="http://rdfs.org/sioc2/forum/9"/>
      </sioc:Forum>
    </sioc:host_of>
    <sioc:link rdfs:label="rdfs.org - Home of SIOC" rdf:resource="http://rdfs.org"/>
  </sioc:Site>
</rdf:RDF>

rdfs:label on sioc:link doesn't give any error, but the one on sioc:host_of give the following error:

[Fatal Error] local:18:12: Element type "rdfs:label" must be followed by either attribute specifications, ">" or "/>".
Exception in thread "main" org.openrdf.rio.ParseException: org.xml.sax.SAXParseException: Element type "rdfs:label" must be followed by either attribute specifications, ">" or "/>".

Yet, it seems (see 2005/12/13 discussion log for #swig) that specs don't clearly mention if the syntax is right or not, and raptor parses it fine but not the W3 validator.

Maybe Rio should (or not) parse it also correctly / w/warnings

 All   Comments   Change History      Sort Order:
Comment by Jeen Broekstra [15/Dec/05 12:12 PM]
This is a somewhat obscure bit of the <a href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML syntax spec</a>, but after having looked through the grammar and text, we conclude that Rio and the W3C RDF Validator are correct in not accepting this syntax.

According to the official grammar, only <a href="http://www.w3.org/TR/rdf-syntax-grammar/#emptyPropertyElt">empty property elements</a> are allowed to have property attributes (like rdfs:label). The host_of property in your document is not an empty element.

The sioc:link property, however, is an empty element, so in this case, using a property attribute (alongside a resource attribute) is allowed.

It seems to me that if it is true that raptor accepts this syntax, then this is a bug in raptor.