{"id":43510331,"url":"https://github.com/cefriel/chimera-tutorial","last_synced_at":"2026-02-03T12:50:26.996Z","repository":{"id":75925174,"uuid":"475773940","full_name":"cefriel/chimera-tutorial","owner":"cefriel","description":"Chimera Tutorial","archived":false,"fork":false,"pushed_at":"2025-07-03T09:41:10.000Z","size":353,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T23:47:51.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cefriel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-30T07:48:31.000Z","updated_at":"2025-07-03T09:41:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"5eaf60b9-2b56-4a82-8201-0c955915c637","html_url":"https://github.com/cefriel/chimera-tutorial","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cefriel/chimera-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fchimera-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fchimera-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fchimera-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fchimera-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cefriel","download_url":"https://codeload.github.com/cefriel/chimera-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fchimera-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29046488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-03T12:50:25.776Z","updated_at":"2026-02-03T12:50:26.986Z","avatar_url":"https://github.com/cefriel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chimera Tutorial\n\nThe `chimera-tutorial` project offers a complete example to easily understand how to develop semantic data transformation pipelines using the [Chimera](https://github.com/cefriel/chimera) framework.\n\n## TL;DR\n\n1. Launch the `chimera-tutorial` pipelines with Docker\n```\ndocker run -p 8888:8888 cefriel/chimera:tutorial\n```\n2. Run the routes described in the [Tutorial Routes](#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](#Tutorial-Routes).\nWhen using the included Postman collection remember to set the Body for each request to the file [sample-gtfs-feed.zip](./inbox/sample-gtfs-feed.zip)\n\n## Chimera Route Components\n\nThe Chimera project specifies three different components.\n\n1. The Chimera Graph Component\n\n   The Chimera Graph Component specifies several operations that act on RDF Graphs.\t\n2. The RML Component\n\n   Allows conversions from an input representation to an output representation through [RML mappings](https://rml.io/specs/rml/).\n3. The Mapping Template Component\n\n   Allows conversions from an input representation to an output representation through [Apache Velocity Templates (VTL)](https://velocity.apache.org/).\n\nThese components and related operations are explained in section [Chimera components and configuration](#Chimera-components-and-configuration).\n\n## Tutorial Routes\n\nThis tutorial presents several Chimera routes, each one making use of the various Chimera Apache Camel components defined by the Chimera Framework. \nRoutes are defined in file [chimera-routes.xml](./src/main/resources/routes/chimera-route.xml).\n\n\u003cp align=\"left\"\u003e\u003cimg src=\"img/chimera-tutorial-routes.png\" alt=\"Chimera tutorial routes\" width=\"1000\"\u003e\u003c/p\u003e\n\nEach route uses a sample [GTFS](https://developers.google.com/transit/gtfs) feed as input and the [Linked GTFS](https://github.com/OpenTransport/linked-gtfs) vocabulary as the reference ontology.\n\n- `lift route (/lift)`\n\n\tThe stops.txt file from the sample gtfs feed is lifted to the linked gtfs ontology using the Chimera RmlMapper component through the RML mappings defined in file [mappings.rml.ttl](./mappings/rml/mappings.rml.ttl). \n\tThe RDF Graph that is produced after the mapping process is saved to a turtle file through the Chimera Graph Dump component. \n\tThe result of this route is shown in file [lift.csv](./outbox/lift.ttl)\n\n- `liftConstruct route (/liftConstruct)`\n\n\tThe route passes through the same steps as the /lift route with the addition of the Chimera Graph Construct step. \n\tThis component allows for the enrichment of the RDF graph with the triples generate through the SPARQL construct query defined in file [construct.txt](./queries/construct.txt). \n\tThe output of this route is shown in file [liftConstruct.ttl](./outbox/liftConstruct.ttl).\n\t\n- `roundtrip route (/roundtrip)`\n\n\tAs described in the previous routes, the stops.txt file is lifted tothe linked gtfs ontology. \n\tThis information is then lowered to a csv file representation through the Chimera Mapping Template component using the [loweringTemplate.vm](./mappings/vtl/loweringTemplate.vm) mapping. \n\tThe result of this operation is presented in file [roundtrip.csv](./outbox/roundtrip.csv).\n\n- `roundtripAdd route (/roundtripAdd)`\n  \n  The same steps as the previous route are performed. \n  In addition, through the Chimera Graph component Add operation, the rdf triples specified in the [my-source.ttl](./inbox/my-source.ttl) file are used to enrich the RDF graph.\n \n- `roundtripInference route (/roundtripInference)`\n   \n   The RDF graph that is produced by applying the RML mappings is enriched through the triples obtained by the inference rules stated in the [ontology.owl](./ontologies/ontology.owl) file which are applied by the Chimera Graph component Inference operation.\n   The obtained result is available in file [roundtripInference.csv](./outbox/roundtripInference.csv).\n  \n- `roundtripTemplate route (/roundtripTemplate)`\n\n\tThis route shows that the Chimera Mapping template can be used for both lifting and lowering steps of a data harmonization pipeline. \n\tThe stops.txt file is lifted throught the mappings defined in file [liftingTemplate.vm](./mappings/vtl/liftingTemplate.vm). \n\tThe obtained RDF triples are then loaded in a RDF graph by using the Chimera Graph Get component. \n\tFurthermore, a validation of the RDF triples is conducted using the SHACL shape defined in file [gtfsStopShacl.ttl](./shacl-shapes/gtfsStopShacl.ttl) through the Chimera Shacl Component.\n\tThe validated result is then lowered to a csv file by using the mapping defined in file [loweringTemplate.vm](./mappings/vtl/loweringTemplate.vm) by the Chimera Mapping component.\n\n### Chimera components and configuration\n\nThis 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](https://camel.apache.org/manual/spring-xml-extensions.html) used to express the routes in file [chimera-routes.xml](./src/main/resources/routes/chimera-route.xml).\n\nThe various Chimera components often require a file or resource to function. \nAn example is the Graph Add Component which adds the RDF triples found in a file to a RDF graph.\n\nFiles and resources that are used in the chimera routes are defined through the ChimeraResource abstraction.\nFor example, the resource needed by the Graph Add component is defined as follows:\n\n```xml\n  \u003cbean id=\"triples\" class=\"com.cefriel.util.ChimeraResourceBean\"\u003e\n    \u003cproperty name=\"url\" value=\"file:///home/inbox/my-source.ttl\"/\u003e\n    \u003cproperty name=\"serializationFormat\" value=\"turtle\"\u003e\u003c/property\u003e\n  \u003c/bean\u003e\n```\n\nEach 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.\nThese properties are the resource's *url* and *serializationFormat*.\nThe *url* can either be a file (file://) url or a remote (http:// or https://) url.\nThe *serializationFormat* is most often the extension of the resource.\n\nResources can then be used by Chimera components by using the \"#bean:bean_id\" syntax in the Apache Camel uris.\nFor example:\n\n```xml\n\u003ccamel:to uri=\"graph://add?chimeraResource=#bean:triples\"/\u003e\n```\n\n- `Chimera RML component` \n\n\tThe Chimera RML component receives an Inputstream and applies supplied RML mappings.\n\tIn this tutorial it is configured as follows:\n\n\t```xml\n\t\u003ccamel:to uri=\"rml://?streamName=stops.txt\u0026amp;mapping=#bean:rmlMappings\u0026amp;baseIri=https://www.cefriel.com/data/\u0026amp;baseIriPrefix=cef\"/\u003e\n\t```\n\t\n\tWhere the *streamName* option is the name of the inputStream file. \n\tThrough the *mappings* parameter the RML mappings that are used in the mapping operation are specified, expressed as ChimeraResources.\n\tFinally, *baseIri* and *baseIriPrefix* are additional parameters that are set.\n\n- `Chimera Graph component Dump operation` \n\n   The Chimera Graph component Dump operation takes a RDF graph as input and saves it to a user-specified file.\n   It is configured as follows:\n\t```xml\n\t\u003ccamel:to uri=\"graph://dump?filename=dump.ttl\u0026amp;basePath=./home/outbox\u0026amp;dumpFormat=turtle\"/\u003e\n\t```\n\n- `Chimera Graph component Inference operation` \n\n   The Chimera Graph component Inference operation applies the inference rules specified in one or more ontology files to the RDF graph received as input.\n   The ontologies are passed to the component via the chimeraResources parameter.\n    ```xml\n\t\u003ccamel:to uri=\"graph://inference?chimeraResource=#bean:ontologies\"/\u003e\n\t```\n\n- `Chimera Graph component Add operation` \n\n   The Chimera Graph component Add operation adds the triples from the files specified in the chimeraResources bean to the received RDF graph.\n    ```xml\n\t\u003ccamel:to uri=\"graph://add?chimeraResource=#bean:triples\"/\u003e\n\t```\n\n- `Chimera Graph component Construct operation` \n\n   The Chimera Graph component Construct operation adds the triples obtained from the SPARQL construct queries specified in the chimeraResources bean to the received RDF graph.\n    ```xml\n\t\u003ccamel:to uri=\"graph://construct?chimeraResource=#bean:queries\"/\u003e\n\t```\n\n- `Chimera Graph component Shacl operation` \n\n   The Chimera Graph component Shacl operation validates the received RDF graph using the SHACL shapes specified in the chimeraResources bean parameter.\n    ```xml\n\t\u003ccamel:to uri=\"graph://shacl?chimeraResource=#bean:shaclShapes\"/\u003e\n\t```\n\n- `Mapping Template component` \n\n   The Mapping Template component is used to apply Apache VTL templates to the received input to obtained a desired output representation.\n   It can be used both for lifting and lowering operations.\n   In this tutorial, when used for the lifting operations the configuration is:\n    ```xml\n\t\u003ccamel:to uri= \"mapt://csv?template=#bean:liftingTemplate\u0026amp;format=turtle\"/\u003e\n\t```\n\t\n\tWhere the *csv* parameter is used to specify the source input format, the template parameter accepts one VTL *template* specified by a Chimera Resource bean and the *format* parameter is used to specify the formatter that is applied to the result of the application of the template. \n\tNote that for lifting operations the target format is always RDF.\n\t\n\tWhen used to perform a lowering operation, the configuration is as follows:\n\t```xml\n\t\u003ccamel:to uri= \"mapt://rdf?template=#bean:loweringTemplate\u0026amp;basePath=./home/outbox\u0026amp;fileName=gtfs-stops.csv\"/\u003e\n\t```\n\n\tThe *rdf* parameter specifies that the source format is rdf. \n\tThis is always the case for lowering operations.\n\tThe used template is specified by the *template* parameter while the directory and filename where the result of the lowering operation will be saved are specified with respectively with the *basePath* and *fileName* parameters.\n\n## How to build and run\n\n### Using Docker\n\nTo run the `chimera-tutorial`, if you have Docker installed, you can simply run the image from [DockerHub](https://hub.docker.com/repository/docker/cefriel/chimera-tutorial):\n```\ndocker run -p 8888:8888 cefriel/chimera:tutorial\n```\n\nRun the desired route by using the [tutorial.sh](./tutorial.sh) file which takes the name of the route as a paremeter (`lift`, `liftConstruct`, `roundtrip`, `roundtripAdd`, `roundtripInference`, `roundtripTemplate`).\n\n## Contributing\n\nBefore contributing, please read carefully, complete and sign our [Contributor Licence Agreement](https://github.com/cefriel/contributing/blob/main/contributor-license-agreement.pdf). \n\nWhen contributing to this repository, please first discuss the change you wish to make via issue or any other available method with the repository's owners.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcefriel%2Fchimera-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcefriel%2Fchimera-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcefriel%2Fchimera-tutorial/lists"}