|
2 | 2 | (:require [fluree.db.json-ld.api :as fluree]
|
3 | 3 | [clojure.tools.namespace.repl :as tn :refer [refresh refresh-all]]
|
4 | 4 | [clojure.core.async :as async]
|
5 |
| - [fluree.db.util.async :refer [<? <?? go-try merge-into?]] |
| 5 | + [fluree.db.did :as did] |
| 6 | + [fluree.db.json-ld.api :as fluree] |
| 7 | + [fluree.db.util.async :refer [<? go-try merge-into?]] |
6 | 8 | [fluree.db.flake :as flake]
|
7 | 9 | [fluree.db.dbfunctions.fns :as dbfunctions]
|
8 | 10 | [fluree.db.constants :as constants]
|
|
34 | 36 | (set! *warn-on-reflection* true)
|
35 | 37 |
|
36 | 38 |
|
| 39 | + |
| 40 | +(comment |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + (do |
| 45 | + (def default-private-key |
| 46 | + "8ce4eca704d653dec594703c81a84c403c39f262e54ed014ed857438933a2e1c") |
| 47 | + |
| 48 | + |
| 49 | + (def did (did/private->did-map default-private-key )) |
| 50 | + |
| 51 | + (def default-context |
| 52 | + {:id "@id" |
| 53 | + :type "@type" |
| 54 | + :xsd "http://www.w3.org/2001/XMLSchema#" |
| 55 | + :rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 56 | + :rdfs "http://www.w3.org/2000/01/rdf-schema#" |
| 57 | + :sh "http://www.w3.org/ns/shacl#" |
| 58 | + :schema "http://schema.org/" |
| 59 | + :skos "http://www.w3.org/2008/05/skos#" |
| 60 | + :wiki "https://www.wikidata.org/wiki/" |
| 61 | + :f "https://ns.flur.ee/ledger#"})) |
| 62 | + |
| 63 | + (def file-conn @(fluree/connect {:method :file |
| 64 | + :storage-path "dev/data" |
| 65 | + :defaults |
| 66 | + {:context (merge default-context {:ex "http://example.org/ns/"}) |
| 67 | + :did did}})) |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + (def ledger @(fluree/create file-conn "user/test")) |
| 72 | + |
| 73 | + (def db1 @(fluree/stage |
| 74 | + (fluree/db ledger) |
| 75 | + [{:context {:ex "http://example.org/ns/"} |
| 76 | + :id :ex/brian, |
| 77 | + :type :ex/User, |
| 78 | + :schema/name "Brian" |
| 79 | + |
| 80 | + :schema/age 50 |
| 81 | + :ex/favNums 7 |
| 82 | + } |
| 83 | + {:context {:ex "http://example.org/ns/"} |
| 84 | + :id :ex/alice, |
| 85 | + :type :ex/User, |
| 86 | + :schema/name "Alice" |
| 87 | + |
| 88 | + :schema/age 50 |
| 89 | + :ex/favNums [42, 76, 9] |
| 90 | + } |
| 91 | + {:context {:ex "http://example.org/ns/"} |
| 92 | + :id :ex/cam, |
| 93 | + :type :ex/User, |
| 94 | + :schema/name "Cam" |
| 95 | + |
| 96 | + :schema/age 34 |
| 97 | + :ex/favNums [5, 10] |
| 98 | + :ex/friend [:ex/brian :ex/alice]}])) |
| 99 | + |
| 100 | + (def db2 @(fluree/commit! ledger db1 {:message "hi"})) |
| 101 | + |
| 102 | + @(fluree/load file-conn (-> ledger :alias)) |
| 103 | + |
| 104 | + ) |
| 105 | + |
37 | 106 | ;; TODO - general
|
38 | 107 | ;; if an subject is a component, do we allow it to be explicitly assigned as a ref to another component?
|
39 | 108 | ;; If so, do we not retract it? If we do retract it, we need to also retract all other refs
|
|
47 | 116 | ;; Some sort of defined-size tag lookup cache could make sense. Would need to clear it if a transaction altered any tag
|
48 | 117 |
|
49 | 118 |
|
50 |
| -;cljs-stuff |
| 119 | + ;cljs-stuff |
51 | 120 | (defn start [] (ra/start-figwheel!))
|
52 | 121 | (defn start-cljs [] (ra/cljs-repl "dev"))
|
53 |
| -;(defn stop [] (ra/stop-figwheel!)) ;; errs |
| 122 | + ;(defn stop [] (ra/stop-figwheel!)) ;; errs |
0 commit comments