Skip to content
Browse files

mulgara support

  • Loading branch information...
1 parent 61842b1 commit 13a34ea7afda221f6d9a74de57a704fb980c9f05 @antoniogarrote committed May 31, 2010
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/plaza/triple_spaces/server/mulgara.clj
View
23 src/plaza/triple_spaces/server/mulgara.clj
@@ -0,0 +1,23 @@
+;; @author Antonio Garrote
+;; @email antoniogarrote@gmail.com
+;; @date 31.05.2010
+
+(ns plaza.triple-spaces.server.mulgara
+ (:use [saturnine]
+ [saturnine.handler]
+ [plaza.triple-spaces.server.rabbit :as rabbit]
+ [clojure.contrib.logging :only [log]]
+ (plaza.triple-spaces core)
+ (plaza.rdf core sparql)
+ (plaza.rdf.implementations sesame))
+ (:import [java.util UUID]
+ [java.net URL]))
+
+(defmethod build-model [:mulgara]
+ ([& opts]
+ (let [options (apply hash-map (rest opts))
+ conn-factory (org.mulgara.connection.ConnectionFactory.)
+ conn (.newConnection conn-factory (java.net.URI. (:rmi options)))
+ jenna-conn (.getJenaConnection conn)
+ graph (if (:graph-url options) (:graph-url options) "http://plaza.org/models/default")]
+ (plaza.rdf.implementations.jena.JenaModel. (.createModel jenna-conn graph)))))

0 comments on commit 13a34ea

Please sign in to comment.
Something went wrong with that request. Please try again.