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.4.tar.gz
(12.7 kB
view details)
Built Distribution
File details
Details for the file hyperon_das-0.1.4.tar.gz
.
File metadata
- Download URL: hyperon_das-0.1.4.tar.gz
- Upload date:
- Size: 12.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f10e5c2304a79e9982e87deadb88e631fe6329516c4c66643bf8d776268afaa |
|
MD5 | a0e7a2b2628990ab41621cbbf31e3be2 |
|
BLAKE2b-256 | ffe210c06b1b6584de9932cdaa93e561f3c6afac8c45b706e3a722a319888a0d |
File details
Details for the file hyperon_das-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: hyperon_das-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5bdd8e6d91e8b74d32ce29930c2a58a1ce20a8b6a9e8883b6e0dc48821c6549 |
|
MD5 | e8b42504d20a4a6e8f51a76a778542b8 |
|
BLAKE2b-256 | 10f21d49619282f81439b1c627990efcf8599011b2c6afd3369a029f16bae3f1 |