From 559369e90a8f09b2cb1f026465df8b102c992aea Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 23 Jun 2023 17:55:16 +0200 Subject: [PATCH] add rdf4j setup --- project.clj | 12 +++++------- .../activity_pub_poc/core.clj | 12 ------------ .../activity_pub_poc/core_test.clj | 9 +++++++-- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/project.clj b/project.clj index 7ded775..a4851e4 100644 --- a/project.clj +++ b/project.clj @@ -9,19 +9,17 @@ :resource-paths ["src/main/resources"] :dependencies [[org.clojure/clojure "1.11.1"] ;; Incoming HTTP - [ring/ring-core "1.9.6"] - [ring/ring-jetty-adapter "1.9.6"] + [ring/ring-core "1.10.0"] + [ring/ring-jetty-adapter "1.10.0"] [ring/ring-mock "0.4.0"] [metosin/muuntaja "0.6.8"] - [metosin/reitit "0.5.18"] + [metosin/reitit "0.6.0"] ;; Outgoing HTTP [hato "0.9.0"] [cheshire/cheshire "5.11.0"] [com.cognitect/transit-clj "1.0.333"] - [lambdaisland/uri "1.13.95"] - [clj-turtle "0.1.3"] - [org.clojars.quoll/raphael "0.1.6"] - [instaparse "1.4.12"]] + [lambdaisland/uri "1.15.125"] + [org.eclipse.rdf4j/rdf4j-rio-turtle "4.3.2"]] :main ^:skip-aot org.domaindrivenarchitecture.activity-pub-poc.core :profiles {:test {:test-paths ["src/test/clj"] :resource-paths ["src/test/resources"] diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj index 3ea82a0..f1f8c04 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj @@ -1,7 +1,6 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.core (:require [lambdaisland.souk.activitypub :as ap] [lambdaisland.souk.json-ld :as ld] - [quoll.raphael.core :refer [parse]] [org.domaindrivenarchitecture.activity-pub-poc.common :as cm] [clojure.spec.alpha :as s] [clojure.inspector :as ins] @@ -20,17 +19,6 @@ (def team (ap/GET team-url)) - -(def parsed-rdf-syntax (parse (slurp cm/activitystreams-ttl))) - - -; ToDo -; Prädikat das langString parsen/validieren kann, evtl auch für xsd:string -; Prädikat für Name und Person ausformulieren - - - - ;;(ins/inspect-tree team-ld) ;;(ins/inspect-tree team) diff --git a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj index 621df7d..1040c5f 100644 --- a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj +++ b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj @@ -1,6 +1,11 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.core-test (:require [clojure.test :refer :all] + [clojure.java.io :as io] [org.domaindrivenarchitecture.activity-pub-poc.core :as sut])) -(deftest get-property-type-from-ld-resource - (is (= 0 1))) \ No newline at end of file +(def activity-streams-ttl (slurp (io/resource "activitystreams_2.0_owl.ttl"))) + +(deftest should-generate-spec + (is (= "(s/def ::activitystreams/name (s/or xsd/string? rdf/langString?))" + (sut/generate-spec activity-streams-ttl ":activitystreams/name" + ["xsd/string?" "rdf/langString"])))) \ No newline at end of file