query-276cd63c7a94c791449d55efb7082d85

rq turtle/ttl

Query to check the shape of the 10-digit PSGC SELECT ?barangay ?barangayLabel ?rank ?psgc ?startTime ?endTime ?refUrl ?refDate WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?barangay wdt:P31 wd:Q61878; wdt:P131 wd:Q17176. ?barangay p:P988 ?psgcNode. ?psgcNode wikibase:rank ?rank. ?psgcNode ps:P988 ?psgc. OPTIONAL { ?psgcNode pq:P580 ?startTime } OPTIONAL { ?psgcNode pq:P582 ?endTime } ?psgcNode prov:wasDerivedFrom ?refNode. ?refNode pr:P854 ?refUrl. ?refNode pr:P813 ?refDate. }

Use at

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 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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Query to check the shape of the 10-digit PSGC
SELECT ?barangay ?barangayLabel ?rank ?psgc ?startTime ?endTime ?refUrl ?refDate WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?barangay wdt:P31 wd:Q61878;
    wdt:P131 wd:Q17176.
  ?barangay p:P988 ?psgcNode.
  ?psgcNode wikibase:rank ?rank.
  ?psgcNode ps:P988 ?psgc.
  OPTIONAL { ?psgcNode pq:P580 ?startTime }
  OPTIONAL { ?psgcNode pq:P582 ?endTime }
  ?psgcNode prov:wasDerivedFrom ?refNode.
  ?refNode pr:P854 ?refUrl.
  ?refNode pr:P813 ?refDate.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?barangay"):::projected v6("?endTime"):::projected v4("?psgc"):::projected v2("?psgcNode") v3("?rank"):::projected v9("?refDate"):::projected v7("?refNode") v8("?refUrl"):::projected v5("?startTime"):::projected c8(["wd:Q17176"]):::iri c6(["wd:Q61878"]):::iri c2(["bd:serviceParam"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"p:direct/P31"--> c6 v1 --"p:direct/P131"--> c8 v1 --"p:P988"--> v2 v2 --"wikibase:rank"--> v3 v2 --"p:statement/P988"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P580".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P582".-> v6 end v2 --"prov:wasDerivedFrom"--> v7 v7 --"p:reference/P854"--> v8 v7 --"p:reference/P813"--> v9