query-4fb3f24b76899a291f8d2a6fee9b0630
Auxiliary query for all trans characters on Wikidata:
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?characterLabel ?movie ?movieLabel (YEAR(MIN(?publicationDate)) AS ?year) WHERE {
?movie wdt:P31/wdt:P279* wd:Q11424;
wdt:P577 ?publicationDate;
p:P161/pq:P453 ?character.
{ ?character wdt:P21 wd:Q2449503. } UNION
{ ?character wdt:P21 wd:Q1052281. } UNION
{ ?character wdt:P21/wdt:P279* wd:Q48270. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?characterLabel ?movie ?movieLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?_anon_42b5416610844a34809f33a099ae9de125509"):::projected
v3("?character")
v1("?movie"):::projected
v2("?publicationDate")
v5("?year")
a1((" "))
a2((" "))
a3((" "))
c8(["wd:Q2449503"]):::iri
c12(["bd:serviceParam"]):::iri
c9(["wd:Q1052281"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q11424"]):::iri
c10(["wd:Q48270"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v1 --"p:direct/P577"--> v2
v1 --"p:P161"--> a2
a2 --"p:qualifier/P453"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P21"--> a3
a3 --"p:direct/P279"--> c10
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P21"--> c9
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P21"--> c8
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
bind1[/"min(?publicationDate)"/]
v2 --o bind1
bind1 --as--o v4
bind2[/"year-from-dateTime()"/]
null --o bind2
bind2 --as--o v5