oeg-upm/gtfs-csv2rdf

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

gtfs-csv2rdf

Mapping script which transforms GTFS CSV into GTFS RDF

Use

Requirements:

Install using npm install

Command Line
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
As a nodejs library

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);

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.