-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloweringTemplate.vm
37 lines (36 loc) · 2.15 KB
/
loweringTemplate.vm
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
stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,stop_timezone,wheelchair_boarding,level_id,platform_code
#set ( $prefixes = "
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rev: <http://purl.org/stuff/rev#>
PREFIX gtfs: <http://vocab.gtfs.org/terms#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX schema: <http://schema.org/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rml: <http://semweb.mmlab.be/ns/rml#>
PREFIX ql: <http://semweb.mmlab.be/ns/ql#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
" )
#set ( $stop = "SELECT *
WHERE {
?s a gtfs:Stop ;
dct:identifier ?stop_id .
OPTIONAL{ ?s gtfs:code ?stop_code . }
OPTIONAL{ ?s foaf:name ?stop_name . }
OPTIONAL{ ?s dct:description ?stop_desc . }
OPTIONAL{ ?s geo:lat ?stop_lat . }
OPTIONAL{ ?s geo:long ?stop_lon . }
OPTIONAL{ ?s gtfs:zone ?zone_id . }
OPTIONAL{ ?s foaf:page ?stop_url . }
OPTIONAL{ ?s gtfs:locationType ?location_type . }
OPTIONAL{ ?s gtfs:timeZone ?stop_timezone . }
OPTIONAL{ ?s gtfs:wheelchairAccessible ?wheelchair_boarding . }
OPTIONAL{ ?s gtfs:parentStation ?parent_station . }
}" )
#set( $queryStop = "$prefixes$stop" )
#set( $stops = $reader.getDataframe($queryStop) )
#set( $setPrefix = $functions.setPrefix("https://www.cefriel.com/data/"))
#if(!$stops.isEmpty())#foreach($s in $stops)#if($s.stop_id)$s.stop_id#end,#if($s.stop_code)$s.stop_code#end,#if($s.stop_name)$s.stop_name#end,#if($s.stop_desc)$s.stop_desc#end,#if($s.stop_lat)$s.stop_lat#end,#if($s.stop_lon)$s.stop_lon#end,#if($s.zone_id)$s.zone_id#end,#if($s.stop_url)$s.stop_url#end,#if($s.location_type)$functions.sp($s.location_type,'resource/LocationType/')#end,#if($s.parent_station)$functions.rp($s.parent_station)#end,#if($s.stop_timezone)$s.stop_timezone#end,#if($s.wheelchair_boarding)$functions.sp($s.wheelchair_boarding,'/resource/WheelchairBoardingStatus/')#end,,$functions.newline()#end#end