Skip to main content

Python bindings for Oxid-DB: a neurosymbolic database combining ontology reasoning with vector search

Project description

oxiddb

PyPI

Python bindings for Oxid-DB: a neurosymbolic database combining ontology reasoning with vector search.

This is the embedded package: the database runs in-process inside your Python program (no server, no network). If instead you want to talk to a running Oxid-DB server over HTTP, use the separate remote client oxiddb-client — same project, two delivery models. Install whichever matches how you deploy.

Installation

pip install oxiddb

Quick Start

import oxiddb

# Create a database with 4-dimensional vectors
db = oxiddb.OxidDB(dim=4)

# Build ontology
db.add_subclass("Pilsner", "Beer")
db.add_subclass("Stout", "Beer")

# Insert individuals with vectors
db.insert("Heineken", "Pilsner", vector=[0.9, 0.1, 0.0, 0.0])
db.insert("Guinness", "Stout", vector=[0.1, 0.0, 0.8, 0.9])

# Run the OWL 2 EL reasoner
db.classify()

# Query using OxQL
results = db.query("FIND ?x WHERE ?x IS-A Beer NEAR ?x TO [0.9, 0.1, 0.0, 0.0] LIMIT 5")
for r in results:
    print(f"{r.iri}: {r.score:.4f}")

# Save to disk
db.save("my_database.oxd")

Project details


Download files

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

Source Distribution

oxiddb-0.8.2.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

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

oxiddb-0.8.2-cp39-abi3-macosx_11_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file oxiddb-0.8.2.tar.gz.

File metadata

  • Download URL: oxiddb-0.8.2.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for oxiddb-0.8.2.tar.gz
Algorithm Hash digest
SHA256 a518e6b6c407674e8ac737d78af260434afe38b4b17a00c35c372f0c79ee1ff4
MD5 dae57f0237349253ce2c27c8bd87f073
BLAKE2b-256 53a1ff5f04effcc347ed378965d171162f56e310e2884050ac94632ffef93b2e

See more details on using hashes here.

File details

Details for the file oxiddb-0.8.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oxiddb-0.8.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22c8f37fa481004f2c8b333f0bf4b6a7b105e73e02424b5e8660b89d45c27d36
MD5 d35dd7591a770ca38f5976ee31c5cf5b
BLAKE2b-256 899c8479b2098272ff374c8d076478283db066b74dae8f99e3a10e4fb6eaa901

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page