SPARQL allows you to write 72 as a shorthand for the literal "72"^^xsd:integer . As you saw, you can get the movie with the identifier "72"^^xsd:integer without any problems. However, the other movie you are looking for has the identifier "44396"^^xsd:int (note that the data type is xsd:int , not xsd:integer ). I donβt know why the data type is different, but it is enough to help us get what we want:
PREFIX mdb: <http://data.linkedmdb.org/resource/movie/> SELECT ?director?nombre_director?id_director WHERE { ?pelicula mdb:filmid "44396"^^xsd:int . ?pelicula <http://data.linkedmdb.org/resource/movie/director> ?director . ?director <http://data.linkedmdb.org/resource/movie/director_name> ?nombre_director . ?director <http://data.linkedmdb.org/resource/movie/director_directorid> ?id_director . }
SPARQL Results (one)
director nombre_director id_director ---------------------------------------------- db:director/9025 "JJ Abrams" 9025
Note that instead of filtering, I simply put the actual desired value in the query template. I find this a little easier, and if the query engine is not optimized, it can be more efficient (since it does not create a large set of results and does not filter it). In fact, this may explain why a semantically equivalent query that uses a variable and a filter does not return results if there is a limit on the number of results that the query can return. (But this is pure speculation.) In any case, the following query does not work, but I think it should:
PREFIX mdb: <http://data.linkedmdb.org/resource/movie/> SELECT ?director?nombre_director?id_director WHERE { ?pelicula mdb:filmid ?id . ?pelicula <http://data.linkedmdb.org/resource/movie/director> ?director . ?director <http://data.linkedmdb.org/resource/movie/director_name> ?nombre_director . ?director <http://data.linkedmdb.org/resource/movie/director_directorid> ?id_director . filter ( ?id = "44396"^^xsd:int ) }
SPARQL Results (none)
source share