commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [4/9] incubator-commonsrdf git commit: code tidy
Date Fri, 08 Jul 2016 11:53:48 GMT
code tidy

Eclipse reformat/organize import/member sort


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

Branch: refs/heads/jena
Commit: 7136d5579e74d3f7c66d239254a7008957efc23b
Parents: ed89a1b
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Fri Jul 8 09:42:44 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Fri Jul 8 09:42:44 2016 +0100

----------------------------------------------------------------------
 .../commons/rdf/jena/ConversionException.java   |  28 ++-
 .../org/apache/commons/rdf/jena/JenaGraph.java  |   6 +-
 .../org/apache/commons/rdf/jena/JenaNode.java   |   6 +-
 .../org/apache/commons/rdf/jena/JenaQuad.java   |   4 +-
 .../commons/rdf/jena/JenaRDFParserBuilder.java  |   8 +-
 .../org/apache/commons/rdf/jena/JenaTriple.java |   6 +-
 .../commons/rdf/jena/RDFTermFactoryJena.java    |  42 ++---
 .../commons/rdf/jena/impl/AbstractRDFTerm.java  |  43 +++--
 .../commons/rdf/jena/impl/BlankNodeImpl.java    |  49 ++---
 .../apache/commons/rdf/jena/impl/GraphImpl.java | 181 ++++++++++---------
 .../apache/commons/rdf/jena/impl/IRIImpl.java   |  63 +++----
 .../commons/rdf/jena/impl/JenaFactory.java      |  64 +++----
 .../commons/rdf/jena/impl/LiteralImpl.java      |  81 +++++----
 .../apache/commons/rdf/jena/impl/QuadImpl.java  | 161 +++++++++--------
 .../commons/rdf/jena/impl/TripleImpl.java       | 122 +++++++------
 15 files changed, 442 insertions(+), 422 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/ConversionException.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/ConversionException.java b/jena/src/main/java/org/apache/commons/rdf/jena/ConversionException.java
index 44953cd..990086f 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/ConversionException.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/ConversionException.java
@@ -18,20 +18,30 @@
 
 package org.apache.commons.rdf.jena;
 
-import org.apache.jena.shared.JenaException ;
+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>.
+ * 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)
; }
-}
+	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/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/JenaGraph.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaGraph.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaGraph.java
index a101da4..7596021 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaGraph.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaGraph.java
@@ -18,9 +18,9 @@
 
 package org.apache.commons.rdf.jena;
 
-import org.apache.jena.graph.Graph ;
+import org.apache.jena.graph.Graph;
 
