-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.txt
40 lines (36 loc) · 1.79 KB
/
query.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PREFIX trip-onto: <http://journeyStar.dhlab.ch/ontology/trip-onto#>
PREFIX schema: <https://schema.org/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdp: <http://www.wikidata.org/prop/>
PREFIX wdps: <http://www.wikidata.org/prop/statement/value/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?startWikiIri ?startLat ?startLong ?endWikiIri ?endLat ?endLong ?startDate ?endDate ?Transportation
WHERE {
?journey a trip-onto:Journey .
BIND(<http://rdfh.ch/0801/gc5ay-xFTvm3nDeCnpLPWw> AS ?entryIRI)
BIND (<< ?person trip-onto:hasJourney ?journey>> AS ?journeyTriple)
?journeyTriple trip-onto:mentionedIn ?entryIRI .
?journeyTriple trip-onto:hasStage ?stage .
BIND(<<?journeyTriple trip-onto:hasStage ?stage>> AS ?stageTriple)
?stage trip-onto:hasStartLocation ?FromLocation .
?FromLocation trip-onto:hasWikiLink ?startWikiIri .
?stageTriple trip-onto:hasEndDate ?endDate .
?stageTriple trip-onto:hasStartDate ?startDate .
?stage trip-onto:hasDestination ?ToLocation .
?ToLocation trip-onto:hasWikiLink ?endWikiIri .
?stage trip-onto:meanOfTransportation ?meanOfTransportation .
?meanOfTransportation schema:name ?Transportation .
OPTIONAL{
SERVICE <https://query.wikidata.org/sparql> {
?startWikiIri wdp:P625 ?coordinate_start.
?coordinate_start wdps:P625 ?coordinate_node_start.
?coordinate_node_start wikibase:geoLongitude ?startLong.
?coordinate_node_start wikibase:geoLatitude ?startLat.
?endWikiIri wdp:P625 ?coordinate_end .
?coordinate_end wdps:P625 ?coordinate_node_end.
?coordinate_node_end wikibase:geoLongitude ?endLong.
?coordinate_node_end wikibase:geoLatitude ?endLat.
}
}