query-017177915d2f2b3ecbc4fda516de764b

rq turtle/ttl

Propertiespublication date (P577)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?game ?date ?statementNodeType ?check0 ?check1 ?check2 ?check3
WHERE
{
    VALUES ?game {
      wd:Q4931588  # no value
      wd:Q1107793  # one value
      wd:Q18857304 # unknown value
      wd:Q2385     # multiple values
      wd:Q23647080 # no property
    }
    OPTIONAL
    {
      ?game      p:P577  ?statementNode
      OPTIONAL { ?statementNode ps:P577  ?date }
      OPTIONAL { ?statementNode rdf:type ?statementNodeType FILTER (?statementNodeType IN (wdno:P577)) }
    }

    BIND(IF(BOUND(?statementNode),true,false)              as ?check0) # property is here?
    BIND(COALESCE(DATATYPE(?date) = xsd:dateTime  , false) as ?check1) # real date?
    BIND(COALESCE((wdno:P577 = ?statementNodeType), false) as ?check2) # no value?
    BIND(COALESCE(isBlank(?date)                  , false) as ?check3) # unknown?
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?check0"):::projected v6("?check1"):::projected v7("?check2"):::projected v8("?check3"):::projected v4("?date"):::projected v1("?game"):::projected v3("?statementNode") v2("?statementNodeType"):::projected bind0[/VALUES ?game/] bind0-->v1 bind00(["wd:Q4931588"]) bind00 --> bind0 bind01(["wd:Q1107793"]) bind01 --> bind0 bind02(["wd:Q18857304"]) bind02 --> bind0 bind03(["wd:Q2385"]) bind03 --> bind0 bind04(["wd:Q23647080"]) bind04 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:P577".-> v3 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:statement/P577".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."a".-> v2 end end bind1[/"if(bound(?statementNode),'true^^xsd:boolean','false^^xsd:boolean')"/] v3 --o bind1 bind1 --as--o v5 bind2[/"?date = 'xsd:dateTime''false^^xsd:boolean'"/] v4 --o bind2 bind2 --as--o v6 bind3[/"'p:novalue/P577' = ?statementNodeType'false^^xsd:boolean'"/] v2 --o bind3 bind3 --as--o v7 bind4[/"isBlank(?date)'false^^xsd:boolean'"/] v4 --o bind4 bind4 --as--o v8