{"id":33132999,"url":"https://github.com/cefriel/mapping-template","last_synced_at":"2026-02-03T12:50:30.341Z","repository":{"id":175842347,"uuid":"653658827","full_name":"cefriel/mapping-template","owner":"cefriel","description":"A template-based component exploiting Apache Velocity to define declarative mappings for schema and data transformations.","archived":false,"fork":false,"pushed_at":"2026-01-28T08:48:40.000Z","size":581,"stargazers_count":8,"open_issues_count":14,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-28T23:55:14.863Z","etag":null,"topics":["rdf","semantic-web","template","velocity-template"],"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":"CITATION.cff","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":"2023-06-14T13:26:05.000Z","updated_at":"2026-01-28T08:38:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb4d4118-7125-4e32-8274-6aa46d3a208c","html_url":"https://github.com/cefriel/mapping-template","commit_stats":null,"previous_names":["cefriel/mapping-template"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/cefriel/mapping-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fmapping-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fmapping-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fmapping-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fmapping-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cefriel","download_url":"https://codeload.github.com/cefriel/mapping-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cefriel%2Fmapping-template/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":["rdf","semantic-web","template","velocity-template"],"created_at":"2025-11-15T10:00:31.640Z","updated_at":"2026-02-03T12:50:30.329Z","avatar_url":"https://github.com/cefriel.png","language":"Java","funding_links":[],"categories":["Mapping"],"sub_categories":["XML"],"readme":"# mapping-template\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.cefriel/mapping-template.svg?label=Maven%20Central)](https://search.maven.org/artifact/com.cefriel/mapping-template)\n\nA template-based component exploiting [Apache Velocity](https://velocity.apache.org/) to define declarative mappings for schema and data transformations.\n\nA quantitative and qualitative evaluation of the tool is available in the repository [mapping-template-eval](https://github.com/cefriel/mapping-template-eval).\n\n### Mapping Template Language (MTL)\n\nThe [Wiki](https://github.com/cefriel/mapping-template/wiki/Mapping-Template-Language-(MTL)) contains the documentation to specify compliant mapping templates.\n\nExample templates are provided in the [examples](https://github.com/cefriel/mapping-template/tree/main/examples) folder.\n\n### RDF Mapping Language support (RML to MTL)\n\nThe `mapping template` supports the execution of RML mappings that are automatically compiled to an MTL template and executed. The `mapping template` is currently compliant with the `rml-core` specification (https://w3id.org/rml/portal).\n\nThe RML mapping can be passed with the `--rml` option for usage via CLI and a [test case](src/test/java/com/cefriel/template/RMLTests.java) is made available to exemplify the usage as a library.\n\n### Usage as a Library\n\nThe  `mapping-template` can be used as a library through the `TemplateExecutor` class. It allows to execute mapping templates accessing data from the filesystem or through `InputStream`s. Configuration examples can be found in the `Main` class and in the `test` folder.\n\nThe `mapping-template` is available on Maven Central and can be added as a dependency in Java projects as described [here](https://search.maven.org/artifact/com.cefriel/mapping-template). Using Maven the following dependency should be specified in the `pom.xml` selecting a [release](https://github.com/cefriel/mapping-template/releases) version:\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.cefriel\u003c/groupId\u003e\n  \u003cartifactId\u003emapping-template\u003c/artifactId\u003e\n  \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\nThe component can be used as an external library to launch multiple template executions in parallel.\n\n### Usage via CLI\nThis is the intended usage of the `mapping-template.jar`.\n\n```\nusage: java -jar mapping-template.jar \u003coptions\u003e\noptions:\n  -b, --basepath \u003carg\u003e            Base path for files (input, template, output). Default value is './'.\n  -c, --contextIRI \u003carg\u003e          IRI identifies the named graph for context-aware querying of the repository. \n                                  Default behaviour: the entire repository is considered for querying.\n  -q, --query \u003carg\u003e               Path to the file containing a query for parametric template execution.\n  -dq, --debug-query              Saves in the output file the result of the query provided with -q option.\n  -f, --format \u003carg\u003e              Activate procedures for specific output formats. Supported values: 'xml' \n                                  (XML escape, XML parsing to check structure, indentation), 'turtle', 'rdfxml', 'nt', 'json'.\n  -fir, --fail-invalid-ref        If this option is enabled, the execution fails every time a variable in the template can not be accessed.\n  -fun, --functions \u003carg\u003e         Provide the path to a Java file defining a TemplateFunctions subclass.\n  -if, --input-format \u003carg\u003e       Format for the input(s). Supported values are: 'csv', 'json', 'xml', 'rdf', 'mysql', 'postgresql'.\n  -i, --input \u003carg\u003e               Path for the input file. Multiple input files are supported if the '--input-format' is 'rdf'.\n  -kv, --key-value \u003carg\u003e          Path for a file containing a key:value pair for each line. These pairs\n                                  are made available as a map in the template.\n  -kvc, --key-value-csv \u003carg\u003e     Path for a csv file with one line interpreted as a set of key[column]-value[line] pairs. \n                                  These pairs are made available as a map in the template.\n  -o, --output \u003carg\u003e              Path of output file. Default: output.txt\n  -rml, --compile-rml \u003carg\u003e       Provide an RML mapping file to be executed\n  -t, --template \u003carg\u003e            Path of template file. Default: template.vm\n  -tm, --time \u003carg\u003e               Path of file reporting template execution time. Default: timing not saved. \n  -tr, --trim                     Trim newlines from the template before executing it to reduce memory usage.\n  -url, --remote-url \u003carg\u003e        Address for accessing remote database (relational or triplestore).\n  -id, --remote-id \u003carg\u003e          Identifier of the remote database or repository for triplestores.\n  -us, --username \u003carg\u003e           Username for accessing remote database.\n  -psw, --password \u003carg\u003e          Password for accessing remote database.\n  -v, --verbose                   Debug information are logged.\n```\nInstructions on how to run the example mapping templates via command line are provided in the [examples/README](https://github.com/cefriel/mapping-template/tree/main/examples/README.md).\n\nA `$reader` is initialized based on the specified `-if` option. Additional `Reader`s should be defined in the template using the available functions.\n\nIf `-url` and `-id` options are set a remote database/repository is used for queries and the `-i`  option is ignored. If they are not set the `-i` option is mandatory. Assumptions to use a remote database/repository are: (i) it is up and running, and (ii) data are already in there.\n\n### Usage via Chimera \n\nIf you would like to use the `mapping-template` for more advanced integration scenarios, check out the integration within the [Chimera](https://github.com/cefriel/chimera) framework. Chimera is implemented on top of Apache Camel and offers components to define schema and data transformation pipelines based on Semantic Web solutions.\n\n### Cite as\n\nIf you use the `mapping-template` for publications, cite the following article: \n\n\u003e Scrocca, M., Carenini, A., Grassi, M., Comerio, M., \u0026 Celino, I. (2024). `Not Everybody Speaks RDF: Knowledge Conversion between Different Data Representations`. In: Fifth International Workshop on Knowledge Graph Construction co-located with the ESWC2024. CEUR-WS. https://ceur-ws.org/Vol-3718/paper3.pdf\n\nCheck the [Chimera](https://github.com/cefriel/chimera) repository for a list of projects using the `mapping-template`.\n\n### Commercial Support\n\nIf you need commercial support for the `mapping-template` contact us at [chimera-dev@cefriel.com](mailto:chimera-dev@cefriel.com).\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\n### License\n\n_Copyright (c) 2019-2025 Cefriel._\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcefriel%2Fmapping-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcefriel%2Fmapping-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcefriel%2Fmapping-template/lists"}