The following SPARQL query fetches only 2500 records with actors and films I don't know why its limited to 2500:
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
SELECT ?id ?filmTitle ?actorName WHERE {
SERVICE <http://data.linkedmdb.org/sparql> {
?film a movie:film ;
movie:filmid ?id ;
dcterms:title ?filmTitle ;
movie:actor [ a movie:actor ;
movie:actor_name ?actorName ].
}
}
The query is from an answer to the question: Querying the Linked Movie Database (LMDB) with SPARQL
What does the a
keyword mean? What do the square brackets []
stand for?
I understood that the a
keyword is a substitute for rdf:type
and I rewrote a portion of the SPARQL query without the actors. But I still can't figure out the meaning of the square brackets [].
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?film ?id ?filmTitle WHERE {
#VALUES ?filmTitle { "The Matrix" }
SERVICE <http://data.linkedmdb.org/sparql> {
?film rdf:type movie:film.
?film movie:filmid ?id.
?film rdfs:label ?filmTitle.
}
}
Thanks for your responses but the code misses out some actors for movies. For example the movie "A Bridge Too Far" has 18 actors but the result of this query has only 2
PREFIX dcterms: <purl.org/dc/terms/>;
PREFIX movie: <data.linkedmdb.org/resource/movie/>;
SELECT ?id ?filmTitle ?actorName
WHERE {
SERVICE <data.linkedmdb.org/sparql>;
{
?film a movie:film ;
movie:filmid ?id ;
dcterms:title ?filmTitle ;
movie:actor [ a movie:actor ;
movie:actor_name ?actorName ].
}
} ORDER BY ASC(?filmTitle)
My edited code, still giving same result of 2 actors instead of 18
filmlist.rq
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?film ?id ?filmTitle ?actorName WHERE {
#VALUES ?filmTitle { "The Matrix" }
SERVICE <http://data.linkedmdb.org/sparql> {
?film rdf:type movie:film.
?film movie:filmid ?id.
?film rdfs:label ?filmTitle.
?film movie:actor ?actorID.
?actorID movie:actor_name ?actorName.
}
}
ORDER BY ASC(?filmTitle)