Home

Awesome

Chimera Tutorial

The chimera-tutorial project offers a complete example to easily understand how to develop semantic data transformation pipelines using the Chimera framework.

TL;DR

  1. Launch the chimera-tutorial pipelines with Docker
docker run -p 8888:8888 cefriel/chimera:tutorial
  1. Run the routes described in the Tutorial Routes to invoke the endpoints: (i) import the Postman collection, or (ii) run the tutorial.sh script with one of the following arguments: lift, liftConstruct, roundtrip, roundtripAdd, roundtripInference, roundtripTemplate. Each argument refers to one of the routes presented in section Tutorial Routes. When using the included Postman collection remember to set the Body for each request to the file sample-gtfs-feed.zip

Chimera Route Components

The Chimera project specifies three different components.

  1. The Chimera Graph Component

    The Chimera Graph Component specifies several operations that act on RDF Graphs.

  2. The RML Component

    Allows conversions from an input representation to an output representation through RML mappings.

  3. The Mapping Template Component

    Allows conversions from an input representation to an output representation through Apache Velocity Templates (VTL).

These components and related operations are explained in section Chimera components and configuration.

Tutorial Routes

This tutorial presents several Chimera routes, each one making use of the various Chimera Apache Camel components defined by the Chimera Framework. Routes are defined in file chimera-routes.xml.

<p align="left"><img src="img/chimera-tutorial-routes.png" alt="Chimera tutorial routes" width="1000"></p>

Each route uses a sample GTFS feed as input and the Linked GTFS vocabulary as the reference ontology.

Chimera components and configuration

This section contains a brief overview of all the Chimera Components that are used in the presented routes alongside snippets that show how they are configured through the Apache Camel Spring Xml DSL used to express the routes in file chimera-routes.xml.

The various Chimera components often require a file or resource to function. An example is the Graph Add Component which adds the RDF triples found in a file to a RDF graph.

Files and resources that are used in the chimera routes are defined through the ChimeraResource abstraction. For example, the resource needed by the Graph Add component is defined as follows:

  <bean id="triples" class="com.cefriel.util.ChimeraResourceBean">
    <property name="url" value="file:///home/inbox/my-source.ttl"/>
    <property name="serializationFormat" value="turtle"></property>
  </bean>

Each ChimeraResource defines an id which will be used by other components in the route to reference the resource, the corresponding class which is always "com.cefriel.util.ChimeraResourceBean" and the values for the properties of this class. These properties are the resource's url and serializationFormat. The url can either be a file (file://) url or a remote (http:// or https://) url. The serializationFormat is most often the extension of the resource.

Resources can then be used by Chimera components by using the "#bean:bean_id" syntax in the Apache Camel uris. For example:

<camel:to uri="graph://add?chimeraResource=#bean:triples"/>

How to build and run

Using Docker

To run the chimera-tutorial, if you have Docker installed, you can simply run the image from DockerHub:

docker run -p 8888:8888 cefriel/chimera:tutorial

Run the desired route by using the tutorial.sh file which takes the name of the route as a paremeter (lift, liftConstruct, roundtrip, roundtripAdd, roundtripInference, roundtripTemplate).