query-19e5cfe08befae960a4313e96e3c37e5

rq turtle/ttl

TODO

Use at

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?rating ?date
WHERE 
{
  VALUES ?item {wd:Q4115189}                                     # constrains to sandbox for test - remove
  ?item p:P1087 ?stat. 
  ?stat ps:P1087 ?rating.                                        # useful for debug only - remove
  optional {?stat pq:P585 ?date .}                               # useful for debug only - remove
  filter not exists {?stat prov:wasDerivedFrom [pr:P813 [] ] .}  # does not have retrieved
  filter not exists {?stat prov:wasDerivedFrom [pr:P248 [] ] .}  # does not have stated in
#  filter not exists {?stat prov:wasDerivedFrom [pr:P854 [] ] .}  # does not have reference URL
  filter not exists {?stat prov:wasDerivedFrom [pr:P1440 [] ] .}  # does not have FIDE ID
} limit 5                     # limit for test only

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?date"):::projected v2("?item"):::projected v3("?rating"):::projected v1("?stat") a6((" ")) a4((" ")) a5((" ")) a3((" ")) a1((" ")) a2((" ")) f0[["not "]] subgraph f0e0["Exists Clause"] e0a1 --"p:reference/P1440"--> e0a2 e0v1 --"prov:wasDerivedFrom"--> e0a1 e0v1("?stat"):::projected e0a1((" ")):::projected e0a2((" ")):::projected end f0--EXISTS--> f0e0 f0 --> a1 f0 --> c1 f0 --> a2 f0 --> v1 f0 --> c2 a1 --"p:reference/P1440"--> a2 v1 --"prov:wasDerivedFrom"--> a1 f1[["not "]] subgraph f1e1["Exists Clause"] e1a1 --"p:reference/P248"--> e1a2 e1v1 --"prov:wasDerivedFrom"--> e1a1 e1v1("?stat"):::projected e1a2((" ")):::projected e1a1((" ")):::projected end f1--EXISTS--> f1e1 f1 --> a3 f1 --> c3 f1 --> a4 f1 --> v1 f1 --> c2 a3 --"p:reference/P248"--> a4 v1 --"prov:wasDerivedFrom"--> a3 f2[["not "]] subgraph f2e2["Exists Clause"] e2a1 --"p:reference/P813"--> e2a2 e2v1 --"prov:wasDerivedFrom"--> e2a1 e2v1("?stat"):::projected e2a2((" ")):::projected e2a1((" ")):::projected end f2--EXISTS--> f2e2 f2 --> a5 f2 --> c4 f2 --> a6 f2 --> v1 f2 --> c2 a5 --"p:reference/P813"--> a6 v1 --"prov:wasDerivedFrom"--> a5 bind3[/VALUES ?item/] bind3-->v2 bind30(["wd:Q4115189"]) bind30 --> bind3 v2 --"p:P1087"--> v1 v1 --"p:statement/P1087"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:qualifier/P585".-> v4 end