query-46cc7bec447c3f91c537eab23b5e2cb2
Régents de St Marin
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 ?naissance ?nomLabel ?nom1Label ?nom2Label
?pr_nomLabel ?pr_nom1Label ?pr_nom2Label
WHERE {
?item wdt:P39 wd:Q258045.
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
OPTIONAL { ?item wdt:P569 ?naissance. }
OPTIONAL {
?item p:P734 ?nom1_statement.
?nom1_statement a wikibase:BestRank.
?nom1_statement pq:P1545 "1".
?nom1_statement ps:P734 ?nom1.
}
OPTIONAL {
?item p:P734 ?nom2_statement.
?nom2_statement a wikibase:BestRank.
?nom2_statement pq:P1545 "2".
?nom2_statement ps:P734 ?nom2.
}
OPTIONAL {
?item p:P734 ?nom_statement.
?nom_statement a wikibase:BestRank.
?nom_statement ps:P734 ?nom.
FILTER (NOT EXISTS { ?nom_statement pq:P1545 "1". } && NOT EXISTS { ?nom_statement pq:P1545 "2". })
}
OPTIONAL {
?item p:P735 ?pr_nom1_statement.
?pr_nom1_statement a wikibase:BestRank.
?pr_nom1_statement pq:P1545 "1".
?pr_nom1_statement ps:P735 ?pr_nom1.
}
OPTIONAL {
?item p:P735 ?pr_nom2_statement.
?pr_nom2_statement a wikibase:BestRank.
?pr_nom2_statement pq:P1545 "2".
?pr_nom2_statement ps:P735 ?pr_nom2.
}
OPTIONAL {
?item p:P735 ?pr_nom_statement.
?pr_nom_statement a wikibase:BestRank.
?pr_nom_statement ps:P735 ?pr_nom.
FILTER (NOT EXISTS { ?pr_nom_statement pq:P1545 "1". } && NOT EXISTS { ?pr_nom_statement pq:P1545 "2". })
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v4("?naissance"):::projected
v9("?nom")
v6("?nom1")
v5("?nom1_statement")
v8("?nom2")
v7("?nom2_statement")
v2("?nom_statement")
v14("?pr_nom")
v11("?pr_nom1")
v10("?pr_nom1_statement")
v13("?pr_nom2")
v12("?pr_nom2_statement")
v1("?pr_nom_statement")
c13(["wikibase:BestRank"]):::iri
c9(["fr"]):::literal
c5(["wd:Q258045"]):::iri
c2(["1"]):::literal
c3(["2"]):::literal
c7(["bd:serviceParam"]):::iri
v3 --"p:direct/P39"--> c5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P569".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P734".-> v5
v5 --"a"--> c13
v5 --"p:qualifier/P1545"--> c2
v5 --"p:statement/P734"--> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P734".-> v7
v7 --"a"--> c13
v7 --"p:qualifier/P1545"--> c3
v7 --"p:statement/P734"--> v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P734".-> v2
v2 --"a"--> c13
v2 --"p:statement/P734"--> v9
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P735".-> v10
v10 --"a"--> c13
v10 --"p:qualifier/P1545"--> c2
v10 --"p:statement/P735"--> v11
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P735".-> v12
v12 --"a"--> c13
v12 --"p:qualifier/P1545"--> c3
v12 --"p:statement/P735"--> v13
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P735".-> v1
v1 --"a"--> c13
v1 --"p:statement/P735"--> v14
end