# This.
@prefix rail:     <http://ontologi.es/rail/vocab#> .
@prefix rf:       <http://ontologi.es/rail/vocab#facilities/> .

# Related.
@prefix geo:      <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix unit:     <http://www.w3.org/2007/ont/unit#> .

# Stock imports.
@prefix cc:       <http://creativecommons.org/ns#> .
@prefix dc:       <http://purl.org/dc/terms/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix foaf:     <http://xmlns.com/foaf/0.1/> .
@prefix link:     <http://www.w3.org/2006/link#> .
@prefix ov:       <http://open.vocab.org/terms/> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos:     <http://www.w3.org/2004/02/skos/core#> .
prefix status:    <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix tio:      <http://purl.org/tio/ns#TransportationService> .
@prefix transit:  <http://vocab.org/transit/terms/> .
@prefix vann:     <http://purl.org/vocab/vann/> .
@prefix vs:       <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix xhv:      <http://www.w3.org/1999/xhtml/vocab#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

rail:
	foaf:isPrimaryTopicOf <http://ontologi.es/rail/vocab> ;
	rdfs:label "Railway-related terms"@en ;
	vann:preferredNamespaceURI rail: ;
	vann:preferredNamespacePrefix "rail" ;
	foaf:maker <http://tobyinkster.co.uk/#i> ;
	foaf:maker <http://dr.jones.dk/foaf#me> ;
	dc:issued "2009-05-11"^^xsd:date ;
	dc:modified "2009-05-12"^^xsd:date ;
	dc:modified "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date ;
	cc:license <http://creativecommons.org/licenses/by-sa/2.0/uk/deed.en_GB> ;
	cc:attributionName "Toby Inkster" ;
	cc:attributionURL <http://ontologi.es/rail/vocab> ;
	ov:exampleResource _:eg1 .

rail:Station
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Station" ;
	rdfs:subClassOf [
		a owl:Class;
		owl:unionOf(
			geo:SpatialThing
			transit:Station
			tio:POI
		)
	] ;
	owl:equivalentClass <http://sw.opencyc.org/2008/06/10/concept/Mx4rv6ZmoZwpEbGdrcN5Y29ycA> ;
	dc:modified "2014-02-19"^^xsd:date .

rail:UKStation
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "UK Station" ;
	rdfs:subClassOf rail:Station .

rail:Route
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Route" ;
	rdfs:comment "A route between train stations, usually corresponding to a physical railway track or set of tracks. One part of the route (which needn't be at the end) is designated its origin. Other points on the route can be given as a positive or negative distance along the route from the origin. (Although this vocabulary doesn't currently have a term to describe it, a particular direction along the route must be defined as positive. If the origin is not at the end of the route, then the opposite direction is defined to be negative.)" ;
	rdfs:subClassOf [
		a owl:Class;
		owl:unionOf(
			geo:SpatialThing
			transit:Route
		)
	] ;
	owl:disjointWith rail:TrainRoute ;
	dc:modified "2014-02-19"^^xsd:date .

rail:RouteWithELR
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Route with ELR" ;
	rdfs:subClassOf rail:Route ;
	rdfs:seeAlso <http://deaves47.users.btopenworld.com/ELRs/ELR0.htm> .

rail:StationPosition
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Station Position" ;
	rdfs:comment "A station's position along a particular route" .

rail:Train
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Train" ;
	owl:equivalentClass tio:TrainService ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:TrainStop
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Train stop" ;
	rdfs:label "A stopping point in time and space for a specific train." ;
	rfds:subClassOf [
		owl:Class ;
		owl:unionOf(
			tio:Stop
			transit:ServiceStop
		)
	] ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:Platform
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Platform" ;
	rdfs:label "A stopping point for trains at a train station." ;
	rdfs:subClassOf [
		a owl:Class;
		owl:unionOf(
			rail:Station
			transit:Stop
		)
	] ;
	owl:disjointWith transit:Station ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:TrainSchedule
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Train schedule" ;
	rdfs:comment "train schedule that applies for one or more routes." ;
	rdfs:subClassOf transit:Schedule ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:serves
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "serves" ;
	rdfs:comment "a place (usually a town or city) served by the station" ;
	rdfs:domain rail:Station ;
	rdfs:range geo:SpatialThing .

