query-52a714395975859317fe401a417828b5
TODO
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?fr_male ?fr_female ?de_male ?de_female ?da {
?item wdt:P31 wd:Q3624078 .
VALUES ?male_val { wd:Q6581097 wd:Q499327 } .
VALUES ?female_val { wd:Q6581072 wd:Q1775415 } .
?item p:P1549 ?fr_male_statement; p:P1549 ?fr_female_statement .
?fr_male_statement (pq:P366|pq:P518) ?male_val; ps:P1549 ?fr_male .
?fr_female_statement (pq:P366|pq:P518) ?female_val; ps:P1549 ?fr_female .
FILTER( LANG( ?fr_male ) = 'fr' && LANG( ?fr_female ) = 'fr' ) .
MINUS { ?fr_male_statement (pq:P366|pq:P518) wd:Q146786 } .
MINUS { ?fr_female_statement (pq:P366|pq:P518) wd:Q146786 } .
OPTIONAL {
?item p:P1549 ?de_male_statement; p:P1549 ?de_female_statement .
?de_male_statement (pq:P366|pq:P518) ?male_val; ps:P1549 ?de_male .
?de_female_statement (pq:P366|pq:P518) ?female_val; ps:P1549 ?de_female .
FILTER( LANG( ?de_male ) = 'de' && LANG( ?de_female ) = 'de' ) .
MINUS { ?de_male_statement (pq:P366|pq:P518) wd:Q146786 } .
MINUS { ?de_female_statement (pq:P366|pq:P518) wd:Q146786 } .
} .
OPTIONAL {
?item p:P1549 ?da_statement .
?da_statement ps:P1549 ?da .
FILTER( LANG( ?da ) = 'da' ) .
MINUS { ?da_statement (pq:P366|pq:P518) wd:Q146786 } .
} .
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v12("?da"):::projected
v13("?da_statement")
v9("?de_female"):::projected
v11("?de_female_statement")
v8("?de_male"):::projected
v10("?de_male_statement")
v5("?female_val")
v2("?fr_female"):::projected
v7("?fr_female_statement")
v1("?fr_male"):::projected
v6("?fr_male_statement")
v3("?item"):::projected
v4("?male_val")
c8(["wd:Q146786"]):::iri
c1(["fr"]):::literal
c3(["wd:Q3624078"]):::iri
c12(["bd:serviceParam"]):::iri
f0[["?fr_male = 'fr'?fr_female = 'fr'"]]
f0 --> v1
f0 --> v2
v3 --"p:direct/P31"--> c3
bind1[/VALUES ?male_val/]
bind1-->v4
bind10(["wd:Q6581097"])
bind10 --> bind1
bind11(["wd:Q499327"])
bind11 --> bind1
bind2[/VALUES ?female_val/]
bind2-->v5
bind20(["wd:Q6581072"])
bind20 --> bind2
bind21(["wd:Q1775415"])
bind21 --> bind2
v3 --"p:P1549"--> v6
v3 --"p:P1549"--> v7
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v6 --"p:qualifier/P518"--> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v6 --"p:qualifier/P366"--> v4
end
union0r <== or ==> union0l
end
v6 --"p:statement/P1549"--> v1
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v7 --"p:qualifier/P518"--> v5
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:qualifier/P366"--> v5
end
union1r <== or ==> union1l
end
v7 --"p:statement/P1549"--> v2
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v6 --"p:qualifier/P518"--> c8
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v6 --"p:qualifier/P366"--> c8
end
union2r <== or ==> union2l
end
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
v7 --"p:qualifier/P518"--> c8
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v7 --"p:qualifier/P366"--> c8
end
union3r <== or ==> union3l
end
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
f5[["?de_male = 'de'?de_female = 'de'"]]
f5 --> v8
f5 --> v9
v3 -."p:P1549".-> v10
v3 --"p:P1549"--> v11
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
v10 --"p:qualifier/P518"--> v4
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v10 --"p:qualifier/P366"--> v4
end
union4r <== or ==> union4l
end
v10 --"p:statement/P1549"--> v8
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
v11 --"p:qualifier/P518"--> v5
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v11 --"p:qualifier/P366"--> v5
end
union5r <== or ==> union5l
end
v11 --"p:statement/P1549"--> v9
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
subgraph union6[" Union "]
subgraph union6l[" "]
style union6l fill:#abf,stroke-dasharray: 3 3;
v10 --"p:qualifier/P518"--> c8
end
subgraph union6r[" "]
style union6r fill:#abf,stroke-dasharray: 3 3;
v10 --"p:qualifier/P366"--> c8
end
union6r <== or ==> union6l
end
end
subgraph minus7["MINUS"]
style minus7 stroke-width:6px,fill:pink,stroke:red;
subgraph union7[" Union "]
subgraph union7l[" "]
style union7l fill:#abf,stroke-dasharray: 3 3;
v11 --"p:qualifier/P518"--> c8
end
subgraph union7r[" "]
style union7r fill:#abf,stroke-dasharray: 3 3;
v11 --"p:qualifier/P366"--> c8
end
union7r <== or ==> union7l
end
end
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
f8[["?da = 'da'"]]
f8 --> v12
v3 -."p:P1549".-> v13
v13 --"p:statement/P1549"--> v12
subgraph minus9["MINUS"]
style minus9 stroke-width:6px,fill:pink,stroke:red;
subgraph union8[" Union "]
subgraph union8l[" "]
style union8l fill:#abf,stroke-dasharray: 3 3;
v13 --"p:qualifier/P518"--> c8
end
subgraph union8r[" "]
style union8r fill:#abf,stroke-dasharray: 3 3;
v13 --"p:qualifier/P366"--> c8
end
union8r <== or ==> union8l
end
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c1
end