{"id":17498323,"url":"https://github.com/simonepri/edgelist-mapper","last_synced_at":"2026-02-23T02:37:46.484Z","repository":{"id":49217977,"uuid":"192795401","full_name":"simonepri/edgelist-mapper","owner":"simonepri","description":"📊Maps nodes and edges of a multi-relational graph to integer","archived":false,"fork":false,"pushed_at":"2021-06-23T04:46:48.000Z","size":39,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-29T00:35:10.717Z","etag":null,"topics":["converter","dataset","edgelist","kb","kg","knowledge-graph","link-prediction","machine-learning","map","relation-prediction"],"latest_commit_sha":null,"homepage":"","language":"Python","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/simonepri.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":"2019-06-19T19:51:39.000Z","updated_at":"2020-06-29T15:17:50.000Z","dependencies_parsed_at":"2022-08-29T22:51:26.715Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/edgelist-mapper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/simonepri/edgelist-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fedgelist-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fedgelist-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fedgelist-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fedgelist-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/edgelist-mapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fedgelist-mapper/sbom","scorecard":{"id":824717,"data":{"date":"2025-08-11","repo":{"name":"github.com/simonepri/edgelist-mapper","commit":"4fcec7e7e0d89f9b0a3ed623256af662e8bd1ecf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/simonepri/edgelist-mapper/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/simonepri/edgelist-mapper/build.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:24","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T16:24:43.759Z","repository_id":49217977,"created_at":"2025-08-23T16:24:43.760Z","updated_at":"2025-08-23T16:24:43.760Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29735759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["converter","dataset","edgelist","kb","kg","knowledge-graph","link-prediction","machine-learning","map","relation-prediction"],"created_at":"2024-10-19T16:27:28.788Z","updated_at":"2026-02-23T02:37:46.445Z","avatar_url":"https://github.com/simonepri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003eedgelist-mapper\u003c/b\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!-- Build --\u003e\n  \u003ca href=\"https://github.com/simonepri/edgelist-mapper/actions?query=workflow%3Abuild\"\u003e\n    \u003cimg src=\"https://github.com/simonepri/edgelist-mapper/workflows/build/badge.svg?branch=master\" alt=\"Build status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- PyPi --\u003e\n  \u003ca href=\"https://pypi.org/project/edgelist-mapper\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/edgelist-mapper.svg\" alt=\"PyPi version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://pepy.tech/project/edgelist-mapper\"\u003e\n    \u003cimg src=\"https://pepy.tech/badge/edgelist-mapper\" alt=\"Total downloads\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003c!-- Code style --\u003e\n  \u003ca href=\"https://github.com/ambv/black\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Linter --\u003e\n  \u003ca href=\"https://github.com/PyCQA/pylint\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/linter-pylint-ce963f.svg\" alt=\"Linter\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Types checker --\u003e\n  \u003ca href=\"https://github.com/PyCQA/pylint\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/types%20checker-mypy-296db2.svg\" alt=\"Types checker\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Test runner --\u003e\n  \u003ca href=\"https://github.com/pytest-dev/pytest\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/test%20runner-pytest-449bd6.svg\" alt=\"Test runner\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Task runner --\u003e\n  \u003ca href=\"https://github.com/illBeRoy/taskipy\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/task%20runner-taskipy-abe63e.svg\" alt=\"Task runner\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Build tool --\u003e\n  \u003ca href=\"https://github.com/python-poetry/poetry\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/build%20system-poetry-4e5dc8.svg\" alt=\"Build tool\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003c!-- License --\u003e\n  \u003ca href=\"https://github.com/simonepri/edgelist-mapper/tree/master/license\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/simonepri/edgelist-mapper.svg\" alt=\"Project license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  📊 Maps nodes and edges of a multi-relational graph to integer\n\u003c/p\u003e\n\n\n## Synopsis\n\nedgelist-mapper is a simple tool that reads an edge-list file representing a graph and maps each node and relation to integer.\nThe mapping assigned is such that entities and relations that appear more frequently in the graph are mapped to smaller numerical values.\n\nThis tool is particularly useful to pre-process some of the publicly available knowledge graph datasets that are often used for the machine learning task of [relation prediction][repo:NLP-progress-\u003erelation_prediction.md].\n\nDo you believe that this is *useful*?\nHas it *saved you time*?\nOr maybe you simply *like it*?  \nIf so, [support this work with a Star ⭐️][start].\n\n## Input format\n\nThe tool takes as input a file (`edgelist.tsv`) that represents a graph as tab-separated triples of the form `(head, relation, tail)` and generates three new files, namely `mapped_edgelist.tsv`, `entities_map.tsv`, and `relations_map.tsv`.\n\n```\nsan_marino\tlocatedin\teurope\nbelgium\tlocatedin\teurope\nrussia\tlocatedin\teurope\nmonaco\tlocatedin\teurope\ncroatia\tlocatedin\teurope\npoland\tlocatedin\teurope\n```\n\u003e Example content of the `edgelist.tsv` file.\n\n```\n0\teurope\n1\tsan_marino\n2\trussia\n3\tpoland\n4\tmonaco\n5\tcroatia\n6\tbelgium\n```\n\u003e Content of the `entities_map.tsv` generated from the `edgelist.tsv` file.\n\n```\n0\tlocatedin\n```\n\u003e Content of the `relations_map.tsv` generated from the `edgelist.tsv` file.\n\n```\n1\t0\t0\n6\t0\t0\n2\t0\t0\n4\t0\t0\n5\t0\t0\n3\t0\t0\n```\n\u003e Content of the `mapped_edgelist.tsv` generated from the `edgelist.tsv` file.\n\n\n## CLI Usage\n\nThe CLI takes the following positional arguments:\n```\n  edgelist    Path of the edgelist file\n  output      Path of the output directory\n```\n\nExample usage:\n```bash\npip install edgelist-mapper\npython -m edgelist_mapper.bin.run \\\n    edgelist.tsv \\\n    .\n```\n\u003e NB: You need Python 3 to run the CLI.\n\n\n## Showcase\n\nThis tool has been used to create [this collection of datasets][repo:datasets-knowledge-embedding].\n\n\n## Authors\n\n- **Simone Primarosa** - [simonepri][github:simonepri]\n\nSee also the list of [contributors][contributors] who participated in this project.\n\n\n## License\n\nThis project is licensed under the MIT License - see the [license][license] file for details.\n\n\n\n\u003c!-- Links --\u003e\n\n[start]: https://github.com/simonepri/edgelist-mapper#start-of-content\n[license]: https://github.com/simonepri/edgelist-mapper/tree/master/license\n[contributors]: https://github.com/simonepri/edgelist-mapper/contributors\n\n[github:simonepri]: https://github.com/simonepri\n\n[repo:NLP-progress-\u003erelation_prediction.md]:https://github.com/sebastianruder/NLP-progress/blob/master/english/relation_prediction.md\n[repo:datasets-knowledge-embedding]: https://github.com/simonepri/datasets-knowledge-embedding\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fedgelist-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fedgelist-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fedgelist-mapper/lists"}