Skip to content

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

License

Notifications You must be signed in to change notification settings

atomobianco/ontologist

Repository files navigation

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)

About

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

Resources

License

Stars

Watchers

Forks