This query page is designed to help you test the citybikes SPARQL protocol endpoint. Examples of queries on static data, dynamic data (observations), and on the combination ob both types of data, are presented.
SPARQL Query examples
Example 1: Museums that are near a given bike station in the city of León, and city travel guides.
Show SPARQL code
Example 1: Museums that are near a given bike station in the city of León, and city travel guides.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX bicy: <http://transporte.linkeddata.es/ontology/>
PREFIX geo: <http://www.geonames.org/ontology#>
PREFIX v: <http://www.w3.org/2006/vcard/ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
select ?est ?mus ?gui
WHERE
{?a rdf:type bicy:BikeStation .
?a bicy:isStationOf <http://transporte.linkeddata.es/id/BikeSystem/44> .
?a dcterms:identifier "6"^^<http://www.w3.org/2001/XMLSchema#string> .
?a bicy:nameStation ?est .
?a geo:nearby ?s .
?s v:org ?o .
?o foaf:name ?mus .
<http://transporte.linkeddata.es/id/BikeSystem/44> geo:nearby ?gui
}
Hide SPARQL code |
Copy SPARQL code to Query Text Area
Example 2: Restaurants that are nearby a given bike station in Zaragoza, and their quality (number of "forks").
Show SPARQL code
Example 2: Restaurants that are nearby a given bike station in Zaragoza, and their quality (number of "forks").
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX bicy: <http://transporte.linkeddata.es/ontology/>
PREFIX geo: <http://www.geonames.org/ontology#>
PREFIX v: <http://www.w3.org/2006/vcard/ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX j.0: <http://www.loa-cnr.it/ontologies/DOLCE-Lite#>
select ?est ?rest ?ten
WHERE
{?a rdf:type bicy:BikeStation .
?a bicy:isStationOf <http://transporte.linkeddata.es/id/BikeSystem/4> .
?a dcterms:identifier "6"^^<http://www.w3.org/2001/XMLSchema#string> .
?a bicy:nameStation ?est .
?a geo:nearby ?s .
?s rdfs:label ?rest .
OPTIONAL {?s j.0:has-quality ?ten}
}
Hide SPARQL code |
Copy SPARQL code to Query Text Area
Example 3: Bike stations that are nearby a given museum in the city of León and city travel guides.
Show SPARQL code
Example 3: Bike stations that are nearby a given museum in the city of León and city travel guides.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.geonames.org/ontology#>
PREFIX v: <http://www.w3.org/2006/vcard/ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX bicy: <http://transporte.linkeddata.es/ontology/>
select ?est ?mus ?gui
WHERE
{?mus rdf:type v:VCard .
?mus v:fn "Museo de la Real Colegiata de San Isidoro" .
?a geo:nearby ?mus .
?a rdf:type bicy:BikeStation .
?a bicy:isStationOf <http://transporte.linkeddata.es/id/BikeSystem/44> .
?a bicy:nameStation ?est .
<http://transporte.linkeddata.es/id/BikeSystem/44> geo:nearby ?gui
}
Hide SPARQL code |
Copy SPARQL code to Query Text Area
Further information about SPARQL Query Language for RDF