Great, I believe it would ease things a lot. Let me notify you when I'm ready to do some more serious coding.
Ivan pet, 24. ruj 2021. u 04:48 Linas Vepstas <[email protected]> napisao je: > Hi Ivan, > > On Thu, Sep 23, 2021 at 10:51 AM Ivan V. <[email protected]> wrote: > > > > Thank you, I'll take some time to think about it if you don't mind. > > Heh. Too late! Rather than nagging you or anyone else about this, I > thought about it a bit, and realized that I could hack up a basic > solution in a day. So I did. If you grabe the very latest atomspace > and cogserver code, then you get a simple network API to the > atomspace, here. The README explains all: > > > https://github.com/opencog/atomspace/blob/master/opencog/persist/json/README.md > > The JSON is delivered as a string, over the network. You still have to > do something with it. If/when you want to create javascript, node.js, > emscripten, or whatever kind of interfaces to it, let me know. I just > now create a new, empty git repo at > https://github.com/opencog/atomspace-js > > Anyone who is interested should just ask, I'll provide write access to > that repo. > > --linas > > > > > > > čet, 23. ruj 2021. u 17:34 Linas Vepstas <[email protected]> > napisao je: > >> > >> On Thu, Sep 23, 2021 at 3:15 AM Ivan V. <[email protected]> wrote: > >> > > >> > Just a quick question while we're at it, if I may: what is the best > way to communicate between web browser and atomspace? > >> > >> Currently, none. The "atomspace explorer" used an atomspace server > >> that was weird, slow, mis-designed, old and incomplete... > >> > >> Let me take you on a trip. > >> > >> What is really needed are some javascript bindings that talk to the > >> cogserver. It is very easy, trivial, even, to talk to the cogserver, > >> and get a reply. The hard part is to convert the results into whatever > >> javascript you want -- we do not have any existing layer for that. > >> Creating this layer would be an excellent project. > >> > >> Thus, for example: > >> -- use javascript to open a socket to 17001 > >> -- send command over that socket; for example, > >> `(cog-value (Concept "foo") (Predicate "some key"))` > >> -- read the result, for example > >> `(FloatValue 1.000000 2.000000 3.00000)` > >> -- close the socket, or re-use it. > >> > >> Great! But how do you convert `(FloatValue 1.000000 2.000000 > >> 3.00000)` into what you want? (What do you want?) > >> > >> Now, before you get on that airplane, and start writing code to use > >> javascript to talk to the cogserver, consider this: > >> > >> If you wrote that code, you would have to cache the results locally, > >> in javascript. That is, you would have to create a local, in-browser > >> copy of (Concept "foo") and (Predicate "some key") and remember that > >> (FloatValue 1 2 3) is attached to it. In other words, you would be > >> re-inventing the atomspace, locally, running inside the browser. Good > >> god, why? We already have an atomspace, why reinvent a > >> browser-specific one? (Because this is what things like the > >> atomspace-explorer were doing.) > >> > >> The correct solution is this: create javascript bindings for the > >> atomspace. That's it, end of story. Want to talk to some remote > >> AtomSpace? Just use the CogStorageNode! That's it, you're done. > >> > >> I'll stop writing the email here .. because there is nothing more to > >> say! People who use web browsers need javascript. If we had javascript > >> binding to the atomspace, you would have it in your browser. > >> > >> If you want to create these bindings, I'l create a github repo under > >> the opencog project, give you full write permission, and you can do > >> whatever in there. I'm sure many people could use them. > >> > >> --linas > >> > >> > > >> > čet, 23. ruj 2021. u 08:24 Linas Vepstas <[email protected]> > napisao je: > >> >> > >> >> On Thu, Sep 23, 2021 at 12:44 AM Ivan V. <[email protected]> > wrote: > >> >> > > >> >> > As for the visualization tool, I'll have more time in a few weeks > when I settle some of my obligations. > >> >> > >> >> You don't have to make promises! There is no intent to guilt-trip > you > >> >> into doing something. > >> >> > >> >> > Then, a kind of OpenCog debugger (or IDE) is what I have on my > mind. > >> >> > >> >> In the end, whatever you create has to be for yourself, for your own > >> >> entertainment. If it turns out to be useful for others, that would be > >> >> wonderful, but, as this long conversation has shown, there's no > >> >> general vision of what anyone wants. Different people want different > >> >> things; what's useful for one is useless for another. > >> >> > >> >> > It would be something like an atomspace editor communicating to > cogserver, showing inference trees related to edited fragments. Nothing too > fancy, no dozens of options, just a simple atomspace expressions writing > aid, as minimalistic as it can get, with an editor on the left and related > inference trees on the right side. > >> >> > >> >> Two part reply. (1) inference trees are very specific to the PLN > >> >> backward chainer, and have almost nothing to do with the atomspace. > >> >> (other than that they are kept in the atomspace ... for a while .. > >> >> until they are deleted. Nil can supply those if that is what you > >> >> really want.) > >> >> > >> >> (2) Don't worry about the cogserver. Don't use the cogserver. Just > >> >> work with the atomspace directly. Why? (a) you don't need the > >> >> cogserver to get things done. (b) if you absolutely must have a > >> >> network connection to some remote AtomSpace, use the CogStorageNode > >> >> -- it will automatically open a network connection to a remote > >> >> AtomSpace, and it will automatically trade atoms with it, bringing > >> >> them over to your local AtomSpace. You just have to specify which > >> >> atoms. If you are not sure which atoms, you can easily run a query on > >> >> the remote AtomSpace. > >> >> > >> >> Documentation: > >> >> https://wiki.opencog.org/w/CogStorageNode > >> >> > >> >> Demos: > >> >> https://github.com/opencog/atomspace-cog/tree/master/examples > >> >> > >> >> -- linas > >> >> > >> >> > >> >> -- > >> >> Patrick: Are they laughing at us? > >> >> Sponge Bob: No, Patrick, they are laughing next to us. > >> >> > >> >> -- > >> >> You received this message because you are subscribed to the Google > Groups "opencog" group. > >> >> To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected]. > >> >> To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CAHrUA34zZ%2BqFdgycq8PQjp1BvikD0b1Y8HSRSebMMxCfeF5p8Q%40mail.gmail.com > . > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > Groups "opencog" group. > >> > To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected]. > >> > To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CAB5%3Dj6UkUirdXC9h7fmgzHvaZzz46coGYTUAU2TdqigTEXX4xw%40mail.gmail.com > . > >> > >> > >> > >> -- > >> Patrick: Are they laughing at us? > >> Sponge Bob: No, Patrick, they are laughing next to us. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups "opencog" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > >> To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CAHrUA35-K8V6T3V%2BM7nLSze0NdPhcuk9txBNAoMAd1XJ%3DGekEw%40mail.gmail.com > . > > > > -- > > You received this message because you are subscribed to the Google > Groups "opencog" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CAB5%3Dj6Vn5b1NdXa1ptQEtEMXES%3D9H23Ry6J3_X4f%3DAraf%2BEybg%40mail.gmail.com > . > > > > -- > Patrick: Are they laughing at us? > Sponge Bob: No, Patrick, they are laughing next to us. > > -- > You received this message because you are subscribed to the Google Groups > "opencog" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CAHrUA36dV20DGvtE2hTP94q48-f5BrtBjRi3h%2Bv5U6hYhr3MsQ%40mail.gmail.com > . > -- You received this message because you are subscribed to the Google Groups "opencog" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/CAB5%3Dj6UzcxtTDdDADHTO9BJJFSkTpA1ExdrxGt_xFw4WWTw1zQ%40mail.gmail.com.
