I tried to run this query using Jena Api in Java.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
select distinct ?p where {
?s ?p ?o .
{
select ?s {
?s a <http://data.linkedmdb.org/resource/movie/film> .
}
limit 10
}
}
I get this error message :
Exception in thread "main" HttpException: 400
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.rewrap(HttpQuery.java:414)
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:358)
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:295)
I think this may have to do with the fact that LinkedMDB endpoint is running under SPARQL 1.0, which does not support subqueries (only in SPARQL 1.0). I was wondering whether there is an alternative to this, I tried to run two queries, first one for the first 10 movies, and the second for the distinct properties describing these movies. But the problem is I get the distinct properties of each of the movies, not all of them, whereas I want to get the distinct properties of all the 10 first movies. Any suggestion?
PS. The SPARQL query works perfectly on DBpedia endpoint.