LUBM Conformance Results

This page summarises pg_ripple's results on the Lehigh University Benchmark (LUBM), a canonical benchmark for OWL RL knowledge-base systems.

Overview

LUBM (Guo et al., 2005) defines 14 canonical SPARQL queries over a synthetic university-domain ontology (univ-bench.owl). The queries exercise:

  • rdf:type lookups with OWL RL subclass/subproperty entailment
  • Multi-hop property chains (memberOf + subOrganizationOf + undergraduateDegreeFrom)
  • Domain and range reasoning
  • Conjunctive patterns over asserted and inferred triples

As of v0.44.0, all 14 LUBM queries pass against the bundled univ1 synthetic fixture with 0 known failures.

Test Fixture

pg_ripple uses a self-contained synthetic fixture (tests/lubm/fixtures/univ1.ttl) rather than the original Java UBA generator. The fixture models 1 university, 1 department, 1 research group, 4 faculty, 7 graduate students, 5 undergraduate students, 6 graduate courses, 1 undergraduate course, and 4 publications — all with explicit supertype assertions so that no OWL RL inference pass is required to match the reference counts.

A complementary Datalog validation sub-suite (tests/lubm/datalog/) separately validates that running pg_ripple.load_rules_builtin('owl-rl') and pg_ripple.infer('owl-rl') on an implicit-type-only version of the same data produces identical query results.

Query Results (univ1 fixture)

QueryDescriptionInference rules exercisedExpectedResultStatus
Q1Graduate students taking GraduateCourse0rdf:type + subclass entailment33✅ PASS
Q2Graduate students whose department is part of their undergrad universityMulti-hop join22✅ PASS
Q3Publications by AssistantProfessor0Direct lookup22✅ PASS
Q4Professors in Dept0 with name/email/phoneProperty star pattern44✅ PASS
Q5Persons in Dept0 taking GraduateCourse0ub:Person superclass33✅ PASS
Q6All studentsub:Student superclass1212✅ PASS
Q7Students taking GC0 advised by a FullProfessorAdvisor + course conjunction33✅ PASS
Q8Students in Dept0/University0 with emailFull join pattern1212✅ PASS
Q9Students taking courses from AssistantProfessors3-way join77✅ PASS
Q10Graduate students in ResearchGroup0ub:memberOf lookup33✅ PASS
Q11Sub-organizations of Department0ub:subOrganizationOf11✅ PASS
Q12Professors heading Department0ub:headOf11✅ PASS
Q13Professors acting as teaching assistantsub:teachingAssistantOf11✅ PASS
Q14All undergraduate studentsub:UndergraduateStudent subclass55✅ PASS

Datalog Validation Sub-suite

The Datalog sub-suite validates the OWL RL inference engine independently of the SPARQL translator.

TestWhat it validatesStatus
Rule compilationload_rules_builtin('owl-rl') compiles ≥ 20 rules✅ PASS
Inference iterationinfer_with_stats() reaches fixpoint in 1–10 iterations✅ PASS
Inferred triple countsKey supertype entailments produce correct row counts✅ PASS
Goal queriesinfer_goal() and SPARQL counts agree for Q1/Q6/Q14✅ PASS
Materialization perfinfer('owl-rl') completes in < 5 s on univ1✅ PASS
Custom rulesUser-defined transitive-closure rule works correctly✅ PASS

Running LUBM Locally

# Start pg_ripple (uses pgrx default port 28818)
cargo pgrx start pg18

# Run the LUBM suite (self-contained — no data download required)
cargo test --test lubm_suite -- --nocapture

To run the Datalog sub-suite SQL files manually:

# Assumes pg_ripple is installed and running
psql -c "SELECT pg_ripple.load_turtle(pg_read_file('tests/lubm/fixtures/univ1.ttl'), false)"
psql -f tests/lubm/datalog/rule_compilation.sql
psql -f tests/lubm/datalog/inference_iterations.sql
psql -f tests/lubm/datalog/inferred_triples.sql

Adding Known Failures

If a LUBM query fails, add a lubm:Q{N} entry to tests/conformance/known_failures.txt:

# Example — Q2 fails due to multi-hop join bug, fix in progress
lubm:Q2  multi-hop memberOf/subOrganizationOf join returns wrong count

Remove the entry once the underlying bug is fixed.

See Also