query-ac763deb8ce85fab73ec30b460d6a908
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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?taille ?item ?naissance ?date ?P585test#
WHERE
{
#VALUES ?item {wd:Q112988605}
?item wdt:P31 wd:Q5 ;
wdt:P569 ?naissance ;
p:P2048 ?t .
?t psn:P2048 ?tm ; #unité SI
rdf:type wikibase:BestRank .
optional {?t pq:P585 ?date.}
?tm wikibase:quantityAmount ?taille .
?tm wikibase:quantityUnit ?unit.
FILTER (?taille < 1) #moins de 1 mètre
BIND(YEAR(NOW()) AS ?year)
BIND(IF(!BOUND(?date),?year,YEAR(?date)) as ?P585test)
FILTER (?year - YEAR(?naissance) >= 18) #au moins 18 ans
FILTER (?P585test - YEAR(?naissance) >= 18) #donnée à au moins 18 ans}
minus {?item wdt:P31 wd:Q190 .} #pas un-e dieu|déesse
minus {VALUES ?item {wd:Q15397819} } #bac à sable
}
ORDER BY (?taille)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?P585test"):::projected
v8("?date"):::projected
v10("?item"):::projected
v3("?naissance"):::projected
v6("?t")
v1("?taille"):::projected
v7("?tm")
v9("?unit")
v10("?year")
c13(["wd:Q190"]):::iri
c9(["wikibase:BestRank"]):::iri
c4(["wd:Q5"]):::iri
f0[["?P585test - year-from-dateTime(?naissance) >= '18^^xsd:integer'"]]
f0 --> v10
f0 --> v3
f1[["?year - year-from-dateTime(?naissance) >= '18^^xsd:integer'"]]
f1 --> v10
f1 --> v3
f2[["?taille < '1^^xsd:integer'"]]
f2 --> v1
v10 --"p:direct/P31"--> c4
v10 --"p:direct/P569"--> v3
v10 --"p:P2048"--> v6
v6 --"p:statement/value-normalized/P2048"--> v7
v6 --"a"--> c9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P585".-> v8
end
v7 --"wikibase:quantityAmount"--> v1
v7 --"wikibase:quantityUnit"--> v9
bind3[/"year-from-dateTime(NOW())"/]
bind3 --as--o v10
bind4[/"if(not bound(?date),?year,year-from-dateTime(?date))"/]
v8 --o bind4
v10 --o bind4
bind4 --as--o v10
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v10 --"p:direct/P31"--> c13
end
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
bind7[/VALUES ?item/]
bind7-->v10
bind70(["wd:Q15397819"])
bind70 --> bind7
end