Principle:AKSW RDFUnit Schema Auto Discovery
| 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 } }
}