RDFLib/rdfextras — Issue #37: Infinite loop while parsing a file
Author: gjhiggins
Created: 2012-02-20 07:57:38+00:00
State: open

kaska...@gmail.com, 2012-01-10T01:34:57.000Z

What steps will reproduce the problem?
1. Execute the example given in rdflib.plugins.parsers.rdfa docs [1] with the attache rdf-example html file (which can be found here [2]):

import rdflib.graph as g
graph = g.Graph()
graph.parse('rdfa-example.html', format='rdfa')
--> infinite loop <--
print graph.serialize(format='pretty-xml')

What is the expected output? What do you see instead?
Expected output: see attached extract.rdf (generated by PyRdfa with the same example)

Nothing happens. graph.parse method never returns.

What version of the product are you using? On what operating system?
LSB Version:	:core-4.0-amd64:core-4.0-noarch
Distributor ID:	Fedora
Description:	Fedora release 16 (Verne)
Release:	16
Codename:	Verne
Python 2.7.2
last versions for rdflib/rdfextras got from pypi

Please provide any additional information below.
[1] http://readthedocs.org/docs/rdflib3/en/latest/_modules/rdflib/plugins/parsers/rdfa.html
[2] http://townx.org/blog/elliot/example-how-put-rdfa-html-list
[3] http://www.w3.org/2007/08/pyRdfa

Comment 1 by gjhigg...@gmail.com
I can't offer much help as I'm unable to replicate the problem on either an ubuntu oneiric 32bit host or an ubuntu natty 64bit host. Perhaps you could try running the test suite, that might shed a little more light locally. Otherwise, all I can suggest is that you try with rdflib-3.2dev. FTR, rdfextras isn't involved here, the RDFa parser is in the rdflib core and for this reason I have marked the ticket as "Invalid". That's just a technicality; if necessary I'll raise an appropriate rdflib issue ticket.

/tmp$ python
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rdflib
>>> rdflib.__version__
'3.1.0'
>>> from rdflib import Graph
>>> g = Graph()
>>> g.parse('rdfa-example.html', format='rdfa')
)>
>>> print(g.serialize(format='pretty-xml'))

Main Collection
true
true

Vague Collection
false
false

Archive Collection
false
false

Comment 2 by kaska...@gmail.com
Please, don't raise a new ticket in rdflib. I should have waited to check my scripts in other distros before opening a new ticket here.

Thanks for your clear and quick response.

Kind Regards