W3C Conformance

This page summarises pg_ripple's conformance status against the W3C SPARQL 1.1, Apache Jena, SHACL Core, WatDiv, and LUBM test suites.

As of v0.41.0, conformance is measured by integrated test harnesses that run in CI on every push to main. Pass rates are published as the conformance_report artifact on the Actions page.

Test suites

pg_ripple runs four complementary conformance suites:

SuiteTestsWhat it validates
W3C SPARQL 1.1~3 000Standard conformance on small, well-defined fixtures
Apache Jena~1 000Implementation edge cases (type coercion, date-time, blank-node scoping)
WatDiv100 templatesCorrectness and performance at 10M-triple scale
LUBM14 queriesOWL RL inference correctness under ontological reasoning (v0.44.0+)
OWL 2 RL~200 testsW3C OWL 2 RL entailment, consistency, and inconsistency (v0.46.0+; informational until ≥95%)

All suites write per-suite results into a unified tests/conformance/report.json artifact.

See Running Conformance Tests for local setup instructions, the WatDiv Results page for performance metrics, and the LUBM Results page for OWL RL conformance details.


W3C SPARQL 1.1 test harness (v0.41.0+)

The test harness (tests/w3c/) runs the official W3C SPARQL 1.1 test suite (~3 000 tests across 13 sub-suites) against a live pg_ripple installation.

Per-category coverage

Sub-suiteTestsCI status
aggregates~120Required (smoke)
bind~20Informational (full suite)
exists~20Informational (full suite)
functions~200Informational (full suite)
grouping~40Required (smoke)
negation~20Informational (full suite)
optional~80Required (smoke)
project-expression~10Informational (full suite)
property-path~60Informational (full suite)
service~10SKIP (live external endpoints)
subquery~20Informational (full suite)
syntax-query~300Informational (full suite)
update~200Informational (full suite)

Running locally

# Download test data first (one-time setup):
bash scripts/fetch_conformance_tests.sh --w3c

# Run smoke subset (180 tests, ~30s):
cargo test --test w3c_smoke

# Run full W3C suite (3000+ tests, ~2min with 8 threads):
cargo test --test w3c_suite -- --test-threads 8

Apache Jena test suite (v0.43.0+)

The Jena adapter (tests/jena/) runs ~1 000 tests from Apache Jena's sparql-query, sparql-update, sparql-syntax, and algebra sub-suites. Jena tests cover implementation edge cases that the W3C suite leaves underspecified.

Jena-specific coverage areas

AreaTests
XSD numeric promotions (xsd:integerxsd:decimalxsd:double)sparql-query
Mixed-type arithmetic and comparisonssparql-query
Timezone-aware xsd:dateTime comparisonssparql-query
Date/time built-ins: NOW(), YEAR(), MONTH(), DAY(), HOURS(), MINUTES(), SECONDS(), TZ()sparql-query
xsd:decimal arithmetic: ROUND(), CEIL(), FLOOR(), ABS()sparql-query
Blank nodes in CONSTRUCT templatessparql-query
Blank-node identity across OPTIONAL and GRAPH boundariessparql-query
String functions: STRLEN(), SUBSTR(), UCASE(), LCASE(), STRSTARTS(), STRENDS(), CONTAINS(), ENCODE_FOR_URI(), CONCAT()sparql-query
SPARQL UPDATE edge casessparql-update
Syntax acceptance / rejection (positive/negative syntax tests)sparql-syntax
Algebra normalisation equivalencesalgebra

CI status

The jena-suite CI job is non-blocking until pass rate ≥ 95%, then promoted to required. Known failures for type-coercion and date-time edge cases are tracked in tests/conformance/known_failures.txt with the jena: prefix.

Running locally

# Download Jena test data:
bash scripts/fetch_conformance_tests.sh --jena

# Run the full Jena suite:
cargo test --test jena_suite

SPARQL 1.1 Query

Test suite: W3C SPARQL 1.1 Query test suite (2013-03-27)

Target: ≥ 95% of applicable tests pass.

Supported features

