From 36a3e73c3cf521bd5042186c55a5d5d0b7c6be7d Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 21 Jun 2023 14:07:36 +0200 Subject: [PATCH] WIP: Implement simplistic converter for our purpose --- .../activity_pub_poc/parser.clj | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj new file mode 100644 index 0000000..91a6b84 --- /dev/null +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/parser.clj @@ -0,0 +1,35 @@ +(ns org.domaindrivenarchitecture.activity-pub-poc.parser + (:require [org.domaindrivenarchitecture.activity-pub-poc.common :as cm] + [clojure.string :as str])) + +(def activitystreams-turtle (slurp cm/activitystreams-ttl)) + +; pre-format +(defn delete-comments-and-newlines [resource-file] + (apply str + (remove + #(or (re-matches #"^#.*" %) (re-matches #"" %)) + (str/split-lines + (slurp resource-file))))) + +; find definitions +(defn find-definitions [string-input] + (str/split string-input #" \.")) + + +; make list of vectors/map from well known input-string +; distinguish iri,keyword and prefix +; if keyword make a triple +; if iri or prefix make a map: +; +;{{prefix:xyz prefix:zab} +; [{prefix:bla "possibly string"@someKeyword} +; {prefix:foo prefix:orSthElse} +; {prefix:range ; range muss sich liebevoll angeschaut werden +; [ +; prefix:Type +; prefix:Type +; +; ]}]} +(defn to-map-from-def [string-input]) +