Add simple specs

This commit is contained in:
erik 2023-06-22 14:10:54 +02:00
parent c5f800715f
commit b4ad068bab

View file

@ -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