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/02 16:14:35 UTC
[18/50] [abbrv] incubator-commonsrdf git commit: Move to jena/*
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 3411597..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.seaborne</groupId>
- <artifactId>commonsrdf-jena</artifactId>
- <version>0.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>commonsrdf-jena</name>
- <description>Commons Java library for RDF 1.1</description>
-
- <inceptionYear>2014</inceptionYear>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <ver.commonsrdf>0.2.0-incubating-SNAPSHOT</ver.commonsrdf>
- <ver.jena>3.0.1</ver.jena>
- </properties>
-
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>apache-jena-libs</artifactId>
- <version>${ver.jena}</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-rdf-api</artifactId>
- <version>${ver.commonsrdf}</version>
- </dependency>
-
- <!-- Used for testing and examples -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-rdf-simple</artifactId>
- <version>${ver.commonsrdf}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-rdf-api</artifactId>
- <version>${ver.commonsrdf}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/ConversionException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/ConversionException.java b/src/main/java/org/apache/jena/commonsrdf/ConversionException.java
deleted file mode 100644
index 65cc04a..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/ConversionException.java
+++ /dev/null
@@ -1,37 +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.jena.commonsrdf;
-
-import org.apache.jena.shared.JenaException ;
-
-/**
- * Exception thrown when a problem arises across the Jena-CommonRDF boundary.
- * This should not happen in well-formed RDF data but, for example, Jena triples
- * allow
- * <a href="http://www.w3.org/TR/rdf11-concepts/#section-generalized-rdf"
- * >generalized RDF</a>.
- */
-
-public class ConversionException extends JenaException {
- public ConversionException() { super(); }
- public ConversionException(String message) { super(message); }
- public ConversionException(Throwable cause) { super(cause) ; }
- public ConversionException(String message, Throwable cause) { super(message, cause) ; }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/JenaCommonsRDF.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/JenaCommonsRDF.java b/src/main/java/org/apache/jena/commonsrdf/JenaCommonsRDF.java
deleted file mode 100644
index 1b24560..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/JenaCommonsRDF.java
+++ /dev/null
@@ -1,154 +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.jena.commonsrdf;
-
-import org.apache.commons.rdf.api.* ;
-import org.apache.jena.commonsrdf.impl.* ;
-import org.apache.jena.datatypes.RDFDatatype ;
-import org.apache.jena.datatypes.xsd.XSDDatatype ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-import org.apache.jena.riot.system.StreamRDF ;
-import org.apache.jena.sparql.graph.GraphFactory ;
-
-/** A set of utilities for moving between CommonsRDF and Jena
- * The {@link RDFTermFactory} for is {@link RDFTermFactoryJena} which
- * creates CommonsRDF objects backed by Jena.
- * <p>
- * This class encapsulates moving between existing object (RDFTerms, Triples, Graphs)
- * which is usually necessary when working with existing data.
- *
- * @see RDFTermFactoryJena
- */
-public class JenaCommonsRDF {
-
- /** Convert a CommonsRDF RDFTerm to a Jena Node.
- * If the RDFTerm was from Jena originally, return that original object else
- * create a copy using Jena objects.
- */
- public static Node toJena(RDFTerm term) {
- if ( term instanceof JenaNode )
- return ((JenaNode)term).getNode() ;
-
- if ( term instanceof IRI )
- return NodeFactory.createURI(((IRI)term).getIRIString()) ;
-
- if ( term instanceof Literal ) {
- Literal lit = (Literal)term ;
- RDFDatatype dt = NodeFactory.getType(lit.getDatatype().getIRIString()) ;
- String lang = lit.getLanguageTag().orElse("") ;
- return NodeFactory.createLiteral(lit.getLexicalForm(), lang, dt) ;
- }
-
- if ( term instanceof BlankNode ) {
- String id = ((BlankNode)term).uniqueReference() ;
- return NodeFactory.createBlankNode(id) ;
- }
- conversionError("Not a concrete RDF Term: "+term) ;
- return null ;
- }
-
- /** Convert a CommonsRDF Triple to a Jena Triple.
- * If the Triple was from Jena originally, return that original object else
- * create a copy using Jena objects.
- */
- public static org.apache.jena.graph.Triple toJena(Triple triple) {
- if ( triple instanceof JenaTriple )
- return ((JenaTriple)triple).getTriple() ;
- return new org.apache.jena.graph.Triple(toJena(triple.getSubject()), toJena(triple.getPredicate()), toJena(triple.getObject()) ) ;
- }
-
- /** Convert a CommonsRDF Graph to a Jena Graph.
- * If the Graph was from Jena originally, return that original object else
- * create a copy using Jena objects.
- */
- public static org.apache.jena.graph.Graph toJena(Graph graph) {
- if ( graph instanceof JenaGraph )
- return ((JenaGraph)graph).getGraph() ;
- org.apache.jena.graph.Graph g = GraphFactory.createGraphMem() ;
- graph.getTriples().forEach(t->g.add(toJena(t))) ;
- return g ;
- }
-
- /** Adapt an existing Jena Node to CommonsRDF {@link RDFTerm}. */
- public static RDFTerm fromJena( Node node) {
- return JCR_Factory.fromJena(node) ;
- }
-
- /** Adapt an existing Jena Triple to CommonsRDF {@link Triple}. */
- public static Triple fromJena(org.apache.jena.graph.Triple triple) {
- return JCR_Factory.fromJena(triple) ;
- }
-
- /** Adapt an existring Jena Graph to CommonsRDF {@link Graph}.
- * This does not take a copy.
- * Changes to the CommonsRDF Graph are reflected in the jena graph.
- */
- public static Graph fromJena(org.apache.jena.graph.Graph graph) {
- return JCR_Factory.fromJena(graph) ;
- }
-
- /** Convert from Jena {@link Node} to any RDFCommons implementation */
- public static RDFTerm fromJena(RDFTermFactory factory, Node node) {
- if ( node.isURI() )
- return factory.createIRI(node.getURI()) ;
- if ( node.isLiteral() ) {
- String lang = node.getLiteralLanguage() ;
- if ( lang != null && ! lang.isEmpty() )
- return factory.createLiteral(node.getLiteralLexicalForm(), lang) ;
- if ( node.getLiteralDatatype().equals(XSDDatatype.XSDstring) )
- return factory.createLiteral(node.getLiteralLexicalForm()) ;
- IRI dt = factory.createIRI(node.getLiteralDatatype().getURI()) ;
- return factory.createLiteral(node.getLiteralLexicalForm(), dt);
- }
- if ( node.isBlank() )
- return factory.createBlankNode(node.getBlankNodeLabel()) ;
- throw new ConversionException("Node is not a concrete RDF Term: "+node) ;
- }
-
- /** Convert from Jena {@link org.apache.jena.graph.Triple} to any RDFCommons implementation */
- public static Triple fromJena(RDFTermFactory factory, org.apache.jena.graph.Triple triple) {
- BlankNodeOrIRI subject = (BlankNodeOrIRI)(fromJena(factory, triple.getSubject())) ;
- IRI predicate = (IRI)(fromJena(factory, triple.getPredicate())) ;
- RDFTerm object = fromJena(factory, triple.getObject()) ;
- return factory.createTriple(subject, predicate, object) ;
- }
-
- /** Convert from Jena to any RDFCommons implementation.
- * This is a copy, even if the factory is a RDFTermFactoryJena.
- * Use {@link #fromJena(org.apache.jena.graph.Graph)} for a wrapper.
- */
- public static Graph fromJena(RDFTermFactory factory, org.apache.jena.graph.Graph graph) {
- Graph g = factory.createGraph() ;
- graph.find(Node.ANY, Node.ANY, Node.ANY).forEachRemaining( t-> {
- g.add(fromJena(factory, t) );
- }) ;
- return g ;
- }
-
- /** Create a {@link StreamRDF} that inserts into any RDFCommons implementation of Graph */
- public static StreamRDF streamJenaToCommonsRDF(RDFTermFactory factory, Graph graph) {
- return new ToGraph(factory, graph) ;
- }
-
- public static void conversionError(String msg) {
- throw new ConversionException(msg) ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/RDFTermFactoryJena.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/RDFTermFactoryJena.java b/src/main/java/org/apache/jena/commonsrdf/RDFTermFactoryJena.java
deleted file mode 100644
index d9d577a..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/RDFTermFactoryJena.java
+++ /dev/null
@@ -1,85 +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.jena.commonsrdf;
-
-import org.apache.commons.rdf.api.* ;
-import org.apache.jena.commonsrdf.impl.JCR_Factory ;
-
-/** RDFTermFactory with Jena-backed objects.
- * See {@link JenaCommonsRDF} for other conversions of existing objects.
- *
- * @see RDFTermFactory
- */
-public class RDFTermFactoryJena implements RDFTermFactory {
-
- @Override
- public BlankNode createBlankNode() {
- return JCR_Factory.createBlankNode() ;
- }
-
- @Override
- public BlankNode createBlankNode(String name) {
- return JCR_Factory.createBlankNode(name) ;
- }
-
- @Override
- public Graph createGraph() {
- return JCR_Factory.createGraph() ;
- }
-
- @Override
- public IRI createIRI(String iri) {
- validateIRI(iri) ;
- return JCR_Factory.createIRI(iri) ;
- }
-
- // Some simple validations - full IRI parsing is not cheap.
- private static void validateIRI(String iri) {
- if ( iri.contains(" ") ) throw new IllegalArgumentException() ;
- if ( iri.contains("<") ) throw new IllegalArgumentException() ;
- if ( iri.contains(">") ) throw new IllegalArgumentException() ;
- }
-
- @Override
- public Literal createLiteral(String lexicalForm) {
- return JCR_Factory.createLiteral(lexicalForm) ;
- }
-
- @Override
- public Literal createLiteral(String lexicalForm, IRI dataType) {
- return JCR_Factory.createLiteralDT(lexicalForm, dataType.getIRIString()) ;
- }
-
- @Override
- public Literal createLiteral(String lexicalForm, String languageTag) {
- validateLang(languageTag) ;
- return JCR_Factory.createLiteralLang(lexicalForm, languageTag) ;
- }
-
- private static void validateLang(String languageTag) {
- if ( languageTag.contains(" ") ) throw new IllegalArgumentException() ;
- }
-
- @Override
- public Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- return JCR_Factory.createTriple(subject, predicate, object) ;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/examples/Ex_JenaGraphToCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/examples/Ex_JenaGraphToCommonsRDFGraph.java b/src/main/java/org/apache/jena/commonsrdf/examples/Ex_JenaGraphToCommonsRDFGraph.java
deleted file mode 100644
index ceeeb53..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/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.jena.commonsrdf.examples;
-
-import org.apache.commons.rdf.api.Graph ;
-import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.jena.atlas.logging.LogCtl ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-import org.apache.jena.commonsrdf.RDFTermFactoryJena ;
-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/5838bf5d/src/main/java/org/apache/jena/commonsrdf/examples/Ex_ParseIntoCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/examples/Ex_ParseIntoCommonsRDFGraph.java b/src/main/java/org/apache/jena/commonsrdf/examples/Ex_ParseIntoCommonsRDFGraph.java
deleted file mode 100644
index cb77289..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/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.jena.commonsrdf.examples;
-
-import org.apache.commons.rdf.api.Graph ;
-import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.commons.rdf.simple.SimpleRDFTermFactory ;
-import org.apache.jena.atlas.logging.LogCtl ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-import org.apache.jena.commonsrdf.RDFTermFactoryJena ;
-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/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_BlankNode.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_BlankNode.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_BlankNode.java
deleted file mode 100644
index ef11a0e..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_BlankNode.java
+++ /dev/null
@@ -1,47 +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.jena.commonsrdf.impl;
-
-import org.apache.commons.rdf.api.BlankNode ;
-import org.apache.jena.graph.Node ;
-
-public class JCR_BlankNode extends JCR_Term implements BlankNode, JenaNode {
-
- /*package*/ JCR_BlankNode(Node node) { super(node) ; }
-
- @Override
- public String uniqueReference() {
- return getNode().getBlankNodeLabel() ;
- }
-
- @Override
- public int hashCode() {
- return uniqueReference().hashCode() ;
- }
-
- @Override
- public boolean equals(Object other) {
- if ( other == this ) return true ;
- if ( other == null ) return false ;
- if ( ! ( other instanceof BlankNode ) ) return false ;
- BlankNode bNode = (BlankNode)other ;
- return uniqueReference().equals(bNode.uniqueReference()) ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Factory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Factory.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Factory.java
deleted file mode 100644
index e1c2b52..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Factory.java
+++ /dev/null
@@ -1,86 +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.jena.commonsrdf.impl;
-import static org.apache.jena.commonsrdf.JenaCommonsRDF.conversionError;
-
-import org.apache.commons.rdf.api.* ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-import org.apache.jena.sparql.graph.GraphFactory ;
-
-public class JCR_Factory {
- // basic components to commonsrdf backed by Jena.
- public static IRI createIRI(String iriStr) {
- return (IRI)JenaCommonsRDF.fromJena(NodeFactory.createURI(iriStr));
- }
-
- public static Literal createLiteral(String lexStr) {
- return new JCR_Literal(NodeFactory.createLiteral(lexStr));
- }
-
- public static Literal createLiteralDT(String lexStr, String datatypeIRI) {
- return new JCR_Literal(NodeFactory.createLiteral(lexStr, NodeFactory.getType(datatypeIRI))) ;
- }
-
- public static Literal createLiteralLang(String lexStr, String langTag) {
- return new JCR_Literal(NodeFactory.createLiteral(lexStr, langTag));
- }
-
- public static BlankNode createBlankNode() {
- return new JCR_BlankNode(NodeFactory.createBlankNode());
- }
-
- public static BlankNode createBlankNode(String id) {
- return new JCR_BlankNode(NodeFactory.createBlankNode(id));
- }
-
- public static Graph createGraph() { return new JCR_Graph(GraphFactory.createDefaultGraph()) ; }
-
- public static Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- return new JCR_Triple(subject, predicate, object) ;
- }
-
- public static Triple fromJena(org.apache.jena.graph.Triple triple) {
- return new JCR_Triple(triple) ;
- }
-
- public static Graph fromJena(org.apache.jena.graph.Graph graph) {
- return new JCR_Graph(graph) ;
- }
-
- public static RDFTerm fromJena(Node node) {
- if ( node.isURI() )
- return new JCR_IRI(node) ;
- if ( node.isLiteral() ) {
- return new JCR_Literal(node) ;
-// String lang = node.getLiteralLanguage() ;
-// if ( lang != null && lang.isEmpty() )
-// return createLiteralLang(node.getLiteralLexicalForm(), lang) ;
-// if ( node.getLiteralDatatype().equals(XSDDatatype.XSDstring) )
-// return createLiteral(node.getLiteralLexicalForm()) ;
-// return createLiteralDT(node.getLiteralLexicalForm(), node.getLiteralDatatype().getURI());
- }
- if ( node.isBlank() )
- return new JCR_BlankNode(node) ;
- conversionError("Node is not a concrete RDF Term: "+node) ;
- return null ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Graph.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Graph.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Graph.java
deleted file mode 100644
index ef043e4..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Graph.java
+++ /dev/null
@@ -1,115 +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.jena.commonsrdf.impl;
-
-import java.io.StringWriter ;
-import java.util.Iterator ;
-import java.util.stream.Stream ;
-
-import org.apache.commons.rdf.api.* ;
-import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.riot.Lang ;
-import org.apache.jena.riot.RDFDataMgr ;
-
-public class JCR_Graph implements Graph, JenaGraph {
-
- private org.apache.jena.graph.Graph graph;
-
- /*package*/ JCR_Graph(org.apache.jena.graph.Graph graph) {
- this.graph = graph ;
- }
-
- @Override
- public org.apache.jena.graph.Graph getGraph() {
- return graph ;
- }
-
- @Override
- public void add(Triple triple) { graph.add(JenaCommonsRDF.toJena(triple)); }
-
- @Override
- public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- graph.add(org.apache.jena.graph.Triple.create(JenaCommonsRDF.toJena(subject),
- JenaCommonsRDF.toJena(predicate),
- JenaCommonsRDF.toJena(object)));
- }
-
- @Override
- public boolean contains(Triple triple) {
- return graph.contains(JenaCommonsRDF.toJena(triple)) ;
- }
-
- @Override
- public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- return graph.contains(JenaCommonsRDF.toJena(subject),
- JenaCommonsRDF.toJena(predicate),
- JenaCommonsRDF.toJena(object) );
- }
-
- @Override
- public void remove(Triple triple) { graph.delete(JenaCommonsRDF.toJena(triple)); }
-
- @Override
- public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- graph.delete(org.apache.jena.graph.Triple.create(JenaCommonsRDF.toJena(subject),
- JenaCommonsRDF.toJena(predicate),
- JenaCommonsRDF.toJena(object)));
- }
-
- @Override
- public void clear() { graph.clear(); }
-
- @Override
- public long size() {
- return graph.size() ;
- }
-
- @Override
- public Stream<? extends Triple> getTriples() {
- return getTriples(null, null, null) ;
- }
-
- @Override
- public Stream<? extends Triple> getTriples(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- Iterator<org.apache.jena.graph.Triple> iter = graph.find(toJenaAny(subject),toJenaAny(predicate),toJenaAny(object)) ;
- Iterator<Triple> iter2 = Iter.map(iter, t-> JenaCommonsRDF.fromJena(t)) ;
- return Iter.asStream(iter2) ;
-
- }
-
- private Node toJenaAny(RDFTerm term) {
- if ( term == null )
- return Node.ANY ;
- return JenaCommonsRDF.toJena(term) ;
- }
-
- @Override
- public void close() { graph.close(); }
-
- @Override
- public String toString() {
- StringWriter sw = new StringWriter() ;
- RDFDataMgr.write(sw, graph, Lang.NT) ;
- return sw.toString() ;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_IRI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_IRI.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_IRI.java
deleted file mode 100644
index 888169e..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_IRI.java
+++ /dev/null
@@ -1,55 +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.jena.commonsrdf.impl;
-
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-
-import org.apache.commons.rdf.api.* ;
-
-public class JCR_IRI extends JCR_Term implements IRI, JenaNode {
-
- /*package*/ JCR_IRI(String iriStr) {
- super(NodeFactory.createURI(iriStr)) ;
- }
-
- /*package*/ JCR_IRI(Node node) {
- super(node) ;
- }
-
- @Override
- public String getIRIString() {
- return getNode().getURI() ;
- }
-
- @Override
- public int hashCode() {
- return getIRIString().hashCode() ;
- }
-
- @Override
- public boolean equals(Object other) {
- if ( other == this ) return true ;
- if ( other == null ) return false ;
- if ( ! ( other instanceof IRI ) ) return false ;
- IRI iri = (IRI)other ;
- return getIRIString().equals(iri.getIRIString()) ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Literal.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Literal.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Literal.java
deleted file mode 100644
index 97284c9..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Literal.java
+++ /dev/null
@@ -1,68 +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.jena.commonsrdf.impl;
-
-import java.util.Objects ;
-import java.util.Optional ;
-
-import org.apache.commons.rdf.api.IRI ;
-import org.apache.commons.rdf.api.Literal ;
-import org.apache.jena.graph.Node ;
-
-public class JCR_Literal extends JCR_Term implements Literal {
-
- /* package */ JCR_Literal(Node node) {
- super(node) ;
- }
-
- @Override
- public String getLexicalForm() {
- return getNode().getLiteralLexicalForm() ;
- }
-
- @Override
- public IRI getDatatype() {
- return JCR_Factory.createIRI(getNode().getLiteralDatatype().getURI()) ;
- }
-
- @Override
- public Optional<String> getLanguageTag() {
- String x = getNode().getLiteralLanguage() ;
- if ( x == null || x.isEmpty() )
- return Optional.empty() ;
- return Optional.of(x) ;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(getLexicalForm(), getDatatype(), getLanguageTag()) ;
- }
-
- @Override
- public boolean equals(Object other) {
- if ( other == this ) return true ;
- if ( other == null ) return false ;
- if ( ! ( other instanceof Literal ) ) return false ;
- Literal literal = (Literal)other ;
- return getLexicalForm().equals(literal.getLexicalForm()) &&
- getLanguageTag().equals(literal.getLanguageTag()) &&
- getDatatype().equals(literal.getDatatype()) ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Term.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Term.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Term.java
deleted file mode 100644
index f2f27ec..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Term.java
+++ /dev/null
@@ -1,48 +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.jena.commonsrdf.impl;
-
-import org.apache.jena.graph.Node ;
-import org.apache.jena.riot.out.NodeFmtLib ;
-import org.apache.jena.shared.PrefixMapping ;
-import org.apache.jena.shared.impl.PrefixMappingImpl ;
-
-class JCR_Term implements JenaNode {
- private Node node;
- static private PrefixMapping empty = new PrefixMappingImpl() ;
-
- protected JCR_Term(Node node) {
- this.node = node ;
- }
-
- @Override
- public Node getNode() {
- return node ;
- }
-
- public String ntriplesString() {
- return NodeFmtLib.str(node) ;
- }
-
- @Override
- public String toString() {
- return ntriplesString() ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Triple.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Triple.java b/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Triple.java
deleted file mode 100644
index 88c36bc..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JCR_Triple.java
+++ /dev/null
@@ -1,88 +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.jena.commonsrdf.impl;
-
-import java.util.Objects ;
-
-import org.apache.commons.rdf.api.* ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-
-public class JCR_Triple implements Triple, JenaTriple {
- private final BlankNodeOrIRI subject ;
- private final IRI predicate ;
- private final RDFTerm object ;
- private org.apache.jena.graph.Triple triple = null ;
-
- /* package */ JCR_Triple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
- this.subject = subject ;
- this.predicate = predicate ;
- this.object = object ;
- }
-
- /* package */ JCR_Triple(org.apache.jena.graph.Triple triple) {
- this.subject = (BlankNodeOrIRI)JCR_Factory.fromJena(triple.getSubject()) ;
- this.predicate = (IRI)JCR_Factory.fromJena(triple.getPredicate()) ;
- this.object = JCR_Factory.fromJena(triple.getObject()) ;
- this.triple = triple ;
- }
-
- @Override
- public org.apache.jena.graph.Triple getTriple() {
- if ( triple == null )
- triple = org.apache.jena.graph.Triple.create(JenaCommonsRDF.toJena(subject), JenaCommonsRDF.toJena(predicate), JenaCommonsRDF.toJena(object)) ;
- return triple ;
- }
-
- @Override
- public BlankNodeOrIRI getSubject() {
- return subject ;
- }
-
- @Override
- public IRI getPredicate() {
- return predicate ;
- }
-
- @Override
- public RDFTerm getObject() {
- return object ;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(getSubject(), getPredicate(), getObject()) ;
- }
-
- @Override
- public boolean equals(Object other) {
- if ( other == this ) return true ;
- if ( other == null ) return false ;
- if ( ! ( other instanceof Triple ) ) return false ;
- Triple triple = (Triple)other ;
- return getSubject().equals(triple.getSubject()) &&
- getPredicate().equals(triple.getPredicate()) &&
- getObject().equals(triple.getObject()) ;
- }
-
- @Override
- public String toString() {
- return getSubject()+" "+getPredicate()+" "+getObject()+" ." ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JenaGraph.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JenaGraph.java b/src/main/java/org/apache/jena/commonsrdf/impl/JenaGraph.java
deleted file mode 100644
index fd0ab3b..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JenaGraph.java
+++ /dev/null
@@ -1,26 +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.jena.commonsrdf.impl;
-
-import org.apache.jena.graph.Graph ;
-
-/** Access the Jena graph backing this object */
-public interface JenaGraph {
- public Graph getGraph() ;
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JenaNode.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JenaNode.java b/src/main/java/org/apache/jena/commonsrdf/impl/JenaNode.java
deleted file mode 100644
index b1148e1..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JenaNode.java
+++ /dev/null
@@ -1,26 +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.jena.commonsrdf.impl;
-
-import org.apache.jena.graph.Node ;
-
-/** Access the Jena node backing this object */
-public interface JenaNode {
- public Node getNode() ;
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/JenaTriple.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/JenaTriple.java b/src/main/java/org/apache/jena/commonsrdf/impl/JenaTriple.java
deleted file mode 100644
index 0b3ef6f..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/JenaTriple.java
+++ /dev/null
@@ -1,26 +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.jena.commonsrdf.impl;
-
-import org.apache.jena.graph.Triple ;
-
-/** Access the Jena triple backing this object */
-public interface JenaTriple {
- public Triple getTriple() ;
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/main/java/org/apache/jena/commonsrdf/impl/ToGraph.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/jena/commonsrdf/impl/ToGraph.java b/src/main/java/org/apache/jena/commonsrdf/impl/ToGraph.java
deleted file mode 100644
index eb16773..0000000
--- a/src/main/java/org/apache/jena/commonsrdf/impl/ToGraph.java
+++ /dev/null
@@ -1,68 +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.jena.commonsrdf.impl;
-
-import org.apache.commons.rdf.api.Graph ;
-import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.jena.commonsrdf.JenaCommonsRDF ;
-import org.apache.jena.riot.system.StreamRDF ;
-
-/** Adapter to go from Jena StreamRDF (e.g. a parser output stream) to a CommonsRDF Graph */
-public class ToGraph implements StreamRDF {
-
- private Graph graph;
- private RDFTermFactory factory;
-
- public ToGraph(RDFTermFactory factory) {
- this(factory, factory.createGraph()) ;
- }
-
- public ToGraph(RDFTermFactory factory, Graph graph) {
- this.factory = factory ;
- this.graph = graph ;
- }
-
- @Override
- public void start() {}
-
- @Override
- public void triple(org.apache.jena.graph.Triple triple) {
- graph.add(JenaCommonsRDF.fromJena(factory, triple)) ;
- }
-
- @Override
- public void quad(org.apache.jena.sparql.core.Quad quad) {
- throw new UnsupportedOperationException() ;
- }
-
- @Override
- public void base(String base) {}
-
- @Override
- public void prefix(String prefix, String iri) {}
-
- @Override
- public void finish() {}
-
- public Graph getGraph() {
- return graph;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/test/java/org/apache/jena/commonsrdf/TS_JenaCommonsRDF.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/jena/commonsrdf/TS_JenaCommonsRDF.java b/src/test/java/org/apache/jena/commonsrdf/TS_JenaCommonsRDF.java
deleted file mode 100644
index b7e98c9..0000000
--- a/src/test/java/org/apache/jena/commonsrdf/TS_JenaCommonsRDF.java
+++ /dev/null
@@ -1,41 +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.jena.commonsrdf;
-
-import org.apache.jena.atlas.logging.LogCtl ;
-import org.junit.BeforeClass ;
-import org.junit.runner.RunWith ;
-import org.junit.runners.Suite ;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( {
- // The tests from commons-rdf
- TestBlankNodeJena.class
- , TestGraphJena.class
- , TestRDFTermFactoryJena.class
- // Additional tests.
-})
-
-public class TS_JenaCommonsRDF {
- @BeforeClass public static void beforeClass() {
- LogCtl.setLog4j();
- //LogCtl.setWarn("org.apache.jena");
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/test/java/org/apache/jena/commonsrdf/TestBlankNodeJena.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/jena/commonsrdf/TestBlankNodeJena.java b/src/test/java/org/apache/jena/commonsrdf/TestBlankNodeJena.java
deleted file mode 100644
index 10ca79f..0000000
--- a/src/test/java/org/apache/jena/commonsrdf/TestBlankNodeJena.java
+++ /dev/null
@@ -1,36 +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.jena.commonsrdf;
-
-import org.apache.commons.rdf.api.AbstractBlankNodeTest ;
-import org.apache.commons.rdf.api.BlankNode ;
-import org.apache.jena.commonsrdf.impl.JCR_Factory ;
-
-public class TestBlankNodeJena extends AbstractBlankNodeTest {
- @Override
- protected BlankNode getBlankNode() {
- return JCR_Factory.createBlankNode() ;
- }
-
- @Override
- protected BlankNode getBlankNode(String identifier) {
- return JCR_Factory.createBlankNode(identifier) ;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/test/java/org/apache/jena/commonsrdf/TestGraphJena.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/jena/commonsrdf/TestGraphJena.java b/src/test/java/org/apache/jena/commonsrdf/TestGraphJena.java
deleted file mode 100644
index 2369732..0000000
--- a/src/test/java/org/apache/jena/commonsrdf/TestGraphJena.java
+++ /dev/null
@@ -1,33 +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.jena.commonsrdf;
-
-import org.apache.commons.rdf.api.AbstractGraphTest ;
-import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.jena.commonsrdf.RDFTermFactoryJena ;
-
-public class TestGraphJena extends AbstractGraphTest {
-
- @Override
- public RDFTermFactory createFactory() {
- return new RDFTermFactoryJena() ;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/test/java/org/apache/jena/commonsrdf/TestRDFTermFactoryJena.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/jena/commonsrdf/TestRDFTermFactoryJena.java b/src/test/java/org/apache/jena/commonsrdf/TestRDFTermFactoryJena.java
deleted file mode 100644
index d2e2c9f..0000000
--- a/src/test/java/org/apache/jena/commonsrdf/TestRDFTermFactoryJena.java
+++ /dev/null
@@ -1,33 +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.jena.commonsrdf;
-
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest ;
-import org.apache.commons.rdf.api.RDFTermFactory ;
-import org.apache.jena.commonsrdf.RDFTermFactoryJena ;
-
-public class TestRDFTermFactoryJena extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDFTermFactory createFactory() {
- return new RDFTermFactoryJena() ;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/5838bf5d/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties
deleted file mode 100644
index 5cedb50..0000000
--- a/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-log4j.rootLogger=INFO, stdlog
-
-log4j.appender.stdlog=org.apache.log4j.ConsoleAppender
-## log4j.appender.stdlog.target=System.err
-log4j.appender.stdlog.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdlog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-25c{1} :: %m%n
-
-# Execution logging
-log4j.logger.org.apache.jena.arq.info=INFO
-log4j.logger.org.apache.jena.arq.exec=INFO
-
-# Everything else in Jena
-log4j.logger.org.apache.jena=WARN
-log4j.logger.org.apache.jena.riot=INFO
-
-# Apache Commons HTTP
-# May be useful to turn up to DEBUG if debugging HTTP communication issues
-log4j.logger.org.apache.http=WARN