Is there a web service that allow me to run SPARQL against a XHTML+RDFa website?

It would be cool if, like those RDFa extraction services, there would be a service that would allow running a SPARQL query against an arbitrary XHTML+RDFa website and return it in, for example, JSON. Is there such a public service?

There isn't a public service that I'm aware of, but there are a sparql services and rdfa services. Let's try to find the creator of a slideshare slideshow:

First, we want rdf from html. Let's use the java rdfa service:

That returns rdf. Let's query that using

    ?source <> ?creator .

There is a json result format available from there, so we'll add that option:*

Readable! But it works:

  "head": {
    "vars": [ "source" , "creator" ]
  } ,
  "results": {
    "bindings": [
        "source": { "type": "uri" , "value": "" } ,
        "creator": { "type": "literal" , "xml:lang": "en" , "value": "Thomas Fuchs" }

We have an answer.

Other services could replace these two, of course. It would be nice if supported rdfa directly, and maybe it will in the future, but this is more fun ('fun' may depend on your definition of entertainment).


You are using Virtuoso, this feature is in-built via the Sponger Middleware layer.

Just do this:


For the most basic demo.

You can even test this live at: (note the sponger options in the drop-down).

Clearly we aren't doing a good job of explaining what the Sponger Middleware component of Virtuoso is all about :-(


  1. -- Sponger Middlware Page
  2. -- Virtuoso SPARQL Tutorial that focuses on Sponger Pragmas for the Virtuoso SPARQL engine.


You should be able to do the same thing using the demo of my SPARQL engine that's part of dotNetRDF at Just use a FROM clause pointing at the URI you want to extract RDFa from or enter the URI in the Default Graph URI box.

It's running on a fairly recent pre-release build of the library that includes the new RDFa parser I'll be rolling out in the next release.*{}&default-graph-uri=&timeout=10000

There's no explicit output option (output format is based on the HTTP accept) header but if you specify application/sparql-results+json as the accept header you'll get back JSON like you want