24 lines
No EOL
535 B
Markdown
24 lines
No EOL
535 B
Markdown
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)
|
|
``` |