diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj index 3ea82a0..cb4bf74 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj @@ -7,7 +7,8 @@ [clojure.inspector :as ins] [hato.client :as hato] [clojure.string :as st] - [clojure.walk :as walk])) + [clojure.walk :as walk] + [clojure.string :as str])) (def team-url "https://social.meissa-gmbh.de/users/team") (def like-url "https://www.w3.org/ns/activitystreams#Like") @@ -20,9 +21,22 @@ (def team (ap/GET team-url)) - (def parsed-rdf-syntax (parse (slurp cm/activitystreams-ttl))) +(defn type-string? [input] + (re-matches #"[A-Z]" (str (first input)))) + +(defn uri-vector? [input] + (and (every? #(uri? %) input) + (vector? input))) + +; Specs for a like +(s/def ::context uri?) +(s/def ::type type-string?) +(s/def ::id uri?) +(s/def ::to uri-vector?) +(s/def ::actor uri?) +(s/def ::object uri?) ; ToDo ; Prädikat das langString parsen/validieren kann, evtl auch für xsd:string