gjhiggins/rdflib — Issue #43: Failure parsing valid RDF from identi.ca
Author: gjhiggins
Created: 2011-10-19 01:04:20+00:00
State: open
Labels: Type-Defect

Originally filed by uldis.bo...@gmail.com on 2009-02-15T14:31:58

What steps will reproduce the problem?
g = Graph()
url = "http://identi.ca/search/notice/rss?q=SIOC"
res = g.parse(url)

Note: this problem only happens when parsing Identi.ca RSS/RDF feed
(parsing other RDF files is OK). the URL provided is a valid RDF file
according to W3C RDF validator.

What is the expected output? What do you see instead?
- expected: RDF triples resulting from parsing contents of the url

- actual result is an AttributeError exception (full exception text below)

What version of the product are you using? On what operating system?
- RdfLib 2.3.1 (the latest version provided by MacPorts py25-rdflib)
- Python 2.5 (python25 from MacPorts)
- MacOSX 10.5.6

Please provide any additional information below.

File "IdentiSearch.py", line 47, in parseUrl
res = g.parse(url)
File "/opt/local/lib/python2.5/site-packages/rdflib/Graph.py", line 438,
in parse
parser.parse(source, self, **args)
File
"/opt/local/lib/python2.5/site-packages/rdflib/syntax/parsers/RDFXMLParser.py",
line 37, in parse
self._parser.parse(source)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/xmlreader.py",
line 123, in parse
self.feed(buffer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 207, in feed
self._parser.Parse(data, isFinal)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File
"/opt/local/lib/python2.5/site-packages/rdflib/syntax/parsers/RDFXMLHandler.py",
line 165, in endElementNS
self.current.end(name, qname)
File
"/opt/local/lib/python2.5/site-packages/rdflib/syntax/parsers/RDFXMLHandler.py",
line 451, in property_element_end
self.store.add((self.parent.subject, current.predicate, current.object))
File "/opt/local/lib/python2.5/site-packages/rdflib/Graph.py", line 193,
in add
self.__store.add((s, p, o), self, quoted=False)
File "/opt/local/lib/python2.5/site-packages/rdflib/store/IOMemory.py",
line 134, in add
for triple, cg in self.triples(triple, context):
File "/opt/local/lib/python2.5/site-packages/rdflib/store/IOMemory.py",
line 298, in triples
oi = self.reverse[object]
File "/opt/local/lib/python2.5/site-packages/rdflib/Literal.py", line 53,
in __eq__
result = self.__cmp__(other)==False
AttributeError: 'Literal' object has no attribute '__cmp__'