Skip to main content

Query Engine API for Distributed AtomSpace

Project description

Hyperon DAS

Query Engine API for Distributed AtomSpace and Pattern Matcher.

Installation

This packaage requires python >= 3.8.5 to run.

pip install hyperon-das

Prepare environment

1. Redis and MongoDB You must have Redis and MongoDB running in your environment 2. Environments Variables You must have the following variables set in your environment with their respective values:

DAS_MONGODB_HOSTNAME=172.17.0.2
DAS_MONGODB_PORT=27017
DAS_MONGODB_USERNAME=mongo
DAS_MONGODB_PASSWORD=mongo
DAS_REDIS_HOSTNAME=127.0.0.1
DAS_REDIS_PORT=6379

Usage

Create a client API

from hyperon_das import DasAPI

api_client = DasAPI('redis_mongo')

Example

from hyperon_das.pattern_matcher import And, Variable, Link

V1 = Variable("V1")
V2 = Variable("V2")
V3 = Variable("V3")

expression = And([
    Link("Inheritance", ordered=True, targets=[V1, V2]),
    Link("Inheritance", ordered=True, targets=[V2, V3])
])

resp = api_client.query(expression)

print(resp)
{{'V1': 'a1fb3a4de5c459bfa4bd87dc423019c3', 'V2': '98870929d76a80c618e70a0393055b31', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}, {'V1': 'bd497eb24420dd50fed5f3d2e6cdd7c1', 'V2': '98870929d76a80c618e70a0393055b31', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}, {'V1': 'e2d9b15ab3461228d75502e754137caa', 'V2': 'c90242e2dbece101813762cc2a83d726', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}, {'V1': 'd1ec11ec366a1deb24a079dc39863c68', 'V2': 'c90242e2dbece101813762cc2a83d726', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}, {'V1': 'fa77994f6835fad256902605a506c59c', 'V2': '98870929d76a80c618e70a0393055b31', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}, {'V1': 'c77b519f8ab36dfea8e2a532a7603d9a', 'V2': 'd1ec11ec366a1deb24a079dc39863c68', 'V3': 'c90242e2dbece101813762cc2a83d726'}, {'V1': '305e7d502a0ce80b94374ff0d79a6464', 'V2': '98870929d76a80c618e70a0393055b31', 'V3': '81ec21b0f1b03e18c55e056a56179fef'}}

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

hyperon_das-0.1.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

hyperon_das-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file hyperon_das-0.1.2.tar.gz.

File metadata

  • Download URL: hyperon_das-0.1.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.4.12-arch1-1

File hashes

Hashes for hyperon_das-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cd7486aee74c5e48ddd8c9ba505253e754487930bce5242f7f58e00d6015e4bb
MD5 2651f8dba1cd0c2e905c188071ca94cb
BLAKE2b-256 db49666181d871b2a6cec09e4ee2df554ea8f1dd006bd4ba5ad566b3b5563c29

See more details on using hashes here.

File details

Details for the file hyperon_das-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hyperon_das-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.4.12-arch1-1

File hashes

Hashes for hyperon_das-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aff514343055fa7e027f92ba3af15f77747427b9b43d444d2708b834dae95e84
MD5 e20babc924f79a4b151b631c254e4a2e
BLAKE2b-256 9b977510841390b8e22150a6ee16d9659dca646a4531e2d8873b00d8a04c930f

See more details on using hashes here.

Supported by

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