W3C home > Mailing lists > Public > semantic-web@w3.org > March 2008

Re: RDF query in XML

From: Danny Ayers <danny.ayers@gmail.com>
Date: Fri, 7 Mar 2008 10:53:48 +0100
Message-ID: <1f2ed5cd0803070153h4816478enf6479594f8be7cad@mail.gmail.com>
To: neelr <vascodagama1@gmail.com>
Cc: "SW-forum list" <semantic-web@w3.org>

[forwarding to semantic-web@w3.org]

On 06/03/2008, neelr <vascodagama1@gmail.com> wrote:
>  Hi everyone,
>         I am quite new to this RDF. I am currently working on a project
>  which involves RDF. I wanted to know if there is any software or query
>  language which can query RDF/XML files in XML.
>      What I mean here is the syntactic constructs of the query language
>  should be in XML,i.e, I should be able to write the queries in XML.
>       Hope to hear from you guys soon.

It would be helpful to know what kind of queries you have in mind.

Because you can say the same thing in many different ways in RDF/XML,
in general it doesn't really lend itself to XML style querying (XQuery
etc). But most serializers have some kind of constrained syntax, so if
you know it's all coming out of the same API then you're in with a
better chance. Another alternative would be to translate to one of the
more regular XML syntaxes, like Trix [1].

SPARQL [2] is generally the best bet for querying RDF, and it's done
against the model/data rather than any specific serialisation (and you
get XML out). There were a handful of alternative query languages
floating around prior to SPARQL, could well be an XML-based on
somewhere - try the ESW Wiki [3].

There are also a few XPath-like languages around that would allow
queries against the graph (rather than the tree of XML), see [4].

While I can't remember seeing SPARQL done in XML, I would guess a
syntax mapping should be relatively straightforward. The top-level
grammar should fit pretty nicely into an XML hierarchy, the pattern
part should be expressable using (presumably namespaced) RDF/XML, with
the inclusion of a new construct for variables. It's all Unicode. An
XSLT transformation to regular SPARQL could be hooked onto the front
end of an existing query engine for your implementation.

But then again, without knowing what you have in mind, it's hard to
see what would be gained from using an XML-based language rather than


[1] http://www.hpl.hp.com/techreports/2004/HPL-2004-56.html
[2] http://www.w3.org/TR/rdf-sparql-query/
[3] http://esw.w3.org/topic/RDF_Query
[4] http://esw.w3.org/topic/RdfPath

Received on Friday, 7 March 2008 09:53:56 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 08:45:05 UTC