Hi,
I am basically trying to have a giant text file with SPARQL code line by line. I want the transformation to be invoked into the graph line by line as well and run the transformation.
So far, I didnt have any luck. i've been reading up the documentation and modyfing my code accordingly but doc does not seem to mention invoking a separate file for SPARQL queries....
Here is the code I have been working on:
import os
with open('/cs/samirage/stephen/querystringtest.rq', 'r') as qbank:
qbank = qbank.read()
g = rdflib.Graph()
g.parse('definitions/HR_Reference_Ontology.xml')
qres = g.query(qbank)
## ParseException: Expected end of text (at char 32), (line:3, col:1) instead of
for row in qres:
print(row)
not sure if it is clear from the code, but i am trying to invoke the SPARQL code iteratively with the for loop, which will run the SPARQL queries into the graph.
qbank is the file with SPARQL querie and the .xml is the graph model.
g.parse('definitions/HR_Reference_Ontology.xml')
qres = g.query(qbank)
for row in qres:
print(row)
--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/3b8319fe-a6f2-47c6-8ae2-f348dac28fd1%40googlegroups.com.
| ______________________________________________________________________________________ |
| |
|