commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [15/22] incubator-commonsrdf git commit: SimpleFactory -> SimpleRDF
Date Sun, 23 Oct 2016 00:59:58 GMT
SimpleFactory -> SimpleRDF


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

Branch: refs/heads/COMMONSRDF-46
Commit: 790b60591d23e5a332932d530f4e98c7e162eb59
Parents: 384a833
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Sun Oct 23 00:44:53 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Sun Oct 23 00:44:53 2016 +0100

----------------------------------------------------------------------
 .../commons/rdf/jsonldjava/JsonLdFactory.java   | 306 -------------------
 .../commons/rdf/jsonldjava/JsonLdRDF.java       | 306 +++++++++++++++++++
 .../commons/rdf/simple/BlankNodeImpl.java       |   2 +-
 .../apache/commons/rdf/simple/DatasetImpl.java  |   8 +-
 .../apache/commons/rdf/simple/GraphImpl.java    |   8 +-
 .../org/apache/commons/rdf/simple/IRIImpl.java  |   2 +-
 .../apache/commons/rdf/simple/LiteralImpl.java  |   2 +-
 .../org/apache/commons/rdf/simple/QuadImpl.java |   2 +-
 .../apache/commons/rdf/simple/SimpleRDF.java    | 114 +++++++
 .../commons/rdf/simple/SimpleRDFFactory.java    | 114 -------
 .../rdf/simple/SimpleRDFTermFactory.java        |   4 +-
 .../apache/commons/rdf/simple/TripleImpl.java   |   2 +-
 .../org/apache/commons/rdf/simple/Types.java    |   2 +-
 .../simple/experimental/AbstractRDFParser.java  |   8 +-
 .../apache/commons/rdf/simple/package-info.java |   6 +-
 .../org.apache.commons.rdf.api.RDFFactory       |   2 +-
 .../commons/rdf/simple/DefaultGraphTest.java    |   2 +-
 .../commons/rdf/simple/SimpleGraphTest.java     |   4 +-
 .../SimpleNoRelativeIRIRDFTermFactoryTest.java  |   2 +-
 .../rdf/simple/SimpleRDFTermFactoryTest.java    |   2 +-
 .../rdf/simple/SimpleServiceLoaderTest.java     |   4 +-
 .../commons/rdf/simple/TestWritingGraph.java    |   2 +-
 .../experimental/AbstractRDFParserTest.java     |   4 +-
 23 files changed, 454 insertions(+), 454 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java
