object-or-refernce #1

Merged
jem merged 25 commits from object-or-refernce into main 2023-08-01 07:43:12 +00:00
2 changed files with 15 additions and 2 deletions
Showing only changes of commit 33404eb853 - Show all commits

View file

@ -3,6 +3,7 @@
is realized in deep implemented." is realized in deep implemented."
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.predicates :as p]
[orchestra.core :refer [defn-spec]])) [orchestra.core :refer [defn-spec]]))
; Properties:https://www.w3.org/TR/owl-ref/#Property ; Properties:https://www.w3.org/TR/owl-ref/#Property
@ -11,7 +12,12 @@
;http://www.w3.org/2002/07/owl#Class ;http://www.w3.org/2002/07/owl#Class
;https://www.w3.org/TR/owl-ref/#Class-def ;https://www.w3.org/TR/owl-ref/#Class-def
(s/def ::Class any?) (defn-spec owl-class? boolean?
[elem any?]
(or (p/uri-string? elem)
(map? elem)
(vector? elem)))
(s/def ::Class owl-class?)
;http://www.w3.org/2002/07/owl#DatatypeProperty ;http://www.w3.org/2002/07/owl#DatatypeProperty
(s/def ::DatatypeProperty any?) (s/def ::DatatypeProperty any?)

View file

@ -12,3 +12,10 @@
(is (not (sut/functional? []))) (is (not (sut/functional? [])))
(is (not (sut/functional? nil))) (is (not (sut/functional? nil)))
(is (not (sut/functional? [1 2])))) (is (not (sut/functional? [1 2]))))
(deftest owl-class-predicate
(is (sut/owl-class? "http://some.uri"))
(is (sut/owl-class? {:as "class-definition"}))
(is (sut/owl-class? []))
(is (not (sut/owl-class? "str")))
(is (not (sut/owl-class? nil))))