clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject clerezza git commit: CLEREZZA-962: using rdf-commons from clerezza-rdf-core repository
Date Thu, 19 Mar 2015 16:04:19 GMT
Repository: clerezza
Updated Branches:
  refs/heads/rdf-commons e9982e996 -> 4cb0b5240


CLEREZZA-962: using rdf-commons from clerezza-rdf-core repository

Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/4cb0b524
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/4cb0b524
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/4cb0b524

Branch: refs/heads/rdf-commons
Commit: 4cb0b5240a2e4d19e909a788a6163e112399239d
Parents: e9982e9
Author: Reto Gmuer <reto@apache.org>
Authored: Thu Mar 19 16:04:07 2015 +0000
Committer: Reto Gmuer <reto@apache.org>
Committed: Thu Mar 19 16:04:07 2015 +0000

----------------------------------------------------------------------
 rdf.jena.commons/pom.xml                        | 14 +++--
 .../rdf/jena/commons/Jena2TriaUtil.java         | 60 ++++++++++----------
 .../rdf/jena/commons/JenaBNodeWrapper.java      |  4 +-
 .../rdf/jena/commons/Tria2JenaUtil.java         | 55 +++++++-----------
 rdf.jena.facade/pom.xml                         | 15 +++--
 .../clerezza/rdf/jena/facade/JenaGraph.java     | 31 +++++-----
 .../rdf/facade/blackbox/TestBasics.java         | 27 +++++----
 rdf.jena.parser/pom.xml                         | 16 +++++-
 .../rdf/jena/parser/JenaParserProvider.java     |  8 +--
 .../rdf/jena/parser/JenaParserProviderTest.java | 27 ++++-----
 10 files changed, 133 insertions(+), 124 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.commons/pom.xml
----------------------------------------------------------------------
diff --git a/rdf.jena.commons/pom.xml b/rdf.jena.commons/pom.xml
index ce308dc..cafb469 100644
--- a/rdf.jena.commons/pom.xml
+++ b/rdf.jena.commons/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <artifactId>clerezza</artifactId>
         <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
+        <version>1.0.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
     <groupId>org.apache.clerezza</groupId>
@@ -35,13 +35,19 @@
     <description>Common classes needed by Jena adaptors</description>
     <dependencies>
         <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
+            <groupId>org.apache.clerezza.commons-rdf</groupId>
+            <artifactId>commons-rdf-api</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.commons-rdf</groupId>
+            <artifactId>commons-rdf-impl-utils</artifactId>
+            <version>0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.jena</groupId>
             <artifactId>jena-core</artifactId>
+            <version>2.13.0</version>
             <exclusions>
                 <exclusion>
                     <artifactId>slf4j-log4j12</artifactId>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Jena2TriaUtil.java
----------------------------------------------------------------------
diff --git a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Jena2TriaUtil.java
b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Jena2TriaUtil.java
index 9f55a67..32919a4 100644
--- a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Jena2TriaUtil.java
+++ b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Jena2TriaUtil.java
@@ -20,30 +20,30 @@ package org.apache.clerezza.rdf.jena.commons;
 
 import com.hp.hpl.jena.graph.Node;
 import java.util.Map;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.Language;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.core.impl.TypedLiteralImpl;
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.Language;
+import org.apache.commons.rdf.Literal;
+import org.apache.commons.rdf.RdfTerm;
+import org.apache.commons.rdf.Triple;
+import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+import org.apache.commons.rdf.impl.utils.TypedLiteralImpl;
 
 /**
  *
  * @author rbn
  */
 public class Jena2TriaUtil {
-    private final Map<Node, BNode> tria2JenaBNodes;
+    private final Map<Node, BlankNode> tria2JenaBNodes;
 
-    public Jena2TriaUtil(Map<Node,BNode> tria2JenaBNodes) {
+    public Jena2TriaUtil(Map<Node,BlankNode> tria2JenaBNodes) {
         this.tria2JenaBNodes = tria2JenaBNodes;
     }
 
-    private BNode convertJenaNode2TriaBlankNode(Node node) {
-        BNode result = tria2JenaBNodes.get(node);
+    private BlankNode convertJenaNode2TriaBlankNode(Node node) {
+        BlankNode result = tria2JenaBNodes.get(node);
         if (result == null) {
             result = new JenaBNodeWrapper(node);
             //tria2JenaBNodes.put(node,result);
@@ -61,7 +61,7 @@ public class Jena2TriaUtil {
         final String lexicalForm = node.getLiteralLexicalForm();
         String datatypeString = node.getLiteralDatatypeURI();
         if (datatypeString != null) {
-            UriRef dtUriRef = new UriRef(datatypeString);
+            Iri dtUriRef = new Iri(datatypeString);
             return new TypedLiteralImpl(lexicalForm, dtUriRef);
         } else {
             String language = node.getLiteralLanguage();
@@ -74,23 +74,23 @@ public class Jena2TriaUtil {
     }
 
     /**
-     * Converts a URI in jena node to a UriRef
+     * Converts a URI in jena node to a Iri
      * @param node
-     * @return UriRef
+     * @return Iri
      */
-    public UriRef convertJenaUri2UriRef(Node node) {
+    public Iri convertJenaUri2UriRef(Node node) {
         if (node == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }
-        return new UriRef(node.getURI());
+        return new Iri(node.getURI());
     }
 
     /**
      * Converts a jena node to a resource
      * @param node
-     * @return BNode if it is a Blank Node, UriRef if it is a URI and Literal if it is a
literal.
+     * @return BlankNode if it is a Blank Node, Iri if it is a URI and Literal if it is a
literal.
      */
-    public Resource convertJenaNode2Resource(Node node) {
+    public RdfTerm convertJenaNode2Resource(Node node) {
         if (node == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }
@@ -103,18 +103,18 @@ public class Jena2TriaUtil {
         if (node.isLiteral()) {
             return convertJenaLiteral2Literal(node);
         }
-        throw new RuntimeException("cannot convert " + node + " to Resource");
+        throw new RuntimeException("cannot convert " + node + " to RdfTerm");
     }
 
     /**
-     * Converts a node to a BNode if it is a Blank Node otherwise to a UriRef.
-     * If node is a BNode and no mapping to a Blank Node exists, then null is
+     * Converts a node to a BlankNode if it is a Blank Node otherwise to a Iri.
+     * If node is a BlankNode and no mapping to a Blank Node exists, then null is
      * returned, otherwise the existing mapping.
      *
      * @param node
-     * @return BNode if it is a Blank Node otherwise a UriRef
+     * @return BlankNode if it is a Blank Node otherwise a Iri
      */
-    public NonLiteral convertNonLiteral(Node node) {
+    public BlankNodeOrIri convertNonLiteral(Node node) {
         if (node == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }
@@ -124,13 +124,13 @@ public class Jena2TriaUtil {
         if (node.isURI()) {
             return convertJenaUri2UriRef(node);
         }
-        throw new RuntimeException("cannot convert " + node + " to NonLiteral");
+        throw new RuntimeException("cannot convert " + node + " to BlankNodeOrIri");
     }
 
     public Triple convertTriple(com.hp.hpl.jena.graph.Triple triple) {
-        NonLiteral subject = convertNonLiteral(triple.getSubject());
-        UriRef predicate = convertJenaUri2UriRef(triple.getPredicate());
-        Resource object = convertJenaNode2Resource(triple.getObject());
+        BlankNodeOrIri subject = convertNonLiteral(triple.getSubject());
+        Iri predicate = convertJenaUri2UriRef(triple.getPredicate());
+        RdfTerm object = convertJenaNode2Resource(triple.getObject());
         if (subject == null || object == null) {
             return null;
         }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/JenaBNodeWrapper.java
----------------------------------------------------------------------
diff --git a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/JenaBNodeWrapper.java
b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/JenaBNodeWrapper.java
index eed72ae..777986d 100644
--- a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/JenaBNodeWrapper.java
+++ b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/JenaBNodeWrapper.java
@@ -19,14 +19,14 @@
 
 package org.apache.clerezza.rdf.jena.commons;
 
-import org.apache.clerezza.rdf.core.BNode;
 import com.hp.hpl.jena.graph.Node;
+import org.apache.commons.rdf.BlankNode;
 
 /**
  *
  * @author reto
  */
-class JenaBNodeWrapper extends BNode {
+class JenaBNodeWrapper extends BlankNode {
 
     final Node node;
     

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Tria2JenaUtil.java
----------------------------------------------------------------------
diff --git a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Tria2JenaUtil.java
b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Tria2JenaUtil.java
index d02e012..5e878a6 100644
--- a/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Tria2JenaUtil.java
+++ b/rdf.jena.commons/src/main/java/org/apache/clerezza/rdf/jena/commons/Tria2JenaUtil.java
@@ -21,31 +21,30 @@ package org.apache.clerezza.rdf.jena.commons;
 import com.hp.hpl.jena.datatypes.TypeMapper;
 import com.hp.hpl.jena.graph.Node;
 import java.util.Map;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.PlainLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.Literal;
+import org.apache.commons.rdf.RdfTerm;
+import org.apache.commons.rdf.Triple;
+
 
 /**
  *
  * @author rbn
  */
 public class Tria2JenaUtil {
-    private Map<BNode, Node> tria2JenaBNodes;
+    private Map<BlankNode, Node> tria2JenaBNodes;
 
-    public Tria2JenaUtil(Map<BNode, Node> tria2JenaBNodes) {
+    public Tria2JenaUtil(Map<BlankNode, Node> tria2JenaBNodes) {
         this.tria2JenaBNodes = tria2JenaBNodes;
     }
 
-    public Node convert2JenaNode(NonLiteral nonLiteral, boolean createBlankNode) {
-        if (nonLiteral instanceof UriRef) {
-            return convert2JenaNode((UriRef)nonLiteral);
+    public Node convert2JenaNode(BlankNodeOrIri nonLiteral, boolean createBlankNode) {
+        if (nonLiteral instanceof Iri) {
+            return convert2JenaNode((Iri)nonLiteral);
         } else {
-            return convert2JenaNode((BNode)nonLiteral, createBlankNode);
+            return convert2JenaNode((BlankNode)nonLiteral, createBlankNode);
         }
     }
 
@@ -53,36 +52,26 @@ public class Tria2JenaUtil {
         if (literal == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }
-        if (literal instanceof PlainLiteral) {
-            return convert2JenaNode((PlainLiteral)literal);
-        }
-        return convert2JenaNode((TypedLiteral)literal);
-    }
-    public Node convert2JenaNode(PlainLiteral literal) {
-        return com.hp.hpl.jena.graph.Node.createLiteral(
+        return com.hp.hpl.jena.graph.NodeFactory.createLiteral(
                             literal.getLexicalForm(),
                             literal.getLanguage() == null ? null : literal.getLanguage().
-                            toString(), false);
-    }
-    public Node convert2JenaNode(TypedLiteral literal) {
-        return com.hp.hpl.jena.graph.Node.createLiteral(
-                            literal.getLexicalForm(), null, TypeMapper.getInstance().
+                            toString(), TypeMapper.getInstance().
                             getSafeTypeByName(
                             literal.getDataType().getUnicodeString()));
     }
 
-    public Node convert2JenaNode(Resource resource) {
+    public Node convert2JenaNode(RdfTerm resource) {
         return convert2JenaNode(resource, false);
     }
 
-    public Node convert2JenaNode(Resource resource, boolean createBlankNode) {
-        if (resource instanceof NonLiteral) {
-            return convert2JenaNode((NonLiteral)resource, createBlankNode);
+    public Node convert2JenaNode(RdfTerm resource, boolean createBlankNode) {
+        if (resource instanceof BlankNodeOrIri) {
+            return convert2JenaNode((BlankNodeOrIri)resource, createBlankNode);
         }
         return convert2JenaNode((Literal)resource);
     }
 
-    public Node convert2JenaNode(UriRef uriRef) {
+    public Node convert2JenaNode(Iri uriRef) {
         if (uriRef == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }
@@ -90,11 +79,11 @@ public class Tria2JenaUtil {
                         uriRef.getUnicodeString());
     }
 
-    public Node convert2JenaNode(BNode bnode) {
+    public Node convert2JenaNode(BlankNode bnode) {
         return convert2JenaNode(bnode, false);
     }
     
-    public Node convert2JenaNode(BNode bnode, boolean createBlankNode) {
+    public Node convert2JenaNode(BlankNode bnode, boolean createBlankNode) {
         if (bnode == null) {
             throw new IllegalArgumentException("null argument not allowed");
         }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.facade/pom.xml
----------------------------------------------------------------------
diff --git a/rdf.jena.facade/pom.xml b/rdf.jena.facade/pom.xml
index 04c8b35..38db757 100644
--- a/rdf.jena.facade/pom.xml
+++ b/rdf.jena.facade/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <artifactId>clerezza</artifactId>
         <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
+        <version>1.0.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
     <groupId>org.apache.clerezza</groupId>
@@ -36,14 +36,19 @@
     run code written against the Jena API on a Triamodel store.</description>
     <dependencies>
         <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
+            <groupId>org.apache.clerezza.commons-rdf</groupId>
+            <artifactId>commons-rdf-api</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.commons-rdf</groupId>
+            <artifactId>commons-rdf-impl-utils</artifactId>
+            <version>0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.clerezza</groupId>
             <artifactId>rdf.jena.commons</artifactId>
-            <version>0.7</version>
+            <version>1.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.wymiwyg</groupId>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.facade/src/main/java/org/apache/clerezza/rdf/jena/facade/JenaGraph.java
----------------------------------------------------------------------
diff --git a/rdf.jena.facade/src/main/java/org/apache/clerezza/rdf/jena/facade/JenaGraph.java
b/rdf.jena.facade/src/main/java/org/apache/clerezza/rdf/jena/facade/JenaGraph.java
index 1845fd3..420d6e3 100644
--- a/rdf.jena.facade/src/main/java/org/apache/clerezza/rdf/jena/facade/JenaGraph.java
+++ b/rdf.jena.facade/src/main/java/org/apache/clerezza/rdf/jena/facade/JenaGraph.java
@@ -18,7 +18,6 @@
  */
 package org.apache.clerezza.rdf.jena.facade;
 
-import com.hp.hpl.jena.graph.Graph;
 import com.hp.hpl.jena.graph.Node;
 import com.hp.hpl.jena.graph.TripleMatch;
 import com.hp.hpl.jena.graph.impl.GraphBase;
@@ -28,12 +27,11 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TripleCollection;
-import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.RdfTerm;
+import org.apache.commons.rdf.Triple;
 import org.apache.clerezza.rdf.jena.commons.Jena2TriaUtil;
 import org.apache.clerezza.rdf.jena.commons.Tria2JenaUtil;
 import org.wymiwyg.commons.util.collections.BidiMap;
@@ -55,18 +53,18 @@ import org.wymiwyg.commons.util.collections.BidiMapImpl;
  *
  * @author reto
  */
-public class JenaGraph extends GraphBase implements Graph {
+public class JenaGraph extends GraphBase implements com.hp.hpl.jena.graph.Graph {
 
 
 
-    final TripleCollection graph;
-    final BidiMap<BNode, Node> tria2JenaBNodes = new BidiMapImpl<BNode, Node>();
+    final org.apache.commons.rdf.Graph graph;
+    final BidiMap<BlankNode, Node> tria2JenaBNodes = new BidiMapImpl<BlankNode,
Node>();
     final Jena2TriaUtil jena2TriaUtil =
             new Jena2TriaUtil(tria2JenaBNodes.inverse());
     final Tria2JenaUtil tria2JenaUtil =
             new Tria2JenaUtil(tria2JenaBNodes);
 
-    public JenaGraph(TripleCollection graph) {
+    public JenaGraph(org.apache.commons.rdf.Graph graph) {
         this.graph = graph;
     }
 
@@ -115,9 +113,9 @@ public class JenaGraph extends GraphBase implements Graph {
      * @return TripleCollection
      */
     private Iterator<Triple> filter(TripleMatch m) {
-        NonLiteral subject = null;
-        UriRef predicate = null;
-        Resource object = null;
+        BlankNodeOrIri subject = null;
+        Iri predicate = null;
+        RdfTerm object = null;
         if (m.getMatchSubject() != null) {
             if (m.getMatchSubject().isLiteral()) {
                 return Collections.EMPTY_SET.iterator();
@@ -155,4 +153,9 @@ public class JenaGraph extends GraphBase implements Graph {
     protected ExtendedIterator graphBaseFind(TripleMatch m) {
         return new TrackingTripleIterator(convert(filter(m)));
     }
+
+    @Override
+    protected ExtendedIterator<com.hp.hpl.jena.graph.Triple> graphBaseFind(com.hp.hpl.jena.graph.Triple
triple) {
+        return new TrackingTripleIterator(convert(filter(triple)));
+    }
 }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.facade/src/test/java/org/apache/clerezza/rdf/facade/blackbox/TestBasics.java
----------------------------------------------------------------------
diff --git a/rdf.jena.facade/src/test/java/org/apache/clerezza/rdf/facade/blackbox/TestBasics.java
b/rdf.jena.facade/src/test/java/org/apache/clerezza/rdf/facade/blackbox/TestBasics.java
index fd640c8..1a3d5e0 100644
--- a/rdf.jena.facade/src/test/java/org/apache/clerezza/rdf/facade/blackbox/TestBasics.java
+++ b/rdf.jena.facade/src/test/java/org/apache/clerezza/rdf/facade/blackbox/TestBasics.java
@@ -34,13 +34,12 @@ import com.hp.hpl.jena.vocabulary.RDF;
 import com.hp.hpl.jena.vocabulary.RDFS;
 import java.io.StringWriter;
 import org.junit.Test;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.jena.facade.JenaGraph;
-import org.wymiwyg.commons.util.Util;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
 
 /**
  *
@@ -51,8 +50,8 @@ public class TestBasics {
     @Test
     public void serializeGraph() {
         final String uriString = "http://example.org/foo#bar";
-        UriRef uri = new UriRef(uriString);
-        MGraph mGraph = new SimpleMGraph();
+        Iri uri = new Iri(uriString);
+        Graph mGraph = new SimpleGraph();
         mGraph.add(new TripleImpl(uri, uri, new PlainLiteralImpl("bla bla")));
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
         Model model = ModelFactory.createModelForGraph(graph);
@@ -63,8 +62,8 @@ public class TestBasics {
     
     @Test
     public void graphSize() {
-        UriRef uri = new UriRef("http://example.org/foo#bar");
-        MGraph mGraph = new SimpleMGraph();
+        Iri uri = new Iri("http://example.org/foo#bar");
+        Graph mGraph = new SimpleGraph();
         mGraph.add(new TripleImpl(uri, uri, new PlainLiteralImpl("bla bla")));
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
         Assert.assertEquals(1, graph.size());
@@ -72,7 +71,7 @@ public class TestBasics {
 
     @Test
     public void modifyingJenaGraph() {
-        MGraph mGraph = new SimpleMGraph();
+        Graph mGraph = new SimpleGraph();
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
         Model model = ModelFactory.createModelForGraph(graph);
         model.add(RDFS.Class, RDF.type, RDFS.Class);
@@ -81,13 +80,13 @@ public class TestBasics {
     
     @Test
     public void typedLiterals() {
-        MGraph mGraph = new SimpleMGraph();
+        Graph mGraph = new SimpleGraph();
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
         Model model = ModelFactory.createModelForGraph(graph);
         Literal typedLiteral = model.createTypedLiteral("<elem>foo</elem>", XMLLiteralType.theXMLLiteralType);
         model.add(RDFS.Class, RDFS.label, typedLiteral);
         Assert.assertEquals(1, mGraph.size());
-        StmtIterator iter = model.listStatements(RDFS.Class, RDFS.label, (Resource)null);
+        StmtIterator iter = model.listStatements(RDFS.Class, RDFS.label, (RDFNode)null);
         Assert.assertTrue(iter.hasNext());
         RDFNode gotObject = iter.nextStatement().getObject();
         Assert.assertEquals(typedLiteral, gotObject);
@@ -95,7 +94,7 @@ public class TestBasics {
     
     @Test
     public void reifications() {
-        MGraph mGraph = new SimpleMGraph();
+        Graph mGraph = new SimpleGraph();
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
         //Model memModel = ModelFactory.createDefaultModel();
         Model model = ModelFactory.createModelForGraph(graph);

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.parser/pom.xml
----------------------------------------------------------------------
diff --git a/rdf.jena.parser/pom.xml b/rdf.jena.parser/pom.xml
index 1f969bc..3507bdb 100644
--- a/rdf.jena.parser/pom.xml
+++ b/rdf.jena.parser/pom.xml
@@ -18,13 +18,13 @@
  specific language governing permissions and limitations
  under the License.
 
--->
+    -->
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>clerezza</artifactId>
         <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
+        <version>1.0.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
     <groupId>org.apache.clerezza</groupId>
@@ -42,12 +42,22 @@
         <dependency>
             <groupId>org.apache.clerezza</groupId>
             <artifactId>rdf.jena.facade</artifactId>
-            <version>0.14</version>
+            <version>1.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.annotations</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.jena</groupId>
+            <artifactId>jena-core</artifactId>
+            <version>2.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>    

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.parser/src/main/java/org/apache/clerezza/rdf/jena/parser/JenaParserProvider.java
----------------------------------------------------------------------
diff --git a/rdf.jena.parser/src/main/java/org/apache/clerezza/rdf/jena/parser/JenaParserProvider.java
b/rdf.jena.parser/src/main/java/org/apache/clerezza/rdf/jena/parser/JenaParserProvider.java
index c429e2e..a1167b5 100644
--- a/rdf.jena.parser/src/main/java/org/apache/clerezza/rdf/jena/parser/JenaParserProvider.java
+++ b/rdf.jena.parser/src/main/java/org/apache/clerezza/rdf/jena/parser/JenaParserProvider.java
@@ -20,21 +20,17 @@ package org.apache.clerezza.rdf.jena.parser;
 
 import java.io.InputStream;
 
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
 import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
 import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
 import org.apache.clerezza.rdf.jena.facade.JenaGraph;
 
 import com.hp.hpl.jena.rdf.model.Model;
 import com.hp.hpl.jena.rdf.model.ModelFactory;
-import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException;
+import org.apache.commons.rdf.Iri;
 /**
  * A {@link org.apache.clerezza.rdf.core.serializedform.ParsingProvider} based on Jena
  *
@@ -55,7 +51,7 @@ import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatExcep
 public class JenaParserProvider implements ParsingProvider {
 
     @Override
-    public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier,
UriRef baseUri) {
+    public void parse(org.apache.commons.rdf.Graph target, InputStream serializedGraph, String
formatIdentifier, Iri baseUri) {
         String jenaFormat = getJenaFormat(formatIdentifier);
         com.hp.hpl.jena.graph.Graph graph = new JenaGraph(target);
         Model model = ModelFactory.createModelForGraph(graph);

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4cb0b524/rdf.jena.parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
----------------------------------------------------------------------
diff --git a/rdf.jena.parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
b/rdf.jena.parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
index 92d89ae..ce9e30e 100644
--- a/rdf.jena.parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
+++ b/rdf.jena.parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
@@ -22,11 +22,12 @@ import java.io.InputStream;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+
 import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.ImmutableGraph;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
 
 
 
@@ -44,8 +45,8 @@ public class JenaParserProviderTest {
         ParsingProvider provider = new JenaParserProvider();
         InputStream nTriplesIn = getClass().getResourceAsStream("test-04.nt");
         InputStream turtleIn = getClass().getResourceAsStream("test-04.ttl");
-        Graph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples", null);
-        Graph graphFromTurtle = parse(provider, turtleIn, "text/turtle", null);
+        ImmutableGraph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples",
null);
+        ImmutableGraph graphFromTurtle = parse(provider, turtleIn, "text/turtle", null);
         Assert.assertEquals(graphFromNTriples, graphFromTurtle);
     }
 
@@ -57,8 +58,8 @@ public class JenaParserProviderTest {
         ParsingProvider provider = new JenaParserProvider();
         InputStream nTriplesIn = getClass().getResourceAsStream("test-04.nt");
         InputStream rdfIn = getClass().getResourceAsStream("test-04.rdf");
-        Graph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples", null);
-        Graph graphFromTurtle = parse(provider, rdfIn, "application/rdf+xml", null);
+        ImmutableGraph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples",
null);
+        ImmutableGraph graphFromTurtle = parse(provider, rdfIn, "application/rdf+xml", null);
         Assert.assertEquals(graphFromNTriples, graphFromTurtle);
     }
     
@@ -67,15 +68,15 @@ public class JenaParserProviderTest {
         ParsingProvider provider = new JenaParserProvider();
         InputStream nTriplesIn = getClass().getResourceAsStream("test-04.nt");
         InputStream turtleIn = getClass().getResourceAsStream("test-04.ttl");
-        Graph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples", null);
-        Graph graphFromTurtle = parse(provider, turtleIn, "text/turtle;charset=UTF-", null);
+        ImmutableGraph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples",
null);
+        ImmutableGraph graphFromTurtle = parse(provider, turtleIn, "text/turtle;charset=UTF-",
null);
         Assert.assertEquals(graphFromNTriples, graphFromTurtle);
     }
 
-    private Graph parse(ParsingProvider parsingProvider, InputStream in, String type, UriRef
base) {
-        MGraph simpleMGraph = new SimpleMGraph();
+    private ImmutableGraph parse(ParsingProvider parsingProvider, InputStream in, String
type, Iri base) {
+        Graph simpleMGraph = new SimpleGraph();
         parsingProvider.parse(simpleMGraph, in, type, base);
-        return simpleMGraph.getGraph();
+        return simpleMGraph.getImmutableGraph();
     }
 
 }


Mime
View raw message