deleted file mode 100644
index d5c49f8..0000000
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rdf.jsonldjava;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Objects;
-import java.util.UUID;
-
-import org.apache.commons.rdf.api.BlankNode;
-import org.apache.commons.rdf.api.BlankNodeOrIRI;
-import org.apache.commons.rdf.api.Dataset;
-import org.apache.commons.rdf.api.Graph;
-import org.apache.commons.rdf.api.IRI;
-import org.apache.commons.rdf.api.Literal;
-import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.commons.rdf.api.RDF;
-import org.apache.commons.rdf.api.Triple;
-import org.apache.commons.rdf.simple.Types;
-
-import com.github.jsonldjava.core.RDFDataset;
-import com.github.jsonldjava.core.RDFDataset.Node;
-
-public final class JsonLdFactory implements RDF {
-
-	final String bnodePrefix;
-
-	public JsonLdFactory() {
-		// An "outside Graph" bnodePrefix
-		this("urn:uuid:" + UUID.randomUUID() + "#b");
-	}
-
-	JsonLdFactory(String bnodePrefix) {
-		this.bnodePrefix = Objects.requireNonNull(bnodePrefix);
-	}
-
-	/**
-	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Dataset}.
-	 * <p>
-	 * Changes to the Commons RDF {@link Dataset} are reflected in the JsonLd
-	 * {@link RDFDataset} and vice versa.
-	 * 
-	 * @see #asGraph(RDFDataset)
-	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
-	 * @return Adapted {@link Dataset}
-	 */
-	public JsonLdDataset asDataset(RDFDataset rdfDataSet) {
-		return new JsonLdDatasetImpl(rdfDataSet);
-	}
-
-	/**
-	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Graph}.
-	 * <p>
-	 * Only triples in the <em>default graph</em> are included. To retrieve
-	 * any other graph, {@link #asDataset(RDFDataset)} together with 
-	 * {@link Dataset#getGraph(BlankNodeOrIRI)}.  
-	 * <p>
-	 * Changes to the Commons RDF {@link Graph} are reflected in the JsonLd
-	 * {@link RDFDataset} and vice versa.
-	 * 
-	 * @see #asDataset(RDFDataset)
-	 * @see #asUnionGraph(RDFDataset) 
-	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
-	 * @return Adapted {@link Graph} covering the <em>default graph</em>
-	 */	
-	public JsonLdGraph asGraph(RDFDataset rdfDataSet) {
-		return new JsonLdGraphImpl(rdfDataSet);
-	}
-
-	public Node asJsonLdNode(RDFTerm term) {
-		if (term instanceof JsonLdBlankNode) {
-			JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;
-			if (jsonLdBlankNode.uniqueReference().startsWith(bnodePrefix)) {
-				// Only return blank nodes 'as is' if they have the same prefix
-				return jsonLdBlankNode.asJsonLdNode();
-			}
-		} else if (term instanceof JsonLdTerm) {
-			// non-Bnodes can always be return as-is
-			return ((JsonLdTerm) term).asJsonLdNode();
-		}
-		if (term instanceof IRI) {
-			return new RDFDataset.IRI(((IRI) term).getIRIString());
-		}
-		if (term instanceof BlankNode) {
-			String ref = ((BlankNode) term).uniqueReference();
-			if (ref.startsWith(bnodePrefix)) {
-				// one of our own (but no longer a JsonLdBlankNode),
-				// we can recover the label after our unique prefix
-				return new RDFDataset.BlankNode(ref.replace(bnodePrefix, ""));
-			}
-			// The "foreign" unique reference might not be a valid bnode string,
-			// we'll convert to a UUID
-			UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
-			return new RDFDataset.BlankNode("_:" + uuid);
-		}
-		if (term instanceof Literal) {
-			Literal literal = (Literal) term;
-			return new RDFDataset.Literal(literal.getLexicalForm(), literal.getDatatype().getIRIString(),
-					literal.getLanguageTag().orElse(null));
-		}
-		throw new IllegalArgumentException("RDFTerm not instanceof IRI, BlankNode or Literal: " + term);
-	}	
-
-	/**
-	 * Adapt a Commons RDF {@link org.apache.commons.rdf.api.Quad} as a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}.
-	 * 
-	 * @param quad Commons RDF {@link org.apache.commons.rdf.api.Quad}  to adapt
-	 * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}
-	 */
-	public RDFDataset.Quad asJsonLdQuad(org.apache.commons.rdf.api.Quad quad) {
-		BlankNodeOrIRI g = quad.getGraphName().orElse(null);		
-		return createJsonLdQuad(g, quad.getSubject(), quad.getPredicate(), quad.getObject());
-	}
-	
-	/**
-	 * Adapt a Commons RDF {@link Triple} as a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}.
-	 * 
-	 * @param triple Commons RDF {@link Triple} to adapt
-	 * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}
-	 */
-	public RDFDataset.Quad asJsonLdQuad(Triple triple) {
-		return createJsonLdQuad(null, triple.getSubject(), triple.getPredicate(), triple.getObject());
-	}
-
-	/**
-	 * Adapt a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} as a Commons RDF
-	 * {@link org.apache.commons.rdf.api.Quad}.
-	 * <p>
-	 * The underlying JsonLd quad can be retrieved with
-	 * {@link JsonLdQuad#asJsonLdQuad()}.
-	 * 
-	 * @param quad
-	 *            A JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} to adapt
-	 * @return Adapted {@link JsonLdQuad}
-	 */
-	public JsonLdQuad asQuad(final RDFDataset.Quad quad) {
-		return new JsonLdQuadImpl(quad, bnodePrefix);
-	}
-
-	/**
-	 * Adapt a JsonLd {@link Node} as a Commons RDF {@link RDFTerm}.
-	 * <p>
-	 * The underlying node can be retrieved with
-	 * {@link JsonLdTerm#asJsonLdNode()}.
-	 * 
-	 * @param node
-	 *            A JsonLd {@link Node} to adapt
-	 * @return Adapted {@link JsonLdTerm}
-	 */
-	public JsonLdTerm asRDFTerm(final Node node) {
-		return asRDFTerm(node, bnodePrefix);
-	}
-
-	/**
-	 * Adapt a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} as a Commons RDF
-	 * {@link org.apache.commons.rdf.api.Triple}.
-	 * <p>
-	 * The underlying JsonLd quad can be retrieved with
-	 * {@link JsonLdTriple#asJsonLdQuad()}.
-	 * 
-	 * @param quad
-	 *            A JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} to adapt
-	 * @return Adapted {@link JsonLdTriple}
-	 */
-	public JsonLdTriple asTriple(final RDFDataset.Quad quad) {
-		return new JsonLdTripleImpl(quad, bnodePrefix);
-	}
-
-	/**
-	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Graph}.
-	 * <p>
-	 * The graph can be seen as a <em>union graph</em> as it will contains all the
-	 * triples across all the graphs of the underlying {@link RDFDataset}.
-	 * <p>
-	 * Note that some triple operations on a union graph 
-	 * can be inefficient as they need to remove any duplicate
-	 * triples across the graphs.   
-	 * <p>
-	 * Changes to the Commons RDF {@link Graph} are reflected in the JsonLd
-	 * {@link RDFDataset} and vice versa. Triples removed from the graph are
-	 * removed from <strong>all</strong> graphs, while triples added
-	 * are added to the <em>default graph</em>.
-	 * 
-	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
-	 * @return Adapted {@link Dataset}
-	 */	
-	public JsonLdUnionGraph asUnionGraph(RDFDataset rdfDataSet) {
-		return new JsonLdUnionGraphImpl(rdfDataSet);
-	}
-
-	@Override
-	public JsonLdBlankNode createBlankNode() {
-		String id = "_:" + UUID.randomUUID().toString();
-		return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
-	}
-
-	@Override
-	public JsonLdBlankNode createBlankNode(String name) {
-		String id = "_:" + name;
-		// TODO: Check if name is valid JSON-LD BlankNode identifier
-		return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
-	}
-
-	@Override
-	public JsonLdDataset createDataset() {
-		return new JsonLdDatasetImpl(bnodePrefix);
-	}
-
-	@Override
-	public JsonLdGraph createGraph() {
-		return new JsonLdGraphImpl(bnodePrefix);
-	}
-
-	@Override
-	public JsonLdIRI createIRI(String iri) {
-		return new JsonLdIRIImpl(iri);
-	}
-
-	@Override
-	public JsonLdLiteral createLiteral(String literal) {
-		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, null, null));
-	}
-
-	@Override
-	public JsonLdLiteral createLiteral(String literal, IRI dataType) {
-		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, dataType.getIRIString(), null));
-	}
-
-	@Override
-	public JsonLdLiteral createLiteral(String literal, String language) {
-		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, Types.RDF_LANGSTRING.getIRIString(), language));
-	}
-
-	@Override
-	public JsonLdQuad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
-			throws IllegalArgumentException, UnsupportedOperationException {
-		return new JsonLdQuadImpl(createJsonLdQuad(graphName, subject, predicate, object), bnodePrefix);
-	}
-
-	@Override
-	public JsonLdTriple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
-		return new JsonLdTripleImpl(createJsonLdQuad(null, subject, predicate, object), bnodePrefix);
-	}
-
-	String asJsonLdString(BlankNodeOrIRI blankNodeOrIRI) {
-		if (blankNodeOrIRI == null) {
-			return null;
-		}
-		if (blankNodeOrIRI instanceof IRI) {
-			return ((IRI)blankNodeOrIRI).getIRIString();
-		} else if (blankNodeOrIRI instanceof BlankNode) {
-			BlankNode blankNode = (BlankNode) blankNodeOrIRI;
-			String ref = blankNode.uniqueReference();
-			if (ref.startsWith(bnodePrefix)) { 
-				// One of ours (but possibly not a JsonLdBlankNode) -  
-				// we can use the suffix directly
-				return ref.replace(bnodePrefix, "_:");
-			} else {
-				// Map to unique bnode identifier, e.g. _:0dbd92ee-ab1a-45e7-bba2-7ade54f87ec5
-				UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
-				return "_:"+ uuid;
-			}
-		} else {
-			throw new IllegalArgumentException("Expected a BlankNode or IRI, not: " + blankNodeOrIRI);
-		}
-	}
-
-	JsonLdTerm asRDFTerm(final Node node, String blankNodePrefix) {
-		if (node == null) {
-			return null; // e.g. default graph
-		}
-		if (node.isIRI()) {
-			return new JsonLdIRIImpl(node);
-		} else if (node.isBlankNode()) {
-			return new JsonLdBlankNodeImpl(node, blankNodePrefix);
-		} else if (node.isLiteral()) {
-			// TODO: Our own JsonLdLiteral
-			if (node.getLanguage() != null) {
-				return createLiteral(node.getValue(), node.getLanguage());
-			} else {
-				return createLiteral(node.getValue(), createIRI(node.getDatatype()));
-			}
-		} else {
-			throw new IllegalArgumentException("Node is neither IRI, BlankNode nor Literal: " + node);
-		}
-	}
-
-	RDFDataset.Quad createJsonLdQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
-		return new RDFDataset.Quad(asJsonLdNode(subject), asJsonLdNode(predicate), asJsonLdNode(object), asJsonLdString(graphName));
-	}
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
new file mode 100644
index 0000000..d5c49f8
--- /dev/null
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
@@ -0,0 +1,306 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rdf.jsonldjava;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Objects;
+import java.util.UUID;
+
+import org.apache.commons.rdf.api.BlankNode;
+import org.apache.commons.rdf.api.BlankNodeOrIRI;
+import org.apache.commons.rdf.api.Dataset;
+import org.apache.commons.rdf.api.Graph;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.Literal;
+import org.apache.commons.rdf.api.RDFTerm;
+import org.apache.commons.rdf.api.RDF;
+import org.apache.commons.rdf.api.Triple;
+import org.apache.commons.rdf.simple.Types;
+
+import com.github.jsonldjava.core.RDFDataset;
+import com.github.jsonldjava.core.RDFDataset.Node;
+
+public final class JsonLdFactory implements RDF {
+
+	final String bnodePrefix;
+
+	public JsonLdFactory() {
+		// An "outside Graph" bnodePrefix
+		this("urn:uuid:" + UUID.randomUUID() + "#b");
+	}
+
+	JsonLdFactory(String bnodePrefix) {
+		this.bnodePrefix = Objects.requireNonNull(bnodePrefix);
+	}
+
+	/**
+	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Dataset}.
+	 * <p>
+	 * Changes to the Commons RDF {@link Dataset} are reflected in the JsonLd
+	 * {@link RDFDataset} and vice versa.
+	 * 
+	 * @see #asGraph(RDFDataset)
+	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
+	 * @return Adapted {@link Dataset}
+	 */
+	public JsonLdDataset asDataset(RDFDataset rdfDataSet) {
+		return new JsonLdDatasetImpl(rdfDataSet);
+	}
+
+	/**
+	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Graph}.
+	 * <p>
+	 * Only triples in the <em>default graph</em> are included. To retrieve
+	 * any other graph, {@link #asDataset(RDFDataset)} together with 
+	 * {@link Dataset#getGraph(BlankNodeOrIRI)}.  
+	 * <p>
+	 * Changes to the Commons RDF {@link Graph} are reflected in the JsonLd
+	 * {@link RDFDataset} and vice versa.
+	 * 
+	 * @see #asDataset(RDFDataset)
+	 * @see #asUnionGraph(RDFDataset) 
+	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
+	 * @return Adapted {@link Graph} covering the <em>default graph</em>
+	 */	
+	public JsonLdGraph asGraph(RDFDataset rdfDataSet) {
+		return new JsonLdGraphImpl(rdfDataSet);
+	}
+
+	public Node asJsonLdNode(RDFTerm term) {
+		if (term instanceof JsonLdBlankNode) {
+			JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;
+			if (jsonLdBlankNode.uniqueReference().startsWith(bnodePrefix)) {
+				// Only return blank nodes 'as is' if they have the same prefix
+				return jsonLdBlankNode.asJsonLdNode();
+			}
+		} else if (term instanceof JsonLdTerm) {
+			// non-Bnodes can always be return as-is
+			return ((JsonLdTerm) term).asJsonLdNode();
+		}
+		if (term instanceof IRI) {
+			return new RDFDataset.IRI(((IRI) term).getIRIString());
+		}
+		if (term instanceof BlankNode) {
+			String ref = ((BlankNode) term).uniqueReference();
+			if (ref.startsWith(bnodePrefix)) {
+				// one of our own (but no longer a JsonLdBlankNode),
+				// we can recover the label after our unique prefix
+				return new RDFDataset.BlankNode(ref.replace(bnodePrefix, ""));
+			}
+			// The "foreign" unique reference might not be a valid bnode string,
+			// we'll convert to a UUID
+			UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
+			return new RDFDataset.BlankNode("_:" + uuid);
+		}
+		if (term instanceof Literal) {
+			Literal literal = (Literal) term;
+			return new RDFDataset.Literal(literal.getLexicalForm(), literal.getDatatype().getIRIString(),
+					literal.getLanguageTag().orElse(null));
+		}
+		throw new IllegalArgumentException("RDFTerm not instanceof IRI, BlankNode or Literal: " + term);
+	}	
+
+	/**
+	 * Adapt a Commons RDF {@link org.apache.commons.rdf.api.Quad} as a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}.
+	 * 
+	 * @param quad Commons RDF {@link org.apache.commons.rdf.api.Quad}  to adapt
+	 * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}
+	 */
+	public RDFDataset.Quad asJsonLdQuad(org.apache.commons.rdf.api.Quad quad) {
+		BlankNodeOrIRI g = quad.getGraphName().orElse(null);		
+		return createJsonLdQuad(g, quad.getSubject(), quad.getPredicate(), quad.getObject());
+	}
+	
+	/**
+	 * Adapt a Commons RDF {@link Triple} as a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}.
+	 * 
+	 * @param triple Commons RDF {@link Triple} to adapt
+	 * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}
+	 */
+	public RDFDataset.Quad asJsonLdQuad(Triple triple) {
+		return createJsonLdQuad(null, triple.getSubject(), triple.getPredicate(), triple.getObject());
+	}
+
+	/**
+	 * Adapt a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} as a Commons RDF
+	 * {@link org.apache.commons.rdf.api.Quad}.
+	 * <p>
+	 * The underlying JsonLd quad can be retrieved with
+	 * {@link JsonLdQuad#asJsonLdQuad()}.
+	 * 
+	 * @param quad
+	 *            A JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} to adapt
+	 * @return Adapted {@link JsonLdQuad}
+	 */
+	public JsonLdQuad asQuad(final RDFDataset.Quad quad) {
+		return new JsonLdQuadImpl(quad, bnodePrefix);
+	}
+
+	/**
+	 * Adapt a JsonLd {@link Node} as a Commons RDF {@link RDFTerm}.
+	 * <p>
+	 * The underlying node can be retrieved with
+	 * {@link JsonLdTerm#asJsonLdNode()}.
+	 * 
+	 * @param node
+	 *            A JsonLd {@link Node} to adapt
+	 * @return Adapted {@link JsonLdTerm}
+	 */
+	public JsonLdTerm asRDFTerm(final Node node) {
+		return asRDFTerm(node, bnodePrefix);
+	}
+
+	/**
+	 * Adapt a JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} as a Commons RDF
+	 * {@link org.apache.commons.rdf.api.Triple}.
+	 * <p>
+	 * The underlying JsonLd quad can be retrieved with
+	 * {@link JsonLdTriple#asJsonLdQuad()}.
+	 * 
+	 * @param quad
+	 *            A JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad} to adapt
+	 * @return Adapted {@link JsonLdTriple}
+	 */
+	public JsonLdTriple asTriple(final RDFDataset.Quad quad) {
+		return new JsonLdTripleImpl(quad, bnodePrefix);
+	}
+
+	/**
+	 * Adapt a JsonLd {@link RDFDataset} as a Commons RDF {@link Graph}.
+	 * <p>
+	 * The graph can be seen as a <em>union graph</em> as it will contains all the
+	 * triples across all the graphs of the underlying {@link RDFDataset}.
+	 * <p>
+	 * Note that some triple operations on a union graph 
+	 * can be inefficient as they need to remove any duplicate
+	 * triples across the graphs.   
+	 * <p>
+	 * Changes to the Commons RDF {@link Graph} are reflected in the JsonLd
+	 * {@link RDFDataset} and vice versa. Triples removed from the graph are
+	 * removed from <strong>all</strong> graphs, while triples added
+	 * are added to the <em>default graph</em>.
+	 * 
+	 * @param rdfDataSet JsonLd {@link RDFDataset} to adapt
+	 * @return Adapted {@link Dataset}
+	 */	
+	public JsonLdUnionGraph asUnionGraph(RDFDataset rdfDataSet) {
+		return new JsonLdUnionGraphImpl(rdfDataSet);
+	}
+
+	@Override
+	public JsonLdBlankNode createBlankNode() {
+		String id = "_:" + UUID.randomUUID().toString();
+		return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
+	}
+
+	@Override
+	public JsonLdBlankNode createBlankNode(String name) {
+		String id = "_:" + name;
+		// TODO: Check if name is valid JSON-LD BlankNode identifier
+		return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
+	}
+
+	@Override
+	public JsonLdDataset createDataset() {
+		return new JsonLdDatasetImpl(bnodePrefix);
+	}
+
+	@Override
+	public JsonLdGraph createGraph() {
+		return new JsonLdGraphImpl(bnodePrefix);
+	}
+
+	@Override
+	public JsonLdIRI createIRI(String iri) {
+		return new JsonLdIRIImpl(iri);
+	}
+
+	@Override
+	public JsonLdLiteral createLiteral(String literal) {
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, null, null));
+	}
+
+	@Override
+	public JsonLdLiteral createLiteral(String literal, IRI dataType) {
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, dataType.getIRIString(), null));
+	}
+
+	@Override
+	public JsonLdLiteral createLiteral(String literal, String language) {
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, Types.RDF_LANGSTRING.getIRIString(), language));
+	}
+
+	@Override
+	public JsonLdQuad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
+			throws IllegalArgumentException, UnsupportedOperationException {
+		return new JsonLdQuadImpl(createJsonLdQuad(graphName, subject, predicate, object), bnodePrefix);
+	}
+
+	@Override
+	public JsonLdTriple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		return new JsonLdTripleImpl(createJsonLdQuad(null, subject, predicate, object), bnodePrefix);
+	}
+
+	String asJsonLdString(BlankNodeOrIRI blankNodeOrIRI) {
+		if (blankNodeOrIRI == null) {
+			return null;
+		}
+		if (blankNodeOrIRI instanceof IRI) {
+			return ((IRI)blankNodeOrIRI).getIRIString();
+		} else if (blankNodeOrIRI instanceof BlankNode) {
+			BlankNode blankNode = (BlankNode) blankNodeOrIRI;
+			String ref = blankNode.uniqueReference();
+			if (ref.startsWith(bnodePrefix)) { 
+				// One of ours (but possibly not a JsonLdBlankNode) -  
+				// we can use the suffix directly
+				return ref.replace(bnodePrefix, "_:");
+			} else {
+				// Map to unique bnode identifier, e.g. _:0dbd92ee-ab1a-45e7-bba2-7ade54f87ec5
+				UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
+				return "_:"+ uuid;
+			}
+		} else {
+			throw new IllegalArgumentException("Expected a BlankNode or IRI, not: " + blankNodeOrIRI);
+		}
+	}
+
+	JsonLdTerm asRDFTerm(final Node node, String blankNodePrefix) {
+		if (node == null) {
+			return null; // e.g. default graph
+		}
+		if (node.isIRI()) {
+			return new JsonLdIRIImpl(node);
+		} else if (node.isBlankNode()) {
+			return new JsonLdBlankNodeImpl(node, blankNodePrefix);
+		} else if (node.isLiteral()) {
+			// TODO: Our own JsonLdLiteral
+			if (node.getLanguage() != null) {
+				return createLiteral(node.getValue(), node.getLanguage());
+			} else {
+				return createLiteral(node.getValue(), createIRI(node.getDatatype()));
+			}
+		} else {
+			throw new IllegalArgumentException("Node is neither IRI, BlankNode nor Literal: " + node);
+		}
+	}
+
+	RDFDataset.Quad createJsonLdQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+		return new RDFDataset.Quad(asJsonLdNode(subject), asJsonLdNode(predicate), asJsonLdNode(object), asJsonLdString(graphName));
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
index 7147322..4b20618 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
@@ -23,7 +23,7 @@ import java.util.UUID;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.rdf.api.BlankNode;
-import org.apache.commons.rdf.simple.SimpleRDFFactory.SimpleRDFTerm;
+import org.apache.commons.rdf.simple.SimpleRDF.SimpleRDFTerm;
 
 /**
  * A simple implementation of BlankNode.

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
index 78f1981..a23f27e 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
@@ -33,7 +33,7 @@ import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.api.Literal;
 import org.apache.commons.rdf.api.Quad;
 import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.commons.rdf.simple.SimpleRDFFactory.SimpleRDFTerm;
+import org.apache.commons.rdf.simple.SimpleRDF.SimpleRDFTerm;
 
 /**
  * A simple, memory-based implementation of Dataset.
@@ -46,10 +46,10 @@ final class DatasetImpl implements Dataset {
 	
     private static final int TO_STRING_MAX = 10;
     private final Set<Quad> quads = new HashSet<Quad>();
-    private final SimpleRDFFactory factory;
+    private final SimpleRDF factory;
 
-    DatasetImpl(SimpleRDFFactory simpleRDFFactory) {
-        this.factory = simpleRDFFactory;
+    DatasetImpl(SimpleRDF simpleRDF) {
+        this.factory = simpleRDF;
     }
     
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
index 1173d53..fb95577 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
@@ -18,7 +18,7 @@
 package org.apache.commons.rdf.simple;
 
 import org.apache.commons.rdf.api.*;
-import org.apache.commons.rdf.simple.SimpleRDFFactory.SimpleRDFTerm;
+import org.apache.commons.rdf.simple.SimpleRDF.SimpleRDFTerm;
 
 import java.util.HashSet;
 import java.util.Objects;
@@ -38,10 +38,10 @@ final class GraphImpl implements Graph {
 
     private static final int TO_STRING_MAX = 10;
     private final Set<Triple> triples = new HashSet<Triple>();
-    private final SimpleRDFFactory factory;
+    private final SimpleRDF factory;
 
-    GraphImpl(SimpleRDFFactory simpleRDFFactory) {
-        this.factory = simpleRDFFactory;
+    GraphImpl(SimpleRDF simpleRDF) {
+        this.factory = simpleRDF;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
index c3ef547..8c81913 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
@@ -24,7 +24,7 @@ import java.net.URI;
 /**
  * A simple implementation of IRI.
  */
