activity-pub-poc/doc/ideaForParsing.md

24 lines
535 B
Markdown
Raw Normal View History

2023-08-03 07:26:54 +00:00
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"}
```clojure
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)
```