Skip to content

ssproessig/tinkerpop-rest

Repository files navigation

TinkerPop REST API

A sample implementation of

  • parsing a railML 3.1 file to a TinkerGraph
  • and providing a REST API to query the graph again.

API provided

See Swagger UI opening the application in the browser.

Hints

railML 3.1 used

You can use the environment variable RAILML_TO_LOAD to point the application to a local resource using file:///... schema.

If nothing is configured the application defaults to loading the official railML 3.1 sample.

Fixing "SunCertPathBuilderException" when loading the official railML 3.1 sample

How to solve the exception sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

The official railML 3.1 sample is provided via https://. It may be that your Java keystore does not yet trust the intermediate CA certificate used to sign *.railml.org.

To fix this:

  • use your browser to open the link
  • view the certificate chain used
  • export e.g. the missing AlphaSSL CA - SHA256 - G2 to alphassl_ca_SHA256_G2.cer file (using DER encoded binary)
  • import the certificate into your JREs default keystore (default password is changeit)
> keytool -import -keystore c:\_\jdk1.8.0_202\jre\lib\security\cacerts -file e:\temp\alphassl_ca_SHA256_G2.cer

Graph created

The graph created from parsing the railML file is persisted to the temporary directory as GraphML file named current_railML_import.graphml.

Viewing the graph created

  • Download Gephi for your platform

  • open the GraphML file created

  • configure the visualization

    • Layout tool window: use a layouting algorithm like Yifan Hu Proportional layouting settings

    • Appearance tool window:

      • color Nodes by configuring Partition by labelV

        nodes appearance

      • color Edges by configuring Partition to labelE

        edges appearance

    • configure Graph view

      • activate Show Node labels

        graph configuration

      • use extId as Label text

        use extId as Label text

  • this results in the sample graph showing /railML/infrastructure/topology with the information

    • network called nw01 with network/level called lv0 (micro level),
    • highlighting some netElement entries prefixed with ne_ and some netRelation prefixed with nr_

    sample graph

About

Tinkerpop REST API for railML 3x files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages