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]) +