You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/07/04 11:24:02 UTC

[5/8] incubator-commonsrdf git commit: Tidy

Tidy


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

Branch: refs/heads/jena
Commit: c3f56f055ab778ccbc46a48412d897ed2010f9df
Parents: 2f4a443
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Jul 4 12:16:03 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Jul 4 12:16:03 2016 +0100

----------------------------------------------------------------------
 jena/D.ttl                                      |  4 --
 jena/README.md                                  | 14 -----
 jena/commit.txt                                 | 10 ----
 .../examples/Ex_JenaGraphToCommonsRDFGraph.java | 54 --------------------
 .../examples/Ex_ParseIntoCommonsRDFGraph.java   | 52 -------------------
 .../jena/TestJenaGraphToCommonsRDFGraph.java    | 54 ++++++++++++++++++++
 jena/src/test/resources/D.ttl                   |  4 ++
 7 files changed, 58 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/D.ttl
----------------------------------------------------------------------
diff --git a/jena/D.ttl b/jena/D.ttl
deleted file mode 100644
index d37081c..0000000
--- a/jena/D.ttl
+++ /dev/null
@@ -1,4 +0,0 @@
-prefix : <http://example/>
-
-:s :p 123 .
-[ :p1 [ :q "r"@en ] ] .

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/README.md
----------------------------------------------------------------------
diff --git a/jena/README.md b/jena/README.md
deleted file mode 100644
index c7f5135..0000000
--- a/jena/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# commonsrdf-jena
-
-Code showing using [Apache CommonsRDF](http://commonsrdf.incubator.apache.org/)
-with [Apache Jena](http://jena.apache.org/).
-
-`package org.apache.commons.rdf.jena.examples`
-
-* `Ex_ParseIntoCommonsRDFGraph`
-
-Shows how to use Jena parsers to stream parser output into any CommonsRDF graph.
-
-* `Ex_JenaGraphToCommonsRDFGraph`
-
-Shows wrapping existing Jena data to use with CommonsRDF so you can inject Jena-backed RDF into a general CommonsRDF algorithm and see the results in Jena later. 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/commit.txt
----------------------------------------------------------------------
diff --git a/jena/commit.txt b/jena/commit.txt
deleted file mode 100644
index 16b0565..0000000
--- a/jena/commit.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-    Merge branch 'asf-jena' into jena
-    
-    Imported from https://github.com/afs/commonsrdf-jena
-    by Andy Seaborne <as...@apache.org>
-    
-    Code already had ASF headers including:
-    
-    > Licensed to the Apache Software Foundation (ASF)
-    
-    .. but perhaps an IP clearance is needed anyway?

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_JenaGraphToCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_JenaGraphToCommonsRDFGraph.java b/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_JenaGraphToCommonsRDFGraph.java
deleted file mode 100644
index 1ef4806..0000000
--- a/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_JenaGraphToCommonsRDFGraph.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.rdf.jena.examples;
-
-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 ;
-
-/** Adapt a Jena Graph after parsing data into it */
-public class Ex_JenaGraphToCommonsRDFGraph {
-    static { LogCtl.setCmdLogging(); }
-    
-    public static void main(String ...a) {
-        org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem() ;
-        RDFDataMgr.read(jGraph, "D.ttl") ;
-        
-        // "graph" is a CommonsRDF graph 
-        Graph graph = JenaCommonsRDF.fromJena(jGraph) ;
-        
-        // Add to CommonsRDF Graph
-        RDFTermFactory rft = new RDFTermFactoryJena() ;
-        graph.add(rft.createIRI("http://example/s2"),
-                  rft.createIRI("http://example/p2"),
-                  rft.createLiteral("foo")) ;
-        System.out.println("==== Write CommonsRDF graph\n") ;
-        graph.getTriples().forEach(System.out::println) ;
-        
-        System.out.println("\n==== Write Jena graph directly\n") ;
-        // And its in the Jena graph
-        RDFDataMgr.write(System.out, jGraph, Lang.TTL) ;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_ParseIntoCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_ParseIntoCommonsRDFGraph.java b/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_ParseIntoCommonsRDFGraph.java
deleted file mode 100644
index 1984c80..0000000
--- a/jena/src/main/java/org/apache/commons/rdf/jena/examples/Ex_ParseIntoCommonsRDFGraph.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.rdf.jena.examples;
-
-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.commons.rdf.simple.SimpleRDFTermFactory ;
-import org.apache.jena.atlas.logging.LogCtl ;
-import org.apache.jena.riot.RDFDataMgr ;
-import org.apache.jena.riot.system.StreamRDF ;
-
-/** Use jena to parse data into an CommonsRDF graph */
-public class Ex_ParseIntoCommonsRDFGraph {
-    static { LogCtl.setCmdLogging(); }
-    
-    public static void main(String ...a) {
-        System.out.println("== RDFTermFactoryJena") ;
-        RDFTermFactory rft1 = new RDFTermFactoryJena() ; // This can be a non-Jena backed factory
-        parse(rft1) ;
-        System.out.println() ;
-        System.out.println("== SimpleRDFTermFactory") ;
-        RDFTermFactory rft2 = new SimpleRDFTermFactory() ;
-        parse(rft2) ;
-    }
-    
-    public static void parse(RDFTermFactory rft) {
-        Graph graph = rft.createGraph() ;
-        StreamRDF dest = JenaCommonsRDF.streamJenaToCommonsRDF(rft, graph) ;
-        RDFDataMgr.parse(dest, "D.ttl") ;
-        graph.getTriples().forEach(System.out::println) ;
-    }
-    
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/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
new file mode 100644
index 0000000..1ef4806
--- /dev/null
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.rdf.jena.examples;
+
+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 ;
+
+/** Adapt a Jena Graph after parsing data into it */
+public class Ex_JenaGraphToCommonsRDFGraph {
+    static { LogCtl.setCmdLogging(); }
+    
+    public static void main(String ...a) {
+        org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem() ;
+        RDFDataMgr.read(jGraph, "D.ttl") ;
+        
+        // "graph" is a CommonsRDF graph 
+        Graph graph = JenaCommonsRDF.fromJena(jGraph) ;
+        
+        // Add to CommonsRDF Graph
+        RDFTermFactory rft = new RDFTermFactoryJena() ;
+        graph.add(rft.createIRI("http://example/s2"),
+                  rft.createIRI("http://example/p2"),
+                  rft.createLiteral("foo")) ;
+        System.out.println("==== Write CommonsRDF graph\n") ;
+        graph.getTriples().forEach(System.out::println) ;
+        
+        System.out.println("\n==== Write Jena graph directly\n") ;
+        // And its in the Jena graph
+        RDFDataMgr.write(System.out, jGraph, Lang.TTL) ;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c3f56f05/jena/src/test/resources/D.ttl
----------------------------------------------------------------------
diff --git a/jena/src/test/resources/D.ttl b/jena/src/test/resources/D.ttl
new file mode 100644
index 0000000..d37081c
--- /dev/null
+++ b/jena/src/test/resources/D.ttl
@@ -0,0 +1,4 @@
+prefix : <http://example/>
+
+:s :p 123 .
+[ :p1 [ :q "r"@en ] ] .