query-b84c2bf055bada88a6ae4bee6219297e
Constraint with an complicated exception 18:01, 12 January 2017 (UTC)) talk (Innocent bystander startdate:2015-12-31" have an automatic exception from this constraint? Statistics Sweden has not provided us with any "names" of new entities. -- (Q14839548)minor locality in Sweden Would it be possible to modify the P1448-constraint for P776, so that those who have "P31:
Use at
- https://query.wikidata.org/sparql
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 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 DISTINCT ?item ?itemLabel ?n
{
?item wdt:P776 ?value .
FILTER NOT EXISTS { ?item wdt:P1448 [] } .
OPTIONAL { ?item p:P31 [ ps:P31 wd:Q14839548; pq:P580 ?n ] }
FILTER ( !BOUND(?n) \u007C\u007C ?n < "2015-12-31T00:00:00Z"^^xsd:dateTime )
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?n"):::projected
v3("?value")
a1((" "))
a2((" "))
c9(["bd:serviceParam"]):::iri
c11(["sv,en"]):::literal
c5(["wd:Q14839548"]):::iri
f0[["(not bound(?n) || ?n < '2015-12-31T00:00:00Z^^xsd:dateTime')"]]
f0 --> v1
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0v1 --"p:direct/P1448"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f1--EXISTS--> f1e0
f1 --> v2
f1 --> c2
f1 --> a1
v2 --"p:direct/P1448"--> a1
v2 --"p:direct/P776"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
a2 -."p:statement/P31".-> c5
a2 --"p:qualifier/P580"--> v1
v2 --"p:P31"--> a2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end