query-df8f19ac41f03b739ef8b785d9ea3110

rq turtle/ttl

Geogast

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?ref_prop ?ref_propLabel ?ref_value ?ref_valueLabel
WHERE
{
  ?item wdt:P31 wd:Q55488 . # Item is railway station
  ?item p:P131 ?statement .
  ?statement ps:P131 wd:Q174 . # in São Paulo
  ?statement prov:wasDerivedFrom ?source .
  ?source ?ref_predicate ?ref_value .
  ?ref_prop wikibase:reference ?ref_predicate .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,pt " . }            
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v4("?ref_predicate") v6("?ref_prop"):::projected v5("?ref_value"):::projected v3("?source") v2("?statement") c9(["bd:serviceParam"]):::iri c5(["wd:Q174"]):::iri c2(["wd:Q55488"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en,pt "]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:P131"--> v2 v2 --"p:statement/P131"--> c5 v2 --"prov:wasDerivedFrom"--> v3 v3 -->v4--> v5 v6 --"wikibase:reference"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end