query-a923990945b7656dc3fe5a4a26b6adcd

rq turtle/ttl

Artists with unknown dod but properties with end/start time qualifiers to detect life signs 11:14, 26 May 2020 (UTC)) talk (HannolansI want a query that detects humans with any start and end time as qualifier in the properties to detect lifesigns for an artist. For example, I want artists that have a statement residence Amsterdam from 2009 untill 2010. I need this to itereate through such collection to check the lates life sign. Below the query I currently use, it takes all human within museum collections with properties residence and working place. But this still doesnt include the property spouse for example. Also, the collection is too broad as I doesn't include humans without qualifier start/endtime. So instead, I would like to check all humans within collection with start/end time qualifiers for any statement. --

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?item ?authorLabel ?timeprecision (YEAR(?dob) as ?year)
WHERE {
  ?item wdt:P31 wd:Q5 .
  ?item wdt:P6379 ?collection. #in a collection
#  ?item wdt:P6379 wd:Q17153751.
  {?item wdt:P937 ?werklocatie}#has a work location
        UNION
  {?item wdt:P108 ?employer}#or an employer
        UNION
  {?item wdt:P551 ?woonplaats}#or living place
#  ?item wdt:P6379 ?institution .
#  ?institution wdt:P17 ?country.#  country
#  ?country wdt:P463 wd:Q458. # member EU
  FILTER NOT EXISTS { ?item wdt:P7763 [] } .#no copyright status
  FILTER NOT EXISTS { ?item wdt:P570 [] }.  #no dod
  FILTER NOT EXISTS { ?item wdt:P1317 [] } .#no floruit
#  ?item     p:P569/psv:P569 ?timenode.
#  ?timenode wikibase:timePrecision     ?timeprecision.
#  FILTER(?timeprecision > 8) #only year or better precision
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?collection") v4("?employer") v1("?item"):::projected v3("?werklocatie") v5("?woonplaats") v6("?year") a3((" ")) a2((" ")) a1((" ")) c5(["wd:Q5"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P1317"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 v1 --"p:direct/P1317"--> a1 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:direct/P570"--> e1a1 e1v1("?item"):::projected e1a1((" ")):::projected end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c2 f1 --> a2 v1 --"p:direct/P570"--> a2 f2[["not "]] subgraph f2e2["Exists Clause"] e2v1 --"p:direct/P7763"--> e2a1 e2v1("?item"):::projected e2a1((" ")):::projected end f2--EXISTS--> f2e2 f2 --> v1 f2 --> c3 f2 --> a3 v1 --"p:direct/P7763"--> a3 v1 --"p:direct/P31"--> c5 v1 --"p:direct/P6379"--> v2 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; v1 --"p:direct/P551"--> v5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P108"--> v4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P937"--> v3 end union0r <== or ==> union0l end bind3[/"year-from-dateTime(?dob)"/] null --o bind3 bind3 --as--o v6