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.1.0.tar.gz (8.2 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.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ontologist-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 7a72788630e03839e4ed7e7e81b2643385b184f6bed5ecddc0a7d7858b63cf89
MD5 27f5faa10ec6f137cfc02190985a36e2
BLAKE2b-256 b33a2ba183e1b3b663e9b5a082cf4b5e05bc21372ca2bdf0a11e2980e1b5c333

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ontologist-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a06e0d71ba2cae031209b569370964ca26a1d449d24e7a8278c0967b59f8e151
MD5 0f78b9646b6aa3a48da8f50cf6194498
BLAKE2b-256 d300980bd2ee774c70bda5e54a65d3c3acf32dffafb4907a695106c2009ec474

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