WIP: Implement simplistic converter for our purpose

This commit is contained in:
erik 2023-06-21 14:07:36 +02:00
parent 61b2e54ded
commit 36a3e73c3c

View file

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