{"id":30664568,"url":"https://github.com/arcangelo7/knowledge-graphs-inversion","last_synced_at":"2025-08-31T19:03:56.900Z","repository":{"id":311916407,"uuid":"999656990","full_name":"arcangelo7/knowledge-graphs-inversion","owner":"arcangelo7","description":"A tool for RML inversion: converting RDF knowledge graphs back to their original data formats (CSV, SQL) by reversing the RML mapping process","archived":false,"fork":false,"pushed_at":"2025-08-27T15:56:40.000Z","size":57122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-27T21:16:29.248Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arcangelo7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-10T15:28:46.000Z","updated_at":"2025-08-27T15:56:43.000Z","dependencies_parsed_at":"2025-08-27T21:26:47.159Z","dependency_job_id":null,"html_url":"https://github.com/arcangelo7/knowledge-graphs-inversion","commit_stats":null,"previous_names":["arcangelo7/knowledge-graphs-inversion"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/arcangelo7/knowledge-graphs-inversion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcangelo7%2Fknowledge-graphs-inversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcangelo7%2Fknowledge-graphs-inversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcangelo7%2Fknowledge-graphs-inversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcangelo7%2Fknowledge-graphs-inversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arcangelo7","download_url":"https://codeload.github.com/arcangelo7/knowledge-graphs-inversion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcangelo7%2Fknowledge-graphs-inversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273025827,"owners_count":25032842,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-31T19:03:55.920Z","updated_at":"2025-08-31T19:03:56.880Z","avatar_url":"https://github.com/arcangelo7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RML Inversion\n\nA tool for **RML inversion**: converting RDF knowledge graphs back to their original data formats (CSV, SQL) by reversing the RML mapping process.\n\n## Overview\n\nThis project implements the inverse process of RML (RDF Mapping Language):\n- **Forward RML**: CSV/SQL → RDF using morph-kgc\n- **Inverse RML**: RDF → CSV/SQL (this project)\n\nCurrently supports:\n- **CSV files** \n- **SQL databases**\n\n## Requirements\n\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv/) package manager\n\n## Quick Start\n\n```bash\n# Install uv if needed\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Setup project\ngit clone https://github.com/arcangelo7/knowledge-graphs-inversion.git\ncd knowledge-graphs-inversion\nuv sync\n\n# Run the main application\nuv run python app.py\n```\n\n## Managing Dependencies with uv\n\n```bash\n# Add new dependency\nuv add package-name\n\n# Remove dependency  \nuv remove package-name\n\n# Update all\nuv sync --upgrade\n\n# Run without activating venv\nuv run python script.py\n```\n\n## Benchmarking\n\nThis project integrates the [KROWN benchmark framework](https://github.com/kg-construct/KROWN) for evaluating the performance of the knowledge graphs inversion system with PostgreSQL focus.\n\n### Setup Benchmark Environment\n\n1. **Initialize KROWN submodule:**\n   ```bash\n   git submodule update --init --recursive\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   uv sync\n   ```\n\n### Running KROWN Benchmark\n\n**Run PostgreSQL benchmark:**\n```bash\n# Run with in-memory RDF processing (default)\nuv run python benchmarks/run_krown_benchmark.py\n\n# Run with Virtuoso triplestore for better performance on large datasets\nuv run python benchmarks/run_krown_benchmark.py --use-virtuoso\n```\n\n**Prerequisites for Virtuoso benchmarks:**\nIf using the `--use-virtuoso` option, you must start Virtuoso before running the benchmark:\n```bash\n# Start Virtuoso container (required for --use-virtuoso option)\nuv run python -m virtuoso_utilities.launch_virtuoso --name virtuoso-kgi --http-port 8890 --detach --wait-ready\n```\n\nThis will:\n- Generate test data using KROWN's data generator (PostgreSQL format)\n- Create 3 benchmark scenarios: Small (1K), Medium (10K), Large (50K rows)\n- Run the inversion system on each scenario using either in-memory RDF processing or Virtuoso triplestore\n- Generate performance metrics and results\n\n**SPARQL Backend Options:**\n- **In-memory processing** (default): Uses rdflib for SPARQL queries, suitable for small to medium datasets\n- **Virtuoso triplestore** (`--use-virtuoso`): Uses OpenLink Virtuoso for SPARQL queries, recommended for large datasets. Requires pre-existing Virtuoso instance running on localhost:8890\n\n### Benchmark Results\n\nResults are stored in `benchmarks/krown/results/` with:\n- Execution times for each scenario\n- Data and mapping file sizes\n- Triple Maps and Predicate Object Maps counts\n- JSON format for analysis\n\n## License\n\nISC License\n\n## Author\n\n**arcangelo7** - arcangelo.massari@unibo.it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcangelo7%2Fknowledge-graphs-inversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcangelo7%2Fknowledge-graphs-inversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcangelo7%2Fknowledge-graphs-inversion/lists"}