-/** Access the Jena graph backing this object */ 
+/** Access the Jena graph backing this object */
 public interface JenaGraph extends org.apache.commons.rdf.api.Graph {
-    public Graph asJenaGraph() ;
+	public Graph asJenaGraph();
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/JenaNode.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaNode.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaNode.java
index 0a47d9f..4be7940 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaNode.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaNode.java
@@ -19,9 +19,9 @@
 package org.apache.commons.rdf.jena;
 
 import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Node;
 
-/** Access the Jena node backing this object */ 
+/** Access the Jena node backing this object */
 public interface JenaNode extends RDFTerm {
-    public Node asJenaNode() ;
+	public Node asJenaNode();
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/JenaQuad.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaQuad.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaQuad.java
index a9c4f05..7fdb658 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaQuad.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaQuad.java
@@ -20,7 +20,7 @@ package org.apache.commons.rdf.jena;
 
 import org.apache.jena.sparql.core.Quad;
 
-/** Access the Jena quad backing this object */ 
+/** Access the Jena quad backing this object */
 public interface JenaQuad extends org.apache.commons.rdf.api.Quad {
-    public Quad asJenaQuad() ;
+	public Quad asJenaQuad();
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFParserBuilder.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFParserBuilder.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFParserBuilder.java
index 2349f8b..e0eb19d 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFParserBuilder.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFParserBuilder.java
@@ -32,8 +32,7 @@ import org.apache.jena.riot.RDFDataMgr;
 import org.apache.jena.riot.system.StreamRDF;
 import org.apache.jena.riot.system.StreamRDFLib;
 
-public class JenaRDFParserBuilder extends AbstractRDFParserBuilder<JenaRDFParserBuilder>

-	implements RDFParserBuilder {
+public class JenaRDFParserBuilder extends AbstractRDFParserBuilder<JenaRDFParserBuilder>
implements RDFParserBuilder {
 
 	protected RDFTermFactory createRDFTermFactory() {
 		return new RDFTermFactoryJena();
@@ -43,9 +42,9 @@ public class JenaRDFParserBuilder extends AbstractRDFParserBuilder<JenaRDFParser
 	protected void parseSynchronusly() throws IOException {
 		StreamRDF dest;
 		if (getTargetGraph().isPresent() && getTargetGraph().get() instanceof JenaGraph)
{
-			Graph jenaGraph = ((JenaGraph)getTargetGraph().get()).asJenaGraph();
+			Graph jenaGraph = ((JenaGraph) getTargetGraph().get()).asJenaGraph();
 			dest = StreamRDFLib.graph(jenaGraph);
-		} else {		
+		} else {
 			dest = RDFTermFactoryJena.streamJenaToCommonsRDF(getRdfTermFactory().get(), getTarget());
 		}
 
@@ -63,5 +62,4 @@ public class JenaRDFParserBuilder extends AbstractRDFParserBuilder<JenaRDFParser
 		}
 	}
 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/JenaTriple.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaTriple.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaTriple.java
index f8e93ed..3735bdd 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaTriple.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaTriple.java
@@ -18,9 +18,9 @@
 
 package org.apache.commons.rdf.jena;
 
-import org.apache.jena.graph.Triple ;
+import org.apache.jena.graph.Triple;
 
-/** Access the Jena triple backing this object */ 
+/** Access the Jena triple backing this object */
 public interface JenaTriple extends org.apache.commons.rdf.api.Triple {
-    public Triple asJenaTriple() ;
+	public Triple asJenaTriple();
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/RDFTermFactoryJena.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/RDFTermFactoryJena.java b/jena/src/main/java/org/apache/commons/rdf/jena/RDFTermFactoryJena.java
index 820884c..f1ac450 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/RDFTermFactoryJena.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/RDFTermFactoryJena.java
@@ -44,11 +44,10 @@ import org.apache.jena.riot.system.StreamRDFBase;
 import org.apache.jena.sparql.graph.GraphFactory;
 
 /**
- * RDFTermFactory with Jena-backed objects. 
+ * RDFTermFactory with Jena-backed objects.
  * <p>
- * This factory can also convert existing objects from/to Jena
- * with methods like {@link #fromJena(org.apache.jena.graph.Graph)} 
- * and {@link #toJena(Graph)}. 
+ * This factory can also convert existing objects from/to Jena with methods like
+ * {@link #fromJena(org.apache.jena.graph.Graph)} and {@link #toJena(Graph)}.
  * 
  * @see RDFTermFactory
  */
@@ -56,10 +55,10 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 
 	private UUID salt;
 
-	public RDFTermFactoryJena() { 
+	public RDFTermFactoryJena() {
 		this.salt = UUID.randomUUID();
 	}
-	
+
 	public RDFTermFactoryJena(UUID salt) {
 		this.salt = salt;
 	}
@@ -75,7 +74,7 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 	}
 
 	@Override
-	public Graph createGraph() {		
+	public Graph createGraph() {
 		return JenaFactory.createGraph(salt);
 	}
 
@@ -162,9 +161,7 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 	public static org.apache.jena.graph.Triple toJena(Triple triple) {
 		if (triple instanceof JenaTriple)
 			return ((JenaTriple) triple).asJenaTriple();
-		return new org.apache.jena.graph.Triple(
-				toJena(triple.getSubject()), 
-				toJena(triple.getPredicate()),
+		return new org.apache.jena.graph.Triple(toJena(triple.getSubject()), toJena(triple.getPredicate()),
 				toJena(triple.getObject()));
 	}
 
@@ -199,26 +196,28 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 		return JenaFactory.fromJena(node, salt);
 	}
 
-	
 	/**
 	 * Adapt an existing Jena Triple to CommonsRDF {@link Triple}.
 	 * 
-	 * @param triple Jena triple
+	 * @param triple
+	 *            Jena triple
 	 */
 	public Triple fromJena(org.apache.jena.graph.Triple triple) {
 		return JenaFactory.fromJena(triple, salt);
 	}
-	
+
 	/**
 	 * Adapt an existing Jena Triple to CommonsRDF {@link Triple}.
 	 * 
-	 * @param triple Jena triple
-	 * @param salt A {@link UUID} salt for adapting any {@link BlankNode}s 
+	 * @param triple
+	 *            Jena triple
+	 * @param salt
+	 *            A {@link UUID} salt for adapting any {@link BlankNode}s
 	 */
 	public static Triple fromJena(org.apache.jena.graph.Triple triple, UUID salt) {
 		return JenaFactory.fromJena(triple, salt);
 	}
-	
+
 	public Quad fromJena(org.apache.jena.sparql.core.Quad quad) {
 		return JenaFactory.fromJena(quad, salt);
 	}
@@ -226,18 +225,17 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 	public static Quad fromJena(org.apache.jena.sparql.core.Quad quad, UUID salt) {
 		return JenaFactory.fromJena(quad, salt);
 	}
-	
 
 	/**
 	 * 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) {	
+	public static Graph fromJena(org.apache.jena.graph.Graph graph) {
 		// NOTE: This generates a new UUID salt per graph
 		return JenaFactory.fromJena(graph);
 	}
-	
+
 	/**
 	 * Convert from Jena {@link Node} to any RDFCommons implementation
 	 * 
@@ -249,7 +247,7 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 		}
 		if (factory instanceof RDFTermFactoryJena) {
 			// No need to convert, just wrap
-			return ((RDFTermFactoryJena)factory).fromJena(node);
+			return ((RDFTermFactoryJena) factory).fromJena(node);
 		}
 		if (node.isURI())
 			return factory.createIRI(node.getURI());
@@ -274,7 +272,7 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 	public static Triple fromJena(RDFTermFactory factory, org.apache.jena.graph.Triple triple)
{
 		if (factory instanceof RDFTermFactoryJena) {
 			// No need to convert, just wrap
-			return ((RDFTermFactoryJena)factory).fromJena(triple);
+			return ((RDFTermFactoryJena) factory).fromJena(triple);
 		}
 		BlankNodeOrIRI subject = (BlankNodeOrIRI) (fromJena(factory, triple.getSubject()));
 		IRI predicate = (IRI) (fromJena(factory, triple.getPredicate()));
@@ -316,7 +314,7 @@ public final class RDFTermFactoryJena implements RDFTermFactory {
 	public static Quad fromJena(RDFTermFactory factory, org.apache.jena.sparql.core.Quad quad)
{
 		if (factory instanceof RDFTermFactoryJena) {
 			// No need to convert, just wrap
-			return ((RDFTermFactoryJena)factory).fromJena(quad);
+			return ((RDFTermFactoryJena) factory).fromJena(quad);
 		}
 		BlankNodeOrIRI graphName = (BlankNodeOrIRI) (fromJena(factory, quad.getGraph()));
 		BlankNodeOrIRI subject = (BlankNodeOrIRI) (fromJena(factory, quad.getSubject()));

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractRDFTerm.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractRDFTerm.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractRDFTerm.java
index 1aaa476..e7bc125 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractRDFTerm.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractRDFTerm.java
@@ -20,29 +20,28 @@ package org.apache.commons.rdf.jena.impl;
 
 import org.apache.commons.rdf.api.RDFTerm;
 import org.apache.commons.rdf.jena.JenaNode;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.riot.out.NodeFmtLib ;
+import org.apache.jena.graph.Node;
+import org.apache.jena.riot.out.NodeFmtLib;
 
 class AbstractRDFTerm implements JenaNode, RDFTerm {
-    private Node node;
-    //static private PrefixMapping empty = new PrefixMappingImpl() ; 
-    
-    protected AbstractRDFTerm(Node node) {
-        this.node = node ;
-    }
-    
-    @Override
-    public Node asJenaNode() {
-        return node ;
-    }
+	private Node node;
+	// static private PrefixMapping empty = new PrefixMappingImpl() ;
 
-    public String ntriplesString() {
-        return NodeFmtLib.str(node) ;
-    }
-    
-    @Override
-    public String toString() {
-        return ntriplesString() ; 
-    }
-}
+	protected AbstractRDFTerm(Node node) {
+		this.node = node;
+	}
+
+	@Override
+	public Node asJenaNode() {
+		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/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/BlankNodeImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/BlankNodeImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/BlankNodeImpl.java
index 9a41c71..fc7d1c3 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/BlankNodeImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/BlankNodeImpl.java
@@ -20,38 +20,39 @@ package org.apache.commons.rdf.jena.impl;
 
 import java.util.UUID;
 
-import org.apache.commons.rdf.api.BlankNode ;
+import org.apache.commons.rdf.api.BlankNode;
 import org.apache.commons.rdf.jena.JenaNode;
-import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Node;
 
 public class BlankNodeImpl extends AbstractRDFTerm implements BlankNode, JenaNode {
 
-    private UUID salt;
+	private UUID salt;
 
 	/* package */ BlankNodeImpl(Node node, UUID salt) {
 		super(node);
 		this.salt = salt;
 	}
 
-    @Override
-    public String uniqueReference() {
-        return salt + asJenaNode().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()) ;
-    }
-    
-    
-}
+	@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());
+	}
+
+	@Override
+	public int hashCode() {
+		return uniqueReference().hashCode();
+	}
 
+	@Override
+	public String uniqueReference() {
+		return salt + asJenaNode().getBlankNodeLabel();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/GraphImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/GraphImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/GraphImpl.java
index ed16b4c..29d3a61 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/GraphImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/GraphImpl.java
@@ -18,106 +18,115 @@
 
 package org.apache.commons.rdf.jena.impl;
 
-import java.io.StringWriter ;
+import java.io.StringWriter;
 import java.util.UUID;
-import java.util.stream.Stream ;
+import java.util.stream.Stream;
 
 import org.apache.commons.rdf.api.BlankNodeOrIRI;
 import org.apache.commons.rdf.api.Graph;
 import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.api.RDFTerm;
 import org.apache.commons.rdf.api.Triple;
-import org.apache.commons.rdf.jena.RDFTermFactoryJena;
 import org.apache.commons.rdf.jena.JenaGraph;
 import org.apache.commons.rdf.jena.RDFTermFactoryJena;
-import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.riot.Lang ;
-import org.apache.jena.riot.RDFDataMgr ;
+import org.apache.jena.atlas.iterator.Iter;
+import org.apache.jena.graph.Node;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFDataMgr;
 
 public class GraphImpl implements Graph, JenaGraph {
 
-    private org.apache.jena.graph.Graph graph;
+	private org.apache.jena.graph.Graph graph;
 	private UUID salt;
 
-    /*package*/ GraphImpl(org.apache.jena.graph.Graph graph, UUID salt) {
-        this.graph = graph ;        
+	/* package */ GraphImpl(org.apache.jena.graph.Graph graph, UUID salt) {
+		this.graph = graph;
 		this.salt = salt;
-    }
-    
-    @Override
-    public org.apache.jena.graph.Graph asJenaGraph() {
-        return graph ;
-    }
-
-    @Override
-    public void add(Triple triple) { graph.add(RDFTermFactoryJena.toJena(triple)); }
-
-    @Override
-    public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) { 
-        graph.add(org.apache.jena.graph.Triple.create(RDFTermFactoryJena.toJena(subject),
-				        		RDFTermFactoryJena.toJena(predicate),
-				        		RDFTermFactoryJena.toJena(object)));
-    }
-
-    @Override
-    public boolean contains(Triple triple) {
-        return graph.contains(RDFTermFactoryJena.toJena(triple)) ; 
-    }
-
-    @Override
-    public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
-        return graph.contains(RDFTermFactoryJena.toJena(subject),
-        		RDFTermFactoryJena.toJena(predicate),
-                              RDFTermFactoryJena.toJena(object) );
-    }
-
-    @Override
-    public void remove(Triple triple) { graph.delete(RDFTermFactoryJena.toJena(triple));
}
-
-    @Override
-    public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
-        graph.delete(org.apache.jena.graph.Triple.create(RDFTermFactoryJena.toJena(subject),
-        		RDFTermFactoryJena.toJena(predicate),
-                                                         RDFTermFactoryJena.toJena(object)));
-    }
-
-    @Override
-    public void clear() { graph.clear(); }
-
-    @Override
-    public long size() {
-        return graph.size() ;
-    }
-
-    @Override
-    public Stream<? extends Triple> stream() {
-    	RDFTermFactoryJena factory = new RDFTermFactoryJena(salt);
-    	return Iter.asStream(graph.find(null, null, null), true).map(factory::fromJena);
-    }
-
-    @Override
-    public Stream<? extends Triple> stream(BlankNodeOrIRI s, IRI p, RDFTerm o) {
-    	RDFTermFactoryJena factory = new RDFTermFactoryJena(salt);
-        return Iter.asStream(graph.find(toJenaAny(s),toJenaAny(p),toJenaAny(o)), true).
-        		map(factory::fromJena);
-    }
-
-    private Node toJenaAny(RDFTerm term) {
-        if ( term == null )
-            return Node.ANY ;
-        return RDFTermFactoryJena.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() ;
-    }
+	}
+
+	@Override
+	public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		graph.add(org.apache.jena.graph.Triple.create(
+				RDFTermFactoryJena.toJena(subject),
+				RDFTermFactoryJena.toJena(predicate), 
+				RDFTermFactoryJena.toJena(object)));
+	}
+
+	@Override
+	public void add(Triple triple) {
+		graph.add(RDFTermFactoryJena.toJena(triple));
+	}
+
+	@Override
+	public org.apache.jena.graph.Graph asJenaGraph() {
+		return graph;
+	}
+
+	@Override
+	public void clear() {
+		graph.clear();
+	}
+
+	@Override
+	public void close() {
+		graph.close();
+	}
+
+	@Override
+	public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		return graph.contains(
+				RDFTermFactoryJena.toJena(subject), 
+				RDFTermFactoryJena.toJena(predicate),
+				RDFTermFactoryJena.toJena(object));
+	}
+
+	@Override
+	public boolean contains(Triple triple) {
+		return graph.contains(RDFTermFactoryJena.toJena(triple));
+	}
+
+	@Override
+	public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		graph.delete(org.apache.jena.graph.Triple.create(
+				RDFTermFactoryJena.toJena(subject),
+				RDFTermFactoryJena.toJena(predicate), 
+				RDFTermFactoryJena.toJena(object)));
+	}
+
+	@Override
+	public void remove(Triple triple) {
+		graph.delete(RDFTermFactoryJena.toJena(triple));
+	}
+
+	@Override
+	public long size() {
+		return graph.size();
+	}
+
+	@Override
+	public Stream<? extends Triple> stream() {
+		RDFTermFactoryJena factory = new RDFTermFactoryJena(salt);
+		return Iter.asStream(graph.find(null, null, null), true).map(factory::fromJena);
+	}
+
+	@Override
+	public Stream<? extends Triple> stream(BlankNodeOrIRI s, IRI p, RDFTerm o) {
+		RDFTermFactoryJena factory = new RDFTermFactoryJena(salt);
+		return Iter.asStream(graph.find(toJenaAny(s), toJenaAny(p), toJenaAny(o)), true)
+				.map(factory::fromJena);
+	}
+
+	private Node toJenaAny(RDFTerm term) {
+		if (term == null)
+			return Node.ANY;
+		return RDFTermFactoryJena.toJena(term);
+	}
+
+	@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/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/IRIImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/IRIImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/IRIImpl.java
index 0716e8d..d5373b7 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/IRIImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/IRIImpl.java
@@ -18,39 +18,40 @@
 
 package org.apache.commons.rdf.jena.impl;
 
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-
-import org.apache.commons.rdf.api.* ;
+import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.jena.JenaNode;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
 
 public class IRIImpl extends AbstractRDFTerm implements IRI, JenaNode {
 
-    /*package*/ IRIImpl(String iriStr) {
-        super(NodeFactory.createURI(iriStr)) ;
-    }
-    
-    /*package*/ IRIImpl(Node node) {
-        super(node) ;
-    }
-
-    @Override
-    public String getIRIString() {
-        return asJenaNode().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()) ;
-    }
-}
+	/* package */ IRIImpl(Node node) {
+		super(node);
+	}
+
+	/* package */ IRIImpl(String iriStr) {
+		super(NodeFactory.createURI(iriStr));
+	}
 
