query-4f016e32e851819ecf07bc051da097d1
Request all (or most!) data for Netflix Original TitlesHi all, completely new to SPARQL and have what I believe is a pretty simple query (or should be). I'm trying to get a list of all Netflix Originals (films AND television series). Ideally, I also want to get some addition info, where possible, for each of these titles, such as genre, country of production, number of episodes in total, etc. . Having done this, I'm able to put together a pretty simple query, which seems to generate a list of Netflix Originals (films AND television series) with some additional info, where available, for each of these titles. Here's the code that I'm using: YouTubeI've spent the last couple of days reading through various help guides and also watched a really helpful tutorial on
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?titleLabel ?item ?itemLabel ?genreLabel ?locationLabel
WHERE
{
?item wdt:P31/wdt:P279* wd:Q2431196. # instances of subclass audiovisual works - have done this because I want to find all films AND television series. Would UNION be another way to approach this?
?item wdt:P449 wd:Q907311. # original network is Netflix
?item wdt:P179 ?title . # can't really explain how/why I've done this! But it seems to be the best way to find and display the title of a TV series
OPTIONAL {?title wdt:P136 ?genre. }
OPTIONAL {?title wdt:P840 ?location. } # these are just two optional values. I would like more in future, such as number of episodes, etc.
# But I'm keeping it simple for the moment
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?titleLabel