Skip to content

Commit f68e7fd

Browse files
authored
Merge pull request #379 from fluree/feature/commit-metadata
Support for returning commits from /history
2 parents 8a74122 + aec1754 commit f68e7fd

13 files changed

+1190
-415
lines changed

deps.edn

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
instaparse/instaparse {:mvn/version "1.4.12"}
1212
metosin/malli {:mvn/version "0.9.2"}
1313
com.fluree/json-ld {:git/url "https://github.com/fluree/json-ld.git"
14-
:sha "0613d03a5657294a5575556f8eac68ab9f12705a"}
14+
:sha "a909330e33196504ef8a5411aaa0409ab72aaa35"}
1515

1616
;; logging
1717
org.clojure/tools.logging {:mvn/version "1.2.4"}
@@ -54,7 +54,8 @@
5454
:extra-deps {org.clojure/tools.namespace {:mvn/version "1.3.0"}
5555
criterium/criterium {:mvn/version "0.4.6"}
5656
figwheel-sidecar/figwheel-sidecar {:mvn/version "0.5.20"}
57-
thheller/shadow-cljs {:mvn/version "2.20.12"}}}
57+
thheller/shadow-cljs {:mvn/version "2.20.12"}
58+
com.magnars/test-with-files {:mvn/version "2021-02-17"}}}
5859

5960
:cljtest
6061
{:extra-paths ["test" "dev-resources"]

dev/user.clj

+72-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
(:require [fluree.db.json-ld.api :as fluree]
33
[clojure.tools.namespace.repl :as tn :refer [refresh refresh-all]]
44
[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?]]
68
[fluree.db.flake :as flake]
79
[fluree.db.dbfunctions.fns :as dbfunctions]
810
[fluree.db.constants :as constants]
@@ -34,6 +36,73 @@
3436
(set! *warn-on-reflection* true)
3537

3638

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+
:schema/email "[email protected]"
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+
:schema/email "[email protected]"
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+
:schema/email "[email protected]"
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+
37106
;; TODO - general
38107
;; if an subject is a component, do we allow it to be explicitly assigned as a ref to another component?
39108
;; If so, do we not retract it? If we do retract it, we need to also retract all other refs
@@ -47,7 +116,7 @@
47116
;; Some sort of defined-size tag lookup cache could make sense. Would need to clear it if a transaction altered any tag
48117

49118

50-
;cljs-stuff
119+
;cljs-stuff
51120
(defn start [] (ra/start-figwheel!))
52121
(defn start-cljs [] (ra/cljs-repl "dev"))
53-
;(defn stop [] (ra/stop-figwheel!)) ;; errs
122+
;(defn stop [] (ra/stop-figwheel!)) ;; errs

0 commit comments

Comments
 (0)