opencog / atomspace-restful

RESTful web server for the AtomSpace Graph Database
http://wiki.opencog.org/w/REST_API
Other
1 stars 3 forks source link

FIX python restapi and examples WIP #2

Closed manisabri closed 4 years ago

manisabri commented 4 years ago

Everything seems to work except setting the attention value. Had a look at the AtomSpace Cython code cython/opencog/value.pyx and cython/opencog/atom.pyx there are setters and getters for tv but nothing for av ... I need to figure out how to set the Attention Value

linas commented 4 years ago

Thanks!

linas commented 4 years ago

While we are on the topic of communications protocols, I should mention one more important possibility to keep in mind. So ... the AtomSpace can be used in a distributed fashion, in that an AtomSpace running on a local machine can pull Atoms from a remote machine, or push them out, or pull/push Values. It does this using the "Backend" API. There's a few gotchas:

The only remaining backend is to the postgres SQL server. So multiple atomspaces can all connect to the same postgres server, and share that way. We used to have a backend to some BigTablle variant, but it never worked right. We used to have a ZMQ-based backend to one of the java DB's, Neo4j I think, but it was painfully slow. I'm not sure if it's because neo4j was slow or if the network serialization-deserializatin was slow .. or both... it ran at a few hundred atoms/sec. A minimum of 2K atoms/sec is required, higher is desirable. Native C++ speeds are 100K atoms/sec and up.

For historical reasons, we do NOT have a direct atomspace-to-atomspace connection. We could, but we don't. The web.api could maybe provide that.. except it is probably too slow, as currently designed and implemented ... but this is worth thinking about.

The backend requires only a half-dozen messages. The web.api is probably overkill for what it needs -- the backend is not anywhere near as fancy. The C++ API is here: https://github.com/opencog/atomspace/blob/master/opencog/atomspace/BackingStore.h

linas commented 4 years ago

Well, there are still two other backends, one to IPFS and one to DHT, but both are mis-designed. They .. work .. .they're just .. fundamentally wrong.