Closed andre-senna closed 1 month ago
You're facing this issue for 2 reasons
das-cli faas start
You'll see this:
Did you see that the function is running on port 8080 and version (1.12.11) ?
So, when you try to connect the function and receive an error about version mismatch
you can fix this with this command:
das-cli faas update-version
For more details run: das-cli faas update-version --help
das = DistributedAtomSpace(query_engine='remote', host=host, port=port)
with query_engine='remote'
not query_engine='local'
The way you instantiated a DAS, you made a local Das with backend in RAM.
It's the same this:
das = DistributedAtomSpace()
The correct concept is this
Local DAS is a DAS that has a backend in RAM
or RedisMongo
# Ram
das = DistributedAtomSpace()
# RedisMongo
das = DistributedAtomSpace(
atomdb='redis_mongo',
mongo_hostname='...',
mongo_port=...,
mongo_username=...,
mongo_password=...,
redis_hostname=...,
redis_port=...
)
And Remote Das is a Das that connects to a server via OpenFaas (this is your case)
das = DistributedAtomSpace(query_engine='remote', host=host, port=port)
Hi! I performed the following steps to load small local DAS:
1.Started dbs with:
$ das-cli db start
$ das-cli metta load /home/saulo/snet/hyperon/github/das-pk/shared_hsa_dmel2metta/data/output/test.metta
from hyperon_das import DistributedAtomSpace
host = '127.0.0.1' port = '8888' das = DistributedAtomSpace(query_engine='local', host=host, port=port)
print(f"Connected to DAS at {host}:{port}") print("(nodes, links) =", das.count_atoms())
$ python3.10 bio2.py Connected to DAS at 127.0.0.1:8888 (nodes, links) = (0, 0)
Why there are no atoms? The MeTTa code in the test.metta is below Thanks!
(allele FBal0100372) (allele_symbol (allele FBal0100372) Myc[P0]) (gene_id (allele FBal0100372) FBgn0262656) (taxon_id (allele FBal0100372) 7227) (allele FBal0304771) (allele_symbol (allele FBal0304771) Clk[SV40.Tag:V5]) (gene_id (allele FBal0304771) FBgn0023076) (taxon_id (allele FBal0304771) 7227)