Name: gtfs-csv2rdf
Owner: Ontology Engineering Group (UPM)
Description: Mapping script which transforms GTFS CSV into GTFS RDF
Forked from: OpenTransport/gtfs-csv2rdf
Created: 2015-05-04 12:46:17.0
Updated: 2015-05-04 12:46:18.0
Pushed: 2014-10-27 19:23:09.0
Homepage: null
Size: 264
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Mapping script which transforms GTFS CSV into GTFS RDF
Requirements:
Install using npm install
rst argument: path to gtfs
cond argument: the version of the feed
ird argument: the base URI
fs-csv2rdf path-to-gtfs.zip 0.1 http://data.gtfs.org/ > gtfsintriples.ttl
By example:
fs = require('fs');
N3 = require('n3');
gtfscsv2rdf = require('./lib/gtfs-csv2rdf.js');
path = "/path/to/gtfs.zip";
/(.*\/)?(.*?)\.zip/.exec(path)) {
r feedname = /(.*\/)?(.*?)\.zip/.exec(path)[2];
se {
row "Not a zip file: " + path;
eate the writer of turtle file towards stdout
streamWriter = new N3.StreamWriter({ 'gtfs': 'http://vocab.gtfs.org/terms#',
'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'foaf' : 'http://xmlns.com/foaf/0.1/',
'dct' : 'http://purl.org/dc/terms/',
'rdfs' : 'http://www.w3.org/2000/01/rdf-schema#',
'owl' : 'http://www.w3.org/2002/07/owl#',
'xsd' : 'http://www.w3.org/2001/XMLSchema#',
'vann' : 'http://purl.org/vocab/vann/',
'skos' : 'http://www.w3.org/2004/02/skos/core#',
'dcat' : 'http://www.w3.org/ns/dcat#'});
amWriter.pipe(process.stdout);
options = {
edname : feedname,
rsion : "0.1",
seuri : "http://data.gtfs.org/"
csv2rdf(fs.createReadStream(path), streamWriter, options);