Skip to content

Commit

Permalink
Updated Zuko/Asami, and needed to include Cheshire directly as a result
Browse files Browse the repository at this point in the history
  • Loading branch information
Paula Gearon committed Mar 20, 2021
1 parent 3ac502b commit 7371c38
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions cli/project.clj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
(defproject org.clojars.quoll/naga-cli "0.3.14"
(defproject org.clojars.quoll/naga-cli "0.3.15-SNAPSHOT"
:description "Forward Chaining Rule Engine CLI"
:url "http://github.com/threatgrid/naga"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojars.quoll/naga "0.3.14"]
[org.clojure/clojure "1.10.2"]
:dependencies [[org.clojars.quoll/naga "0.3.15-SNAPSHOT"]
[org.clojure/clojure "1.10.3"]
[prismatic/schema "1.1.12"]
[org.clojure/tools.cli "0.3.5"]
[org.clojure/core.cache "1.0.207"]
[org.clojars.quoll/parsatron "0.0.10"]
[cheshire "5.10.0"]
[org.clojars.quoll/naga-store "0.5.2"]
[org.clojars.quoll/asami "1.2.15"]
[org.clojars.quoll/asami "2.0.0-alpha6"]
; [com.datomic/datomic-pro "0.9.5697" :exclusions [com.google.guava/guava] ; uncomment for Datomic Pro
[com.datomic/datomic-free "0.9.5697"]
[org.postgresql/postgresql "9.3-1102-jdbc41"]]
Expand Down
10 changes: 7 additions & 3 deletions cli/src/naga/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
[zuko.entity.writer :as data-writer]
[asami.core]
[naga.storage.datomic.core]
[naga.storage.asami.core])
[naga.storage.asami.core]
[cheshire.core :as j])
(:import [clojure.lang ExceptionInfo]
[java.net URI]
[java.io File]))
Expand Down Expand Up @@ -138,7 +139,10 @@
{:keys [rules axioms]} (pabu/read-stream in-stream)

basic-store (store/assert-data fresh-store axioms)
json-data (data-writer/stream->triples (:graph basic-store) json-file)
json-data (with-open [r (io/reader json-file)]
(data-writer/entities->triples
(:graph basic-store)
(j/parse-stream r true)))
loaded-store (store/assert-data basic-store json-data)

config (assoc store-config :store loaded-store)
Expand All @@ -147,7 +151,7 @@

;; run the program
[store stats] (e/run config program)
output (data-reader/graph->str (:graph store))]
output (j/generate-string (data-reader/graph->entities (:graph store) false))]
(spit out-file output)))

(defn -main [& args]
Expand Down
2 changes: 1 addition & 1 deletion cli/test/tmp/out.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"id":"fred","sibling":"barney","parent":"mary","uncle":"george"},{"id":"barney","parent":"mary","uncle":"george","sibling":"fred"},{"id":"george","type":"male","sibling":"mary"},{"id":"mary","sibling":"george","brother":"george"}]
[{"id":"fred","sibling":"barney","parent":"mary","uncle":"george"},{"id":"barney","parent":"mary","uncle":"george","sibling":"fred"},{"id":"mary","sibling":"george","brother":"george"},{"id":"george","type":"male","sibling":"mary"}]
6 changes: 4 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
:url "http://github.com/threatgrid/naga"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.2"]
:dependencies [[org.clojure/clojure "1.10.3"]
[prismatic/schema "1.1.12"]
[org.clojure/core.cache "1.0.207"]
[org.clojars.quoll/parsatron "0.0.10"]
[org.clojars.quoll/naga-store "0.5.2"]
[org.clojars.quoll/asami "1.2.15"]]
[org.clojars.quoll/asami "2.0.0-alpha6"]
[cheshire "5.10.0"]]
:plugins [[lein-cljsbuild "1.1.8"]]
:deploy-repositories {"releases" {:url "https://repo.clojars.org" :creds :gpg}}
:profiles {
:dev {
:dependencies [[org.clojure/clojurescript "1.10.773"]
[tailrecursion/cljs-priority-map "1.2.1"]
[org.clojars.quoll/qtest "0.1.1"]
; [com.datomic/datomic-pro "0.9.5697" :exclusions [com.google.guava/guava] ; uncomment for Datomic Pro
[com.datomic/datomic-free "0.9.5697" :exclusions [com.google.guava/guava]]
Expand Down

0 comments on commit 7371c38

Please sign in to comment.