Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/setzer22/jena-clj
An idiomatic clojure wrapper to the Jena API
https://github.com/setzer22/jena-clj
clojure jena ontology rdf
Last synced: 3 months ago
JSON representation
An idiomatic clojure wrapper to the Jena API
- Host: GitHub
- URL: https://github.com/setzer22/jena-clj
- Owner: setzer22
- License: lgpl-3.0
- Created: 2017-05-28T08:22:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-08T17:28:33.000Z (about 3 years ago)
- Last Synced: 2024-09-28T17:40:54.067Z (4 months ago)
- Topics: clojure, jena, ontology, rdf
- Language: Clojure
- Size: 19.5 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jena-clj
An idiomatic clojure wrapper to the Jena ontology management library.
## Install
### Leiningen / Boot:
```clj
[jena-clj "0.1.0"]
```### Gradle
``` gradle
compile "jena-clj:jena-clj:0.1.0"
```### Maven
``` xmljena-clj
jena-clj
0.1.0```
## Usage
Some usage examples:
``` clj
(require '[jena-clj.triplestore :as ts])
(import '[org.apache.jena.query ReadWrite])
(defonce db (ts/init-database "path/to/triplestore") ; If it doesn't exist, it creates one(with-transaction db ReadWrite/WRITE
(ts/insert-rdf db "path/to/rdf/or/ttl/file")) ; Loads a whole RDF file into triplestore
(with-transaction db ReadWrite/READ
(ts/select-query
"prefix rdf:
SELECT ?uri ?name
WHERE {?uri rdf:name ?name}")) ; Returns a lazy sequence with all results.
```
Take a look at triplestore.clj source for more!### Features
- TDB Triplestore management
- SPARQL queries## License
Copyright © 2017 setzer22
Distributed under the GNU General Public License v3.0