{"id":13781508,"url":"https://github.com/RMLio/yarrrml-parser","last_synced_at":"2025-05-11T15:31:54.586Z","repository":{"id":32840130,"uuid":"135715691","full_name":"RMLio/yarrrml-parser","owner":"RMLio","description":"A YARRRML parser library and CLI in Javascript","archived":false,"fork":false,"pushed_at":"2025-03-11T13:39:34.000Z","size":1444,"stargazers_count":45,"open_issues_count":55,"forks_count":17,"subscribers_count":5,"default_branch":"development","last_synced_at":"2025-05-02T07:02:37.139Z","etag":null,"topics":["parser","yarrrml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/RMLio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-06-01T12:35:47.000Z","updated_at":"2025-03-11T13:38:36.000Z","dependencies_parsed_at":"2022-08-03T12:20:37.163Z","dependency_job_id":"b1be27bf-7069-4021-b1a1-3915bdf52b9e","html_url":"https://github.com/RMLio/yarrrml-parser","commit_stats":{"total_commits":361,"total_committers":11,"mean_commits":32.81818181818182,"dds":0.554016620498615,"last_synced_commit":"7146173287ff27d6f11ad94397fae8a1965c0a0e"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fyarrrml-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fyarrrml-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fyarrrml-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fyarrrml-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMLio","download_url":"https://codeload.github.com/RMLio/yarrrml-parser/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588556,"owners_count":21932277,"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":["parser","yarrrml"],"created_at":"2024-08-03T18:01:26.621Z","updated_at":"2025-05-11T15:31:53.545Z","avatar_url":"https://github.com/RMLio.png","language":"JavaScript","funding_links":[],"categories":["Mapping Translators","others","Other Awesome","Misc","Open Data and Statistics"],"sub_categories":["Previous RML version (and extensions)","BBedit"],"readme":"# YARRRML Parser\n\nThis library allows to convert [YARRRML](https://w3id.org/yarrrml) rules to [RML](http://rml.io) or [R2RML](https://www.w3.org/TR/r2rml/) rules.\n\n## Install\n\n- `npm i -g @rmlio/yarrrml-parser`\n\n## Usage\n\n### CLI\n\nThere are two CLI functions, `yarrrml-parser` and `yarrrml-generator`.\nUsing the `--help` flag will show all possible commands.\n\n#### yarrrml-parser\n\nIf you want to generate RML rules from a YARRRML document,\nyou do the following: `yarrrml-parser -i rules.yml`.\n\nThe rules will be written to standard output.\nIf you want to write them to a file, you can add the `-o` option.\n\nBy default, the parser generates RML rules.\nIf you want to generate R2RML rules add `-f R2RML`.\n\nIf you want to use `rr:class` instead of Predicate Object Maps, use the `-c` flag.\n\nYou can use multiple input files too: `yarrrml-parser -i rules-1.yml -i rules-2.yml`.\nThey are converted to a single RML document.\nNote that the keys in `prefixes`, `sources`, and `mappings` have to be unique across all files.\n`base` can only be set once.\nYou find an example at [`test/multiple-input-files`](test/multiple-input-files).\n\nYou can overwrite external references via the `-e`.\nAn external reference starts with `_`.\nFor example, `-e name=John` will replace all occurrences of `$(_name)` with `John`.\nRepeat `-e` for multiple references.\nWhen you do not provide a value for an external reference,\nthe reference will not be replaced.\nYou find an example in [`test/template-escape`](test/template-escape).\nIf you want to use for example `$(_name)` as both an external reference and a normal reference,\nthen you add a `\\` for the latter resulting in `$(\\_name)` for the latter.\n\nIf you want the outputted RML to be pretty, please provide the `-p` or `--pretty` parameter.\n\n#### yarrrml-generator\n\nIf you want to generate YARRRML rules from an RML document, you do the following: `yarrrml-generator -i rules.rml.ttl`.\nThe rules will be written to standard output.\nIf you want to write them to a file, you can add the `-o` option.\n\n### Library\n\n`npm i --save @rmlio/yarrrml-parser`\n\n```javascript\nlet yarrrml = require('@rmlio/yarrrml-parser/lib/rml-generator');\n\nconst yaml = \"[yarrrml string]\";\nconst y2r = new yarrrml();\nconst triples = y2r.convert(yaml);\n\nif ( y2r.getLogger().has('error') ) {\n   const logs = y2r.getLogger().getAll();\n   ...\n}\n```\n\n## Development\n\n- Clone this repo.\n- Install the dependencies via `npm i`\n- Update code, if needed.\n- Run the tests via `npm test`\n  - If you make a new test, make sure the (RML) Turtle is 'pretty'. If you're not sure it's pretty, run `./test/prettify_ttl.js`\n- Make the [CLI](#cli) (based on the code in the cloned repo)\navailable system-wide via `npm link` (optional).\n\n## Docker\n\nRun (from [DockerHub](https://hub.docker.com/repository/docker/rmlio/yarrrml-parser)):\n\n```bash\ndocker run --rm -it -v $(pwd)/resources:/data rmlio/yarrrml-parser:latest -i /data/test.yarrr.yml\n```\n\nBuild from source:\n\n```bash\ndocker build -t yarrrml-parser .\n```\n\n## License\n\nThis code is copyrighted by [Ghent University – imec](http://idlab.ugent.be/) and released under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRMLio%2Fyarrrml-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRMLio%2Fyarrrml-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRMLio%2Fyarrrml-parser/lists"}