Skip to main content

Wraps several RDF schema solver tools

Project description

RDFSolve

Tests PyPI PyPI - Python Version PyPI - License Documentation Status

Extract RDF schemas from SPARQL endpoints, convert between formats (JSON-LD, LinkML, SHACL, VoID, RDF-config), and derive cross-dataset mappings.

Dashboard (static demo): jmillanacosta.github.io/rdfsolve-frontend

Installation

uv pip install rdfsolve

CLI

rdfsolve [--verbose] <group> <command> [OPTIONS]

Schema mining (pipeline)

# Mine schemas from remote SPARQL endpoints listed in sources.yaml
rdfsolve pipeline mine --sources data/sources.yaml

# Mine a single source from a local QLever endpoint
rdfsolve pipeline local-mine --name drugbank --endpoint http://localhost:7026

# Generate Qleverfiles for local QLever instances
rdfsolve pipeline qleverfile --data-dir /data/rdf

Format conversion (export)

Convert any VoID .ttl or rdfsolve .jsonld schema to another format (auto-detected from extension):

rdfsolve export csv       schema.jsonld
rdfsolve export jsonld    void.ttl
rdfsolve export void      schema.jsonld
rdfsolve export linkml    schema.jsonld -o ./out
rdfsolve export shacl     schema.jsonld --closed
rdfsolve export rdfconfig void.ttl --endpoint-url https://sparql.example.org

Web backend

A Flask REST API exposes schemas, SPARQL query generation, IRI resolution, export, mappings, and SHACL/LinkML conversion over HTTP. It can also serve the rdfsolve-frontend app.

# Quick start with Docker
docker compose up --build        # http://localhost:8000

# Or run directly
python -m rdfsolve.backend.app   # uses env vars for config

Key endpoints: /api/schemas, /api/sparql, /api/export, /api/shapes, /api/mappings, /api/linkml, /api/compose.

Python API

from rdfsolve.api import mine_schema, load_parser_from_file

# Mine a schema from a SPARQL endpoint
result = mine_schema(
    name="rhea",
    endpoint_url="https://sparql.rhea-db.org/sparql",
)

# Load a previously mined schema and convert
parser = load_parser_from_file("rhea_schema.jsonld")
parser.to_schema()       # pandas DataFrame
parser.to_jsonld()       # JSON-LD dict
parser.to_linkml_yaml()  # LinkML YAML string
parser.to_shacl()        # SHACL Turtle string

Documentation

Full docs: rdfsolve.readthedocs.io

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rdfsolve-0.0.2.tar.gz (170.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rdfsolve-0.0.2-py3-none-any.whl (158.4 kB view details)

Uploaded Python 3

File details

Details for the file rdfsolve-0.0.2.tar.gz.

File metadata

  • Download URL: rdfsolve-0.0.2.tar.gz
  • Upload date:
  • Size: 170.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rdfsolve-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9042b93879e200eb8da760281d6cd495e658731fe031d768b465af8b58767613
MD5 5e54d8c43f8a389c760d1158dc612655
BLAKE2b-256 c444849d19e266690975f571c6fd91df24fea0dcb26c0c21303471c0404cf2db

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdfsolve-0.0.2.tar.gz:

Publisher: python-publish.yml on jmillanacosta/rdfsolve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rdfsolve-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rdfsolve-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 158.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rdfsolve-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4edb681338569ebdf49df7d936763d233f32240a344916842a47c91ab31382ee
MD5 7e7e8f8d96cc47c0ebd036b13e5744ec
BLAKE2b-256 18181e135484ccc98995cf4e48882ad1fc51c5c1071fe0b7292caa58f1b2f116

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdfsolve-0.0.2-py3-none-any.whl:

Publisher: python-publish.yml on jmillanacosta/rdfsolve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page