{"id":23076389,"url":"https://github.com/lszeremeta/mizgra","last_synced_at":"2025-08-15T18:32:30.511Z","repository":{"id":175709873,"uuid":"654358045","full_name":"lszeremeta/mizgra","owner":"lszeremeta","description":"Converts Mizar ESX MML mathematical data to property graph formats - GraphML, YARS-PG for Neo4j, and other graph databases. Supports external RDF data.","archived":false,"fork":false,"pushed_at":"2024-06-24T06:41:09.000Z","size":245,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T22:33:00.830Z","etag":null,"topics":["converter","graph","graph-data","graph-database","graphml","mathematics","mizar","neo4j","property-graphs","rdf","rdflib","yars-pg"],"latest_commit_sha":null,"homepage":"https://mmlkg.uwb.edu.pl","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/lszeremeta.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":"2023-06-16T00:48:26.000Z","updated_at":"2024-06-24T06:41:05.000Z","dependencies_parsed_at":"2024-11-15T22:31:10.294Z","dependency_job_id":"fd8bc4e1-fcdd-4c41-b7a7-95c508a5957f","html_url":"https://github.com/lszeremeta/mizgra","commit_stats":null,"previous_names":["lszeremeta/mizgra"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lszeremeta%2Fmizgra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lszeremeta%2Fmizgra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lszeremeta%2Fmizgra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lszeremeta%2Fmizgra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lszeremeta","download_url":"https://codeload.github.com/lszeremeta/mizgra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229898131,"owners_count":18141246,"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":["converter","graph","graph-data","graph-database","graphml","mathematics","mizar","neo4j","property-graphs","rdf","rdflib","yars-pg"],"created_at":"2024-12-16T09:31:30.430Z","updated_at":"2024-12-16T09:31:31.132Z","avatar_url":"https://github.com/lszeremeta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mizgra\n\n[![PyPI](https://img.shields.io/pypi/v/mizgra)](https://pypi.org/project/mizgra/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mizgra) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/lszeremeta/mizgra?label=Docker%20image%20size)](https://hub.docker.com/r/lszeremeta/mizgra)\n\nConverts Mizar ESX MML mathematical data to property graph formats - GraphML, YARS-PG. Produce files ready to import to various graph databases, including Neo4j. Supports external RDF data in various formats.\n\nTo save output to file, add `\u003e /path/to/output.graphml` to the end of the command, e.g.:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -m /path/to/metadata.xml -c /path/to/CSVs -cv \u003e mmlkg.graphml\n```\n\nRead more about the MMLKG project at the [MMLKG website](https://mmlkg.uwb.edu.pl).\n\n## Run mizgra\n\nThere are several ways to run mizgra. You can install it from PyPI, run it using Docker, or run it from the source.\nChoose the most convenient way for you.\n\n### PyPI\n\n1. Install mizgra:\n\n```shell\npip install mizgra\n```\n\n2. Run mizgra:\n\n```shell\nmizgra [ESXMML] [MMLLAR]\n```\n\n### Docker from Docker Hub\n\n1. Pull Docker image from Docker Hub:\n\n```shell\ndocker pull lszeremeta/mizgra\n```\n\n2. Run Docker container:\n\n```shell\ndocker run --rm -v /path/to/esx/and/mml.lar:/app/input lszeremeta/mizgra /app/input/esx_mml /app/input/mml.lar\n```\n\n### Docker from source\n\n1. Build Docker image:\n\n```shell\ndocker build -t mizgra .\n```\n\n2. Run Docker container:\n\n```shell\ndocker run --rm -v /path/to/esx/and/mml.lar:/app/input mizgra /app/input/esx_mml /app/input/mml.lar\n```\n\n### Python from source\n\n1. Clone this repository and go to its directory:\n\n```shell\ngit clone git@github.com:lszeremeta/mizgra.git\ncd mizgra\n```\n\n2. Install requirements:\n\n```shell\npip install -r requirements.txt\n```\n\n3. Run mizgra:\n\n```shell\npython -m mizgra [ESXMML] [MMLLAR]\n```\n\n## Recommended usage\n\nMizgra requires two arguments:\n\n- `ESXMML`: Path to the ESX MML files directory. You can [download](https://github.com/arturkornilowicz/esx_files/archive/refs/heads/main.zip) it from [esx_files](https://github.com/arturkornilowicz/esx_files/) repository.\n- `MMLLAR`: Path to the mml.lar file. You can [download](https://github.com/arturkornilowicz/esx_files/archive/refs/heads/main.zip) it from [esx_files](https://github.com/arturkornilowicz/esx_files/) repository.\n\nMetadata and CSV relations are recommended. To include them, use `-m` and `-c` arguments.\nYou can generate metadata with statistics using [metadata_gen](https://github.com/domel/metadata_gen)\nand CSV relations using [csvrelgen](https://github.com/arturkornilowicz/csvrelgen).\n\nTo save the output to a file, add `\u003e /path/to/output.graphml` to the end of the command.\n\nExample:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -m /path/to/metadata.xml -c /path/to/CSVs -cv \u003e mmlkg.graphml\n```\n\nSee [Usage](#usage) for more details.\n\n## Usage\n\n```shell\nusage: mizgra [-h] [-v] [-o OUTPUT]\n              [-s {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...]]\n              [-d {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...]]\n              [-m METADATA] [-c CSV [CSV ...]] [-cv] [-r RDF] [-rf {json-ld,hext,n3,nquads,nt,trix,turtle,xml}]\n              ESXMML MMLLAR\n```\n\nTo see all options in your version use `-h` or `--help`:\n\n```shell\nmizgra -h\n```\n\n### Informative arguments\n\n- `-h`, `--help`: Show help message and exit.\n- `-v`, `--version`: Show program version and exit.\n\n### Required arguments\n\n- `ESXMML`: Path to the ESX MML files directory. You can [download](https://github.com/arturkornilowicz/esx_files/archive/refs/heads/main.zip) it from [esx_files](https://github.com/arturkornilowicz/esx_files/) repository.\n- `MMLLAR`: Path to the mml.lar file. You can [download](https://github.com/arturkornilowicz/esx_files/archive/refs/heads/main.zip) it from [esx_files](https://github.com/arturkornilowicz/esx_files/) repository.\n\n### Output preference arguments\n\n- `-o OUTPUT`, `--output OUTPUT`: Output format (`graphml`, `yarspg`; default: `graphml`).\n- `-s {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...], --show {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...]`:\n  Show only selected outputs; by default, all possible results are shown, excluding those that are disabled by default (\n  local-ref-relations, usages-relations, and broader-relations; handled by CSV relations). To show disabled\n  outputs, specify them directly with -s/--show option. It's recommended to use CSV relations.\n- `-d {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...], --disable {filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} [{filenames,nodes,metadata,member-relations,local-ref-relations,usages-relations,broader-relations,csv-relations,rdf-relations} ...]`:\n  Disable selected outputs (local-ref-relations, usages-relations, and broader-relations are disabled by default; handled\n  by CSV relations).\n\n### External data arguments\n\n- `-m METADATA`, `--metadata METADATA`: Path to the metadata file. If not specified, metadata without dataset statistics will\n  be included. You can generate a full metadata file using: https://github.com/domel/metadata_gen\n- `-c CSV`, `--csv CSV`: Paths to the CSV files/directories with relations. You can generate it using: https://github.com/arturkornilowicz/csvrelgen\n- `-cv`, `--csv-validate`: Validates CSV files by several checks before reading to minimize the possibility of CSV errors;\n  turned off by default.\n- `-r RDF`, `--rdf RDF`: Path to the RDF data file; for URLs or files with not standard extensions may be needed to\n  specify format using `-rf`.\n- `-rf {json-ld,hext,n3,nquads,nt,trix,turtle,xml}`, `--rdf-format {json-ld,hext,n3,nquads,nt,trix,turtle,xml}`: RDF\n  data file format, specify if not detected automatically\n\n## Examples\n\nConvert ESX MML data to GraphML format:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar \u003e graph.graphml\n```\n\nConvert ESX MML data to YARS-PG format:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -o yarspg \u003e graph.yarspg\n```\n\nConvert ESX MML data to GraphML format, showing only metadata and member-relations:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -s metadata member-relations \u003e graph.graphml\n```\n\nConvert ESX MML data to GraphML format and include external metadata:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -m /path/to/metadata.xml \u003e graph.graphml\n```\n\nConvert ESX MML data to GraphML format and include RDF data in Turtle format:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -r /path/to/external.ttl -rf turtle \u003e graph.graphml\n```\n\nConvert ESX MML data to GraphML format, include CSV data from selected directory, validate CSV files:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -c /path/to/external -cv \u003e graph.graphml\n```\n\nConvert ESX MML data to GraphML format and include CSV data:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -c /path/to/external.csv \u003e graph.graphml\n```\n\nConvert ESX MML data to GraphML format and include CSV data from multiple files and directories:\n\n```shell\nmizgra /path/to/esx_mml /path/to/mml.lar -c /path/to/external1.csv /path/to/external2 /path/to/external3.csv \u003e graph.graphml\n```\n\n## Contribution\n\nWould you like to improve this project? Great! We are waiting for your help and suggestions. If you are new to open\nsource contributions, read [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/).\n\n## License\n\nDistributed under [MIT License](https://github.com/lszeremeta/mizgra/blob/main/LICENSE).\n\nThis project contains a sample external RDF data file ([rdf_data.nt](https://github.com/lszeremeta/mizgra/blob/main/mizgra/resources/rdf_data.nt)), prepared by Dominik Tomaszuk ([@domel](https://github.com/domel)) and available under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by/4.0/). The base for the query was developed using [Wikidata](https://www.wikidata.org/), which is available under the [Creative Commons CC0 License](https://creativecommons.org/publicdomain/zero/1.0/). While it also includes references to [DBpedia](https://wiki.dbpedia.org/) and [YAGO](https://yago-knowledge.org/) (whose data are on [Creative Commons Attribution-ShareAlike 3.0 License](https://creativecommons.org/licenses/by-sa/3.0/)), Dominik Tomaszuk only retrieved non-data links from these sources. The structure of this file is entirely different than the above datasets.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flszeremeta%2Fmizgra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flszeremeta%2Fmizgra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flszeremeta%2Fmizgra/lists"}