query-87295b41688f657346ef4c69ec437ca8

rq turtle/ttl

. limited number of external sourcesThe SPARQL service can also include data retrieved from a : (P3120)TOID but no (P836)GSS code (2011) from the UK Ordnance Survey for items that have a (P3120)TOID For example, the following query tries to find a value for Federated Queries

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?gss ?os_toid WHERE {
    ?item p:P836 ?gss_stmt .
    ?gss_stmt ps:P836 ?gss .
    FILTER NOT EXISTS { ?gss_stmt pq:P582 [] } .
    FILTER NOT EXISTS { ?item wdt:P3120 [] } .

    SERVICE <http://data.ordnancesurvey.co.uk/datasets/os-linked-data/apis/sparql> {
      ?os_toid <http://data.ordnancesurvey.co.uk/ontology/admingeo/gssCode> ?gss
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?gss"):::projected v2("?gss_stmt") v1("?item"):::projected v4("?os_toid"):::projected a2((" ")) a1((" ")) c8(["bd:serviceParam"]):::iri c10(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P3120"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 v1 --"p:direct/P3120"--> a1 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:qualifier/P582"--> e1a1 e1v1("?gss_stmt"):::projected e1a1((" ")):::projected end f1--EXISTS--> f1e1 f1 --> v2 f1 --> c2 f1 --> a2 v2 --"p:qualifier/P582"--> a2 v1 --"p:P836"--> v2 v2 --"p:statement/P836"--> v3 subgraph s1["http://data.ordnancesurvey.co.uk/datasets/os-linked-data/apis/sparql"] style s1 stroke-width:4px; v4 --http://data.ordnancesurvey.co.uk/ontology/admingeo/gssCode--> v3 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c8 --"wikibase:language"--> c10 end