main
Michael Jerger 10 months ago
parent 68e5703821
commit 5e71840662

@ -1,4 +1,4 @@
(defproject activity-pub-poc "0.1.0-SNAPSHOT" (defproject fed-poc "0.1.0-SNAPSHOT"
:description "FIXME: write description" :description "FIXME: write description"
:url "http://example.com/FIXME" :url "http://example.com/FIXME"
:license {:name "Apache License, Version 2.0" :license {:name "Apache License, Version 2.0"
@ -24,7 +24,7 @@
[clj-turtle "0.1.3"] [clj-turtle "0.1.3"]
[org.clojars.quoll/raphael "0.1.6"] [org.clojars.quoll/raphael "0.1.6"]
[instaparse "1.4.12"]] [instaparse "1.4.12"]]
:main ^:skip-aot org.domaindrivenarchitecture.activity-pub-poc.core :main ^:skip-aot org.domaindrivenarchitecture.fed-poc.core
:profiles {:test {:test-paths ["src/test/cljc" :profiles {:test {:test-paths ["src/test/cljc"
"src/test/clj"] "src/test/clj"]
:resource-paths ["src/test/resources"] :resource-paths ["src/test/resources"]

@ -1,9 +1,9 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 (ns org.domaindrivenarchitecture.fed-poc.activitystreams2
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]] [orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh] [org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl] [org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.activity-pub-poc.xsd :as xsd])) [org.domaindrivenarchitecture.fed-poc.xsd :as xsd]))

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core (ns org.domaindrivenarchitecture.fed-poc.core
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[clojure.walk :as walk] [clojure.walk :as walk]
[orchestra.core :refer [defn-spec]] [orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh] [org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[clojure.data.json :as json])) [clojure.data.json :as json]))
(declare normalize-functional-property) (declare normalize-functional-property)

@ -1,9 +1,9 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.owl (ns org.domaindrivenarchitecture.fed-poc.owl
"A swallow spec translation implementation of owl. Inheritance of FunctionalProperty "A swallow spec translation implementation of owl. Inheritance of FunctionalProperty
is realized in deep implemented." is realized in deep implemented."
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.predicates :as p] [org.domaindrivenarchitecture.fed-poc.predicates :as p]
[orchestra.core :refer [defn-spec]])) [orchestra.core :refer [defn-spec]]))
; Properties:https://www.w3.org/TR/owl-ref/#Property ; Properties:https://www.w3.org/TR/owl-ref/#Property

@ -1,4 +1,4 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.predicates (ns org.domaindrivenarchitecture.fed-poc.predicates
(:require [clojure.string :as str] (:require [clojure.string :as str]
[lambdaisland.uri :as uri])) [lambdaisland.uri :as uri]))

