Skip to main content

Query Engine API for Distributed AtomSpace

Project description

Hyperon DAS

A data manipulation API for Distributed Atomspace (DAS). It allows queries with pattern matching capabilities and traversal of the Atomspace hypergraph.

References and Guides

Installation

Before you start, make sure you have Python >= 3.10 and Pip installed on your system.

You can install and run this project using different methods. Choose the one that suits your needs.

Using-pip

Run the following command to install the project using pip::

pip install hyperon-das

Using-Poetry

If you prefer to manage your Python projects with Poetry, follow these steps:

  1. Install Poetry (if you haven't already):

    pip install poetry
    
  2. Clone the project repository:

    git clone git@github.com:singnet/das-query-engine.git
    cd das-query-engine
    
  3. Install project dependencies using Poetry:

    poetry install
    

    Note: If perhaps you are running over SSH, poetry install might stuck checking the keyring, you can verify this by running poetry install -vvv, then the command will be stuck on the following lines:

    Checking if keyring is available
    [keyring:keyring. backend] Loading KWallet |  
    [keyring:keyring.backend] Loading SecretService |  
    [keyring:keyring. backend] Loading Windows |  
    [keyring: keyring.backend] Loading chainer |  
    [keyring:keyring.backend] Loading libsecret |  
    [keyring:keyring.backend] Loading macOS |  
    Using keyring backend 'SecretService Keyring'
    

    If that is the case, deactivate keyring and run poetry install again:

    poetry config keyring.enabled false
    poetry install
    
  4. Activate the virtual environment created by Poetry:

    poetry shell
    

Now you can run the project within the Poetry virtual environment.

Tests

In the main project directory, you can run the command below to run the unit tests

make unit-tests

Likewise, to run performance tests

make performance-tests

Generating atoms and checking the performance. This test typically takes more than 60 seconds to run with the default settings. Arguments allowed in OPTIONS:

  • --node_count (default: "100"): Number of nodes in the knowledge base
  • --word_count (default: "8"): Number of words in a node's name
  • --word_length (default: "3"): Number of characters in each word of node's name
  • --alphabet_range (default: "2-5"): Determines the range for the alphabet size.
  • --word_link_percentage (default: 0.1): Percentage of word links.
  • --letter_link_percentage (default: 0.1): Percentage of letter links.
  • --seed (default: 11): Sets the random seed for reproducibility (int/float).
  • --repeat (default: 1): (Test only) Repeats test n times to collect average/std deviation of execution time.
  • --mongo_host_port (default: "localhost:15927"): (Test only) Mongo hostname and port. eg: localhost:1234.
  • --mongo_credentials (default: ***:*** ): (Test only) Mongo username and password. eg: user:pass.
  • --redis_host_port (default: "localhost:15926"): (Test only) Redis hostname and port. eg: localhost:1234.
  • --redis_credentials (default: ":"): (Test only) Redis username and password. eg: user:pass.
  • --redis_cluster (default: False): (Test only) Redis cluster configuration.
  • --redis_ssl (default: False): (Test only) Sets Redis SSL.
make benchmark-tests OPTIONS="--word_link_percentage=0.01"

or create a MeTTa file using the same options:

make benchmark-tests-metta-file OPTIONS="--word_link_percentage=0.01"

You can do the same to run integration tests

make integration-tests

The integration tests use a remote testing server hosted on Vultr, at the address 45.63.85.59, port 8080. The loaded knowledge base is the animal base, which contains the Nodes and Links listed below:

(: Similarity Type)
(: Concept Type)
(: Inheritance Type)
(: "human" Concept)
(: "monkey" Concept)
(: "chimp" Concept)
(: "snake" Concept)
(: "earthworm" Concept)
(: "rhino" Concept)
(: "triceratops" Concept)
(: "vine" Concept)
(: "ent" Concept)
(: "mammal" Concept)
(: "animal" Concept)
(: "reptile" Concept)
(: "dinosaur" Concept)
(: "plant" Concept)
(Similarity "human" "monkey")
(Similarity "human" "chimp")
(Similarity "chimp" "monkey")
(Similarity "snake" "earthworm")
(Similarity "rhino" "triceratops")
(Similarity "snake" "vine")
(Similarity "human" "ent")
(Inheritance "human" "mammal")
(Inheritance "monkey" "mammal")
(Inheritance "chimp" "mammal")
(Inheritance "mammal" "animal")
(Inheritance "reptile" "animal")
(Inheritance "snake" "reptile")
(Inheritance "dinosaur" "reptile")
(Inheritance "triceratops" "dinosaur")
(Inheritance "earthworm" "animal")
(Inheritance "rhino" "mammal")
(Inheritance "vine" "plant")
(Inheritance "ent" "plant")
(Similarity "monkey" "human")
(Similarity "chimp" "human")
(Similarity "monkey" "chimp")
(Similarity "earthworm" "snake")
(Similarity "triceratops" "rhino")
(Similarity "vine" "snake")
(Similarity "ent" "human")

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.9.11.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

hyperon_das-0.9.11-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyperon_das-0.9.11.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for hyperon_das-0.9.11.tar.gz
Algorithm Hash digest
SHA256 54600a31418e832d5789d8dfede8bb8e14d135b70174c2e340bfb6c9c1a90802
MD5 4a9315e43f4e421cc7618ade3d165d01
BLAKE2b-256 0555e0a6fdedba140818ff0678fc9eb945a80d3460038861d92323b620705ca5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyperon_das-0.9.11-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for hyperon_das-0.9.11-py3-none-any.whl
Algorithm Hash digest
SHA256 fbe4eef481feae9f1dc74b8a1552aaa1b8a9984a8683bb2598d71e04a40cff99
MD5 9e68fbd564ed633a32e37cbe3d764d65
BLAKE2b-256 cb56e2d629842f44c8e4314efb4c92d37e3b8e04012f15cc5d69945fd8ce03d9

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