Letractively / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

construct() fails #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The following code fails:
graph=SPARQLGraph(Graph())
graph.parse('test.rdf')

where = GraphPattern([("?x",URIRef('http://xmlns.com/foaf/0.1/name'),"?name")])
constructPattern =
GraphPattern([(URIRef("http://example.org/person#Alice"),URIRef('http://www.w3.o
rg/2001/vcard-rdf/3.0#FN'),"?name")])
resultObject = Query.queryObject(graph,where)
result = resultObject.construct(constructPattern)

What is the expected output? What do you see instead?
Expected output: No error

Actual output:
Traceback (most recent call last):
  File "sparqlinfer.py", line 44, in ?
    infer('test.rdf','rules.txt')
  File "sparqlinfer.py", line 40, in infer
    r=q.construct()
  File "/var/lib/python-support/python2.4/rdflib/sparql/Query.py", line
799, in construct
    subgraph = SPARQLGraph()
TypeError: __init__() takes at least 2 arguments (1 given)

What version of the product are you using? On what operating system?
Version 2.4.0, Debian "lenny"

Please provide any additional information below.
Changing line 799 in
/var/lib/python-support/python2.4/rdflib/sparql/Query.py to "subgraph =
SPARQLGraph(rdflib.Graph.Graph())" fixes the problem.

Original issue reported on code.google.com by stefan.p...@mbnet.fi on 27 Nov 2007 at 10:59

GoogleCodeExporter commented 9 years ago

Original comment by eike...@gmail.com on 23 Jan 2008 at 3:43

GoogleCodeExporter commented 9 years ago

Original comment by eike...@gmail.com on 31 Jan 2008 at 3:59

GoogleCodeExporter commented 9 years ago

Original comment by eik...@gmail.com on 10 Feb 2009 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by eik...@gmail.com on 1 Feb 2010 at 7:57

GoogleCodeExporter commented 9 years ago

Original comment by eik...@gmail.com on 1 Feb 2010 at 9:04

GoogleCodeExporter commented 9 years ago
These issues involve bits that have been moved out of rdflib proper for now. We 
will re-open them 
or move them to rdfextas as appropriate.

Original comment by eik...@gmail.com on 11 Feb 2010 at 6:06