rdflib icon indicating copy to clipboard operation
rdflib copied to clipboard

make parsed SPARQL queries re-serializable

Open joernhees opened this issue 9 years ago • 2 comments

currently, once a sparql query is parsed, it's very difficult to get the text form back if you didn't remember it somewhere

in #565 i accepted a hackish quick solution for this in order to move on, but it's certainly desirable to:

  • "just" add __str__ and __repr__ to Query?
  • revert ff5ada5fa878ca4c9f89b650c588416a6ad320f4 and 6de4da04c162450aedd767f41754d4f6cd3912f3

joernhees avatar Jan 29 '16 19:01 joernhees

I think an explicit method is better. __str__ and __repr__ of Query should probably be the prologue and algebra properties. Also, the query should serialize its current state rather than the original string used for parsing this will allow interpolating the algebra and prologue if needed.

iddan avatar Apr 24 '19 09:04 iddan

I have been working on this on this issue for quite some time now. I was wondering if you could explain in detail, the exact expectations from this so that I can keep those in mind before sending out a PR.

karish-grover avatar May 13 '22 08:05 karish-grover