{"id":13929355,"url":"https://github.com/RMLio/matey","last_synced_at":"2025-07-19T11:31:42.416Z","repository":{"id":94396601,"uuid":"396723511","full_name":"RMLio/matey","owner":"RMLio","description":"Web-based editor for YARRRML rules.","archived":false,"fork":false,"pushed_at":"2024-10-09T08:51:44.000Z","size":8826,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-31T20:48:28.402Z","etag":null,"topics":[],"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}},"created_at":"2021-08-16T09:39:54.000Z","updated_at":"2024-10-16T08:54:35.000Z","dependencies_parsed_at":"2024-01-14T18:09:28.228Z","dependency_job_id":null,"html_url":"https://github.com/RMLio/matey","commit_stats":{"total_commits":245,"total_committers":5,"mean_commits":49.0,"dds":"0.25306122448979596","last_synced_commit":"cd19df9b62f5f8b30d5c4295405e9dc07ec358d5"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fmatey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fmatey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fmatey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMLio%2Fmatey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMLio","download_url":"https://codeload.github.com/RMLio/matey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226597682,"owners_count":17657189,"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":[],"created_at":"2024-08-07T18:02:17.206Z","updated_at":"2025-07-19T11:31:42.406Z","avatar_url":"https://github.com/RMLio.png","language":"JavaScript","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# Matey\n\nA browser-based editor meant for writing YARRRML rules.\nThe corresponding RML rules can be exported for use outside of Matey.\nAdditionally, the rules can be executed on a sample of the data,\nwhich allows users to inspect the generated Linked Data.\n\n## Table of contents\n\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Examples](#examples)\n5. [Run tests](#run-tests)\n6. [License](#license)\n\n## Requirements\n\n[Node.js](https://nodejs.org/en/download/)\n\n## Installation\n\n```shell\nnpm i @rmlio/matey\n```\n\n## Usage\n\n### Setting up the RMLMapper Web API endpoint\n\nTo generate Linked Data triples, Matey does its RML mapping through a remote server.\nFor this, Matey requires you to provide\nan RMLMapper endpoint.\nYou can either provide the URL of an existing server, or\nset one up yourself by following\n[these instructions](https://github.com/RMLio/rmlmapper-webapi-js).\nMake sure that you provide the correct URL for the endpoint during [configuration](#configuring-matey).\n\n### Preparing your page\n\nPut a div element with a certain id where you want your Matey editor to be:\n\n```html\n\u003cdiv id=\"matey-id\"\u003e\u003c/div\u003e\n```\n\nTry to avoid declaring div elements with id's suffixed with `-matey`,\nas most div elements that will be inserted into your page have such an id.\nFor example, elements with id's such as `btn-matey` or `editor-matey` are reserved by Matey.\n\n### Setting up Matey by including minified script in page\n\n- Install dependencies by running `npm install`.\n- Create minified version by running `npm run build:browser`,\nwhich puts the scripts in the current working directory.\nYou can also choose your own file destination by running\n`browserify lib/index.js --standalone Matey -t urify/transform -t brfs -t browserify-css | terser \u003e my/file/destination.min.js`.\n- Start an RMLMapper Web API endpoint (sugggested: [rmlmapper-webapi-js](https://github.com/RMLio/rmlmapper-webapi-js))\n- Include the script in your HTML code, and call Matey's `init` function on an instance of the `Matey` class:\n\n```html\n\u003chead\u003e\n    \u003c!-- otherwise browsers won't be able to parse the minified script --\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n\u003c/head\u003e\n\n\u003cscript src=\"matey.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    let matey = new Matey();\n    const config = {\n       rmlMapperUrl: \"http://localhost:4000/execute\" // make sure an RMLMapper endpoint with this URL is active!\n    };\n    matey.init(\"matey-id\", config);\n\u003c/script\u003e\n```\n\n### Setting up Matey using a bundler\n\nIn your JavaScript code, import the Matey class from the package, and\non an instance call the `init` function with the `id` of the `div` element for the editor.\n\n```javascript\nconst Matey = require(\"matey\");\nconst matey = new Matey();\nconst config = {\n  rmlMapperUrl: \"https://rml.io/api/rmlmapper/execute\" // make sure an RMLMapper endpoint with this URL is active!\n};\nmatey.init(\"matey-id\", config);\n```\n\nYou can use `browserify` from within the project's root directory to bundle up the code and its dependencies,\nso you can include it in your HTML code.\nThe example in the folder `examples/with_bundler` used the following command\nto bundle the code up into `examples/with_with_bundler/bundle.js`:\n\n```shell\nbrowserify examples/with_bundler/init.js -t urify/transform -t brfs -t browserify-css --minify=true | terser \u003e examples/with_bundler/bundle.js\n```\n\nThe browserify transformations used in the example are necessary for Matey to work.\n\n### Configuring Matey\n\nTo configure Matey, you can pass a JSON object as an argument to Matey's `init` method.\nThe configuration options are:\n\n- `rmlMapperUrl`: URL of RMLMapper Web API endpoint\n\nAn example of calling `init` with a configuration object would be:\n\n```javascript\nlet config = {\n    rmlMapperUrl: \"http://tw06v069.ugent.be/rmlmapper/process\"\n};\nmatey.init(\"matey-id\", config);\n```\n\n### YARRRML examples\n\nThe YARRRML examples come from a single configuration file located at `lib/resources/examples.json`.\nIf you want to add a new example to the editor, that's where you want to add stuff.\n\n## Examples\n\nExamples of usage can be found in the `examples` directory of the project.\nBoth examples illustrate the use of Matey through a single web page which only contains Matey's editors.\nIn these examples, Matey is configured to use an RMLMapper endpoint with URL `http://localhost:4000/execute`, so if you\nwant these examples to run, make sure you have such an endpoint set up.\n\n## Developing\n\n1. Install dependencies via\n\n   ```shell\n   npm i\n   ```\n\n2. Build via\n\n   ```shell\n   npm run build:browser\n   ```\n\n3. Copy `matey.min.js` from `dist` to `examples/with_minified_script/matey.min.js` via\n\n   ```shell\n   cp dist/matey.min.js examples/with_minified_script/matey.min.js\n   ```\n\n4. Run an HTTP server inside `examples/with_minified_script` via\n\n   ```shell\n   npx http-server examples/with_minified_script\n   ```\n\n5. Open \u003chttp://localhost:8080/test.html\u003e in the browser.\n\n## Run tests\n\nThe tests also assume that an RMLMapper endpoint with URL \u003chttp://localhost:4000/execute\u003e is up and running.\nOnce you have it set up,\nrun the following commands from inside the project directory:\n\n```shell\nnpm install\nnpm test\n```\n\n## License\n\nThis code is copyrighted by [Ghent University – imec](http://knows.idlab.ugent.be/) and\nreleased under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRMLio%2Fmatey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRMLio%2Fmatey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRMLio%2Fmatey/lists"}