This question already has an answer here:
You can run the query below at the Linked MDB SPARQL Explorer. The values of ?imdbID
(the last variable) contains IRIs from one of three possible domains (freebase.com, rottentomatoes.com or imdb.com). I would like to know how to apply a filter
such that only the rows from the imdb.com domain are retained.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
SELECT ?title ?date ?director ?imdbID
WHERE {
?film foaf:page ?imdbID.
?film dc:title ?title.
?film dc:date ?date .
?film movie:director ?directorURI.
?directorURI rdfs:label ?director .
}
Not sure why this wasn't posted by @JoshuaTaylor as an answer but adding @JoshuaTaylor's filter to your query is what you are requesting:
Which returns:
If you want to make it case insensitive you can use the
i
flag like so:If you want to see some more information on filter have a look at 3.1 Restricting the Values of Strings.