W3C home > Mailing lists > Public > public-lod@w3.org > May 2010

How to serve hash URIs from a (Virtuoso) SPARQL endpoint?

From: Christoph LANGE <ch.lange@jacobs-university.de>
Date: Wed, 19 May 2010 10:50:31 +0200
To: "public-lod@w3.org" <public-lod@w3.org>
Cc: "nikita.zhiltsov@gmail.com" <nikita.zhiltsov@gmail.com>, Vyacheslav Zholudev <v.zholudev@jacobs-university.de>
Message-Id: <201005191050.32999.ch.lange@jacobs-university.de>
Dear all,

  the data we would like to publish have hash URIs.  We have translated them
to RDF and store the RDF in a Virtuoso triple store with a SPARQL endpoint.

Now, when a client requests application/rdf+xml from a cool URI like
http://our.server/data/document#fragment, it actually makes a request for
http://our.server/data/document.  In the resulting RDF/XML it expects to find
the desired information unter rdf:ID="fragment" or
rdf:about="http://...#fragment", i.e. resolving everything behind the # is up
to the client.  That is, the RDF/XML document the server returns for
http://our.server/data/document must contain all triples relevant for
<http://our.server/data/document> and for any
<http://our.server/data/document#whatever> – i.e. we would essentially like
our SPARQL endpoint to emulate the behavior of a stupid web server serving a
static http://.../document.rdf file, which contains all those triples.

So far, our solution is that we rewrite the cool URI into the following query
to the SPARQL endpoint:

construct { ?s ?p ?o }
where { ?s ?p ?o .
    filter(
        ?s = "http://our.server/data/document"
            ||
        regex(?s,"^http://our.server/data/document#"))
}

That works, it's even efficient – but I wonder whether there is any better way
of doing it.

Thanks for your feedback,

Christoph

-- 
Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701

Received on Wednesday, 19 May 2010 11:44:25 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:29:48 UTC