query-464a4d67c640cca826eaaf50683ffe0a
Propertiespublication date (P577)
Use at
- https://query.wikidata.org/sparql
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 ?check1 ?check2 ?check3
WHERE
{
VALUES ?game {
wd:Q4931588 # no value
wd:Q1107793 # one value
wd:Q18857304 # unknown value
wd:Q2385 # multiple values
}
?game p:P577 ?statementNode.
OPTIONAL
{
?statementNode ps:P577 ?date.
}
OPTIONAL
{
?statementNode rdf:type ?statementNodeType FILTER (?statementNodeType IN (wdno:P577)).
}
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) # unkown?
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?check1"):::projected
v6("?check2"):::projected
v7("?check3"):::projected
v4("?date"):::projected
v2("?game"):::projected
v3("?statementNode")
v1("?statementNodeType"):::projected
bind0[/VALUES ?game/]
bind0-->v2
bind00(["wd:Q4931588"])
bind00 --> bind0
bind01(["wd:Q1107793"])
bind01 --> bind0
bind02(["wd:Q18857304"])
bind02 --> bind0
bind03(["wd:Q2385"])
bind03 --> bind0
v2 --"p:P577"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:statement/P577".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."a".-> v1
end
bind1[/"?date = 'xsd:dateTime''false^^xsd:boolean'"/]
v4 --o bind1
bind1 --as--o v5
bind2[/"'p:novalue/P577' = ?statementNodeType'false^^xsd:boolean'"/]
v1 --o bind2
bind2 --as--o v6
bind3[/"isBlank(?date)'false^^xsd:boolean'"/]
v4 --o bind3
bind3 --as--o v7