query-c1ad6e5d81d050bfb2d0ee5073a21c3b

rq turtle/ttl

The 25 EON James Bond movies

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>

SELECT ?film ?ordinal ((MIN(YEAR(?pub))) AS ?year) ?actorLabel ((?year-YEAR(?birthday)) AS ?age) ?title ?filmLabel (GROUP_CONCAT(DISTINCT(?directorName);separator=", ") AS ?director) (SAMPLE(?duration) AS ?duration) ((MIN(?pub)) AS ?publication) ?imdb WHERE {
    ?film p:P179 ?series .
    ?series v:P179 wd:Q26451486.
    ?series pq:P1545 ?ordinal .
    ?film p:P161 ?bond . ?bond pq:P453 wd:Q2009573 . ?bond v:P161 ?actor . FILTER(?actor != wd:Q888254)
    ?actor wdt:P569 ?birthday .
    ?film wdt:P345 ?imdb .
    ?film wdt:P1476 ?title .
    OPTIONAL{?film wdt:P57 ?dir . ?dir rdfs:label ?directorName .  FILTER(lang(?directorName) = "en")} .  
    OPTIONAL {?film wdt:P2047 ?duration}
    OPTIONAL {?film wdt:P577 ?pub}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
GROUP BY ?film ?filmLabel ?imdb ?ordinal ?title ?actor ?actorLabel ?birthday
ORDER BY ASC(xsd:integer(?ordinal))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?actor") v14("?age") v7("?birthday"):::projected v6("?bond") v10("?dir") v15("?director") v3("?directorName"):::projected v16("?duration"):::projected v4("?film"):::projected v8("?imdb"):::projected v1("?ordinal"):::projected v12("?pub"):::projected v16("?publication") v5("?series") v9("?title"):::projected v13("?year"):::projected c21(["de"]):::literal c9(["wd:Q2009573"]):::iri c19(["bd:serviceParam"]):::iri c5(["wd:Q26451486"]):::iri f0[["?actor != 'wd:Q888254'"]] f0 --> v2 v4 --"p:P179"--> v5 v5 --"p:statement/P179"--> c5 v5 --"p:qualifier/P1545"--> v1 v4 --"p:P161"--> v6 v6 --"p:qualifier/P453"--> c9 v6 --"p:statement/P161"--> v2 v2 --"p:direct/P569"--> v7 v4 --"p:direct/P345"--> v8 v4 --"p:direct/P1476"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P57".-> v10 v10 --"rdfs:label"--> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P2047".-> v16 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P577".-> v12 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c19 --"wikibase:language"--> c21 end bind5[/"min(year-from-dateTime(?pub))"/] v12 --o bind5 bind5 --as--o v13 bind6[/"?year - year-from-dateTime(?birthday)"/] v13 --o bind6 v7 --o bind6 bind6 --as--o v14 bind7[/"?directorName"/] v3 --o bind7 bind7 --as--o v15 bind8[/"sample(?duration)"/] v16 --o bind8 bind8 --as--o v16 bind9[/"min(?pub)"/] v12 --o bind9 bind9 --as--o v16