Package: mizgra
mizgraConverts 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.To save output to file, add> /path/to/output.graphmlto the end of the command, e.g.:mizgra/path/to/esx_mml/path/to/mml.lar-m/path/to/metadata.xml-c/path/to/CSVs-cv>mmlkg.graphmlRead more about the MMLKG project at theMMLKG website.Run mizgraThere are several ways to run mizgra. You can install it from PyPI, run it using Docker, or run it from the source.
Choose the most convenient way for you.PyPIInstall mizgra:pipinstallmizgraRun mizgra:mizgra[ESXMML][MMLLAR]Docker from Docker HubPull Docker image from Docker Hub:dockerpulllszeremeta/mizgraRun Docker container:dockerrun--rm-v/path/to/esx/and/mml.lar:/app/inputlszeremeta/mizgra/app/input/esx_mml/app/input/mml.larDocker from sourceBuild Docker image:dockerbuild-tmizgra.Run Docker container:dockerrun--rm-v/path/to/esx/and/mml.lar:/app/inputmizgra/app/input/esx_mml/app/input/mml.larPython from sourceClone this repository and go to its directory:gitclonegit@github.com:lszeremeta/mizgra.gitcdmizgraInstall requirements:pipinstall-rrequirements.txtRun mizgra:python-mmizgra[ESXMML][MMLLAR]Recommended usageMizgra requires two arguments:ESXMML: Path to the ESX MML files directory. You candownloadit fromesx_filesrepository.MMLLAR: Path to the mml.lar file. You candownloadit fromesx_filesrepository.Metadata and CSV relations are recommended. To include them, use-mand-carguments.
You can generate metadata with statistics usingmetadata_genand CSV relations usingcsvrelgen.To save the output to a file, add> /path/to/output.graphmlto the end of the command.Example:mizgra/path/to/esx_mml/path/to/mml.lar-m/path/to/metadata.xml-c/path/to/CSVs-cv>mmlkg.graphmlSeeUsagefor more details.Usageusage:mizgra[-h][-v][-oOUTPUT][-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}...]][-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}...]][-mMETADATA][-cCSV[CSV...]][-cv][-rRDF][-rf{json-ld,hext,n3,nquads,nt,trix,turtle,xml}]ESXMMLMMLLARTo see all options in your version use-hor--help:mizgra-hInformative arguments-h,--help: Show help message and exit.-v,--version: Show program version and exit.Required argumentsESXMML: Path to the ESX MML files directory. You candownloadit fromesx_filesrepository.MMLLAR: Path to the mml.lar file. You candownloadit fromesx_filesrepository.Output preference arguments-o OUTPUT,--output OUTPUT: Output format (graphml,yarspg; default:graphml).-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} ...]:
Show only selected outputs; by default, all possible results are shown, excluding those that are disabled by default (
local-ref-relations, usages-relations, and broader-relations; handled by CSV relations). To show disabled
outputs, specify them directly with -s/--show option. It's recommended to use CSV relations.-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} ...]:
Disable selected outputs (local-ref-relations, usages-relations, and broader-relations are disabled by default; handled
by CSV relations).External data arguments-m METADATA,--metadata METADATA: Path to the metadata file. If not specified, metadata without dataset statistics will
be included. You can generate a full metadata file using:https://github.com/domel/metadata_gen-c CSV,--csv CSV: Paths to the CSV files/directories with relations. You can generate it using:https://github.com/arturkornilowicz/csvrelgen-cv,--csv-validate: Validates CSV files by several checks before reading to minimize the possibility of CSV errors;
turned off by default.-r RDF,--rdf RDF: Path to the RDF data file; for URLs or files with not standard extensions may be needed to
specify format using-rf.-rf {json-ld,hext,n3,nquads,nt,trix,turtle,xml},--rdf-format {json-ld,hext,n3,nquads,nt,trix,turtle,xml}: RDF
data file format, specify if not detected automaticallyExamplesConvert ESX MML data to GraphML format:mizgra/path/to/esx_mml/path/to/mml.lar>graph.graphmlConvert ESX MML data to YARS-PG format:mizgra/path/to/esx_mml/path/to/mml.lar-oyarspg>graph.yarspgConvert ESX MML data to GraphML format, showing only metadata and member-relations:mizgra/path/to/esx_mml/path/to/mml.lar-smetadatamember-relations>graph.graphmlConvert ESX MML data to GraphML format and include external metadata:mizgra/path/to/esx_mml/path/to/mml.lar-m/path/to/metadata.xml>graph.graphmlConvert ESX MML data to GraphML format and include RDF data in Turtle format:mizgra/path/to/esx_mml/path/to/mml.lar-r/path/to/external.ttl-rfturtle>graph.graphmlConvert ESX MML data to GraphML format, include CSV data from selected directory, validate CSV files:mizgra/path/to/esx_mml/path/to/mml.lar-c/path/to/external-cv>graph.graphmlConvert ESX MML data to GraphML format and include CSV data:mizgra/path/to/esx_mml/path/to/mml.lar-c/path/to/external.csv>graph.graphmlConvert ESX MML data to GraphML format and include CSV data from multiple files and directories:mizgra/path/to/esx_mml/path/to/mml.lar-c/path/to/external1.csv/path/to/external2/path/to/external3.csv>graph.graphmlContributionWould you like to improve this project? Great! We are waiting for your help and suggestions. If you are new to open
source contributions, readHow to Contribute to Open Source.LicenseDistributed underMIT License.This project contains a sample external RDF data file (rdf_data.nt), prepared by Dominik Tomaszuk (@domel) and available under theCC-BY 4.0 License. The base for the query was developed usingWikidata, which is available under theCreative Commons CC0 License. While it also includes references toDBpediaandYAGO(whose data are onCreative Commons Attribution-ShareAlike 3.0 License), Dominik Tomaszuk only retrieved non-data links from these sources. The structure of this file is entirely different than the above datasets.