-final class IRIImpl implements IRI, SimpleRDFFactory.SimpleRDFTerm {
+final class IRIImpl implements IRI, SimpleRDF.SimpleRDFTerm {
 
     private final String iri;
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
index b3f7042..d477e43 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
@@ -28,7 +28,7 @@ import org.apache.commons.rdf.api.Literal;
 /**
  * A simple implementation of Literal.
  */
-final class LiteralImpl implements Literal, SimpleRDFFactory.SimpleRDFTerm {
+final class LiteralImpl implements Literal, SimpleRDF.SimpleRDFTerm {
 
     private static final String QUOTE = "\"";
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
index 54c5fc1..00f8fa8 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
@@ -40,7 +40,7 @@ final class QuadImpl implements Quad {
      * Construct Quad from its constituent parts.
      * <p>
      * The objects are not changed. All mapping of BNode objects is done in
-     * {@link SimpleRDFFactory#createQuad(BlankNodeOrIRI, BlankNodeOrIRI, IRI, RDFTerm)}.
+     * {@link SimpleRDF#createQuad(BlankNodeOrIRI, BlankNodeOrIRI, IRI, RDFTerm)}.
      *
      * @param graphName  graphName of triple
      * @param subject   subject of triple

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
new file mode 100644
index 0000000..91bd7da
--- /dev/null
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
@@ -0,0 +1,114 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rdf.simple;
+
+import java.util.UUID;
+
+import org.apache.commons.rdf.api.BlankNode;
+import org.apache.commons.rdf.api.BlankNodeOrIRI;
+import org.apache.commons.rdf.api.Dataset;
+import org.apache.commons.rdf.api.Graph;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.Literal;
+import org.apache.commons.rdf.api.Quad;
+import org.apache.commons.rdf.api.RDFTerm;
+import org.apache.commons.rdf.api.RDF;
+import org.apache.commons.rdf.api.Triple;
+
+/**
+ * A simple implementation of RDF.
+ * <p>
+ * The {@link RDFTerm}, {@link Triple}, {@link Quad}, {@link Graph}
+ * and {@link Dataset} instances created by this factory are
+ * simple in-memory Implementations that are not thread-safe or efficient, but
+ * which may be useful for testing and prototyping purposes.
+ */
+public class SimpleRDF implements RDF {
+
+	/**
+	 * Marker interface to say that this RDFTerm is part of the 
+	 * Simple implementation. Used by {@link GraphImpl} to avoid
+	 * double remapping. 
+	 * <p>
+	 * This method is package protected to avoid any third-party
+	 * subclasses.
+	 *
+	 */
+	static interface SimpleRDFTerm extends RDFTerm {		
+	}
+	
+    /** Unique salt per instance, for {@link #createBlankNode(String)}
+     */
+    private final UUID SALT = UUID.randomUUID();
+
+    @Override
+    public BlankNode createBlankNode() {
+        return new BlankNodeImpl();
+    }
+
+    @Override
+    public BlankNode createBlankNode(String name) {
+        return new BlankNodeImpl(SALT, name);
+    }
+
+    @Override
+    public Graph createGraph() {
+        // Creates a GraphImpl object using this object as the factory for
+        // delegating all object creation to
+        return new GraphImpl(this);
+    }
+
+    @Override
+    public Dataset createDataset() throws UnsupportedOperationException {
+    	return new DatasetImpl(this);
+    }
+    
+    @Override
+    public IRI createIRI(String iri) {
+        IRI result = new IRIImpl(iri);
+        // Reuse any IRI objects already created in Types
+        return Types.get(result).orElse(result);
+    }
+
+    @Override
+    public Literal createLiteral(String literal) {
+        return new LiteralImpl(literal);
+    }
+
+    @Override
+    public Literal createLiteral(String literal, IRI dataType) {
+        return new LiteralImpl(literal, dataType);
+    }
+
+    @Override
+    public Literal createLiteral(String literal, String language) {
+        return new LiteralImpl(literal, language);
+    }
+
+    @Override
+    public Triple createTriple(BlankNodeOrIRI subject, IRI predicate,
+                               RDFTerm object) {
+        return new TripleImpl(subject, predicate, object);
+    }
+    
+    @Override
+    public Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
+    		throws IllegalArgumentException {
+    	return new QuadImpl(graphName, subject, predicate, object);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFFactory.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFFactory.java b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFFactory.java
deleted file mode 100644
index d8103fe..0000000
--- a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFFactory.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rdf.simple;
-
-import java.util.UUID;
-
-import org.apache.commons.rdf.api.BlankNode;
-import org.apache.commons.rdf.api.BlankNodeOrIRI;
-import org.apache.commons.rdf.api.Dataset;
-import org.apache.commons.rdf.api.Graph;
-import org.apache.commons.rdf.api.IRI;
-import org.apache.commons.rdf.api.Literal;
-import org.apache.commons.rdf.api.Quad;
-import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.commons.rdf.api.RDF;
-import org.apache.commons.rdf.api.Triple;
-
-/**
- * A simple implementation of RDF.
- * <p>
- * The {@link RDFTerm}, {@link Triple}, {@link Quad}, {@link Graph}
- * and {@link Dataset} instances created by this factory are
- * simple in-memory Implementations that are not thread-safe or efficient, but
- * which may be useful for testing and prototyping purposes.
- */
-public class SimpleRDFFactory implements RDF {
-
-	/**
-	 * Marker interface to say that this RDFTerm is part of the 
-	 * Simple implementation. Used by {@link GraphImpl} to avoid
-	 * double remapping. 
-	 * <p>
-	 * This method is package protected to avoid any third-party
-	 * subclasses.
-	 *
-	 */
-	static interface SimpleRDFTerm extends RDFTerm {		
-	}
-	
-    /** Unique salt per instance, for {@link #createBlankNode(String)}
-     */
-    private final UUID SALT = UUID.randomUUID();
-
-    @Override
-    public BlankNode createBlankNode() {
-        return new BlankNodeImpl();
-    }
-
-    @Override
-    public BlankNode createBlankNode(String name) {
-        return new BlankNodeImpl(SALT, name);
-    }
-
-    @Override
-    public Graph createGraph() {
-        // Creates a GraphImpl object using this object as the factory for
-        // delegating all object creation to
-        return new GraphImpl(this);
-    }
-
-    @Override
-    public Dataset createDataset() throws UnsupportedOperationException {
-    	return new DatasetImpl(this);
-    }
-    
-    @Override
-    public IRI createIRI(String iri) {
-        IRI result = new IRIImpl(iri);
-        // Reuse any IRI objects already created in Types
-        return Types.get(result).orElse(result);
-    }
-
-    @Override
-    public Literal createLiteral(String literal) {
-        return new LiteralImpl(literal);
-    }
-
-    @Override
-    public Literal createLiteral(String literal, IRI dataType) {
-        return new LiteralImpl(literal, dataType);
-    }
-
-    @Override
-    public Literal createLiteral(String literal, String language) {
-        return new LiteralImpl(literal, language);
-    }
-
-    @Override
-    public Triple createTriple(BlankNodeOrIRI subject, IRI predicate,
-                               RDFTerm object) {
-        return new TripleImpl(subject, predicate, object);
-    }
-    
-    @Override
-    public Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
-    		throws IllegalArgumentException {
-    	return new QuadImpl(graphName, subject, predicate, object);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
index 5f6f5fe..fa242b1 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
@@ -29,12 +29,12 @@ import org.apache.commons.rdf.api.Triple;
 /**
  * A Simple implementation of {@link RDFTermFactory}
  * <p>
- * This class is <strong>deprecated</strong>, use instead {@link SimpleRDFFactory}.
+ * This class is <strong>deprecated</strong>, use instead {@link SimpleRDF}.
  */
 @Deprecated
 public class SimpleRDFTermFactory implements RDFTermFactory {
 
-	private SimpleRDFFactory factory = new SimpleRDFFactory();
+	private SimpleRDF factory = new SimpleRDF();
 
 	public BlankNode createBlankNode() {
 		return factory.createBlankNode();

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
index bc7f103..1abd905 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
@@ -37,7 +37,7 @@ final class TripleImpl implements Triple {
      * Construct Triple from its constituent parts.
      * <p>
      * The objects are not changed. All mapping of BNode objects is done in
-     * {@link SimpleRDFFactory#createTriple(BlankNodeOrIRI, IRI, RDFTerm)}.
+     * {@link SimpleRDF#createTriple(BlankNodeOrIRI, IRI, RDFTerm)}.
      *
      * @param subject   subject of triple
      * @param predicate predicate of triple

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/Types.java b/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
index 8ad6df8..b6dd8ee 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
@@ -27,7 +27,7 @@ import java.util.Set;
 /**
  * Types from the RDF and XML Schema vocabularies.
  */
-public final class Types implements IRI, SimpleRDFFactory.SimpleRDFTerm {
+public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
 
     /**
      * <tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML</tt>

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
index b34bc4d..e478c39 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
@@ -35,7 +35,7 @@ import org.apache.commons.rdf.api.Quad;
 import org.apache.commons.rdf.api.RDFSyntax;
 import org.apache.commons.rdf.api.RDF;
 import org.apache.commons.rdf.experimental.RDFParser;
-import org.apache.commons.rdf.simple.SimpleRDFFactory;
+import org.apache.commons.rdf.simple.SimpleRDF;
 
 /**
  * Abstract RDFParser
@@ -63,7 +63,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
 	private static final ExecutorService threadpool = Executors.newCachedThreadPool(r -> new Thread(threadGroup, r));
 
 	// Basically only used for creating IRIs
-	private static RDF internalRdfTermFactory = new SimpleRDFFactory();
+	private static RDF internalRdfTermFactory = new SimpleRDF();
 
 	/**
 	 * Get the set {@link RDF}, if any.
@@ -418,7 +418,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
 		// parseSynchronously()
 		AbstractRDFParser<T> c = clone();
 
-		// Use a fresh SimpleRDFFactory for each parse
+		// Use a fresh SimpleRDF for each parse
 		if (!c.rdfTermFactory.isPresent()) {
 			c.rdfTermFactory = Optional.of(createRDFTermFactory());
 		}
@@ -515,7 +515,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
 	 * @return A new {@link RDF}
 	 */
 	protected RDF createRDFTermFactory() {
-		return new SimpleRDFFactory();
+		return new SimpleRDF();
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/java/org/apache/commons/rdf/simple/package-info.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/package-info.java b/simple/src/main/java/org/apache/commons/rdf/simple/package-info.java
index 5405cef..f536594 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/package-info.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/package-info.java
@@ -28,10 +28,10 @@
  * testing and simple usage (e.g. prototyping).
  * <p>
  * To use this implementation, create an instance of
- * {@link org.apache.commons.rdf.simple.SimpleRDFFactory}
+ * {@link org.apache.commons.rdf.simple.SimpleRDF}
  * and use methods like
- * {@link org.apache.commons.rdf.simple.SimpleRDFFactory#createGraph} and
- * {@link org.apache.commons.rdf.simple.SimpleRDFFactory#createIRI(String)}.
+ * {@link org.apache.commons.rdf.simple.SimpleRDF#createGraph} and
+ * {@link org.apache.commons.rdf.simple.SimpleRDF#createIRI(String)}.
  * <p>
  * The {@link org.apache.commons.rdf.simple.Types} class provide constant
  * {@link org.apache.commons.rdf.api.IRI}s of the common RDF XML datatypes.

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFFactory
----------------------------------------------------------------------
diff --git a/simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFFactory b/simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFFactory
index 67557cf..4003034 100644
--- a/simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFFactory
+++ b/simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFFactory
@@ -1 +1 @@
-org.apache.commons.rdf.simple.SimpleRDFFactory
+org.apache.commons.rdf.simple.SimpleRDF

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java
index 64f5acd..3d3aad1 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java
@@ -36,7 +36,7 @@ public class DefaultGraphTest extends AbstractGraphTest {
         return new RDF() {
             @Override
             public Graph createGraph() throws UnsupportedOperationException {
-                return new GraphImpl(new SimpleRDFFactory());
+                return new GraphImpl(new SimpleRDF());
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
index e4cdf8e..ebfdc6b 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
@@ -25,13 +25,13 @@ import org.junit.Assume;
 import org.junit.Test;
 
 /**
- * Test SimpleRDFFactory with AbstractGraphTest
+ * Test SimpleRDF with AbstractGraphTest
  */
 public class SimpleGraphTest extends AbstractGraphTest {
 
     @Override
     public RDF createFactory() {
-        return new SimpleRDFFactory();
+        return new SimpleRDF();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java
index 527d7b9..3167243 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java
@@ -33,7 +33,7 @@ public class SimpleNoRelativeIRIRDFTermFactoryTest extends
         AbstractRDFTermFactoryTest {
     @Override
     public RDF createFactory() {
-        return new SimpleRDFFactory() {
+        return new SimpleRDF() {
             @Override
             public IRI createIRI(String iri) {
                 if (!URI.create(iri).isAbsolute()) {

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java
index e308f00..816eef9 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java
@@ -27,7 +27,7 @@ public class SimpleRDFTermFactoryTest extends AbstractRDFTermFactoryTest {
 
     @Override
     public RDF createFactory() {
-        return new SimpleRDFFactory();
+        return new SimpleRDF();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
index 08930ac..8ec0649 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
@@ -31,10 +31,10 @@ public class SimpleServiceLoaderTest {
     public void testServiceLoaderLookup() {
         ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
         for (RDF impl : loader) {
-        	if (impl instanceof SimpleRDFFactory) {
+        	if (impl instanceof SimpleRDF) {
         		return; // yay
         	}
         }
-        fail("SimpleRDFFactory not found in ServiceLoader");        
+        fail("SimpleRDF not found in ServiceLoader");        
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
index 8af3034..ca4925f 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
@@ -57,7 +57,7 @@ public class TestWritingGraph {
 
     @BeforeClass
     public static void createGraph() throws Exception {
-        factory = new SimpleRDFFactory();
+        factory = new SimpleRDF();
         graph = factory.createGraph();
         IRI subject = factory.createIRI("subj");
         IRI predicate = factory.createIRI("pred");

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/790b6059/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
index 732df71..fed76b3 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
@@ -38,7 +38,7 @@ import org.apache.commons.rdf.api.RDF;
 import org.apache.commons.rdf.api.Triple;
 import org.apache.commons.rdf.experimental.RDFParser;
 import org.apache.commons.rdf.simple.DummyRDFParserBuilder;
-import org.apache.commons.rdf.simple.SimpleRDFFactory;
+import org.apache.commons.rdf.simple.SimpleRDF;
 import org.apache.commons.rdf.simple.Types;
 import org.junit.After;
 import org.junit.Before;
@@ -48,7 +48,7 @@ import org.junit.rules.ExpectedException;
 
 public class AbstractRDFParserTest {
 
-	private RDF factory = new SimpleRDFFactory();
+	private RDF factory = new SimpleRDF();
 	
 	private DummyRDFParserBuilder dummyParser = new DummyRDFParserBuilder();
 	private Path testNt;


Mime
View raw message