{"id":21192178,"url":"https://github.com/mu-semtech/export-service","last_synced_at":"2026-04-24T20:02:30.025Z","repository":{"id":151390217,"uuid":"59018489","full_name":"mu-semtech/export-service","owner":"mu-semtech","description":"Microservice to export data using custom defined SPARQL queries","archived":false,"fork":false,"pushed_at":"2017-06-03T18:34:12.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-02T00:57:01.703Z","etag":null,"topics":["export-service","microservice","mu-service","musemtech","sparql"],"latest_commit_sha":null,"homepage":null,"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/mu-semtech.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}},"created_at":"2016-05-17T12:00:02.000Z","updated_at":"2017-05-23T18:52:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fc3552a-7d4e-460a-9fa3-21f419a1edb7","html_url":"https://github.com/mu-semtech/export-service","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mu-semtech/export-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fexport-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fexport-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fexport-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fexport-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mu-semtech","download_url":"https://codeload.github.com/mu-semtech/export-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fexport-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32238748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: 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":["export-service","microservice","mu-service","musemtech","sparql"],"created_at":"2024-11-20T19:07:51.183Z","updated_at":"2026-04-24T20:02:30.008Z","avatar_url":"https://github.com/mu-semtech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Export service\n==============\n\nMicroservice to export data using custom defined SPARQL queries.\n\n## Using the template\nExtend `semtech/mu-export-service` and provide an export configuration in `export.js`.\n\n## Example Dockerfile\n\n```\nFROM semtech/mu-export-service:1.0.0\nMAINTAINER Erika Pauwels \u003cerika.pauwels@gmail.com\u003e\n```\n\n## Export configuration\n\nThe `export.js` file defines an array of export configuration objects as follows:\n\n```javascript\nexport default [\n    {\n        path: '/example',\n        format: 'text/csv',\n        query: `SELECT * FROM \u003chttp://mu.semte.ch/application\u003e WHERE { ?s ?p ?o } LIMIT 100`,\n        file: 'export-example.csv'\n    },\n    ...\n];\n\n```\n\nEach element in the array will become an API endpoint in the microservice. An export configuration object consists of the following properties:\n* [REQUIRED] `path`: endpoint on which the export will be exposed\n* [REQUIRED] `format`: format of the export (`application/json`, `text/csv`, `text/turtle`, etc.)\n* [REQUIRED] `query`: the SPARQL query to execute. This may be a `SELECT` or a `CONSTRUCT` query.\n* [OPTIONAL] `file`: name of the downloaded file. The filename may also be provided through a query param on the export request (e.g. `/example?file=my-name.csv`). If no filename is provided, the export will be displayed inline in the browser.\n\n## Using variables in the export query\nYou can also define variables in your SPARQL export query which will be replaced with query param values at runtime. Therefore, we use [ES6's tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals).\n\nImport the `template` tag function from `/app/template.js` in your `export.js` and apply the tag function on your query. You can then define variables in your SPARQL query using `${['myVariable', 'type']}`.\n* `myVariable` is the name of the variable that must be replaced.\n* `type` is the datatype of the variable. This must be one of `'string'`, `'uri'`, `'int'`, `'float'`, `'date'`, `'dateTime'`, `'bool'`.\nAt runtime the variable will be replaced with the value provided in the `myVariable` query param of the request.\n\nAn example `export.js` including variables file may look as follows:\n\n```javascript\nimport template from '/app/template.js';\n\nexport default [\n    {\n        path: '/example',\n        format: 'text/csv',\n        query: template`SELECT * FROM \u003chttp://mu.semte.ch/application\u003e WHERE { ?s a ${['class', 'uri']} } LIMIT 100`,\n        file: 'export-example.csv'\n    },\n    ...\n];\n\n```\n\nA GET request on `/example?class=http://xmlns.com/foaf/0.1/Person` will export the first 100 URIs of type `foaf:Person`.\n\n## Example docker-compose\nIf you don't want to build a new Docker image you can also run `semtech/mu-export-service` and mount your export configuration in `/config`.\n\n```yaml\nversion: '2',\nservices:\n  export:\n    image: semtech/mu-export-service:1.0.0\n    volumes:\n      - ./:/config\n    links:\n      - database:database\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmu-semtech%2Fexport-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmu-semtech%2Fexport-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmu-semtech%2Fexport-service/lists"}