+	@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());
+	}
+
+	@Override
+	public String getIRIString() {
+		return asJenaNode().getURI();
+	}
+
+	@Override
+	public int hashCode() {
+		return getIRIString().hashCode();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
index a856d07..c67bb7c 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
@@ -35,6 +35,26 @@ import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.sparql.graph.GraphFactory;
 
 public class JenaFactory {
+	public static BlankNode createBlankNode() {
+		return new BlankNodeImpl(NodeFactory.createBlankNode(), UUID.randomUUID());
+	}
+
+	public static BlankNode createBlankNode(String id, UUID salt) {
+		return new BlankNodeImpl(NodeFactory.createBlankNode(id), salt);
+	}
+
+	public static BlankNode createBlankNode(UUID salt) {
+		return new BlankNodeImpl(NodeFactory.createBlankNode(), salt);
+	}
+
+	public static Graph createGraph() {
+		return createGraph(UUID.randomUUID());
+	}
+
+	public static Graph createGraph(UUID salt) {
+		return new GraphImpl(GraphFactory.createDefaultGraph(), salt);
+	}
+
 	// basic components to commonsrdf backed by Jena.
 	public static IRI createIRI(String iriStr) {
 		return new IRIImpl(iriStr);
@@ -52,38 +72,10 @@ public class JenaFactory {
 		return new LiteralImpl(NodeFactory.createLiteral(lexStr, langTag));
 	}
 
-	public static BlankNode createBlankNode() {
-		return new BlankNodeImpl(NodeFactory.createBlankNode(), UUID.randomUUID());
-	}
-
-	public static BlankNode createBlankNode(UUID salt) {
-		return new BlankNodeImpl(NodeFactory.createBlankNode(), salt);
-	}
-
-	public static BlankNode createBlankNode(String id, UUID salt) {
-		return new BlankNodeImpl(NodeFactory.createBlankNode(id), salt);
-	}
-
-	public static Graph createGraph() {
-		return createGraph(UUID.randomUUID());
-	}
-
 	public static Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
{
 		return new TripleImpl(subject, predicate, object);
 	}
 
-	public static Triple fromJena(org.apache.jena.graph.Triple triple, UUID salt) {
-		return new TripleImpl(triple, salt);
-	}
-
-	public static Graph fromJena(org.apache.jena.graph.Graph graph) {
-		return new GraphImpl(graph, UUID.randomUUID());
-	}
-
-	public static Graph fromJena(org.apache.jena.graph.Graph graph, UUID salt) {
-		return new GraphImpl(graph, salt);
-	}
-	
 	public static RDFTerm fromJena(Node node, UUID salt) {
 		if (node.isURI())
 			return new IRIImpl(node);
@@ -102,11 +94,19 @@ public class JenaFactory {
 		return null;
 	}
 
-	public static Quad fromJena(org.apache.jena.sparql.core.Quad quad, UUID salt) {
-		return new QuadImpl(quad, salt);
+	public static Graph fromJena(org.apache.jena.graph.Graph graph) {
+		return new GraphImpl(graph, UUID.randomUUID());
 	}
 
-	public static Graph createGraph(UUID salt) {
-		return new GraphImpl(GraphFactory.createDefaultGraph(), salt);
+	public static Graph fromJena(org.apache.jena.graph.Graph graph, UUID salt) {
+		return new GraphImpl(graph, salt);
+	}
+
+	public static Triple fromJena(org.apache.jena.graph.Triple triple, UUID salt) {
+		return new TripleImpl(triple, salt);
+	}
+
+	public static Quad fromJena(org.apache.jena.sparql.core.Quad quad, UUID salt) {
+		return new QuadImpl(quad, salt);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/LiteralImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/LiteralImpl.java
index 345532d..efcf099 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/LiteralImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/LiteralImpl.java
@@ -18,51 +18,52 @@
 
 package org.apache.commons.rdf.jena.impl;
 
-import java.util.Objects ;
-import java.util.Optional ;
+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 ;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.Literal;
+import org.apache.jena.graph.Node;
 
 public class LiteralImpl extends AbstractRDFTerm implements Literal {
 
-    /* package */ LiteralImpl(Node node) {
-        super(node) ;
-    }
+	/* package */ LiteralImpl(Node node) {
+		super(node);
+	}
 
-    @Override
-    public String getLexicalForm() {
-        return asJenaNode().getLiteralLexicalForm() ;
-    }
+	@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());
+	}
 
-    @Override
-    public IRI getDatatype() {
-        return JenaFactory.createIRI(asJenaNode().getLiteralDatatype().getURI()) ;
-    }
+	@Override
+	public IRI getDatatype() {
+		return JenaFactory.createIRI(asJenaNode().getLiteralDatatype().getURI());
+	}
 
-    @Override
-    public Optional<String> getLanguageTag() {
-        String x = asJenaNode().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()) ;
-    }
-}
+	@Override
+	public Optional<String> getLanguageTag() {
+		String x = asJenaNode().getLiteralLanguage();
+		if (x == null || x.isEmpty())
+			return Optional.empty();
+		return Optional.of(x);
+	}
+
+	@Override
+	public String getLexicalForm() {
+		return asJenaNode().getLiteralLexicalForm();
+	}
 
+	@Override
+	public int hashCode() {
+		return Objects.hash(getLexicalForm(), getDatatype(), getLanguageTag());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/QuadImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/QuadImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/QuadImpl.java
index 4a347b3..31c96b2 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/QuadImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/QuadImpl.java
@@ -27,93 +27,94 @@ import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.api.Quad;
 import org.apache.commons.rdf.api.RDFTerm;
 import org.apache.commons.rdf.api.Triple;
-import org.apache.commons.rdf.jena.RDFTermFactoryJena;
 import org.apache.commons.rdf.jena.JenaQuad;
+import org.apache.commons.rdf.jena.RDFTermFactoryJena;
 
 public class QuadImpl implements Quad, JenaQuad {
 
-	private final Optional<BlankNodeOrIRI> graphName;	
-    private final BlankNodeOrIRI subject ;
-    private final IRI predicate ;
-    private final RDFTerm object ;
-    private org.apache.jena.sparql.core.Quad quad = null ;
-
-    /* package */ QuadImpl(Optional<BlankNodeOrIRI> graphName, BlankNodeOrIRI subject,
IRI predicate, RDFTerm object) {
-        this.graphName = Objects.requireNonNull(graphName);
-		this.subject = Objects.requireNonNull(subject) ;
-        this.predicate = Objects.requireNonNull(predicate) ;
-        this.object = Objects.requireNonNull(object) ;
-    }
-    
-    /* package */ QuadImpl(org.apache.jena.sparql.core.Quad quad, UUID salt) {
-        this.quad = Objects.requireNonNull(quad) ;
-    	this.graphName = Optional.of((BlankNodeOrIRI)JenaFactory.fromJena(quad.getGraph(), salt))
;
-        this.subject = (BlankNodeOrIRI)JenaFactory.fromJena(quad.getSubject(), salt) ;
-        this.predicate = (IRI)JenaFactory.fromJena(quad.getPredicate(), salt) ;
-        this.object = JenaFactory.fromJena(quad.getObject(), salt) ;
-    }
-
-    @Override
-    public org.apache.jena.sparql.core.Quad asJenaQuad() {
-        if ( quad == null ) {
-            quad = org.apache.jena.sparql.core.Quad.create(
-            		RDFTermFactoryJena.toJena(graphName.orElse(null)), 
-            		RDFTermFactoryJena.toJena(subject), 
-            		RDFTermFactoryJena.toJena(predicate), 
-            		RDFTermFactoryJena.toJena(object)) ;
-        }
-        return quad ;
-    }
-
-    @Override
-    public BlankNodeOrIRI getSubject() {
-        return subject ;
-    }
-
-    @Override
-    public IRI getPredicate() {
-        return predicate ;
-    }
-
-    @Override
-    public RDFTerm getObject() {
-        return object ;
-    }
-
-    @Override
+	private final Optional<BlankNodeOrIRI> graphName;
+	private final RDFTerm object;
+	private final IRI predicate;
+	private org.apache.jena.sparql.core.Quad quad = null;
+	private final BlankNodeOrIRI subject;
+
+	/* package */ QuadImpl(Optional<BlankNodeOrIRI> graphName, BlankNodeOrIRI subject,
IRI predicate, RDFTerm object) {
+		this.graphName = Objects.requireNonNull(graphName);
+		this.subject = Objects.requireNonNull(subject);
+		this.predicate = Objects.requireNonNull(predicate);
+		this.object = Objects.requireNonNull(object);
+	}
+
+	/* package */ QuadImpl(org.apache.jena.sparql.core.Quad quad, UUID salt) {
+		this.quad = Objects.requireNonNull(quad);
+		this.graphName = Optional.of((BlankNodeOrIRI) JenaFactory.fromJena(quad.getGraph(), salt));
+		this.subject = (BlankNodeOrIRI) JenaFactory.fromJena(quad.getSubject(), salt);
+		this.predicate = (IRI) JenaFactory.fromJena(quad.getPredicate(), salt);
+		this.object = JenaFactory.fromJena(quad.getObject(), salt);
+	}
+
+	@Override
+	public org.apache.jena.sparql.core.Quad asJenaQuad() {
+		if (quad == null) {
+			quad = org.apache.jena.sparql.core.Quad.create(
+					RDFTermFactoryJena.toJena(graphName.orElse(null)),
+					RDFTermFactoryJena.toJena(subject), 
+					RDFTermFactoryJena.toJena(predicate),
+					RDFTermFactoryJena.toJena(object));
+		}
+		return quad;
+	}
+
+	@Override
+	public Triple asTriple() {
+		return new TripleImpl(getSubject(), getPredicate(), getObject());
+	}
+
+	@Override
+	public boolean equals(Object other) {
+		if (other == this)
+			return true;
+		if (other == null)
+			return false;
+		if (!(other instanceof Quad))
+			return false;
+		Quad quad = (Quad) other;
+		return getGraphName().equals(quad.getGraphName()) && getSubject().equals(quad.getSubject())
+				&& getPredicate().equals(quad.getPredicate()) && getObject().equals(quad.getObject());
+	}
+
+	@Override
 	public Optional<BlankNodeOrIRI> getGraphName() {
 		return graphName;
 	}
-    
-    @Override
-    public int hashCode() {
-        return Objects.hash(getSubject(), getPredicate(), getObject(), getGraphName()) ;
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if ( other == this ) return true ;
-        if ( other == null ) return false ;
-        if ( ! ( other instanceof Quad ) ) return false ;
-        Quad quad = (Quad)other ;
-        return getGraphName().equals(quad.getGraphName()) &&
-        		getSubject().equals(quad.getSubject()) &&
-        		getPredicate().equals(quad.getPredicate()) &&
-        		getObject().equals(quad.getObject()) ;
-    }
-    
-    @Override 
-    public String toString() {
-    	// kind of nquad syntax
+
+	@Override
+	public RDFTerm getObject() {
+		return object;
+	}
+
+	@Override
+	public IRI getPredicate() {
+		return predicate;
+	}
+
+	@Override
+	public BlankNodeOrIRI getSubject() {
+		return subject;
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getSubject(), getPredicate(), getObject(), getGraphName());
+	}
+
+	@Override
+	public String toString() {
+		// kind of nquad syntax
 		return getSubject().ntriplesString() + " " + 
-    			getPredicate().ntriplesString() + " " + 
-    			getObject().ntriplesString() + " " + 
-    			getGraphName().map(RDFTerm::ntriplesString).orElse("") +  ".";
-    }
-
-    @Override
-    public Triple asTriple() {
-    	return new TripleImpl(getSubject(), getPredicate(), getObject());
-    }
+				getPredicate().ntriplesString() + " "
+				+ getObject().ntriplesString() + " " + 
+				getGraphName().map(RDFTerm::ntriplesString).orElse("") + ".";
+	}
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/7136d557/jena/src/main/java/org/apache/commons/rdf/jena/impl/TripleImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/TripleImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/TripleImpl.java
index a778a8e..3a0f15b 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/TripleImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/TripleImpl.java
@@ -18,76 +18,78 @@
 
 package org.apache.commons.rdf.jena.impl;
 
-import java.util.Objects ;
+import java.util.Objects;
 import java.util.UUID;
 
-import org.apache.commons.rdf.api.* ;
-import org.apache.commons.rdf.jena.RDFTermFactoryJena;
+import org.apache.commons.rdf.api.BlankNodeOrIRI;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.RDFTerm;
+import org.apache.commons.rdf.api.Triple;
 import org.apache.commons.rdf.jena.JenaTriple;
+import org.apache.commons.rdf.jena.RDFTermFactoryJena;
 
 public class TripleImpl implements Triple, JenaTriple {
-    private final BlankNodeOrIRI subject ;
-    private final IRI predicate ;
-    private final RDFTerm object ;
-    private org.apache.jena.graph.Triple triple = null ;
+	private final RDFTerm object;
+	private final IRI predicate;
+	private final BlankNodeOrIRI subject;
+	private org.apache.jena.graph.Triple triple = null;
 
-    /* package */ TripleImpl(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
-        this.subject = subject ;
-        this.predicate = predicate ;
-        this.object = object ;
-    }
-    
-    /* package */ TripleImpl(org.apache.jena.graph.Triple triple, UUID salt) {
-        this.subject = (BlankNodeOrIRI)JenaFactory.fromJena(triple.getSubject(), salt) ;
-        this.predicate = (IRI)JenaFactory.fromJena(triple.getPredicate(), salt) ;
-        this.object = JenaFactory.fromJena(triple.getObject(), salt) ;
-        this.triple = triple ;
-    }
+	/* package */ TripleImpl(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		this.subject = subject;
+		this.predicate = predicate;
+		this.object = object;
+	}
 
-    @Override
-    public org.apache.jena.graph.Triple asJenaTriple() {
-        if ( triple == null )
-            triple = org.apache.jena.graph.Triple.create(
-            		RDFTermFactoryJena.toJena(subject), 
-            		RDFTermFactoryJena.toJena(predicate), 
-            		RDFTermFactoryJena.toJena(object)) ;
-        return triple ;
-    }
+	/* package */ TripleImpl(org.apache.jena.graph.Triple triple, UUID salt) {
+		this.subject = (BlankNodeOrIRI) JenaFactory.fromJena(triple.getSubject(), salt);
+		this.predicate = (IRI) JenaFactory.fromJena(triple.getPredicate(), salt);
+		this.object = JenaFactory.fromJena(triple.getObject(), salt);
+		this.triple = triple;
+	}
 
-    @Override
-    public BlankNodeOrIRI getSubject() {
-        return subject ;
-    }
+	@Override
+	public org.apache.jena.graph.Triple asJenaTriple() {
+		if (triple == null)
+			triple = org.apache.jena.graph.Triple.create(RDFTermFactoryJena.toJena(subject),
+					RDFTermFactoryJena.toJena(predicate), RDFTermFactoryJena.toJena(object));
+		return triple;
+	}
 
-    @Override
-    public IRI getPredicate() {
-        return predicate ;
-    }
+	@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 RDFTerm getObject() {
-        return object ;
-    }
+	@Override
+	public RDFTerm getObject() {
+		return object;
+	}
 
-    @Override
-    public int hashCode() {
-        return Objects.hash(getSubject(), getPredicate(), getObject()) ;
-    }
+	@Override
+	public IRI getPredicate() {
+		return predicate;
+	}
 
-    @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()+" ." ;
-    }
-}
+	@Override
+	public BlankNodeOrIRI getSubject() {
+		return subject;
+	}
 
+	@Override
+	public int hashCode() {
+		return Objects.hash(getSubject(), getPredicate(), getObject());
+	}
+
+	@Override
+	public String toString() {
+		return getSubject() + " " + getPredicate() + " " + getObject() + " .";
+	}
+}



Mime
View raw message