rail:is_stop_for
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "i stop for" ;
	rdfs:comment "a specific train stopping at a railway platform" ;
	rdfs:domain rail:Stop ;
	rdfs:range rail:TrainStop ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:has_stop_at
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "i stop for" ;
	rdfs:comment "a railway platform where this train stops" ;
	rdfs:domain rail:TrainStop ;
	rdfs:range rail:Stop ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:has_train_schedule
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "has train schedule" ;
	rdfs:comment "a train schedule for stopping at the station" ;
	rdfs:domain rail:Station ;
	rdfs:range rail:TrainSchedule ;
	status:term_status "unstable" ;
	dc:issued "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:follows_schedule
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "follows schedule" ;
	rdfs:comment "a schedule followed by the train" ;
	rdfs:domain rail:Train ;
	rdfs:range rail:TrainSchedule ;
	status:term_status "unstable" ;
	dc:issued "2014-02-20"^^xsd:date ;

rail:route_followed_by
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "route followed by" ;
	rdfs:comment "specific train using this rail route" ;
	rdfs:domain rail:Route ;
	rdfs:range rail:Train .
	status:term_status "unstable" ;
	dc:issued "2014-02-20"^^xsd:date .

rail:follows_route
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "follows route" ;
	rdfs:comment "rail route followed by a specific train" ;
	rdfs:domain rail:Train ;
	rdfs:range rail:Route ;
	status:term_status "unstable" ;
	dc:issued "2014-02-20"^^xsd:date .

rail:crs
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "CRS code" ;
	rdfs:comment "a three letter Computer Reservation System (CRS) code capable of identifying a UK railway station" ;
	rdfs:subPropertyOf dc:identifier ;
	rdfs:domain rail:UKStation .

rail:nlc
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "national location code" ;
	rdfs:subPropertyOf dc:identifier ;
	rdfs:domain rail:UKStation .

rail:tiploc
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "timing point location code" ;
	rdfs:subPropertyOf dc:identifier ;
	rdfs:domain rail:UKStation .

rail:stanox
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "station number" ;
	rdfs:subPropertyOf dc:identifier ;
	rdfs:domain rail:UKStation .

rail:adjacent
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "adjacent" ;
	rdfs:comment "The two stations occur one after the other along at least one route. This predicate is symmetric. { A rail:adjacent B } => {B rail:adjacent A }." ;
	rdfs:domain rail:Station ;
	rdfs:range rail:Station .

rail:provides
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "provides" ;
	rdfs:domain rail:Station ;
	rdfs:range rf:Generic .

rail:managed_by
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "managed by" ;
	rdfs:domain rail:Station ;
	rdfs:range foaf:Agent .

rail:located_at
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "located at" ;
	rdfs:domain rail:Station ;
	rdfs:range rail:StationPosition .

rail:along_route
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "along route" ;
	rdfs:domain rail:StationPosition .

rail:distance
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "distance" ;
	rdfs:domain rail:StationPosition .

rail:elr
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "engineers' line ref" ;
	rdfs:domain rail:RouteWithELR .

rail:route_origin
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "route origin" ;
	rdfs:domain rail:Route ;
	dc:modified "2014-02-19"^^xsd:date ;
	dc:modified "2014-02-20"^^xsd:date .

rail:stations
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "stations" ;
	rdfs:domain rail:Route ;
	rdfs:range rdf:List .

rail:departures
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "departures information" ;
	rdfs:subPropertyOf foaf:page ;
	rdfs:domain rail:Station ;
	rdfs:range foaf:Document .

rail:arrivals
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "arrivals information" ;
	rdfs:subPropertyOf foaf:page ;
	rdfs:domain rail:Station ;
	rdfs:range foaf:Document .

rail:nearest_station
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "nearest station" ;
	rdfs:comment "The station which is nearest to a thing. Not necessarily closest as the crow flies, but perhaps the easiest to get to." ;
	rdfs:domain geo:SpatialThing ;
	rdfs:range rail:Station .

rail:home_station
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "home station" ;
	rdfs:comment "The station that someone might get off the train at when they're going home." ;
	rdfs:domain foaf:Agent ;
	rdfs:range rail:Station .

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

# Facilities

rf:Generic
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Facility" ;
	rdfs:comment "A facility provided by an organisation or place. This class is not necessarily railway-specific." .

rf:note
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "note" ;
	rdfs:subPropertyOf rdfs:comment ;
	rdfs:domain rf:Generic .

rf:more_info
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "more info" ;
	rdfs:subPropertyOf rdfs:seeAlso ;
	rdfs:domain rf:Generic .

rf:availability
	a rdf:Property ;
	rdfs:isDefinedBy rail: ;
	rdfs:subPropertyOf rf:note ;
	rdfs:label "availability" ;
	rdfs:comment "Note on the availability of a facility, possibly restricting its hours of use." ;
	rdfs:domain rf:Generic .

rf:Staffing
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Staffing" ;
	rdfs:subClassOf rf:Generic .

rf:Information
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Information" ;
	rdfs:subClassOf rf:Generic .

