{"id":26190140,"url":"https://github.com/zazuko/carml-service","last_synced_at":"2025-04-15T02:09:44.740Z","repository":{"id":46957181,"uuid":"406776492","full_name":"zazuko/carml-service","owner":"zazuko","description":"Use carml via HTTP API to convert non-RDF data to RDF","archived":false,"fork":false,"pushed_at":"2023-09-11T13:07:45.000Z","size":55,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-15T02:09:36.650Z","etag":null,"topics":["carml","csv","json","rdf","rml","xml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zazuko.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}},"created_at":"2021-09-15T13:29:07.000Z","updated_at":"2024-05-15T10:07:01.000Z","dependencies_parsed_at":"2023-01-22T07:02:42.265Z","dependency_job_id":null,"html_url":"https://github.com/zazuko/carml-service","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcarml-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcarml-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcarml-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazuko%2Fcarml-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zazuko","download_url":"https://codeload.github.com/zazuko/carml-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991544,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["carml","csv","json","rdf","rml","xml"],"created_at":"2025-03-12T00:52:42.419Z","updated_at":"2025-04-15T02:09:44.715Z","avatar_url":"https://github.com/zazuko.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zazuko CARML Service #\n\n[CARML](https://github.com/carml/carml) is an implementation of the [RML](https://rml.io/docs/) mapping specification, with [extensions](#notes-on-the-stream-extension) to process streams. It can be used to convert non-RDF data like XML, JSON or CSV to RDF.\n\nThis project creates a web service around the [CARML RML Engine](https://github.com/carml/carml). This facilitates using carml as a mapping engine from non-Java/JVM projects. Via the HTTP API, one can send mappings and sources with a POST to the service and get the resulting triples back.\n\nAt [Zazuko](https://zazuko.com/), we use the service to scale RDF conversion of millions of XML files by integrating the carml service in our linked data pipelining framework [barnard59](https://github.com/zazuko/barnard59). The step implementing this service can be found [here](https://github.com/zazuko/barnard59-carml-service/). \n\nIf you are looking for a command-line tool you might want to check out [carml-jar](https://github.com/carml/carml-jar)\n\n## Flavors ##\n\nThis project provides two flavors\n* WAR to use in stock tomcat\n* stand-alone service which uses [Apache Meecorwave](https://openwebbeans.apache.org/meecrowave/)\n\n## Building ##\n\nTo build this project you need a standard maven setup\n\n```\nmvn clean package\n```\n\nWill generate both the Meecrowave bundle and the drop in WAR\n\nResults are available in\n`war/target/war-1.0.0-SNAPSHOT.war`\n`service/target/meecrowave-meecrowave-distribution.zip`\n\nThe war should be copied in the Tomcat webapps directory, the zip distribution contains a Meecrowave instance that can be started through `bin/meecrowave.sh run`\n\nThe war has test endpoint at `service/test` the meecrowave instance has the test endpoint at `/test`\n\n## Service ##\n\nThe service at `/`(*meecrowave*),`/service/`(*war*) expects `multipart/form-data` with the following fields to be POSTed\n* `mapping` a turtle based R2RML mapping file\n* `source` the source file, the formats supported are XML, CSV and JSON, indicated by the content type\n\nHeaders\n* The service supports content negotiation to determine the result format through the `Accept` header, if none is provided it will return `text/turtle`\n\n### curl example ###\n\nTo process a mapping from the command line the following [curl](https://curl.se/) command can be used:\n\n```\ncurl -F mapping=@mapping.ttl -F source=@source.xml -H \"Accept: text/turtle\" http://localhost:8080/\n```\n\nWhere:\n* `mapping.ttl` is a valid R2RML mapping fle\n* `source.xml` is XML file that is described by the `mapping.ttl`\n* `text/turtle` is the requested output format\n* `http://localhost:8080` is the URI where the service is listening\n\n### Results ###\nEither a RDF file in the requested format is returned with `200 OK` status code or a error report according to the [Problem Details for HTTP APIs](https://datatracker.ietf.org/doc/html/rfc7807#section-3) with a `400` status code.\n\n## Notes on the stream extension\n\nThe RML spec supports file based sources by default and CARML extends this to use streams.\nThis service expects a logical source that declares a stream named 'stdin'\n\nExample:\n\n```turtle\nPREFIX rml: \u003chttp://semweb.mmlab.be/ns/rml#\u003e\nPREFIX carml: \u003chttp://carml.taxonic.com/carml/\u003e\nPREFIX rr: \u003chttp://www.w3.org/ns/r2rml#\u003e\nPREFIX ql: \u003chttp://semweb.mmlab.be/ns/ql#\u003e\n\n\u003c#person\u003e\na rr:TriplesMap;\n\trml:logicalSource [\n\t\trml:source [\n\t\t\ta carml:Stream;\n\t\t\tcarml:streamName \"stdin\"\n\t\t];\n\t\trml:referenceFormulation ql:JSONPath;\n\t\trml:iterator \"$.characters[*]\"\n\t].\n```\n\nIf you are using [XRM](https://zazuko.com/products/expressive-rdf-mapper/) plugin, set the mapping outputs to `carml` and use `stdin` instead of file-names. The plugin will produce this mapping for you.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazuko%2Fcarml-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzazuko%2Fcarml-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazuko%2Fcarml-service/lists"}