From d18ba9f1174111b68902dbc2e4b7883193fd2104 Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 30 Jun 2023 15:25:23 +0200 Subject: [PATCH] updated activitystreams2 namespace --- .../activity_pub_poc/activitystreams2.clj | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj index 797674a..0565ff5 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj @@ -1,9 +1,11 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.core (:require [clojure.spec.alpha :as s])) -(s/def ::Object (s/keys +(s/def ::Object (s/or + :uri any? + :map (s/keys :req-un [::id ::type] ;type darf nicht "Link" sein - :opt-un [::attributedTo ::und-mehr])) + :opt-un [::attributedTo ::und-mehr]))) (s/def ::id any?) (s/def ::type any?);(fn [s] (s/or (uri? s) (= s "Link")))) @@ -21,23 +23,22 @@ :opt-un [::result ::target ::origin ::instrument ::verb]))) ; "IntransitiveActivity" erbt von Activity, aber ohne ::object +(s/def ::attributedTo (s/or :object ::Object :link ::Link)) +(s/def ::actor ::attributedTo) -(s/def ::actor (s/* (s/or ::Object ::Link))) -(s/def ::attributedTo (s/* (s/or ::Object ::Link))) +(s/def ::object (s/or :object ::Object :link ::Link)) -(s/def ::object (s/* (s/or ::Object ::Link))) +(s/def ::result (s/or :object ::Object :link ::Link)) -(s/def ::result (s/* (s/or ::Object ::Link))) +(s/def ::target (s/or :object ::Object :link ::Link)) -(s/def ::target (s/* (s/or ::Object ::Link))) +(s/def ::origin (s/or :object ::Object :link ::Link)) -(s/def ::origin (s/* (s/or ::Object ::Link))) +(s/def ::instrument (s/or :object ::Object :link ::Link)) -(s/def ::instrument (s/* (s/or ::Object ::Link))) +(s/def ::verb uri?) -(s/def ::verb (s/* uri?)) - -(s/def ::instrument (s/* (s/or ::Object ::Link))) +(s/def ::instrument (s/or :object ::Object :link ::Link))