-
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
RDF/XML behaves weird if RDF is the default namespace #468
Comments
I think you always have to prefix the |
The RDF spec disagrees: http://www.w3.org/TR/REC-rdf-syntax/#eventterm-attribute-URI For attributes without namespaces, "if local-name is The --- rdfxml.py 2015-03-04 12:02:02.555737327 -0800
+++ - 2015-03-05 14:16:19.582665301 -0800
@@ -235,9 +235,9 @@
atts = {}
for (n, v) in attrs.items(): #attrs._attrs.iteritems(): #
if n[0] is None:
- att = URIRef(n[1])
+ att = n[1]
else:
- att = URIRef("".join(n))
+ att = "".join(n)
if att.startswith(XMLNS) or att[0:3].lower()=="xml":
pass
elif att in UNQUALIFIED: |
hmm, several thoughts on this: here's an example install.rdf: let's put it through the W3C RDF validator:
Also looking at its output it becomes quite apparent that it does not interpret the install.rdf correctly (similar to rdflib it inserts a blank node above and doesn't seem to understand There are several reasons we should still deal with this:
|
Unfortunately, there isn't such a thing. People copy |
@kmaglione: Thanks for clearing up and fixing the bug. The W3C validator is rather strict to reject the install.rdf, however, validators are supposed to be strict. Also, I found the same problem in the install.rdf of a Firefox extension I wrote myself. So yes, people copy templates from all over the place, for example (sarcasm) from the Mozilla Developer Network. |
fixes #468 RDF/XML problem with unqualified use of rdf:about
Noticed this while trying to parse mozilla addon install.rdf files. They use
xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
so they don't have to prefix things like<Description>
orabout
with<rdf:Description>
orrdf:about
.Parsing such a file the current rdflib will not understand the rdf basics anymore and introduce BNodes to capture the xml.
Examples:
Here we define the rdf namespace as commonly done:
this is ok.
let's use something other than rdf, e.g. fdr:
this looks ok as well.
now let's make rdf the default namespace so we don't need to prefix everything with rdf (2nd line):
this looks as if rdflib doesn't understand rdf anymore, as it introduces a BNode above all :(
The text was updated successfully, but these errors were encountered: