Skip to content
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

construct() fails #3

Closed
ghost opened this issue Feb 20, 2012 · 0 comments
Closed

construct() fails #3

ghost opened this issue Feb 20, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2012

[email protected], 2007-11-27T10:59:23.000Z

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.org/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.

Comment 1 by [email protected]



Comment 2 by [email protected]



Comment 3 by [email protected]



Comment 4 by [email protected]



Comment 5 by [email protected]



Comment 6 by [email protected]
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.
@ghost ghost closed this as completed Feb 20, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants