{"id":16899491,"url":"https://github.com/funkyfuture/m4p0-rs-metadata-import","last_synced_at":"2026-04-29T10:02:31.413Z","repository":{"id":77696839,"uuid":"195068470","full_name":"funkyfuture/m4p0-rs-metadata-import","owner":"funkyfuture","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-27T18:40:44.000Z","size":194,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-20T12:23:24.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkyfuture.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-07-03T14:16:58.000Z","updated_at":"2020-01-27T18:40:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3afc65e-06bc-42dd-a0ac-8b0fba58ce6c","html_url":"https://github.com/funkyfuture/m4p0-rs-metadata-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/funkyfuture/m4p0-rs-metadata-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyfuture%2Fm4p0-rs-metadata-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyfuture%2Fm4p0-rs-metadata-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyfuture%2Fm4p0-rs-metadata-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyfuture%2Fm4p0-rs-metadata-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkyfuture","download_url":"https://codeload.github.com/funkyfuture/m4p0-rs-metadata-import/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkyfuture%2Fm4p0-rs-metadata-import/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261487227,"owners_count":23166042,"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-10-13T17:49:09.048Z","updated_at":"2026-04-29T10:02:26.389Z","avatar_url":"https://github.com/funkyfuture.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metadata import for https://enter.museum4punkt0.org\n\n`rs-import` is a command-line interface (CLI) to that reads metadata of digital\nobjects provided as csv-file(s), generates RDF triples and submits these to the\n[ResearchSpace](https://www.researchspace.org/) instance available at\nhttps://enter.museum4punkt0.de/. The generated data conforms with the\n[project's documentation ontology](https://github.com/museum4punkt0/enter-ontology),\nwhile the mapping of csv to RDF data is documented in\n[a supplemental document](./SPECIFICATION.md) in the tool's sources.\n\n## Prerequisites\n\n- the command-line tool is installed (see below)\n- a configuration file with connection information is available (see below)\n- the actual data has been uploaded and is available on the web\n- the metadata is converted from a spreadsheet format to a comma separated\n  value text file (see below)\n- the metadata itself is described in a file (see below)\n\n## Installing the tool\n\nTODO\n\n## Configuration file\n\nThe user needs to have a configuration file present on the system s/he's using\nthis tool on. It is to be formatted with [YAML](https://yaml.org/) syntax and\nmust contain these keys:\n\n- `media_types`\n  - this mapping provides unambiguous IRIs for ambiguous filename extensions of\n    the digital objects\n  - all used filename extensions must be specified here\n  - the IRIs must be used consistently across the project; in case of changes,\n    previously imported metadata should be re-imported\n- `sparql_endpoint`\n  - the URL where the instance's SPARQL interface is available\n- `sparql_user`\n  - the name of a user of the platform that is allowed to add data\n- `sparql_pass`\n  - the password of that user\n\nBy default the tool will look in the user folder for a file named\n`.rs-import.yml`, but it can also specified with the `--config` flag on\ninvocation. It would roughly look like this:\n\n```yaml\n---\n\nmedia_types:\n  jpeg: https://www.iana.org/assignments/media-types/image/jp2\n  jpg: https://www.iana.org/assignments/media-types/image/jp2\n  tif: https://www.iana.org/assignments/media-types/image/tiff\n  tiff: https://www.iana.org/assignments/media-types/image/tiff\n  zip: https://www.iana.org/assignments/media-types/application/zip\n\nsparql_endpoint: https://enter.museum4punkt0.de/sparql\nsparql_user: editor\nsparql_pass: sEcr3t\n```\n\n## Converting the provided spreadsheets to csv text files\n\nMost spreadsheet applications allow to save/export the tabular data to text\nfiles that contain a comma-separated representation of that data. Here's an\nexample flow that uses [LibreOffice](https://www.libreoffice.org/):\n\n![Save as…](img/xlsx_to_csv_0.png)\n\n![File name and format](img/xlsx_to_csv_1.png)\n\n![format settings](img/xlsx_to_csv_2.png)\n\nMind that each table is to be saved separately with the designated filename of\nthe digital object type (`images.csv`, `audio_video.csv`, `3d.csv`)\nrespectively as `entities.csv`. Empty tables are not required to be saved.\n\nMake sure to remove the first line that contains usage hints from the resulting\nfile.\n\n## Preparing and describing the dataset\n\nThe aforementioned resulting files must be saved to a separate folder (*import\nfolder*) for each set of metadata. Of course, also the metadata needs to be\ndescribed. This file is again in YAML syntax, must be named `dataset.yml`,\nreside in the import folder and requires two keys to be defined:\n\n- `file_namespace` is the base URL where the digital objects can be found by\n  the filename noted in the metadata.\n- `data_provider` is an IRI that identifies the providing institution.\n\nHere's an example:\n\n```yaml\n---\n\nfile_namespace: \"https://objekte.museum4punkt0.de/narrenschopf/\"\ndata_provider: \"http://www.vsan.de/\"\n```\n\n## Using the tool\n\nThe tool can print a brief description of the expected arguments and options:\n\n```\n$ rs-import --help\nusage: rs-import [-h] [--config PATH] [--verbose] [--review]\n                 IMPORT_PATH [IMPORT_PATH ...]\n\nThis tool takes the contents of the specified import folders, transforms them\ninto SPARQL statements and submits these to a SPARQL endpoint.A detailed log\nfile will always be stored in a folder `logs` within each import folder. Please\nrefer to the supplied usage documentation and specificationfor more details.\n\npositional arguments:\n  IMPORT_PATH    The folder(s) containing the import data.\n\noptional arguments:\n  -h, --help     show this help message and exit\n  --config PATH  The path to the configuration file. Default: ~/.rs-import.yml\n  --verbose, -v  Increases verbosity to DEBUG level.\n  --review       Review and confirm the generated SPARQL update before\n                 submitting.\n```\n\nSo, assuming that the configuration file is located at the default location and\nthe *current working directory* named `imports` contains two folders with\nmetadata like this:\n\n```\nimports/\n├── bambule\n│   ├── dataset.yml\n│   └── audio_video.csv\n└── narrenschopf\n    ├── dataset.yml\n    ├── entities.csv\n    └── images.csv\n```\n\nThe tool would be invoked to import both folders' contents consecutively:\n\n    rs-import bambule narrenschopf\n\n## Further hints\n\nBoth, the designated script to upload the digital objects and this tool,\nnormalize filename extensions to be lower case. E.g. `image.TIFF` becomes\n`image.tiff`.\n\nImports can be re-done. Any previously imported metadata for the specified\n`file_namespace` is deleted.\n\n## Genesis, credits, license and re-use\n\nThis tool is part of the project museum4punkt0 - Digital Strategies for the\nMuseum of the Future. Further information: https://www.museum4punkt0.de/en/\n\nIt has been developed by Martin Wagner on behalf of the Stiftung Preußischer\nKulturbesitz.\n\nThe project museum4punkt0 is funded by the Federal Government Commissioner\nfor Culture and the Media in accordance with a resolution issued by the German\nBundestag (Parliament of the Federal Republic of Germany).\n\nThe contents of this repository are licensed under the terms of\n[GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html).\nSee [LICENSE.md](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkyfuture%2Fm4p0-rs-metadata-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkyfuture%2Fm4p0-rs-metadata-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkyfuture%2Fm4p0-rs-metadata-import/lists"}