Skip to main content

A Python library for validating RDF data alignment with ontologies without requiring SHACL definitions.

Project description

ontologist

Release Build status License

A Python library for validating RDF data alignment with ontologies without requiring SHACL definitions.

Why onto-match?

When working with Large Language Models (LLMs) to extract RDF data based on ontologies, it's crucial to verify that the extracted data aligns correctly with the target ontology. While tools like pySHACL exist for RDF validation, they may require explicit SHACL shape definitions, or may fail on certain validation checks.

This library provides a programmatic approach to verify ontology alignment, making it particularly suitable for:

  • Validating LLM-extracted RDF data
  • Working with ontologies that lack SHACL definitions
  • Getting detailed violation reports for debugging and improvement

Features

  • Validate RDF data against ontology definitions without SHACL
  • Detect undefined classes and properties
  • Verify property domain and range constraints
  • Provide detailed violation reports

Installation

pip install onto-match

Quick Start

from rdflib import Graph
from ontologist import validate

# Load your ontology and data graphs
data = Graph().parse("your_data.ttl")
ontology = Graph().parse("your_ontology.ttl")

# Validate the data
is_valid, violations, report = validate(data, ontology)

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

ontologist-0.0.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

ontologist-0.0.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file ontologist-0.0.1.tar.gz.

File metadata

  • Download URL: ontologist-0.0.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.11 Linux/6.5.0-1025-azure

File hashes

Hashes for ontologist-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c552e17c508ab0e42247acb2f59bd60b398dd54a2bc873431f5f2fab6759fdb8
MD5 2e3e73a643f2583a08d6501c91c2fde3
BLAKE2b-256 12de17f5ffeeb72f174b8b749da741080e7f5eb4e1faae3de4e055ba79602315

See more details on using hashes here.

File details

Details for the file ontologist-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ontologist-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.11 Linux/6.5.0-1025-azure

File hashes

Hashes for ontologist-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da70c41e3fecc950190c1a0848e3c74e2e944157227433450dc19be001601fdf
MD5 79b5370dc3be8c7315ba27afa2e5a0a0
BLAKE2b-256 960436f7aef0fb3fb55d5422db8efde084403341542ac56a50385d562cab04e5

See more details on using hashes here.

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