RDFLib/rdflib — Issue #42: Failure parsing valid RDF from identi.ca
Author: gjhiggins
Created: 2012-02-20 08:31:14+00:00
State: open

uldis.bo...@gmail.com, 2009-02-15T14:31:58.000Z

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__'

Comment 1 by eik...@gmail.com
Looks like it works in trunk. Not much we can do to fix version 2.3.1 ;) We could try to motivate MacPorts
updating to 2.4.0 which has been out for a couple years at this point. Anyone know how to go about poking
the MacPorts process?

{{{
>>> from rdflib.Graph import Graph
>>> g = Graph()
>>> url = "http://identi.ca/search/notice/rss?q=SIOC"
>>> res = g.parse(url)
>>> len(res)
481
}}}

NOTE: I'm marking this as won't fix since we can't and opening a issue #48 for seeing if we can get MacPorts
to update to a newer version.