Compare commits

...

2 commits

Author SHA1 Message Date
09e677c722 add forge 2023-08-07 08:34:49 +02:00
5e71840662 rename 2023-08-07 08:34:39 +02:00
19 changed files with 151 additions and 41 deletions

View file

@ -1,4 +1,4 @@
(defproject activity-pub-poc "0.1.0-SNAPSHOT"
(defproject fed-poc "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Apache License, Version 2.0"
@ -24,7 +24,7 @@
[clj-turtle "0.1.3"]
[org.clojars.quoll/raphael "0.1.6"]
[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"
"src/test/clj"]
:resource-paths ["src/test/resources"]

View file

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

View file

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core
(ns org.domaindrivenarchitecture.fed-poc.core
(:require [clojure.spec.alpha :as s]
[clojure.walk :as walk]
[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]))
(declare normalize-functional-property)

View file

@ -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
is realized in deep implemented."
(:require
[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]]))
; Properties:https://www.w3.org/TR/owl-ref/#Property

View file

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

View file

@ -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
is realized in deep implemented."
(:require

View file

@ -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."
(: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
(s/def ::anyURI p/uri-string?)

View file

@ -0,0 +1,112 @@
{
"@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" }
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl]
[org.domaindrivenarchitecture.activity-pub-poc.core :as core]))
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.fed-poc.core :as core]))
; TODO: We could do these with multispec, but that is too much for a POC
(def objectAndLinkTypes #{; Object Types

View file

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

View file

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core
(ns org.domaindrivenarchitecture.fed-poc.core
(:require [lambdaisland.souk.activitypub :as ap]
[lambdaisland.souk.json-ld :as ld]
[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]
[orchestra.core :refer [defn-spec]]
[clojure.data.json :as json]

View file

@ -1,8 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.core-test
(ns org.domaindrivenarchitecture.fed-poc.core-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[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)

View file

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

View file

@ -1,6 +1,6 @@
;(ns org.domaindrivenarchitecture.activity-pub-poc.parser-test
;(ns org.domaindrivenarchitecture.fed-poc.parser-test
; (: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"))