Giter Site home page Giter Site logo

enroute-mobi / netex-cli-validator Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 0.0 7 KB

Command line validator for NeTEx files

Home Page: https://enroute.mobi/produits/chouette/

License: Apache License 2.0

Ruby 100.00%
netex public-transportation transit-data transit ruby

netex-cli-validator's Introduction

What is a NeTEX file ?

NeTEx (Network Exchange) is a reference format for data exchange, collective transport, defined at European level. It provides a description of network topology, schedules, pricing datas and access to information services.

A NeTEx file is simply a unique or group of XML files, that must be compliant with a (complete) XSD schema.  

For French readers, you’ll find a lot of resources on this page.

You can read the European NeTEx profil which gives a good overview on what can contain a NeTEx file here.

Install

git clone --recurse-submodules https://github.com/af83/netex-cli-validator.git
gem install bundler
bundle install

Validate a file

We benefit from the amazing work performed by the NeTEx CEN team. They maintain an uptodate and living XSD in their GitHub repository : https://github.com/NeTEx-CEN/NeTEx. They provide both an XSD of NeTEx format and a large set of examples.

Our internal tool uses their XSD to valid a given NeTEx file. This simple command line tool in Ruby will give you a direct feedback of your XML file :

$ bundle exec ruby netex-cli-validator.rb netex_full20190212.xml
1060:27: ERROR: Element '{http://www.netex.org.uk/netex}CompanyCode': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}validityConditions, {http://www.netex.org.uk/netex}ValidBetween, {http://www.netex.org.uk/netex}alternativeTexts, {http://www.netex.org.uk/netex}keyList, {http://www.netex.org.uk/netex}Extensions, {http://www.netex.org.uk/netex}BrandingRef, {http://www.netex.org.uk/netex}PublicCode, {http://www.netex.org.uk/netex}PrivateCode, {http://www.netex.org.uk/netex}CompanyNumber, {http://www.netex.org.uk/netex}ExternalOperatorRef ).
1078:22: ERROR: Element '{http://www.netex.org.uk/netex}stopPlaces': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}validityConditions, {http://www.netex.org.uk/netex}ValidBetween, {http://www.netex.org.uk/netex}alternativeTexts, {http://www.netex.org.uk/netex}keyList, {http://www.netex.org.uk/netex}Extensions, {http://www.netex.org.uk/netex}BrandingRef, {http://www.netex.org.uk/netex}Name, {http://www.netex.org.uk/netex}Description, {http://www.netex.org.uk/netex}TypeOfFrameRef, {http://www.netex.org.uk/netex}BaselineVersionFrameRef ).
38934:84: ERROR: Element '{http://www.netex.org.uk/netex}LineRef': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}DirectionRef, {http://www.netex.org.uk/netex}pointsInSequence, {http://www.netex.org.uk/netex}InverseRouteRef ).
38998:28: ERROR: Element '{http://www.netex.org.uk/netex}stopAssignements': This element is not expected. Expected is one of ( {http://www.netex.org.uk/netex}serviceLinks, {http://www.netex.org.uk/netex}servicePatterns, {http://www.netex.org.uk/netex}stopAreas, {http://www.netex.org.uk/netex}connections, {http://www.netex.org.uk/netex}tariffZones, {http://www.netex.org.uk/netex}stopAssignments, {http://www.netex.org.uk/netex}timingPoints, {http://www.netex.org.uk/netex}timingLinks, {http://www.netex.org.uk/netex}timingPatterns, {http://www.netex.org.uk/netex}journeyPatterns ).

netex-cli-validator's People

Contributors

ldonnet avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.