rf:Ticketing
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Ticketing" ;
	rdfs:subClassOf rf:Generic .

rf:Luggage
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Luggage-Related Facility" ;
	rdfs:subClassOf rf:Generic .

rf:LostProperty
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Lost Property Service" ;
	rdfs:subClassOf rf:Luggage .

rf:LeftLuggage
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Left Luggage Service" ;
	rdfs:subClassOf rf:Luggage .

rf:Waiting
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Waiting-related Service" ;
	rdfs:comment "Things to use while waiting (waiting rooms, toilets, eating facilities, etc)." ;
	rdfs:subClassOf rf:Generic .

rf:WaitingRoom
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Waiting Room" ;
	rdfs:subClassOf rf:Waiting .

rf:FirstClassLounge
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "1st Class Lounge" ;
	rdfs:subClassOf rf:WaitingRoom .

rf:WomenOnlyWaitingRoom
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Women-only Waiting Room" ;
	rdfs:subClassOf rf:WaitingRoom .

rf:FoodOutlet
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Food Outlet" ;
	rdfs:subClassOf rf:Waiting .

rf:Toilets
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Toilets" ;
	rdfs:subClassOf rf:Waiting .

rf:BabyChanging
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Baby Changing Facilities" ;
	rdfs:subClassOf rf:Toilets .

rf:Communications
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Communications" ;
	rdfs:subClassOf rf:Generic .

rf:Internet
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Internet" ;
	rdfs:subClassOf rf:Communications .

rf:Wifi
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Public Wi-Fi" ;
	rdfs:subClassOf rf:Internet .

rf:InternetKiosk
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Internet Kiosk / Café" ;
	rdfs:subClassOf rf:Internet .

rf:Postal
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Postal Facility" ;
	rdfs:subClassOf rf:Communications .

rf:Postbox
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Postbox" ;
	rdfs:subClassOf rf:Postal .

rf:PostOffice
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Post Office" ;
	rdfs:subClassOf rf:Postal .

rf:Payphone
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Payphone" ;
	rdfs:subClassOf rf:Communications .

rf:Financial
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Financial Facility" ;
	rdfs:subClassOf rf:Generic .

rf:ATM
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "ATM" ;
	rdfs:comment "'Automatic Teller Machine Machines' ;-)" ;
	rdfs:subClassOf rf:Financial .

rf:BureauDeChange
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Bureau de Change" ;
	rdfs:subClassOf rf:Financial .

rf:Bank
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Banking Facility" ;
	rdfs:subClassOf rf:Financial .

rf:Accessibility
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Accessibility" ;
	rdfs:comment "Facilities related to access for people with disabilities or other particular needs." ;
	rdfs:subClassOf rf:Generic .

rf:Ramps
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Ramps" ;
	rdfs:comment "Ramps for train access" ;
	rdfs:subClassOf rf:Accessibility .

rf:InductionLoop
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Induction Loop" ;
	rdfs:subClassOf rf:Accessibility .

rf:DisabledParking
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Disabled Parking" ;
	rdfs:subClassOf rf:Accessibility , rf:Parking .

rf:TransportFacility
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Transport-Related Facility" ;
	rdfs:subClassOf rf:Generic .

rf:CycleStorage
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Cycle Storage" ;
	rdfs:subClassOf rf:TransportFacility .

rf:Parking
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Parking" ;
	rdfs:subClassOf rf:TransportFacility .

rf:Taxi
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Taxi Rank" ;
	rdfs:subClassOf rf:TransportFacility .

rf:Bus
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Bus Stop" ;
	rdfs:subClassOf rf:TransportFacility .

rf:Tube
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Tube" ;
	rdfs:subClassOf rf:TransportFacility .

rf:Airport
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Airport" ;
	rdfs:subClassOf rf:TransportFacility .

rf:CarHire
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Car Hire" ;
	rdfs:subClassOf rf:TransportFacility .

rf:CycleHire
	a rdfs:Class ;
	rdfs:isDefinedBy rail: ;
	rdfs:label "Cycle Hire" ;
	rdfs:subClassOf rf:TransportFacility .

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

# Example usage

_:eg1
	a rail:Station ;
	rdfs:label "Arlesburgh West station" ;
	rail:serves [ rdfs:label "West Arlesburgh" ] ;
	rail:provides [
		a rf:Staffing ;
		rdfs:comment "The Fat Controller is very helpful."
		] ;
	rail:located_at [
		a rail:StationPosition ;
		rail:distance [ unit:m 12500 ] ;
		rail:along_route [
			a rail:Route ;
			rdfs:label "North Western Railway"
			] ;
		] .

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
