Skip to content

OWL 2 RL Reasoner Engine Support - #756

Merged
bplatz merged 63 commits into
mainfrom
feature/owl2rl
Apr 16, 2024
Merged

bplatz merged 63 commits into
mainfrom
feature/owl2rl

Conversation

@bplatz

@bplatz bplatz commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

This is an initial version of OWL 2 RL reasoner support with support for the complete OWL 2 RL rule set. There are other rules beyond OWL 2 RL that folks would like supported, and we can add those.

This initial version focuses on functionality and not yet performance, but was designed in a way that can leverage some of Fluree's capabilities to improve.

Our approach to OWL is different than most (if not all) reasoners. We leverage an underlying datalog reasoning engine that can take advantage of Fluree's immutabilty characteristics to deliver fast performance and edge-scalability. It also allow custom reasoning rules in datalog to be combined with OWL to deliver capabilities that OWL alone is not capable of.

Technically, applying a reasoner creates a new "virtual" DB independent from the source database, or source reasoner rules. This allows the source database to update unimpeded, and also allows the reasoning rules to be updated unimpeded as well - making both the source data and reasoning rules very dynamic.

Reasoning for OWL is a query concern, and is therefore pushed to the edge in a query server. This allows unlimited query scalability. It is also allows new "reasoned dbs" to be created dynamically, allowing practitioners to iterate on rules quickly and determine effects, or even utilize multiple reasoning rule sets as different dbs within a single federated query.

Reasoned facts reside in-memory which results in extremely fast query. This means large reasonded fact sets will required more memory - but with memory availability today this seems like the ideal tradeoff in almost all circumstances.

Improvements from here include:

  • Performance - e.g. keeping reasoned dbs current with source data changes
  • Fuel calculations, limits (this is partially there, just not fully wired
  • Enhanced options (e.g. user-supplied reasoning rounds)
  • Supporting more of OWL beyond OWL 2 RL

The following OWL statements are part of OWL 2 RL and supported, according to the rules expressions detailed here:
https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules

instance equality

  • owl:sameAs

RDFS

  • rdfs:domain
  • rdfs:range
  • rdfs:subPropertyOf
  • rdfs:subClassOf

property semantics

  • owl:FunctionalProperty
  • owl:InverseFunctionalProperty
  • owl:SymmetricProperty
  • owl:propertyChainAxiom
  • owl:equivalentProperty
  • owl:inverseOf
  • owl:hasKey
  • owl:TransitiveProperty

class semantics

  • owl:equivalentClass
  • owl:intersectionOf
  • owl:unionOf
  • owl:someValuesFrom
  • owl:allValuesFrom
  • owl:hasValue (owl:onProperty)
  • owl:maxCardinality (where value = 1)
  • owl:maxQualifiedCardinality (where value = 1)
  • owl:oneOf

@bplatz
bplatz requested a review from a team April 12, 2024 14:39
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
Comment thread src/clj/fluree/db/reasoner.cljc Resolved
@bplatz
bplatz requested a review from zonotope April 16, 2024 02:31

@zonotope zonotope left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧧

@bplatz
bplatz merged commit 7f4967e into main Apr 16, 2024
@bplatz
bplatz deleted the feature/owl2rl branch April 16, 2024 17:16
aaj3f added a commit that referenced this pull request Jul 9, 2026
Add a cheap "peek" at Iceberg table data — the first N rows, or the first
N values of a column — as public fluree-db-api entries `sample_iceberg_rows`
and `sample_column_values`. Powers the LLM agent data-peek tool and solo
#756 (row preview).

Reader change (fluree-db-iceberg): wire a `max_rows` budget through
`decode_batches_arrow`. When set, the decode is restricted to the first
surviving row group, the decode batch is sized to the budget, and the row
loop stops (slicing the final batch) once N rows are produced. Combined with
the range-backed chunk reader this fetches only the footer plus the first
row group's projected column chunks — never a full-file scan. Unbounded
callers pass `None` and are behavior-identical.

`SendParquetReader::read_task_sample` drives that bounded decode from the
source store (no disk-cache fill) for any file size.

Sampler (fluree-db-api graph_source::iceberg_sample): mirrors
`preview_iceberg_table`'s catalog/storage/snapshot handling, plans a
projected single-table scan, reads the first task via `read_task_sample`,
and renders cells to JSON through the shared `typed_value_to_json` path
(temporals ISO-8601, decimals scaled, bytes hex, nulls JSON null).

Tests: bounded-N + first-row-group-only + projection over the in-memory
2-row-group fixture (fluree-db-iceberg); pure JSON-assembly unit tests
(bounded-N, projection, types/nulls/decimal) in the sampler; and an
env-gated `#[ignore]` live regression (FLUREE_ICEBERG_LIVE=1 + PAT) that
samples a real Snowflake table.
aaj3f added a commit that referenced this pull request Jul 9, 2026
…nto #1450

Brings feat/iceberg-act-step-engine onto feat/iceberg-virtual-dataset-support.
Disjoint from the browse-crawl work (6fdcedb) — no file overlap; merge-tree clean.

- WP-DB2 b8af743: bounded row/column Iceberg sampler (also solo #756)
- WP-DB3 ac5e15c: query a provisional (unpersisted) R2RML mapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants