Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kr-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-backend</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion kr-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion kr-jena/kr-jena-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr-jena</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-jena-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
edu.ucdenver.ccp.kr.sparql
edu.ucdenver.ccp.kr.jena.rdf
edu.ucdenver.ccp.kr.jena.sparql)
(import com.hp.hpl.jena.query.DatasetFactory
com.hp.hpl.jena.sparql.core.DatasetImpl
com.hp.hpl.jena.graph.Graph
com.hp.hpl.jena.rdf.model.Model))
(import org.apache.jena.query.DatasetFactory
org.apache.jena.sparql.core.DatasetImpl
org.apache.jena.graph.Graph
org.apache.jena.rdf.model.Model))

;;; --------------------------------------------------------
;;; specials and types
Expand Down Expand Up @@ -183,15 +183,15 @@


(defn new-jena-kb
([] (new-jena-kb (com.hp.hpl.jena.query.DatasetFactory/createMem)))
([] (new-jena-kb (org.apache.jena.query.DatasetFactory/createMem)))
([dataset]
(jena-initialize
(initialize-ns-mappings
(JenaKB. dataset *default-model-type* nil)))))

(defn jena-kb-from-model [model]
;;creates a dataset with this model as the default model
(let [dataset (com.hp.hpl.jena.query.DatasetFactory/create model)]
(let [dataset (org.apache.jena.query.DatasetFactory/create model)]
(new-jena-kb dataset)))

;; (defn new-jena-server [model-factory]
Expand All @@ -212,12 +212,12 @@
(defmethod kb :jena-mem [_]
(new-jena-kb))

(defmethod kb com.hp.hpl.jena.sparql.core.DatasetImpl [arg]
(defmethod kb org.apache.jena.sparql.core.DatasetImpl [arg]
(if (class? arg)
(new-jena-kb)
(new-jena-kb arg)))

(defmethod kb com.hp.hpl.jena.rdf.model.ModelCon [arg]
(defmethod kb org.apache.jena.rdf.model.ModelCon [arg]
(if (class? arg)
(new-jena-kb)
(jena-kb-from-model arg)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
[clojure.java.io :exclude (resource)])
(import java.io.IOException

com.hp.hpl.jena.graph.Graph
com.hp.hpl.jena.graph.Triple
com.hp.hpl.jena.graph.GraphMaker
com.hp.hpl.jena.rdf.model.Model
com.hp.hpl.jena.rdf.model.Property
com.hp.hpl.jena.rdf.model.RDFNode
com.hp.hpl.jena.rdf.model.Resource
com.hp.hpl.jena.rdf.model.Statement
com.hp.hpl.jena.rdf.model.StmtIterator
com.hp.hpl.jena.rdf.model.AnonId
org.apache.jena.graph.Graph
org.apache.jena.graph.Triple
org.apache.jena.graph.GraphMaker
org.apache.jena.rdf.model.Model
org.apache.jena.rdf.model.Property
org.apache.jena.rdf.model.RDFNode
org.apache.jena.rdf.model.Resource
org.apache.jena.rdf.model.Statement
org.apache.jena.rdf.model.StmtIterator
org.apache.jena.rdf.model.AnonId

com.hp.hpl.jena.util.FileManager
org.apache.jena.util.FileManager

com.hp.hpl.jena.datatypes.TypeMapper))
org.apache.jena.datatypes.TypeMapper))


;;; --------------------------------------------------------
Expand All @@ -42,7 +42,7 @@
;; should we implement the default jena stores?
;;this is a place holder while decisions are made about how to represent models
(defn model [kb]
(if (instance? com.hp.hpl.jena.rdf.model.ModelCon kb)
(if (instance? org.apache.jena.rdf.model.ModelCon kb)
kb
(or (get kb :active-model)
(default-model kb))))
Expand All @@ -60,7 +60,7 @@

(defn named-model [kb name]
(cond
(instance? com.hp.hpl.jena.rdf.model.ModelCon name) name
(instance? org.apache.jena.rdf.model.ModelCon name) name
(nil? name) (default-model kb)
(= "" name) (default-model kb)
:else (.getNamedModel (:dataset kb)
Expand Down Expand Up @@ -113,7 +113,7 @@


;;how to get literal types for jena from a URI
;; (.getTypeByName (com.hp.hpl.jena.datatypes.TypeMapper/getInstance)
;; (.getTypeByName (org.apache.jena.datatypes.TypeMapper/getInstance)
;; (str (resource my-jena-kb 'xsd/int)))

(defn jena-create-literal
Expand All @@ -131,7 +131,7 @@
(defn jena-create-statement
([kb [s p o]] (jena-create-statement kb s p o))
([kb s p o]
(.createStatement ^com.hp.hpl.jena.rdf.model.impl.ModelCom (model kb)
(.createStatement ^org.apache.jena.rdf.model.impl.ModelCom (model kb)
^Resource (resource kb s)
^Property (property kb p)
^RDFNode (object kb o))))
Expand Down Expand Up @@ -160,7 +160,7 @@

(defn literal-to-value [kb l]
(let [val (.getValue l)]
(if (instance? com.hp.hpl.jena.datatypes.BaseDatatype$TypedValue val)
(if (instance? org.apache.jena.datatypes.BaseDatatype$TypedValue val)
(. val lexicalValue)
val)))

Expand All @@ -171,11 +171,16 @@
lang)))

(defn literal-type-or-language [kb l]
(or (let [dt (.getDatatypeURI l)]
(and dt
(convert-string-to-sym kb dt)))
(literal-language l)))
;;(.getLanguage l)))
(let [dt (.getDatatypeURI l)
sym (and dt
(convert-string-to-sym kb dt))]
(if (or (= 'xsd/string sym) (= 'rdf/langString sym))
(literal-language l)
sym
)
)
)
;;(.getLanguage l)))

(defn literal-to-clj [kb l]
(clj-ify-literal kb l
Expand Down Expand Up @@ -204,16 +209,16 @@
(clj-ify kb (.getObject s))))

;; statement pieces
(defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.ResourceImpl [kb r]
(defmethod clj-ify org.apache.jena.rdf.model.impl.ResourceImpl [kb r]
(resource-to-sym kb r))

(defmethod clj-ify com.hp.hpl.jena.graph.Node_URI [kb r]
(defmethod clj-ify org.apache.jena.graph.Node_URI [kb r]
(uri-to-sym kb r))

(defmethod clj-ify com.hp.hpl.jena.graph.Node_Blank [kb b]
(defmethod clj-ify org.apache.jena.graph.Node_Blank [kb b]
(symbol *anon-ns-name* (str (.getLabelString (.getBlankNodeId b)))))

(defmethod clj-ify com.hp.hpl.jena.graph.Node_Literal [kb l]
(defmethod clj-ify org.apache.jena.graph.Node_Literal [kb l]
(clj-ify-literal kb l
literal-node-to-value
literal-to-string-value
Expand All @@ -222,13 +227,13 @@

;;(.getLiteralValue l))

(defmethod clj-ify com.hp.hpl.jena.rdf.model.Literal [kb l]
(defmethod clj-ify org.apache.jena.rdf.model.Literal [kb l]
(clj-ify-literal kb l
literal-to-value
literal-to-string-value
literal-type-or-language))

(defmethod clj-ify com.hp.hpl.jena.datatypes.BaseDatatype$TypedValue [kb l]
(defmethod clj-ify org.apache.jena.datatypes.BaseDatatype$TypedValue [kb l]
(clj-ify-literal kb l
literal-to-value
literal-to-string-value
Expand All @@ -238,27 +243,27 @@

;; Properties are resources - nothing to do special
;; unless meta data is of interest
;; (defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.PropertyImpl [p]
;; (defmethod clj-ify org.apache.jena.rdf.model.impl.PropertyImpl [p]
;; (resource-to-sym p))
;; (defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.LiteralImpl [kb l]
;; (defmethod clj-ify org.apache.jena.rdf.model.impl.LiteralImpl [kb l]
;; (literal-to-clj kb l))

;; (defmethod clj-ify com.hp.hpl.jena.rdf.model.Literal [kb l]
;; (defmethod clj-ify org.apache.jena.rdf.model.Literal [kb l]
;; (.getValue l))
;;(literal-to-clj kb l))

;;(.getValue l))

;; statements
(defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.StatementImpl [kb s]
(defmethod clj-ify org.apache.jena.rdf.model.impl.StatementImpl [kb s]
(clj-ify-statement kb s))

(defmethod clj-ify com.hp.hpl.jena.graph.Triple [kb s]
(defmethod clj-ify org.apache.jena.graph.Triple [kb s]
(clj-ify-statement kb s))


;; collections of clj-ifiable things
(defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl [kb s]
(defmethod clj-ify org.apache.jena.rdf.model.impl.StmtIteratorImpl [kb s]
(clj-ify kb (or (iterator-seq s)
'())))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(import
;interfaces
(com.hp.hpl.jena.query QueryFactory
(org.apache.jena.query QueryFactory
QueryExecutionFactory
QueryExecution
Query
Expand Down Expand Up @@ -43,7 +43,7 @@
;; (defmethod clj-ify org.openrdf.query.TupleQueryResult [results]
;; (result-map (jena-iteration-seq results)))

;; (defmethod clj-ify com.hp.hpl.jena.rdf.model.impl.LiteralImpl [kb l]
;; (defmethod clj-ify org.apache.jena.rdf.model.impl.LiteralImpl [kb l]
;; (.getValue l))


Expand Down
2 changes: 1 addition & 1 deletion kr-jena/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-jena</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion kr-sesame/kr-sesame-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr-sesame</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-sesame-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion kr-sesame/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.ucdenver.ccp</groupId>
<artifactId>kr</artifactId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
</parent>

<artifactId>kr-sesame</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<clojure.version>1.4.0</clojure.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<ver.arq>2.10.1</ver.arq>
<ver.arq>3.0.0</ver.arq>
<!--<ver.sesame>2.7.1</ver.sesame>-->
<ver.sesame>2.6.10</ver.sesame>
<!--<ver.sesame>2.6.8</ver.sesame>-->
Expand All @@ -24,7 +24,7 @@
</properties>

<groupId>edu.ucdenver.ccp</groupId>
<version>1.4.20-SNAPSHOT</version>
<version>1.4.21-SNAPSHOT</version>
<artifactId>kr</artifactId>
<packaging>pom</packaging>

Expand Down