query-4f016e32e851819ecf07bc051da097d1

rq turtle/ttl

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

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?genre") v2("?item"):::projected v5("?location") v3("?title") v1("?titleLabel"):::projected a1((" ")) c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q907311"]):::iri c3(["wd:Q2431196"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P449"--> c5 v2 --"wdt:P179"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P136".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P840".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end