Skip to main content

conceptual-taxonomy

Find class abstractions — rdfs:subClassOf hierarchies — in a conceptual schema, whatever kind of database it came from.

pip install conceptual-taxonomy
from conceptual_taxonomy import discover_abstractions

result = discover_abstractions(bundle)          # a {conceptualSchema, physicalMapping} bundle
result.abstract_classes                          # proposed classes, with evidence
result.subclass_edges                            # proposed subClassOf edges
merged = result.merge_into(bundle)               # additive; never rewrites what is already there

Pure function. No database access, no connectors, no credentials, no I/O. Same input, same output, every time.

The problem it solves

A database stores Account → {Checking, Savings, Mortgage, Insurance} in any of several ways: one table with a type column; a parent table plus subtype tables joined on a shared key; four independent tables with the common columns copied into each; and the ArangoDB equivalents of all three. Same concepts, completely different physical shapes.

All of them must produce the same conceptual answer. That is the whole requirement, and it is what the fixture set tests: one bank-account taxonomy in eight encodings, one expected result.

Designed as a companion to arango-schema-analyzer and relational-schema-analyzer, which already emit the same {conceptualSchema, physicalMapping, metadata} bundle shape. Neither discovers abstractions today, and the logic is identical for both — so it lives here rather than being written twice.

Why one implementation and not two

An abstraction must separate properties present on every subclass from those present on only some:

top.shared_properties    # [{"name": "balance", ...}]  → SUM(balance) across all accounts is sound
top.partial_properties   # [{"name": "monthlyPayment", "presentOn": ["MortgageAccount"],
                         #   "coverage": 0.25}]        → SUM(monthlyPayment) reads 1 of 4 subclasses

Aggregating over the second kind silently under-reports, with no error. Two implementations would drift on that boundary, and the drift shows up as one of them answering confidently and wrong. That is a correctness argument for sharing, not a tidiness one.

How it finds them

Four mechanisms; the first three are deterministic and need no LLM.

Mechanism Finds
4.1 Discriminator values one container + a type column
4.2 Formal concept analysis sibling tables with a shared property core and no parent
4.3 Shared-key subsumption a child keyed on its parent's key, and the ER specialization pattern
4.4 Naming hook (optional LLM) a domain name where morphology gives none

Concept analysis yields a genuine lattice, so multi-level taxonomies come out multi-level: Account → FinancialAccount → Checking alongside Account → InsuranceAccount.

Mechanism 4.4 may only rename or subdivide what the deterministic mechanisms produced — it can never introduce a class none of them proposed.

Output is proposals, not facts

Every class and edge carries mechanism, confidence, and evidence, and merge_into is additive and reversible. Consumers are expected to arbitrate: schema-derived taxonomy will compete with taxonomy extracted from documents and from cross-ontology alignment, and resolving those conflicts — cycle detection, disjointness checking, human curation — belongs downstream, not here.

Correspondingly, this library does no consistency checking of its own.

Disjointness and completeness, measured rather than assumed

Where the caller supplies key-overlap counts, the ER specialization constraints are derived: disjoint when no parent key appears in two subtypes, complete when every parent key appears in one. Unmeasured yields None — never False. Absence of evidence is not evidence of absence, and blanket disjointness assertions are how schema-to-OWL pipelines produce unsatisfiable ontologies.

Not in scope

  • Database access — input is a bundle, output is a bundle fragment
  • Foreign-key inference — paradigm-specific; lives in the two analyzers
  • Query generation — consumers compile abstractions into AQL / SQL / SPARQL themselves

Documentation

Status

Pre-1.0 and moving. The API is one function and will change as real analyzers feed it — pin a version.

License

Apache-2.0, matching the surrounding Arango ecosystem libraries.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conceptual_taxonomy-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

conceptual_taxonomy-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file conceptual_taxonomy-0.1.0.tar.gz.

File metadata

  • Download URL: conceptual_taxonomy-0.1.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for conceptual_taxonomy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9161d7373fcf7968d409dbfcf78e12073863efb8ad13b0f52b4210b123182429
MD5 742a4d6391a9d1da7be694e58cd899bc
BLAKE2b-256 de2b750f058095e56616c3241cacfd5d761bce7fc7f2628995cc52f65091f3df

See more details on using hashes here.

File details

Details for the file conceptual_taxonomy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for conceptual_taxonomy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cba46ca2d4894c584068d18a6c1d57f81b27e5712a69e10229acb6a80d2c0af
MD5 6ace865d0bc50bd8d40d24a37368408b
BLAKE2b-256 20fd7215d2f1a2cb572e60656201a6866785b2ed80841e5922fbbb444e9b2f23

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page