{"id":13781179,"url":"https://github.com/anuzzolese/pyrml","last_synced_at":"2026-01-21T10:48:29.512Z","repository":{"id":43062467,"uuid":"262798765","full_name":"anuzzolese/pyrml","owner":"anuzzolese","description":"pyRML is a Python based engine for processing RML files. The RDF Mapping Language (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF data model. RML is defined as a superset of the W3C-standardized mapping language R2RML, aiming to extend its applicability and broaden its scope, adding support for data in other structured formats.","archived":false,"fork":false,"pushed_at":"2025-05-13T22:52:46.000Z","size":217,"stargazers_count":40,"open_issues_count":9,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-09T05:46:24.221Z","etag":null,"topics":["csv2rdf","rdf","rml","rml-mapper","rml-mapping"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anuzzolese.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,"zenodo":null}},"created_at":"2020-05-10T13:57:17.000Z","updated_at":"2025-06-05T14:58:23.000Z","dependencies_parsed_at":"2023-11-15T22:34:34.105Z","dependency_job_id":"55e0beb4-fc55-45d9-9aa3-8c9e31168f2f","html_url":"https://github.com/anuzzolese/pyrml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/anuzzolese/pyrml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuzzolese%2Fpyrml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuzzolese%2Fpyrml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuzzolese%2Fpyrml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuzzolese%2Fpyrml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anuzzolese","download_url":"https://codeload.github.com/anuzzolese/pyrml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuzzolese%2Fpyrml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["csv2rdf","rdf","rml","rml-mapper","rml-mapping"],"created_at":"2024-08-03T18:01:23.675Z","updated_at":"2026-01-21T10:48:29.495Z","avatar_url":"https://github.com/anuzzolese.png","language":"Python","funding_links":[],"categories":["KGC Materializers"],"sub_categories":[],"readme":"# pyRML\npyRML is a Python based engine for processing RML files. The [RDF Mapping Language](https://rml.io/specs/rml/) (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF data model. RML is defined as a superset of the W3C-standardized mapping language [R2RML](https://rml.io/specs/rml/#bib-r2rml), aiming to extend its applicability and broaden its scope, adding support for data in other structured formats.\n### Installation\npyRML requires Python 3.\nTo install the engine use the Python package manager `pip`, i.e.:\n```\npip install pyrml-lib\n```\n\nAlternatively, it is possible to run `pip` under the root directory of source code of PyRML once it has been downloaded. For example:\n\n```\npip install .\n```\n\nAlternatively, it is possible to install the pyRML package directly from GitHub in the following way:\n\n```\npip install git+https://github.com/anuzzolese/pyrml\n```\n\n### Usage\n\nIt is possible to use pyRML either by means of its API or the command line tool that is provided along with the source package.\n\n###### API\nThe ```Mapper``` is the key class of pyRML. It accepts the path to an RML file as input and returns an RDF graph as output. The output graph is an instance of the class ```Graph``` provided by [RDFLib](https://github.com/RDFLib/rdflib).\n```python\nfrom pyrml import Mapper, PyRML\nfrom rdflib import Graph\nimport os\n\n# Create an instance of RML Mapper with PyRML.\nmapper : Mapper = PyRML.get_mapper()\n\n'''\nInvoke the method convert on the instance of class RMLConverter by:\n - using the file examples/artist/artist-map.ttl (see the examples in this repo);\n - obtaining an RDF graph as output.\n'''\n\nrml_file_path = os.path.join('examples', 'artists', 'artist-map.ttl')\nrdf_graph : Graph  = mapper.convert(rml_file_path)\n\n# Print the triples contained into the RDF graph.\nfor s,p,o in rdf_graph:\n    print(s, p, o)\n```\n\n###### Command line tool\nThe command line tool is implemented by the script ```pyrml-mapper.py```.\nSuch a script can be used in the following way:\n\n```bash\npython pyrml-mapper.py [-o RDF out file] [-f RDF out file] [-m] input\n```\n\nwhere:\n - the positional argument ```input``` is the input RML mapping file for enabling the RDF conversion;\n - the optional argument ```-o filename``` is the file to store the resulting RDF graph. If no choice is provided then standard output is assumed as default.\n - the optional argument ```-f rdf-syntax``` can be used to specify the syntax to serialize the RDF graph. Possible values are n3, nquads, nt, pretty-xml, trig, trix, turtle, and xml. If no choice is provided then NTRIPLES is assumed as default.\n - the optional flag ```-m``` enables the conversion based on multiprocessing for speeding up the transformation process.\n \nThe following is an example about how to use the command line tool for processing the RML file available in ```examples/artists/artist-map.ttl```, thus converting the CSV files ```examples/artists/Artist.csv``` and ```examples/artists/Place.csv``` into an RDF graph serialized as TURTLE and stored into the file named ```artists_places.ttl```.\n\n```bash\npython pyrml-mapper.py -o artists_places.ttl -f turtle examples/artists/artist-map.ttl\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuzzolese%2Fpyrml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuzzolese%2Fpyrml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuzzolese%2Fpyrml/lists"}