Added some logic

This commit is contained in:
Clemens 2023-07-21 13:41:52 +02:00
parent d58fa20147
commit 7e60392a75
6 changed files with 56 additions and 1 deletions

View file

@ -0,0 +1,14 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2
(:require [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.owl :as owl]
[org.domaindrivenarchitecture.activity-pub-poc.core :as core]))
;http://www.w3.org/ns/activitystreams#id
;TODO: how do we translate this? rdfs:domain [a owl:Class ; owl:unionOf (as:Link as:Object)]
; Der token 'a' in einer ttl definition entspricht dem RDF-Prädikat rdf:type.
; Siehe: https://www.w3.org/TR/turtle/#sec-iri UND https://www.w3.org/TR/rdf12-schema/#ch_type
; => (R, rdf:type, C) => C instanceof rdfs:Class & R instanceof C
(s/def ::id (s/and ::owl/FunctionalProperty
::owl/DatatypeProperty
::owl/DeprecatedProperty
core/uri-string?))

View file

@ -5,7 +5,7 @@
; Properties:https://www.w3.org/TR/owl-ref/#Property
; * Datatype properties link individuals to data values.
; * Object properties link individuals to data values.
; * Object properties link individuals to individuals.
;http://www.w3.org/2002/07/owl#DatatypeProperty
(s/def ::DatatypeProperty any?)

View file

@ -0,0 +1,6 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.predicates
(:require [clojure.string :as str]))
(defn uri-string? [input]
(and (string? input)
(re-matches #"\w+:(\/?\/?)[^\s]+" input)))

View file

@ -0,0 +1,12 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.rdf
"" "A swallow spec translation implementation of rdf. Inheritance of FunctionalProperty
is realized in deep implemented." ""
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]))
; TODO: Fill out logic
(defn-spec triple boolean?
[rdf-types any?
property any?
object any?]
)

View file

@ -0,0 +1,15 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.rdfs
"" "A swallow spec translation implementation of rdfs. Inheritance of FunctionalProperty
is realized in deep implemented." ""
(:require [clojure.spec.alpha :as s]))
;https://www.w3.org/TR/rdf12-schema/#ch_range
; "P rdfs:range C" indicates that:
; 1. P is an instance of the class rdf:Property
; 2. C is an instance of the class rdfs:Class
; 3. all the resources denoted by the objects of triples whose predicate is P are instances of the class C.
; =>Bedeutet(?): Es gilt: Tupel = (Subjekt, Prädikat, Objekt):
; => Wenn (P, rdfs:range, C) & (S, P, C2) => C2 is instance of C
;
; 1. und 2. könnten wir in der spec abbilden. 3. brauchen wir vmtl nicht (und hab ich nicht 100% verstanden)
(s/def ::range any?)

View file

@ -0,0 +1,8 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.xsd
"" "A swallow spec translation implementation of xsd Inheritance of FunctionalProperty
is realized in deep implemented." ""
(:require [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.predicates :as p]))
;https://www.w3.org/TR/xmlschema11-2/#anyURI
(s/def ::anyURI p/uri-string?)