XML format for SPARQL queries?

Hello-

I was wondering, is there an XML format for encoding SPARQL queries and
update requests? That is, a format which serializes this:

"""
SELECT ?s ?p ?o
WHERE {
  ?s ?p ?o .
}
"""

as this:

"""
<?xml version="1.0"?>
<query xmlns="http://fake.org/sparql-query#">
  <clause type="select">
    <binding name="s" />
    <binding name="p" />
    <binding name="o" />
  </clause>
  <clause type="where">
    <triple>
      <subject>s<subject>
      <predicate>p</predicate>
      <object>o</object>
    </triple>
  </clause>
</query>
"""

(or, you know, something else that could actually be processed)

I ask because I know I can get my SPARQL results in XML (either
sparql-results or rdf+xml), so it wouldn't surprise me if a format for
SPARQL queries was also available. I've checked the mailing list archives,
and the current list of W3C standards and drafts, but I'm not seeing
anything like this. There's SPIN, but that seems to be moving in the
opposite direction from what I'm looking for.

Being able to serialize queries in XML would make them easier to log and
rollback (for updates, that is). It would also permit the use of XML tools
for generating SPARQL queries. Currently, I'm accomplishing this in my
scripts with a lot of string concatenation and string formatting, but that
seems flimsy and unreliable. I don't think it would be impossibly hard to
write my own schema for a SPARQL Query document, but I also don't want to
reinvent the wheel.

Thank you-
Steve McCauley

Received on Saturday, 17 June 2017 11:48:44 UTC