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

\n added to query in sparqlstore.py #521

Closed
nvitucci opened this issue Sep 10, 2015 · 4 comments · Fixed by #522
Closed

\n added to query in sparqlstore.py #521

nvitucci opened this issue Sep 10, 2015 · 4 comments · Fixed by #522
Assignees
Labels
Milestone

Comments

@nvitucci
Copy link

These lines cause a spurious '\n' to be inserted in the query string:

https://github.com/RDFLib/rdflib/blob/master/rdflib/plugins/stores/sparqlstore.py#L77-L81

Example:

from rdflib.plugins.stores import sparqlstore

store = sparqlstore.SPARQLStore()
query = "SELECT DISTINCT * WHERE {?s ?p ?o} LIMIT 10"

store.setQuery(query)
print repr(store.queryString)

This prints '\nSELECT DISTINCT * WHERE {?s ?p ?o} LIMIT 10'

@joernhees joernhees added enhancement New feature or request low priority store Related to a store. labels Sep 10, 2015
@joernhees joernhees added this to the rdflib 4.2.2 milestone Sep 10, 2015
@joernhees joernhees self-assigned this Sep 10, 2015
@joernhees
Copy link
Member

i guess this is more a stylistic problem than a real bug...

@nvitucci
Copy link
Author

Sure, but I got some tests to fail because the query actually submitted to the endpoint was different because of the leading '\n'.

@joernhees
Copy link
Member

@nvitucci better? (you can try with pip install -U git+https://github.com/RDFLib/rdflib.git)

@nvitucci
Copy link
Author

Brilliant, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants