commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [23/50] incubator-commonsrdf git commit: import of JsonLd*Impl
Date Fri, 07 Oct 2016 14:22:10 GMT
import of JsonLd*Impl


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

Branch: refs/heads/jena
Commit: f2bcb3d23079b5b3eeeb2889d4346142ea2772c7
Parents: a87270a
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Fri Sep 9 09:48:37 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Fri Sep 9 09:48:37 2016 +0100

----------------------------------------------------------------------
 .../commons/rdf/jsonldjava/JsonLdLiteral.java   |  3 ++-
 .../rdf/jsonldjava/JsonLdRDFTermFactory.java    | 25 ++++++++++++--------
 2 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/f2bcb3d2/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
index 025128e..befc410 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
@@ -23,6 +23,7 @@ import java.util.Optional;
 import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.api.Literal;
 import org.apache.commons.rdf.simple.Types;
+import org.apache.commons.rdf.jsonldjava.JsonLdIRI.JsonLdIRIImpl;
 
 import com.github.jsonldjava.core.RDFDataset.Node;
 
@@ -65,7 +66,7 @@ public interface JsonLdLiteral extends JsonLdTerm, Literal {
 	
 		@Override
 		public IRI getDatatype() {
-			return new JsonLdIRI.JsonLdIRIImpl(node.getDatatype());
+			return new JsonLdIRIImpl(node.getDatatype());
 		}
 	
 		@Override

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/f2bcb3d2/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTermFactory.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTermFactory.java
b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTermFactory.java
index 12ab13d..607e319 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTermFactory.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTermFactory.java
@@ -30,11 +30,16 @@ import org.apache.commons.rdf.api.RDFTermFactory;
 import org.apache.commons.rdf.api.Triple;
 import org.apache.commons.rdf.api.TripleLike;
 import org.apache.commons.rdf.simple.Types;
+import org.apache.commons.rdf.jsonldjava.JsonLdBlankNode.JsonLdBlankNodeImpl;
+import org.apache.commons.rdf.jsonldjava.JsonLdTriple.JsonLdTripleImpl;
+import org.apache.commons.rdf.jsonldjava.JsonLdQuad.JsonLdQuadImpl;
+import org.apache.commons.rdf.jsonldjava.JsonLdLiteral.JsonLdLiteralImpl;
 
 import com.github.jsonldjava.core.RDFDataset;
 import com.github.jsonldjava.core.RDFDataset.Node;
 
-final class JsonLdRDFTermFactory implements RDFTermFactory {
+
+public final class JsonLdRDFTermFactory implements RDFTermFactory {
 	
 	public JsonLdRDFTermFactory() {
 		// An "outside Graph" bnodePrefix
@@ -60,41 +65,41 @@ final class JsonLdRDFTermFactory implements RDFTermFactory {
 	@Override
 	public JsonLdBlankNode createBlankNode() {
 		String id = "_:" + UUID.randomUUID().toString();
-		return new JsonLdBlankNode.JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
+		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 JsonLdBlankNode.JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
+		return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
 	}
 	
 	@Override
 	public JsonLdTriple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
{
-		return new JsonLdTriple.JsonLdTripleImpl(asJsonLdQuad(subject, predicate, object), bnodePrefix);
+		return new JsonLdTripleImpl(asJsonLdQuad(subject, predicate, object), bnodePrefix);
 	}
 	
 	public Triple asTriple(final RDFDataset.Quad quad) {
-		return new JsonLdTriple.JsonLdTripleImpl(quad, bnodePrefix);
+		return new JsonLdTripleImpl(quad, bnodePrefix);
 	}
 
 	@Override
 	public JsonLdQuad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate,
RDFTerm object)
 			throws IllegalArgumentException, UnsupportedOperationException {
-		return new JsonLdQuad.JsonLdQuadImpl(asJsonLdQuad(graphName, subject, predicate, object),
bnodePrefix);
+		return new JsonLdQuadImpl(asJsonLdQuad(graphName, subject, predicate, object), bnodePrefix);
 	}
 	
 	@Override
 	public JsonLdLiteral createLiteral(String literal) {		
-		return new JsonLdLiteral.JsonLdLiteralImpl(new RDFDataset.Literal(literal, null, null));
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, null, null));
 	}
 	@Override
 	public JsonLdLiteral createLiteral(String literal, IRI dataType) {
-		return new JsonLdLiteral.JsonLdLiteralImpl(new RDFDataset.Literal(literal, dataType.getIRIString(),
null));	}
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, dataType.getIRIString(), null));
}
 	@Override
 	public JsonLdLiteral createLiteral(String literal, String language) {
-		return new JsonLdLiteral.JsonLdLiteralImpl(new RDFDataset.Literal(literal, Types.RDF_LANGSTRING.getIRIString(),
language));		
+		return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, Types.RDF_LANGSTRING.getIRIString(),
language));		
 	}
 
 
@@ -151,7 +156,7 @@ final class JsonLdRDFTermFactory implements RDFTermFactory {
 		if (node.isIRI()) {
 			return new JsonLdIRI.JsonLdIRIImpl(node);
 		} else if (node.isBlankNode()) {
-			return new JsonLdBlankNode.JsonLdBlankNodeImpl(node, blankNodePrefix);
+			return new JsonLdBlankNodeImpl(node, blankNodePrefix);
 		} else if (node.isLiteral()) {
 			// TODO: Our own JsonLdLiteral
 			if (node.getLanguage() != null) {


Mime
View raw message