Compare commits
No commits in common. "09e677c722fdab1a8548dc805f0b17a115af7578" and "68e5703821db05f144bb34d7334812482d59b2fd" have entirely different histories.
09e677c722
...
68e5703821
19 changed files with 41 additions and 151 deletions
|
@ -1,4 +1,4 @@
|
||||||
(defproject fed-poc "0.1.0-SNAPSHOT"
|
(defproject activity-pub-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.fed-poc.core
|
:main ^:skip-aot org.domaindrivenarchitecture.activity-pub-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.fed-poc.activitystreams2
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.spec-helper :as sh]
|
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh]
|
||||||
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
|
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl]
|
||||||
[org.domaindrivenarchitecture.fed-poc.xsd :as xsd]))
|
[org.domaindrivenarchitecture.activity-pub-poc.xsd :as xsd]))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.core
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.spec-helper :as sh]
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.owl
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.predicates :as p]
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.predicates
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.spec-helper
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.xsd
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.predicates :as p]))
|
[org.domaindrivenarchitecture.activity-pub-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,112 +0,0 @@
|
||||||
{
|
|
||||||
"@context":
|
|
||||||
{
|
|
||||||
"@vocab": "_:",
|
|
||||||
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
||||||
"as": "https://www.w3.org/ns/activitystreams#",
|
|
||||||
"forge": "https://forgefed.org/ns#",
|
|
||||||
"sec": "https://w3id.org/security#",
|
|
||||||
|
|
||||||
"Branch": "forge:Branch",
|
|
||||||
"Commit": "forge:Commit",
|
|
||||||
"Push": "forge:Push",
|
|
||||||
"Repository": "forge:Repository",
|
|
||||||
"Ticket": "forge:Ticket",
|
|
||||||
"TicketDependency": "forge:TicketDependency",
|
|
||||||
|
|
||||||
"earlyItems": {
|
|
||||||
"@id": "forge:earlyItems",
|
|
||||||
"@type": "@id" },
|
|
||||||
"previousVersions": {
|
|
||||||
"@id": "forge:previousVersions",
|
|
||||||
"@type": "@id",
|
|
||||||
"@container": "@list" },
|
|
||||||
"currentVersion": {
|
|
||||||
"@id": "forge:currentVersion",
|
|
||||||
"@type": "@id" },
|
|
||||||
"assignedTo": {
|
|
||||||
"@id": "forge:assignedTo",
|
|
||||||
"@type": "@id" },
|
|
||||||
"isResolved": {
|
|
||||||
"@id": "forge:isResolved",
|
|
||||||
"@type": "xsd:boolean" },
|
|
||||||
"resolvedBy": {
|
|
||||||
"@id": "forge:resolvedBy",
|
|
||||||
"@type": "@id" },
|
|
||||||
"resolved": {
|
|
||||||
"@id": "forge:resolved",
|
|
||||||
"@type": "xsd:dateTime" },
|
|
||||||
"dependsOn": {
|
|
||||||
"@id": "forge:dependsOn",
|
|
||||||
"@type": "@id" },
|
|
||||||
"dependedBy": {
|
|
||||||
"@id": "forge:dependedBy",
|
|
||||||
"@type": "@id" },
|
|
||||||
"dependencies": {
|
|
||||||
"@id": "forge:dependencies",
|
|
||||||
"@type": "@id" },
|
|
||||||
"dependants": {
|
|
||||||
"@id": "forge:dependants",
|
|
||||||
"@type": "@id" },
|
|
||||||
"description": {
|
|
||||||
"@id": "forge:description",
|
|
||||||
"@type": "@id" },
|
|
||||||
"cloneUri": {
|
|
||||||
"@id": "forge:cloneUri",
|
|
||||||
"@type": "@id" },
|
|
||||||
"committedBy": {
|
|
||||||
"@id": "forge:committedBy",
|
|
||||||
"@type": "@id" },
|
|
||||||
"hash": {
|
|
||||||
"@id": "forge:hash",
|
|
||||||
"@type": "xsd:string" },
|
|
||||||
"committed": {
|
|
||||||
"@id": "forge:committed",
|
|
||||||
"@type": "xsd:dateTime" },
|
|
||||||
"filesAdded": {
|
|
||||||
"@id": "forge:filesAdded",
|
|
||||||
"@type": "xsd:string" },
|
|
||||||
"filesModified": {
|
|
||||||
"@id": "forge:filesModified",
|
|
||||||
"@type": "xsd:string" },
|
|
||||||
"filesRemoved": {
|
|
||||||
"@id": "forge:filesRemoved",
|
|
||||||
"@type": "xsd:string" },
|
|
||||||
"ref": {
|
|
||||||
"@id": "forge:ref",
|
|
||||||
"@type": "xsd:string" },
|
|
||||||
"team": {
|
|
||||||
"@id": "forge:team",
|
|
||||||
"@type": "@id" },
|
|
||||||
"ticketsTrackedBy": {
|
|
||||||
"@id": "forge:ticketsTrackedBy",
|
|
||||||
"@type": "@id" },
|
|
||||||
"tracksTicketsFor": {
|
|
||||||
"@id": "forge:tracksTicketsFor",
|
|
||||||
"@type": "@id" },
|
|
||||||
"sendPatchesTo": {
|
|
||||||
"@id": "forge:sendPatchesTo",
|
|
||||||
"@type": "@id" },
|
|
||||||
"tracksPatchesFor": {
|
|
||||||
"@id": "forge:tracksPatchesFor",
|
|
||||||
"@type": "@id" },
|
|
||||||
"forkedFrom": {
|
|
||||||
"@id": "forge:forkedFrom",
|
|
||||||
"@type": "@id" },
|
|
||||||
"forks": {
|
|
||||||
"@id": "forge:forks",
|
|
||||||
"@type": "@id" },
|
|
||||||
"mirrors": {
|
|
||||||
"@id": "forge:mirrors",
|
|
||||||
"@type": "@id" },
|
|
||||||
"mirroredBy": {
|
|
||||||
"@id": "forge:mirroredBy",
|
|
||||||
"@type": "@id" },
|
|
||||||
"mirrorsTo": {
|
|
||||||
"@id": "forge:mirrorsTo",
|
|
||||||
"@type": "@id" },
|
|
||||||
"mirroredFrom": {
|
|
||||||
"@id": "forge:mirroredFrom",
|
|
||||||
"@type": "@id" }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +1,8 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.activitystreams2-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.activitystreams2 :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-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,10 +1,12 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.core-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.activitystreams2 :as as]
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as]
|
||||||
[org.domaindrivenarchitecture.fed-poc.core :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.owl-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.owl :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.spec-helper-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.activitystreams2 :as as2]
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as2]
|
||||||
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.xsd-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.xsd :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-poc.xsd :as sut]))
|
|
@ -1,7 +1,7 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.activitystreams2-legacy
|
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy
|
||||||
(:require [clojure.spec.alpha :as s]
|
(:require [clojure.spec.alpha :as s]
|
||||||
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
|
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl]
|
||||||
[org.domaindrivenarchitecture.fed-poc.core :as core]))
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.common)
|
(ns org.domaindrivenarchitecture.activity-pub-poc.common)
|
||||||
|
|
||||||
(def resource-path "src/main/resources/")
|
(def resource-path "src/main/resources/")
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.core
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.common :as cm]
|
[org.domaindrivenarchitecture.activity-pub-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.fed-poc.core-test
|
(ns org.domaindrivenarchitecture.activity-pub-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.fed-poc.core :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut]))
|
||||||
|
|
||||||
(st/instrument `sut/generate-like-map)
|
(st/instrument `sut/generate-like-map)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(ns org.domaindrivenarchitecture.fed-poc.parser
|
(ns org.domaindrivenarchitecture.activity-pub-poc.parser
|
||||||
(:require [org.domaindrivenarchitecture.fed-poc.common :as cm]
|
(:require [org.domaindrivenarchitecture.activity-pub-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.fed-poc.parser-test
|
;(ns org.domaindrivenarchitecture.activity-pub-poc.parser-test
|
||||||
; (:require [clojure.test :refer :all]
|
; (:require [clojure.test :refer :all]
|
||||||
; [org.domaindrivenarchitecture.fed-poc.parser :as sut]))
|
; [org.domaindrivenarchitecture.activity-pub-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…
Reference in a new issue