activity-pub-poc/doc/ideaForParsing.md

535 B

I have logic in this module: https://github.com/ont-app/igraph-jena that uses Jena's parser, called 'riot'.

https://jena.apache.org/documentation/

org.apache.jena/jena-arq {:mvn/version "4.9.0"}

ns ...
(:import
 [org.apache.jena.riot
	RDFDataMgr  RDFFormat]))

(defn read-rdf
  [model rdf-file]
(try (RDFDataMgr/read model (str rdf-file))
	   (catch Error e
		 (throw (ex-info "Jena riot error"
						 (merge
						  (ex-data e)
						  {:type ::RiotError
						   ::file-name (str rdf-file)
						   })))))
  model)