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.

98 lines
2.4 KiB
Clojure

(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl]
[org.domaindrivenarchitecture.activity-pub-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-un [::id ::type ::attachment ::bcc]))))
;http://www.w3.org/ns/activitystreams#Link
;TODO: definition in progress
(s/def ::Link
(s/and
::owl/Class
(sh/map-spec (s/keys :opt-un [::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-un [::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-un [::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
::Object
::Link))
;http://www.w3.org/ns/activitystreams#id
(s/def ::id
(s/and ::owl/DatatypeProperty
::owl/FunctionalProperty
::owl/DeprecatedProperty
::xsd/anyURI))
;http://www.w3.org/ns/activitystreams#bcc
(s/def ::bcc
(s/and ::owl/ObjectProperty
::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
any?;::xsd/anyURI
)
;http://www.w3.org/ns/activitystreams#result
(s/def ::result
(s/and
::owl/ObjectProperty
::Object
::Link))
;http://www.w3.org/ns/activitystreams#object
(s/def ::object
(s/and
::owl/ObjectProperty
::owl/Class
::Object
::Link))
;http://www.w3.org/ns/activitystreams#actor
(s/def ::actor
(s/and
::owl/ObjectProperty
::owl/Class
::Object
::Link))