@ -1,4 +1,4 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.spec-helper (ns org.domaindrivenarchitecture.fed-poc.spec-helper
"A swallow spec translation implementation of owl. Inheritance of FunctionalProperty "A swallow spec translation implementation of owl. Inheritance of FunctionalProperty
is realized in deep implemented." is realized in deep implemented."
(:require (:require

@ -1,7 +1,7 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.xsd (ns org.domaindrivenarchitecture.fed-poc.xsd
"A spec translation implementation of xsd. Predicates are implemented fully functional." "A spec translation implementation of xsd. Predicates are implemented fully functional."
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.predicates :as p])) [org.domaindrivenarchitecture.fed-poc.predicates :as p]))
;https://www.w3.org/TR/xmlschema11-2/#anyURI ;https://www.w3.org/TR/xmlschema11-2/#anyURI
(s/def ::anyURI p/uri-string?) (s/def ::anyURI p/uri-string?)

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test (ns org.domaindrivenarchitecture.fed-poc.activitystreams2-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut])) [org.domaindrivenarchitecture.fed-poc.activitystreams2 :as sut]))
(deftest id-test (deftest id-test
(is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH")) (is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH"))
@ -16,7 +16,7 @@
(deftest type-test (deftest type-test
(is (s/valid? ::sut/type "https://social.bla/alyssa/status/RANDOMHASH")) (is (s/valid? ::sut/type "https://social.bla/alyssa/status/RANDOMHASH"))
(is (s/valid? ::sut/type "Activity")) (is (s/valid? ::sut/type "Activity"))
(is (s/valid? ::sut/type "Activity")) (is (s/valid? ::sut/type [ "Activity"]))
(is (s/valid? ::sut/type ["https://social.bla/alyssa/status/RANDOMHASH", "https://social.bla/alyssa/status/RANDOMHASH2"])) (is (s/valid? ::sut/type ["https://social.bla/alyssa/status/RANDOMHASH", "https://social.bla/alyssa/status/RANDOMHASH2"]))
(is (not (s/valid? ::sut/type nil))) (is (not (s/valid? ::sut/type nil)))
(is (not (s/valid? ::sut/type []))) (is (not (s/valid? ::sut/type [])))

@ -1,12 +1,10 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core-test (ns org.domaindrivenarchitecture.fed-poc.core-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[clojure.string :as str] [clojure.string :as str]
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as] [org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut])) [org.domaindrivenarchitecture.fed-poc.core :as sut]))
(def tmp )
(deftest should-normalize (deftest should-normalize
(is (= {::as/id "http://example.org/likes/1" (is (= {::as/id "http://example.org/likes/1"

@ -1,9 +1,9 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.owl-test (ns org.domaindrivenarchitecture.fed-poc.owl-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st] [clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as sut])) [org.domaindrivenarchitecture.fed-poc.owl :as sut]))
(deftest functional-predicate (deftest functional-predicate
(is (sut/functional? "str")) (is (sut/functional? "str"))

@ -1,10 +1,10 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.spec-helper-test (ns org.domaindrivenarchitecture.fed-poc.spec-helper-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st] [clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as2] [org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as2]
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sut])) [org.domaindrivenarchitecture.fed-poc.spec-helper :as sut]))
(deftest shoult-test-spec-for-having-functional-property (deftest shoult-test-spec-for-having-functional-property
(is (sut/is-functional-property? ::as2/id)) (is (sut/is-functional-property? ::as2/id))

@ -1,6 +1,6 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.xsd-test (ns org.domaindrivenarchitecture.fed-poc.xsd-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st] [clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.xsd :as sut])) [org.domaindrivenarchitecture.fed-poc.xsd :as sut]))

@ -1,7 +1,7 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy (ns org.domaindrivenarchitecture.fed-poc.activitystreams2-legacy
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl] [org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.activity-pub-poc.core :as core])) [org.domaindrivenarchitecture.fed-poc.core :as core]))
; TODO: We could do these with multispec, but that is too much for a POC ; TODO: We could do these with multispec, but that is too much for a POC
(def objectAndLinkTypes #{; Object Types (def objectAndLinkTypes #{; Object Types

@ -1,4 +1,4 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.common) (ns org.domaindrivenarchitecture.fed-poc.common)
(def resource-path "src/main/resources/") (def resource-path "src/main/resources/")

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core (ns org.domaindrivenarchitecture.fed-poc.core
(:require [lambdaisland.souk.activitypub :as ap] (:require [lambdaisland.souk.activitypub :as ap]
[lambdaisland.souk.json-ld :as ld] [lambdaisland.souk.json-ld :as ld]
[quoll.raphael.core :refer [parse]] [quoll.raphael.core :refer [parse]]
[org.domaindrivenarchitecture.activity-pub-poc.common :as cm] [org.domaindrivenarchitecture.fed-poc.common :as cm]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]] [orchestra.core :refer [defn-spec]]
[clojure.data.json :as json] [clojure.data.json :as json]

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core-test (ns org.domaindrivenarchitecture.fed-poc.core-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st] [clojure.spec.test.alpha :as st]
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut])) [org.domaindrivenarchitecture.fed-poc.core :as sut]))
(st/instrument `sut/generate-like-map) (st/instrument `sut/generate-like-map)

@ -1,5 +1,5 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.parser (ns org.domaindrivenarchitecture.fed-poc.parser
(:require [org.domaindrivenarchitecture.activity-pub-poc.common :as cm] (:require [org.domaindrivenarchitecture.fed-poc.common :as cm]
[clojure.string :as str])) [clojure.string :as str]))
(def activitystreams-turtle (slurp cm/activitystreams-ttl)) (def activitystreams-turtle (slurp cm/activitystreams-ttl))

@ -1,6 +1,6 @@
;(ns org.domaindrivenarchitecture.activity-pub-poc.parser-test ;(ns org.domaindrivenarchitecture.fed-poc.parser-test
; (:require [clojure.test :refer :all] ; (:require [clojure.test :refer :all]
; [org.domaindrivenarchitecture.activity-pub-poc.parser :as sut])) ; [org.domaindrivenarchitecture.fed-poc.parser :as sut]))
;(def processed (slurp "src/test/resources/deleted_comments_minimal.ttl")) ;(def processed (slurp "src/test/resources/deleted_comments_minimal.ttl"))

Loading…
Cancel
Save