commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [6/8] incubator-commonsrdf git commit: Update for quads
Date Mon, 04 Jul 2016 11:24:03 GMT
Update for quads


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/53c4deaa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/53c4deaa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/53c4deaa

Branch: refs/heads/jena
Commit: 53c4deaa9d7ae40d0bf595da9937e02d949ad232
Parents: c3f56f0
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Mon Jul 4 12:16:07 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Mon Jul 4 12:16:07 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/rdf/jena/JenaCommonsRDF.java    |  4 ++--
 .../rdf/jena/TestJenaGraphToCommonsRDFGraph.java   | 17 +++++++++--------
 2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/53c4deaa/jena/src/main/java/org/apache/commons/rdf/jena/JenaCommonsRDF.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaCommonsRDF.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaCommonsRDF.java
index 338a47d..04caeb7 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaCommonsRDF.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaCommonsRDF.java
@@ -184,8 +184,8 @@ public static Quad fromJena(RDFTermFactory factory, org.apache.jena.sparql.core.
 	}
     BlankNodeOrIRI graphName = (BlankNodeOrIRI)(fromJena(factory, quad.getGraph())) ;
     BlankNodeOrIRI subject = (BlankNodeOrIRI)(fromJena(factory, quad.getSubject())) ;
-    IRI predicate = (IRI)(fromJena(factory, triple.getPredicate())) ;
-    RDFTerm object = fromJena(factory, triple.getObject()) ;
+    IRI predicate = (IRI)(fromJena(factory, quad.getPredicate())) ;
+    RDFTerm object = fromJena(factory, quad.getObject()) ;
     return factory.createQuad(graphName, subject, predicate, object);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/53c4deaa/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
b/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
index 1ef4806..fcc2f51 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
@@ -16,22 +16,23 @@
  * limitations under the License.
  */
 
-package org.apache.commons.rdf.jena.examples;
+package org.apache.commons.rdf.jena;
 
 import org.apache.commons.rdf.api.Graph ;
 import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.commons.rdf.jena.JenaCommonsRDF;
-import org.apache.commons.rdf.jena.RDFTermFactoryJena;
-import org.apache.jena.atlas.logging.LogCtl ;
 import org.apache.jena.riot.Lang ;
 import org.apache.jena.riot.RDFDataMgr ;
 import org.apache.jena.sparql.graph.GraphFactory ;
+import org.junit.Test;
 
 /** Adapt a Jena Graph after parsing data into it */
-public class Ex_JenaGraphToCommonsRDFGraph {
-    static { LogCtl.setCmdLogging(); }
+public class TestJenaGraphToCommonsRDFGraph {
+    static { 
+    	//LogCtl.setCmdLogging(); 
+    }
     
-    public static void main(String ...a) {
+    @Test
+	public void jenaToCommonsRDF() throws Exception {
         org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem() ;
         RDFDataMgr.read(jGraph, "D.ttl") ;
         
@@ -44,7 +45,7 @@ public class Ex_JenaGraphToCommonsRDFGraph {
                   rft.createIRI("http://example/p2"),
                   rft.createLiteral("foo")) ;
         System.out.println("==== Write CommonsRDF graph\n") ;
-        graph.getTriples().forEach(System.out::println) ;
+        graph.stream().forEach(System.out::println) ;
         
         System.out.println("\n==== Write Jena graph directly\n") ;
         // And its in the Jena graph


Mime
View raw message