FeatureStatus
Basic Graph Patterns (BGP)Supported
FILTER with all comparison and logical operatorsSupported
OPTIONALSupported
UNIONSupported
Subqueries (SELECT … { SELECT … })Supported
BINDSupported
VALUESSupported
Property paths (/, `, *, +, ?, ^`)
Negated property sets (`!(p1p2)`)
Aggregates: COUNT, SUM, AVG, MIN, MAXSupported
GROUP BY, HAVINGSupported
ORDER BY, LIMIT, OFFSETSupported
DISTINCTSupported
ASKSupported
CONSTRUCTSupported
DESCRIBESupported
Named graphs (GRAPH ?g { … })Supported
Federated query (SERVICE)Supported (v0.16.0)
All XPath/SPARQL built-in functions (STR, STRLEN, UCASE, LCASE, STRSTARTS, STRENDS, CONTAINS, REGEX, ABS, CEIL, FLOOR, ROUND, IF, COALESCE, isIRI, isLiteral, isBlank, DATATYPE, LANG, BIND)Supported
Language-tagged literals (storage and LANG() function)Supported
Typed literals with xsd:integer, xsd:decimal, xsd:double, xsd:dateTime, xsd:booleanSupported
NOT EXISTSSupported
MINUSSupported
RDF-star (quoted triples, SPARQL-star BGP)Supported (v0.4.0)

Known limitations

FeatureStatus
langMatches() functionNot supported. Returns 0 rows without error. Full BCP 47 language tag matching is planned for a future release.
Custom aggregate extensions (property functions)Not supported. Standard aggregates (COUNT, SUM, AVG, MIN, MAX) are fully supported.
Variable-inside-quoted-triple patterns (<< ?s ?p ?o >>)Returns 0 rows with a WARNING. Ground quoted-triple patterns work.
LOAD <url> from arbitrary HTTP URIsNetwork-access dependent; supported via pg_ripple_http companion service.

SPARQL 1.1 Update

Test suite: W3C SPARQL 1.1 Update test suite (2013)

Target: ≥ 95% of applicable tests pass.

Supported features

FeatureStatus
INSERT DATASupported
DELETE DATASupported
INSERT WHERESupported
DELETE WHERESupported
DELETE/INSERT WHERESupported
CLEAR GRAPHSupported
CREATE GRAPH / DROP GRAPHSupported
Multi-statement updates (; separator)Supported
Named graph update operationsSupported
Idempotent re-insert (ON CONFLICT DO NOTHING)Supported

Known limitations

FeatureStatus
COPY, MOVE, ADD graph operationsImplemented as no-ops returning 0; full implementation planned for v0.21.0.
LOAD <url>Same as for queries above.

SHACL Core

Test suite: W3C SHACL Core test suite

Target: ≥ 95% of SHACL Core tests pass.

Supported constraints

ConstraintStatus
sh:targetClassSupported
sh:targetNodeSupported
sh:targetSubjectsOfSupported
sh:targetObjectsOfSupported
sh:property with sh:pathSupported
sh:minCount / sh:maxCountSupported
sh:datatypeSupported
sh:pattern (regex)Supported
sh:minLength / sh:maxLengthSupported
sh:minInclusive / sh:maxInclusiveSupported
sh:minExclusive / sh:maxExclusiveSupported
sh:in (enumeration)Supported
sh:hasValueSupported
sh:classSupported
sh:nodeKind (IRI, BlankNode, Literal)Supported
sh:orSupported
sh:andSupported
sh:notSupported
sh:node (nested shape reference)Supported
sh:qualifiedValueShape + sh:qualifiedMinCount / sh:qualifiedMaxCountSupported
Async validation pipeline (process_validation_queue)Supported
Sync mode (insert rejection)Supported

Known limitations

FeatureStatus
SHACL Advanced Features (SPARQL-based constraints, sh:SPARQLConstraint)Deferred to v0.21.0.
SHACL-AF (rules, sh:TripleRule)Partial implementation via Datalog; full SHACL-AF integration planned.

Running the conformance gate

The conformance tests run as part of the standard pg_regress suite:

cargo pgrx regress pg18 --postgresql-conf "allow_system_table_mods=on"

The relevant test files are:

  • tests/pg_regress/sql/w3c_sparql_query_conformance.sql
  • tests/pg_regress/sql/w3c_sparql_update_conformance.sql
  • tests/pg_regress/sql/w3c_shacl_conformance.sql
  • tests/pg_regress/sql/crash_recovery_merge.sql