add the option for having [value] or value

main
Michael Jerger 10 months ago
parent 73cf280ad5
commit 69d93a99ff

@ -51,66 +51,72 @@
(s/and
::owl/ObjectProperty
::owl/Class
::Object
::Link))
(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
::xsd/anyURI))
(sh/seq-spec ::xsd/anyURI)))
;http://www.w3.org/ns/activitystreams#bcc
(s/def ::bcc
(s/and ::owl/ObjectProperty
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#bto
(s/def ::bto
(s/and ::owl/ObjectProperty
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#cc
(s/def ::cc
(s/and ::owl/ObjectProperty
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#to
(s/def ::to
(s/and ::owl/ObjectProperty
::Object
::Link))
(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
(s/or
:single-value ::xsd/anyURI
:coll-of-values (s/+ ::xsd/anyURI)))
(sh/seq-spec ::xsd/anyURI))
;http://www.w3.org/ns/activitystreams#result
(s/def ::result
(s/and
::owl/ObjectProperty
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#object
(s/def ::object
(s/and
::owl/ObjectProperty
::owl/Class
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))
;http://www.w3.org/ns/activitystreams#actor
(s/def ::actor
(s/and
::owl/ObjectProperty
::owl/Class
::Object
::Link))
(sh/seq-spec (s/and
::Object
::Link))))

@ -13,6 +13,14 @@
:no-map #(not (map? %))
:map spec)))
(defn-spec seq-spec s/spec?
"Spec that applies only for map values."
[spec s/spec?]
(s/and
(s/or
:single-value spec
:coll-of-values (s/+ spec))))
(defn-spec
is-functional-property? boolean?
"Checks whether spec is a FunctionalProperty."

Loading…
Cancel
Save