From 572d42f6ea80991e6296589484dd048442a444f0 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 28 Jul 2023 13:31:48 +0200 Subject: [PATCH] fix the tests - transormation description in progress --- .../activity_pub_poc/activitystreams2.cljc | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc index 29ff3a8..9d2d0c1 100644 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc +++ b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc @@ -50,24 +50,33 @@ (s/and ::owl/ObjectProperty ::Class - (s/or ::Object - ::Link))) + ::Object + ::Link)) ;http://www.w3.org/ns/activitystreams#object -(s/def ::Object - (s/keys :opt-un [::id ::Class])) +(defmulti object-type map?) +(defmethod object-type true [_] + (s/and ::Class + (s/keys :opt-un [::id]))) +(defmethod object-type false [_] + (s/and ::Class)) +(s/def ::Object object-type) ;http://www.w3.org/ns/activitystreams#Link ;TODO: definition in progress -(s/def ::Link (s/keys :opt-un [::id])) +(defmulti link-type map?) +(defmethod link-type true [_] + (s/and ::Class + (s/keys :opt-un [::id]))) +(defmethod link-type false [_] + (s/and ::Class)) +(s/def ::Link link-type) ;TODO: There is no as:Class! Why do we need this? ;Answer jem: I do not want to enhance owl/Class inline from here. (s/def ::Class - (s/and ::owl/Class - )) - ;(s/keys :opt-un [::id ::object]))) + (s/and ::owl/Class)) ;http://www.w3.org/ns/activitystreams#Like