From c3cda39e414f7ccf12cd7f2c8404464ffae1158a Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 21 Jul 2023 16:14:10 +0200 Subject: [PATCH] adjustments --- doc/Translate_ttl_to_spec.md | 23 ++++++++++++++++++- ...reams2.clj => activitystreams2_legacy.clj} | 2 +- .../activity_pub_poc/activitystreams2.cljc | 6 ++--- .../activity_pub_poc/owl.cljc | 4 ++-- .../activity_pub_poc/rdf.cljc | 12 ---------- .../activity_pub_poc/rdfs.cljc | 15 ------------ .../activity_pub_poc/xsd.cljc | 4 ++-- src/test/cljc/org/activitystreams2_test.clj | 9 ++++++++ 8 files changed, 38 insertions(+), 37 deletions(-) rename src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/{activitystreams2.clj => activitystreams2_legacy.clj} (99%) delete mode 100644 src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdf.cljc delete mode 100644 src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdfs.cljc create mode 100644 src/test/cljc/org/activitystreams2_test.clj diff --git a/doc/Translate_ttl_to_spec.md b/doc/Translate_ttl_to_spec.md index 8db86b0..0e1c86b 100644 --- a/doc/Translate_ttl_to_spec.md +++ b/doc/Translate_ttl_to_spec.md @@ -20,4 +20,25 @@ Maps to (s/and ::DeprecatedProperty ::FunctionalProperty)) -``` \ No newline at end of file +``` + +Der token `a` in einer ttl Definition entspricht dem RDF-Prädikat `rdf:type`. Siehe: +* https://www.w3.org/TR/turtle/#sec-iri +* https://www.w3.org/TR/rdf12-schema/#ch_type + +Das bedeutet für das Tripel: `(R, rdf:type, C) => C instanceof rdfs:Class & R instanceof C` + +# Further infos + +## RDF/S + +### range (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 + +### type (https://www.w3.org/TR/rdf12-schema/#ch_type) \ No newline at end of file diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2_legacy.clj similarity index 99% rename from src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj rename to src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2_legacy.clj index d0dbda5..4c89f60 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2_legacy.clj @@ -1,4 +1,4 @@ -(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 +(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy (:require [clojure.spec.alpha :as s] [org.domaindrivenarchitecture.activity-pub-poc.owl :as owl] [org.domaindrivenarchitecture.activity-pub-poc.core :as core])) diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc index 9114f18..71b718a 100644 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc +++ b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/activitystreams2.cljc @@ -1,14 +1,12 @@ (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.rdf :as rdf] [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?)) \ No newline at end of file + core/uri-string?)) diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/owl.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/owl.cljc index cb1a30a..20cd38a 100644 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/owl.cljc +++ b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/owl.cljc @@ -1,6 +1,6 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.owl - """A swallow spec translation implementation of owl. Inheritance of FunctionalProperty - is realized in deep implemented.""" + "A swallow spec translation implementation of owl. Inheritance of FunctionalProperty + is realized in deep implemented." (:require [clojure.spec.alpha :as s])) ; Properties:https://www.w3.org/TR/owl-ref/#Property diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdf.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdf.cljc deleted file mode 100644 index a2d6173..0000000 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdf.cljc +++ /dev/null @@ -1,12 +0,0 @@ -(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?] - ) \ No newline at end of file diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdfs.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdfs.cljc deleted file mode 100644 index bebcc7d..0000000 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/rdfs.cljc +++ /dev/null @@ -1,15 +0,0 @@ -(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?) \ No newline at end of file diff --git a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/xsd.cljc b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/xsd.cljc index 021697f..2fecabf 100644 --- a/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/xsd.cljc +++ b/src/main/cljc/org/domaindrivenarchitecture/activity_pub_poc/xsd.cljc @@ -1,6 +1,6 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.xsd - "" "A swallow spec translation implementation of xsd Inheritance of FunctionalProperty - is realized in deep implemented." "" + "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])) diff --git a/src/test/cljc/org/activitystreams2_test.clj b/src/test/cljc/org/activitystreams2_test.clj new file mode 100644 index 0000000..5944812 --- /dev/null +++ b/src/test/cljc/org/activitystreams2_test.clj @@ -0,0 +1,9 @@ +(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test + (:require + [clojure.test :refer [deftest is are testing run-tests]] + [clojure.spec.test.alpha :as st] + [clojure.spec.alpha :as s] + [org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut])) + +(deftest id-test + (is true)) \ No newline at end of file