-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDFLib will accept broken RDF/XML #363
Comments
Not so fast :) |
This currently breaks master... the test fails here:
who doesn't love rdf+xml: http://www.w3.org/TR/2014/REC-rdf-syntax-grammar-20140225/#section-Syntax-parsetype-resource |
Oh dear - It's not just that my hacky attempt at raising an exception wasn't working, but our parseType=Resource parsing is completely broken. If I reduce down the example to this: <?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.example.org/meeting_organization#">
<rdf:Description about="http://meetings.example.com/cal#m1">
<Location parseType="Resource">
<zip xmlns="http://www.another.example.org/geographical#">02139</zip>
<lat xmlns="http://www.another.example.org/geographical#">14.124425</lat>
</Location>
</rdf:Description>
</rdf:RDF> And parse it without my exception raising code, I get:
which is complete gobblygook. AFAIK the rdf/xml code hasn't been touched for a long time, and it may have been broken forever. I'll investigate. |
So at first I started going back in rdflib history, and this was broken all the way back to version 2.0.6 - the earliest tagged version we have :) BUT, as I start looking into the rdfxml parser, I realise that it's not the parsed that is broken, it's the example. The parseType here needs to be in the rdf namespace: <?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.example.org/meeting_organization#">
<rdf:Description about="http://meetings.example.com/cal#m1">
<Location rdf:parseType="Resource">
<zip xmlns="http://www.another.example.org/geographical#">02139</zip>
<lat xmlns="http://www.another.example.org/geographical#">14.124425</lat>
</Location>
</rdf:Description>
</rdf:RDF>
That XML parses fine, and no exception is raised. :) |
phew ;) the thing is: build still breaks. |
ah, i think you just forgot to restore https://github.com/RDFLib/rdflib/edit/master/test/test_issue363.py to something which works... should we report upstream that http://www.w3.org/2000/10/swap/test/meet/white.rdf is broken? |
This RDF/XML is invalid and should raise an exception:
The text was updated successfully, but these errors were encountered: