Skip to content

OWLGraph 1.0.2

Released: 2026-04-11 Status: available

A bug-fix release that closes three holes exposed by end-to-end verification of the 1.0.1 fiveloaves reasoning tests. 1.0.1 shipped the OWL rule implementations correctly, but the schema a fresh ontology compiled to was silently single-valued, and mutation errors came back with the wrong HTTP status. Both issues combined made it look like reasoning features were failing when they were actually working — or, worse, silently corrupting data on writes.

  • Non-functional properties now compile to multi-value predicates. owl/compiler emitted pred: uid @count (single-value) instead of pred: [uid] @count (list) when serializing a non-functional object or data property to a Dgraph schema string. Dgraph silently accepted writes to the resulting single-value predicate and replaced the existing edge each time, so any property that should have multiple targets (hasChapter, hasChild, hasMember, precedesEvent, …) retained only the last-written edge. The struct field SchemaUpdate.List was already correct; only the string serializer was wrong. Fixed in CompileSchemaString, covered by new regression tests that check the serialized schema string (not just the struct field) for both functional and non-functional object and data properties.
  • Mutation error responses now return proper HTTP status codes. /mutate used to return HTTP 200 with {"errors": [...], "data": null} on OWL materializer errors (like disjointness violations). Clients that check HTTP status before parsing the body — including the fiveloaves reasoning test harness and any vanilla fetch() caller — saw the 200 and assumed success, silently missing the error. Added x.SetHttpStatusWithData and wired it into the mutation handler’s post-execute error branch so materializer errors come back as HTTP 400 Bad Request with the errors body. Unit-tested against httptest.Recorder.
  • Integration-test cluster detection is more discriminating. clusterAvailable() in owl/materializer/integration_test.go treated any 200 response from localhost:8080/health as a Dgraph alpha. On dev boxes where :8080 is held by an unrelated service, the test would mis-detect and then fail loudly on /alter 404 instead of properly skipping. The probe now verifies Dgraph’s health response shape (version present, service absent).

This is a patch release on the 1.0 line. No action required for databases created on 1.0.2+. The compiler fix applies automatically to any ontology loaded or re-loaded after the upgrade.

Databases created on 1.0.0 or 1.0.1 that loaded an ontology with non-functional object or data properties may have lost edge data. Re-loading the ontology on 1.0.2 migrates the schema to the correct [uid]/[string]/etc. list types for all new writes. Any historical data that was silently clobbered on 1.0.1 must be re-ingested from the source (or rebuilt from reverse edges where available — e.g. hasChapter can be reconstructed from inBook’s reverse index).

  • HTTP behavior change: mutations that fail OWL validation now return HTTP 400 instead of HTTP 200. Clients that parse the response body will continue to see the same error shape. Clients that only inspect HTTP status will now correctly detect the failure.
  • Schema change on ontology re-load: predicates that were pred: uid @count on 1.0.1 will be declared as pred: [uid] @count after the next ontology load on 1.0.2. Dgraph handles the in-place ALTER; existing data on those predicates is preserved (single-value becomes a one-element list) and new writes correctly append.