I have recently been exploring SPARQl queries and they seem noticably slow. I also tried to run a federated query using Apache Jena Fuseki, this too was very slow, slower than the queries using one SPARQL endpoint. Is there a way to improve the performance of SPARQL query? Some suggestions I found on the internet was to use cached query results, which I think defeats the purpose of putting data in the web.
Here is an example of the federated query that I tried. I got this query from Connecting Linkedmdb and DBpedia via federated SPARQL queries
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT ?film ?label ?subject WHERE {
SERVICE <http://data.linkedmdb.org/sparql> {
?film a movie:film .
?film rdfs:label ?label .
?film owl:sameAs ?dbpediaLink
FILTER(regex(str(?dbpediaLink), "dbpedia", "i"))
}
SERVICE <http://dbpedia.org/sparql> {
?dbpediaLink dcterms:subject ?subject
}
}
LIMIT 50