You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.2 KiB
Clojure

(ns org.domaindrivenarchitecture.fed-poc.activitystreams2
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.fed-poc.xsd :as xsd]))
;=======================
;http://www.w3.org/ns/activitystreams#Object
;TODO: definition in progress
(s/def ::Object
(s/and
::owl/Class
(sh/map-spec (s/keys :opt [::id ::type ::attachment ::bcc ::bto ::cc ::to]))))
;http://www.w3.org/ns/activitystreams#Link
;TODO: definition in progress
(s/def ::Link
(s/and
::owl/Class
(sh/map-spec (s/keys :opt [::id ::type]))))
;http://www.w3.org/ns/activitystreams#Activity
;TODO: Define more properties necessary for Like
(s/def ::Activity
(s/and
::owl/Class
::Object
(sh/map-spec (s/keys :opt [::result ::object ::actor]))))
;http://www.w3.org/ns/activitystreams#Relationship
;We only have this class, since the property "object" is in the domain "Activity" and "Relationship"
; TODO: What means: "as:Relationship a rdf:Statement". Relevant for spec?
(s/def ::Relationship
(s/and
::owl/Class
::Object
(sh/map-spec (s/keys :opt [::object]))))
;http://www.w3.org/ns/activitystreams#Like
(s/def ::Like
(s/and
::owl/Class
::Activity))
;http://www.w3.org/ns/activitystreams#attachment
(s/def ::attachment
(s/and
::owl/ObjectProperty
::owl/Class
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#id
(s/def ::id
(s/and ::owl/DatatypeProperty
::owl/FunctionalProperty
::owl/DeprecatedProperty
(sh/seq-spec ::xsd/anyURI)))
;http://www.w3.org/ns/activitystreams#bcc
(s/def ::bcc
(s/and ::owl/ObjectProperty
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#bto
(s/def ::bto
(s/and ::owl/ObjectProperty
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#cc
(s/def ::cc
(s/and ::owl/ObjectProperty
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#to
(s/def ::to
(s/and ::owl/ObjectProperty
(sh/seq-spec (s/and
::Object
::Link))))
;https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type
;TODO: this can not be found in the ttl / namespace. Where is this exactly defined?
(s/def ::type
(sh/seq-spec ::xsd/anyURI))
;http://www.w3.org/ns/activitystreams#result
(s/def ::result
(s/and
::owl/ObjectProperty
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#object
(s/def ::object
(s/and
::owl/ObjectProperty
::owl/Class
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#actor
(s/def ::actor
(s/and
::owl/ObjectProperty
::owl/Class
(sh/seq-spec (s/and
::Object
::Link))))