diff --git a/opencog/persist/ipfs/IPFSAtomLoad.cc b/opencog/persist/ipfs/IPFSAtomLoad.cc index 7b04ae2..c1fffa8 100644 --- a/opencog/persist/ipfs/IPFSAtomLoad.cc +++ b/opencog/persist/ipfs/IPFSAtomLoad.cc @@ -166,12 +166,9 @@ std::string IPFSAtomStorage::encodeValueToStr(const ValuePtr& v) /* ================================================================ */ -Handle IPFSAtomStorage::getNode(Type t, const char * str) +Handle IPFSAtomStorage::do_fetch_atom(Handle &h) { - rethrow(); - // Build the name - Handle h(createNode(t, str)); std::string path = _atomspace_cid + "/" + h->to_short_string(); // std::cout << "Query path = " << path << std::endl; @@ -185,13 +182,18 @@ Handle IPFSAtomStorage::getNode(Type t, const char * str) return h; } +Handle IPFSAtomStorage::getNode(Type t, const char * str) +{ + rethrow(); + Handle h(createNode(t, str)); + return do_fetch_atom(h); +} + Handle IPFSAtomStorage::getLink(Type t, const HandleSeq& hs) { rethrow(); - throw RuntimeException (TRACE_INFO, "Not implemented\n"); - Handle hg; // (doGetLink(t, hs)); - // if (hg) get_atom_values(hg); - return hg; + Handle h(createLink(hs, t)); + return do_fetch_atom(h); } /* ============================= END OF FILE ================= */ diff --git a/opencog/persist/ipfs/IPFSAtomStorage.h b/opencog/persist/ipfs/IPFSAtomStorage.h index c1bccea..5493d3e 100644 --- a/opencog/persist/ipfs/IPFSAtomStorage.h +++ b/opencog/persist/ipfs/IPFSAtomStorage.h @@ -84,6 +84,7 @@ class IPFSAtomStorage : public BackingStore ipfs::Json fetch_atom_dag(const std::string&); Handle decodeStrAtom(const std::string&); Handle decodeJSONAtom(const ipfs::Json&); + Handle do_fetch_atom(Handle&); void store_incoming_of(const Handle &, const Handle&); // --------------------------