Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AKSW RDFUnit Schema Auto Discovery

From Leeroopedia
Knowledge Sources
Domains Semantic_Web, Data_Quality, Schema_Management
Last Updated 2026-10-16 00:00 GMT

Overview

Technique for automatically identifying which vocabularies and schemas an RDF dataset uses by introspecting namespace usage, enabling schema-driven validation without manual schema specification.

Description

Schema Auto-Discovery addresses the problem that, in open RDF datasets, the schemas (ontologies, vocabularies) governing the data are often not explicitly declared. RDFUnit solves this by analyzing the namespaces used in a dataset's RDF triples and mapping them to known schemas through several strategies:

  • LOV (Linked Open Vocabularies): A cached registry of vocabulary prefixes and namespaces, bundled as `schemaLOV.csv`.
  • Schema Declarations: User-provided CSV files mapping prefixes to schema URIs (`schemaDecl.csv`).
  • Standard Vocabularies: Bundled vocabulary files (SKOS, FOAF, DC, etc.) with `vann:preferredNamespacePrefix` annotations.
  • Dataset Introspection: Querying the dataset's SPARQL endpoint to extract namespace statistics—counting distinct namespaces used in subject, predicate, and object positions—and matching them against the schema service.

When no schemas are explicitly provided, RDFUnit auto-discovers them by running namespace statistics queries against the dataset and resolving each namespace to a schema source.

Usage

Use this principle when validating an RDF dataset where the governing schemas are unknown or only partially specified. It eliminates the need for users to manually list every vocabulary in use. When schemas are known, provide them explicitly via the `-s` CLI option for faster, more deterministic validation.

Theoretical Basis

The auto-discovery algorithm:

# Abstract algorithm
namespaces = count_namespaces_in_dataset(query_endpoint)
for ns in namespaces:
    schema = schema_service.lookup_by_namespace(ns)
    if schema:
        schema_sources.add(schema)
    elif use_lov:
        schema = lov_registry.lookup(ns)
        if schema:
            schema_sources.add(schema)

Namespace statistics query (simplified):

SELECT (COUNT(DISTINCT ?ns) AS ?count) WHERE {
  { SELECT (REPLACE(STR(?s), "(#|/)[^#/]*$", "$1") AS ?ns) WHERE { ?s ?p ?o } }
}

Related Pages

Implemented By

Uses Heuristics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment