-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
; | ||
; restore-ro.scm | ||
; | ||
; Simple example of read-only access to an AtomSpace. | ||
; | ||
(use-modules (opencog)) | ||
(use-modules (opencog persist)) | ||
(use-modules (opencog persist-ipfs)) | ||
|
||
; Open connection to the IPFS server. | ||
; One can specify either an IPNS CID, or an IPFS CID that identifies the | ||
; AtomSpace. | ||
; (ipfs-open "ipfs://localhost/ipns/QmVkzxhCMDYisZ2QEMA5WYTjrZEPVbETZg5rehsijUxVHx") | ||
; (ipfs-open "ipfs://localhost:5001/ipns/QmVkzxhCMDYisZ2QEMA5WYTjrZEPVbETZg5rehsijUxVHx") | ||
(ipfs-open "ipfs:///ipfs/QmaHDniEkN8uzcoPFc8htBakBLg4qkhZsj3nhyYbHM5Q2i") | ||
|
||
; (ipfs-resolve-atomspace) | ||
|
||
; Given a specific Atom, fetch the current Values on that Atom | ||
(define c (ConceptNode "example concept")) | ||
(fetch-atom c) | ||
|
||
; Restore the EvaluationLink that was previously created, by restoring | ||
; the Incoming Set of the ListLink it contains. Recall, that the | ||
; original EvaluationLink was: | ||
; | ||
; (EvaluationLink | ||
; (PredicateNode "Some relationship") | ||
; (ListLink | ||
; (ConceptNode "foo") | ||
; (ConceptNode "bar"))) | ||
; | ||
(define ll (List (Concept "foo") (Concept "bar"))) | ||
(fetch-incoming-set ll) | ||
|
||
; Review the stats | ||
(ipfs-stats) | ||
|
||
; Or one can fetch the entire contents of the AtomSpace. | ||
(load-atomspace) | ||
|
||
; Verify the AtomSpace contents | ||
(cog-prt-atomspace) | ||
|
||
; Review the stats | ||
(ipfs-stats) | ||
|
||
; Close the connection. | ||
(ipfs-close) | ||
|
||
; The End. That's all for now. |