You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/10/28 10:34:31 UTC
[01/12] incubator-commonsrdf git commit: COMMONSRDF-38 internallyMap
on .remove()
Repository: incubator-commonsrdf
Updated Branches:
refs/heads/COMMONSRDF-46 7779fca80 -> 2d4b5d300
COMMONSRDF-38 internallyMap on .remove()
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/cb58d566
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/cb58d566
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/cb58d566
Branch: refs/heads/COMMONSRDF-46
Commit: cb58d5666e389e4b74f99e56303436498e82c7f1
Parents: 4f243b3
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Oct 27 10:01:54 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Oct 27 10:01:54 2016 +0100
----------------------------------------------------------------------
simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/cb58d566/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 779b1ad..c268f45 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
@@ -165,7 +165,7 @@ final class GraphImpl implements Graph {
@Override
public void remove(Triple triple) {
- triples.remove(Objects.requireNonNull(triple));
+ triples.remove(internallyMap(triple));
}
@Override
[10/12] incubator-commonsrdf git commit: RDFDTerm is
IRI/BlankNode/Literal. BlankNodeOrIRI is BlankNode/Literal
Posted by st...@apache.org.
RDFDTerm is IRI/BlankNode/Literal. BlankNodeOrIRI is BlankNode/Literal
Using "SHOULD" to leave open possibility of say a JenaSparqlVariable.
See
https://github.com/apache/incubator-commonsrdf/pull/25#discussion_r85433083
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/fb0dd9c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/fb0dd9c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/fb0dd9c0
Branch: refs/heads/COMMONSRDF-46
Commit: fb0dd9c03ebba0da8cef75c1ee21343c9a1fdd81
Parents: d0501ac
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:27:45 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:27:45 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/commons/rdf/api/BlankNodeOrIRI.java | 6 ++++--
.../main/java/org/apache/commons/rdf/api/RDFTerm.java | 11 +++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/fb0dd9c0/api/src/main/java/org/apache/commons/rdf/api/BlankNodeOrIRI.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/BlankNodeOrIRI.java b/api/src/main/java/org/apache/commons/rdf/api/BlankNodeOrIRI.java
index 8999c6f..1c6c469 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/BlankNodeOrIRI.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/BlankNodeOrIRI.java
@@ -19,8 +19,10 @@ package org.apache.commons.rdf.api;
/**
* This interface represents the {@link RDFTerm}s that may be used in the
- * subject position of an RDF-1.1 {@link Triple}, that is {@link BlankNode}
- * and {@link IRI}.
+ * subject position of an RDF-1.1 {@link Triple} as well as the graph name
+ * position of a {@link Quad}.
+ * <p>
+ * Instances of BlankNodeOrIRI SHOULD be a {@link BlankNode} or an {@link IRI}.
*/
public interface BlankNodeOrIRI extends RDFTerm {
}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/fb0dd9c0/api/src/main/java/org/apache/commons/rdf/api/RDFTerm.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/RDFTerm.java b/api/src/main/java/org/apache/commons/rdf/api/RDFTerm.java
index 9488338..59d8fa1 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/RDFTerm.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/RDFTerm.java
@@ -19,12 +19,15 @@ package org.apache.commons.rdf.api;
/**
* An <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term" >RDF-1.1
- * Term</a>, as defined by <a href= "http://www.w3.org/TR/rdf11-concepts/"
- * >RDF-1.1 Concepts and Abstract Syntax</a>, a W3C Recommendation published on
- * 25 February 2014.<br>
+ * Term</a>, as defined by
+ * <a href= "http://www.w3.org/TR/rdf11-concepts/" >RDF-1.1 Concepts and
+ * Abstract Syntax</a>, a W3C Recommendation published on 25 February 2014.<br>
+ * <p>
+ * Instances of RDFTerm SHOULD be an {@link IRI}, {@link BlankNode} or
+ * {@link Literal}.
*
* @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term" >RDF-1.1
- * Term</a>
+ * Term</a>
*/
public interface RDFTerm {
[02/12] incubator-commonsrdf git commit: preparing 0.3.0 release notes
Posted by st...@apache.org.
preparing 0.3.0 release notes
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/98d56f87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/98d56f87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/98d56f87
Branch: refs/heads/COMMONSRDF-46
Commit: 98d56f87d671e345eea8642641d427c9df509948
Parents: cb58d56
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Oct 27 10:59:17 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Oct 27 10:59:17 2016 +0100
----------------------------------------------------------------------
RELEASE-NOTES.txt | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/98d56f87/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index e99babd..a04233c 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,5 +1,24 @@
# Apache Commons RDF (incubating)
+## 0.3.0-incubating (2016-11)
+
+This release adds RDF implementations based on Apache Jena, Eclipse RDF4J and
+JSONLD-Java. New interfaces include Dataset and Quad. Note that the
+interface RDFTermFactory has been deprecated and been replaced by the interface
+RDF. Graph.getTriples() has been deprecated and replaced by
+Graph.iterate(). This release adds an experimental interface
+RDFParser, note that this may evolve or be removed in the next release.
+
+* [COMMONSRDF-7] - Document that RDFTerm, Triple and Quad are immutable
+* [COMMONSRDF-33] - Jena integration
+* [COMMONSRDF-34] - Add DatasetImpl using Jena
+* [COMMONSRDF-35] - rdf4j integration
+* [COMMONSRDF-36] - jsonld-java integratoin
+* [COMMONSRDF-37] - Quad and Dataset support
+* [COMMONSRDF-38] - simple Graph.contains(Triple) now maps bnodes consistently
+* [COMMONSRDF-39] - Add RDFParser interface (experimental)
+* [COMMONSRDF-46] - Rename RDFTermFactory to RDF
+
## 0.2.0-incubating (2016-04)
This release clarifies .equals() and .hashCode() for RDFTerms so that they can
[12/12] incubator-commonsrdf git commit: Merge branch 'master' into
COMMONSRDF-46
Posted by st...@apache.org.
Merge branch 'master' into COMMONSRDF-46
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/2d4b5d30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/2d4b5d30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/2d4b5d30
Branch: refs/heads/COMMONSRDF-46
Commit: 2d4b5d300c1f27f62b356e4ef2d6910b746549f2
Parents: fb80617 6aa5a5d
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:34:20 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:34:20 2016 +0100
----------------------------------------------------------------------
RELEASE-NOTES.txt | 19 +++++++++++++++++++
pom.xml | 4 ++--
.../rdf/rdf4j/experimental/RDF4JParser.java | 2 +-
.../org/apache/commons/rdf/simple/GraphImpl.java | 2 +-
4 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/2d4b5d30/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
----------------------------------------------------------------------
diff --cc rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
index 558108b,be37449..26b3647
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
@@@ -111,10 -111,10 +111,10 @@@ public class RDF4JParser extends Abstra
@Override
protected RDF4JParser prepareForParsing() throws IOException, IllegalStateException {
- RDF4JParser c = prepareForParsing();
+ RDF4JParser c = super.prepareForParsing();
- // Ensure we have an RDF4JFactory for conversion.
+ // Ensure we have an RDF4J for conversion.
// We'll make a new one if user has provided a non-RDF4J factory
- c.rdf4jTermFactory = (RDF4JFactory) getRdfTermFactory().filter(RDF4JFactory.class::isInstance)
+ c.rdf4jTermFactory = (RDF4J) getRdfTermFactory().filter(RDF4J.class::isInstance)
.orElseGet(c::createRDFTermFactory);
return c;
}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/2d4b5d30/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
----------------------------------------------------------------------
[04/12] incubator-commonsrdf git commit: newer jsonld-java and rdf4j
Posted by st...@apache.org.
newer jsonld-java and rdf4j
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/6aa5a5d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/6aa5a5d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/6aa5a5d0
Branch: refs/heads/COMMONSRDF-46
Commit: 6aa5a5d0df961908bf9851582f3a68e44aa403fc
Parents: 49cba1f
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Oct 27 16:51:20 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Oct 27 16:51:20 2016 +0100
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/6aa5a5d0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9ef400a..879b131 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,8 +58,8 @@
<!-- NOTE: jsonldjava is also used by rdf4j and jena, check -->
- <jsonldjava.version>0.8.2</jsonldjava.version>
- <rdf4j.version>2.0</rdf4j.version>
+ <jsonldjava.version>0.8.3</jsonldjava.version>
+ <rdf4j.version>2.1</rdf4j.version>
<jena.version>3.1.0</jena.version>
<!-- NOTE: dexx and xerces versions should match
the versions marked as <optional> in jena-osgi pom
[05/12] incubator-commonsrdf git commit: JavaDoc and 'protected' for
abstract test methods
Posted by st...@apache.org.
JavaDoc and 'protected' for abstract test methods
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/e340604b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/e340604b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/e340604b
Branch: refs/heads/COMMONSRDF-46
Commit: e340604bb4bd00665494706c7535a34fba59f51e
Parents: 7779fca
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 10:55:40 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 10:55:40 2016 +0100
----------------------------------------------------------------------
.../apache/commons/rdf/api/AbstractBlankNodeTest.java | 8 ++++++++
.../org/apache/commons/rdf/api/AbstractGraphTest.java | 9 ++++++++-
.../commons/rdf/api/AbstractRDFTermFactoryTest.java | 12 ++++++------
3 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/e340604b/api/src/test/java/org/apache/commons/rdf/api/AbstractBlankNodeTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractBlankNodeTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractBlankNodeTest.java
index 1556a03..b61c64a 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractBlankNodeTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractBlankNodeTest.java
@@ -27,6 +27,14 @@ import static org.junit.Assert.assertNotEquals;
*/
public abstract class AbstractBlankNodeTest {
+ /**
+ * This method must be overridden by the implementing test to
+ * create a {@link BlankNode} to be tested.
+ * <p>
+ * Each call to this method must provide a new, unique BlankNode.
+ *
+ * @return {@link RDF} instance to be tested.
+ */
protected abstract BlankNode getBlankNode();
/**
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/e340604b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
index ba930eb..422e97b 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
@@ -67,7 +67,14 @@ public abstract class AbstractGraphTest {
protected Literal companyName;
protected Triple bobNameTriple;
- public abstract RDF createFactory();
+ /**
+ *
+ * This method must be overridden by the implementing test to provide a
+ * factory for the test to create {@link Graph}, {@link IRI} etc.
+ *
+ * @return {@link RDF} instance to be tested.
+ */
+ protected abstract RDF createFactory();
@Before
public void createGraphAndAdd() {
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/e340604b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
index 35eb764..1ef5b6c 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
@@ -42,13 +42,13 @@ public abstract class AbstractRDFTermFactoryTest {
private RDF factory;
/**
- * testCreate a new, distinct {@link RDF} object using the
- * implementation being tested here.
- *
- * @return a new, distinct {@link RDF} object using the
- * implementation being tested here
+ *
+ * This method must be overridden by the implementing test to provide a
+ * factory for the test to create {@link Literal}, {@link IRI} etc.
+ *
+ * @return {@link RDF} instance to be tested.
*/
- public abstract RDF createFactory();
+ protected abstract RDF createFactory();
@Before
public void setUp() {
[09/12] incubator-commonsrdf git commit: Use @Ignore rather than
Assume
Posted by st...@apache.org.
Use @Ignore rather than Assume
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/d0501ac0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/d0501ac0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/d0501ac0
Branch: refs/heads/COMMONSRDF-46
Commit: d0501ac0b99a060d8dc11d5a1d9206e4dceec82e
Parents: de6842f
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:21:21 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:21:21 2016 +0100
----------------------------------------------------------------------
.../org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d0501ac0/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
index 14099e8..99c0771 100644
--- a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
+++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
@@ -19,7 +19,6 @@ package org.apache.commons.rdf.jsonldjava;
import org.apache.commons.rdf.api.AbstractRDFTest;
import org.apache.commons.rdf.api.RDF;
-import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;
@@ -31,22 +30,21 @@ public class JsonLdRDFTest extends AbstractRDFTest {
}
// TODO: Add support for checking for invalid lang/iri/blanknode IDs
-
+ @Ignore("JSONLD-Java does not validate lang strings")
@Test
@Override
public void testInvalidLiteralLang() throws Exception {
- Assume.assumeFalse("JSONLD-Java does not validate lang strings", false);
super.testInvalidLiteralLang();
}
+ @Ignore("JSONLD-Java does not validate IRIs")
@Test
@Override
public void testInvalidIRI() throws Exception {
- Assume.assumeFalse("JSONLD-Java does not validate IRIs", false);
super.testInvalidIRI();
}
- @Ignore
+ @Ignore("JSONLD-Java does not validate blanknode identifiers")
@Test
@Override
public void testPossiblyInvalidBlankNode() throws Exception {
[06/12] incubator-commonsrdf git commit: Don't test relative IRIs
Posted by st...@apache.org.
Don't test relative IRIs
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/2e160b58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/2e160b58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/2e160b58
Branch: refs/heads/COMMONSRDF-46
Commit: 2e160b5839713fe3419775fb8dbdeaa82e089553
Parents: e340604
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 10:57:39 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 10:57:39 2016 +0100
----------------------------------------------------------------------
.../rdf/api/AbstractRDFTermFactoryTest.java | 26 --------------------
1 file changed, 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/2e160b58/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
index 1ef5b6c..97ee5fa 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
@@ -164,32 +164,6 @@ public abstract class AbstractRDFTermFactoryTest {
}
@Test
- public void testCreateIRIRelative() throws Exception {
- // Although relative IRIs are defined in
- // http://www.w3.org/TR/rdf11-concepts/#section-IRIs
- // it is not a requirement for an implementation to support
- // it (all instances of an relative IRI should eventually
- // be possible to resolve to an absolute IRI)
- try {
- factory.createIRI("../relative");
- } catch (IllegalArgumentException ex) {
- Assume.assumeNoException("Relative IRIs not supported - ignore this test", ex);
- return;
- }
- IRI relative = factory.createIRI("../relative");
- assertEquals("../relative", relative.getIRIString());
- assertEquals("<../relative>", relative.ntriplesString());
-
- IRI relativeTerm = factory.createIRI("../relative#term");
- assertEquals("../relative#term", relativeTerm.getIRIString());
- assertEquals("<../relative#term>", relativeTerm.ntriplesString());
-
- IRI emptyRelative = factory.createIRI(""); // <> equals the base URI
- assertEquals("", emptyRelative.getIRIString());
- assertEquals("<>", emptyRelative.ntriplesString());
- }
-
- @Test
public void testCreateLiteral() throws Exception {
Literal example = factory.createLiteral("Example");
assertEquals("Example", example.getLexicalForm());
[11/12] incubator-commonsrdf git commit: typo
Posted by st...@apache.org.
typo
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/fb806177
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/fb806177
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/fb806177
Branch: refs/heads/COMMONSRDF-46
Commit: fb8061770f5faf11f7c7b736ef5e61beefc780fa
Parents: fb0dd9c
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:33:37 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:33:37 2016 +0100
----------------------------------------------------------------------
src/site/markdown/userguide.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/fb806177/src/site/markdown/userguide.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/userguide.md b/src/site/markdown/userguide.md
index 6191889..ce9af61 100644
--- a/src/site/markdown/userguide.md
+++ b/src/site/markdown/userguide.md
@@ -222,7 +222,7 @@ subtypes for interoperability with their underlying RDF framework's API.
the super-interface for instances that can be used as subject, predicate and
object of a [Triple](apidocs/org/apache/commons/rdf/api/Triple.html).
-The RDF term interfaces are arranged in this ty[e hierarchy:
+The RDF term interfaces are arranged in this type hierarchy:
* [RDFTerm](apidocs/org/apache/commons/rdf/api/RDFTerm.html)
* [BlankNodeOrIRI](apidocs/org/apache/commons/rdf/api/BlankNodeOrIRI.html)
[08/12] incubator-commonsrdf git commit: *RDFTermFactoryTest ->
*RDFTest
Posted by st...@apache.org.
*RDFTermFactoryTest -> *RDFTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/de6842f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/de6842f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/de6842f9
Branch: refs/heads/COMMONSRDF-46
Commit: de6842f9828fc7c9678c014d3650cd569e131294
Parents: b7016f0
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:15:09 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:15:09 2016 +0100
----------------------------------------------------------------------
.../rdf/api/AbstractRDFTermFactoryTest.java | 334 -------------------
.../apache/commons/rdf/api/AbstractRDFTest.java | 334 +++++++++++++++++++
.../apache/commons/rdf/jena/JenaRDFTest.java | 32 ++
.../rdf/jena/TestRDFTermFactoryJena.java | 32 --
.../rdf/jsonldjava/JsonLdFactoryTest.java | 56 ----
.../commons/rdf/jsonldjava/JsonLdRDFTest.java | 56 ++++
.../rdf/rdf4j/MemoryRDFTermFactoryTest.java | 37 --
.../commons/rdf/rdf4j/MemoryStoreRDFTest.java | 37 ++
.../org/apache/commons/rdf/rdf4j/RDF4JTest.java | 37 ++
.../rdf/rdf4j/Rdf4JRDFTermFactoryTest.java | 37 --
.../SimpleNoRelativeIRIRDFTermFactoryTest.java | 46 ---
.../rdf/simple/SimpleNoRelativeIRIRDTest.java | 46 +++
.../rdf/simple/SimpleRDFTermFactoryTest.java | 33 --
.../commons/rdf/simple/SimpleRDFTest.java | 33 ++
14 files changed, 575 insertions(+), 575 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
deleted file mode 100644
index 97ee5fa..0000000
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
+++ /dev/null
@@ -1,334 +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.api;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotSame;
-
-import java.util.Objects;
-
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test RDF implementation (and thus its RDFTerm implementations)
- * <p>
- * To add to your implementation's tests, create a subclass with a name ending
- * in <code>Test</code> and provide {@link #createFactory()} which minimally
- * supports one of the operations, but ideally supports all operations.
- *
- * @see RDF
- */
-public abstract class AbstractRDFTermFactoryTest {
-
- private RDF factory;
-
- /**
- *
- * This method must be overridden by the implementing test to provide a
- * factory for the test to create {@link Literal}, {@link IRI} etc.
- *
- * @return {@link RDF} instance to be tested.
- */
- protected abstract RDF createFactory();
-
- @Before
- public void setUp() {
- factory = createFactory();
- }
-
- @Test
- public void testCreateBlankNode() throws Exception {
- BlankNode bnode = factory.createBlankNode();
-
- BlankNode bnode2 = factory.createBlankNode();
- assertNotEquals(
- "Second blank node has not got a unique internal identifier",
- bnode.uniqueReference(), bnode2.uniqueReference());
- }
-
- @Test
- public void testCreateBlankNodeIdentifierEmpty() throws Exception {
- try {
- factory.createBlankNode("");
- } catch (IllegalArgumentException e) {
- // Expected exception
- }
- }
-
- @Test
- public void testCreateBlankNodeIdentifier() throws Exception {
- factory.createBlankNode("example1");
- }
-
- @Test
- public void testCreateBlankNodeIdentifierTwice() throws Exception {
- BlankNode bnode1, bnode2, bnode3;
- bnode1 = factory.createBlankNode("example1");
- bnode2 = factory.createBlankNode("example1");
- bnode3 = factory.createBlankNode("differ");
- // We don't know what the identifier is, but it MUST be the same
- assertEquals(bnode1.uniqueReference(), bnode2.uniqueReference());
- // We don't know what the ntriplesString is, but it MUST be the same
- assertEquals(bnode1.ntriplesString(), bnode2.ntriplesString());
- // and here it MUST differ
- assertNotEquals(bnode1.uniqueReference(),
- bnode3.uniqueReference());
- assertNotEquals(bnode1.ntriplesString(), bnode3.ntriplesString());
- }
-
- @Test
- public void testCreateBlankNodeIdentifierTwiceDifferentFactories() throws Exception {
- BlankNode bnode1, differentFactory;
- bnode1 = factory.createBlankNode();
- // it MUST differ from a second factory
- differentFactory = createFactory().createBlankNode();
-
- // NOTE: We can't make similar assumption if we provide a
- // name to createBlankNode(String) as its documentation
- // only says:
- //
- // * BlankNodes created using this method with the same parameter, for
- // * different instances of RDFFactory, SHOULD NOT be equivalent.
- //
- // https://github.com/apache/incubator-commonsrdf/pull/7#issuecomment-92312779
- assertNotEquals(bnode1, differentFactory);
- assertNotEquals(bnode1.uniqueReference(),
- differentFactory.uniqueReference());
- // but we can't require:
- //assertNotEquals(bnode1.ntriplesString(), differentFactory.ntriplesString());
- }
-
-
- @Test
- public void testCreateGraph() {
- Graph graph = factory.createGraph();
-
- assertEquals("Graph was not empty", 0, graph.size());
- graph.add(factory.createBlankNode(),
- factory.createIRI("http://example.com/"),
- factory.createBlankNode());
-
- Graph graph2 = factory.createGraph();
- assertNotSame(graph, graph2);
- assertEquals("Graph was empty after adding", 1, graph.size());
- assertEquals("New graph was not empty", 0, graph2.size());
- }
-
- @Test
- public void testCreateIRI() throws Exception {
- IRI example = factory.createIRI("http://example.com/");
-
- assertEquals("http://example.com/", example.getIRIString());
- assertEquals("<http://example.com/>", example.ntriplesString());
-
- IRI term = factory.createIRI("http://example.com/vocab#term");
- assertEquals("http://example.com/vocab#term", term.getIRIString());
- assertEquals("<http://example.com/vocab#term>", term.ntriplesString());
-
- // and now for the international fun!
-
- IRI latin1 = factory.createIRI("http://acc�nt.example.com/premi�re");
- assertEquals("http://acc�nt.example.com/premi�re",
- latin1.getIRIString());
- assertEquals("<http://acc�nt.example.com/premi�re>",
- latin1.ntriplesString());
-
- IRI cyrillic = factory.createIRI("http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430");
- assertEquals("http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430",
- cyrillic.getIRIString());
- assertEquals("<http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430>",
- cyrillic.ntriplesString());
-
- IRI deseret = factory.createIRI("http://\U00010400.example.com/\U00010400");
- assertEquals("http://\U00010400.example.com/\U00010400", deseret.getIRIString());
- assertEquals("<http://\U00010400.example.com/\U00010400>", deseret.ntriplesString());
- }
-
- @Test
- public void testCreateLiteral() throws Exception {
- Literal example = factory.createLiteral("Example");
- assertEquals("Example", example.getLexicalForm());
- assertFalse(example.getLanguageTag().isPresent());
- assertEquals("http://www.w3.org/2001/XMLSchema#string", example
- .getDatatype().getIRIString());
- // http://lists.w3.org/Archives/Public/public-rdf-comments/2014Dec/0004.html
- assertEquals("\"Example\"", example.ntriplesString());
- }
-
- @Test
- public void testCreateLiteralDateTime() throws Exception {
- Literal dateTime = factory
- .createLiteral(
- "2014-12-27T00:50:00T-0600",
- factory.createIRI("http://www.w3.org/2001/XMLSchema#dateTime"));
- assertEquals("2014-12-27T00:50:00T-0600", dateTime.getLexicalForm());
- assertFalse(dateTime.getLanguageTag().isPresent());
- assertEquals("http://www.w3.org/2001/XMLSchema#dateTime", dateTime
- .getDatatype().getIRIString());
- assertEquals(
- "\"2014-12-27T00:50:00T-0600\"^^<http://www.w3.org/2001/XMLSchema#dateTime>",
- dateTime.ntriplesString());
- }
-
- @Test
- public void testCreateLiteralLang() throws Exception {
- Literal example = factory.createLiteral("Example", "en");
-
- assertEquals("Example", example.getLexicalForm());
- assertEquals("en", example.getLanguageTag().get());
- assertEquals("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",
- example.getDatatype().getIRIString());
- assertEquals("\"Example\"@en", example.ntriplesString());
- }
-
- @Test
- public void testCreateLiteralLangISO693_3() throws Exception {
- // see https://issues.apache.org/jira/browse/JENA-827
- Literal vls = factory.createLiteral("Herbert Van de Sompel", "vls"); // JENA-827
-
- assertEquals("vls", vls.getLanguageTag().get());
- assertEquals("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",
- vls.getDatatype().getIRIString());
- assertEquals("\"Herbert Van de Sompel\"@vls", vls.ntriplesString());
- }
-
- @Test
- public void testCreateLiteralString() throws Exception {
- Literal example = factory.createLiteral("Example", factory
- .createIRI("http://www.w3.org/2001/XMLSchema#string"));
- assertEquals("Example", example.getLexicalForm());
- assertFalse(example.getLanguageTag().isPresent());
- assertEquals("http://www.w3.org/2001/XMLSchema#string", example
- .getDatatype().getIRIString());
- // http://lists.w3.org/Archives/Public/public-rdf-comments/2014Dec/0004.html
- assertEquals("\"Example\"", example.ntriplesString());
- }
-
- @Test
- public void testCreateTripleBnodeBnode() {
- BlankNode subject = factory.createBlankNode("b1");
- IRI predicate = factory.createIRI("http://example.com/pred");
- BlankNode object = factory.createBlankNode("b2");
- Triple triple = factory.createTriple(subject, predicate, object);
-
- // bnode equivalence should be OK as we used the same
- // factory and have not yet inserted Triple into a Graph
- assertEquals(subject, triple.getSubject());
- assertEquals(predicate, triple.getPredicate());
- assertEquals(object, triple.getObject());
- }
-
- @Test
- public void testCreateTripleBnodeIRI() {
- BlankNode subject = factory.createBlankNode("b1");
- IRI predicate = factory.createIRI("http://example.com/pred");
- IRI object = factory.createIRI("http://example.com/obj");
- Triple triple = factory.createTriple(subject, predicate, object);
-
- // bnode equivalence should be OK as we used the same
- // factory and have not yet inserted Triple into a Graph
- assertEquals(subject, triple.getSubject());
- assertEquals(predicate, triple.getPredicate());
- assertEquals(object, triple.getObject());
- }
-
- @Test
- public void testCreateTripleBnodeTriple() {
- BlankNode subject = factory.createBlankNode();
- IRI predicate = factory.createIRI("http://example.com/pred");
- Literal object = factory.createLiteral("Example", "en");
- Triple triple = factory.createTriple(subject, predicate, object);
-
- // bnode equivalence should be OK as we used the same
- // factory and have not yet inserted Triple into a Graph
- assertEquals(subject, triple.getSubject());
- assertEquals(predicate, triple.getPredicate());
- assertEquals(object, triple.getObject());
- }
-
- @Test
- public void testPossiblyInvalidBlankNode() throws Exception {
- BlankNode withColon;
- try {
- withColon = factory.createBlankNode("with:colon");
- } catch (IllegalArgumentException ex) {
- // Good!
- return;
- }
- // Factory allows :colon, which is OK as long as it's not causing an
- // invalid ntriplesString
- assertFalse(withColon.ntriplesString().contains("with:colon"));
-
- // and creating it twice gets the same ntriplesString
- assertEquals(withColon.ntriplesString(),
- factory.createBlankNode("with:colon").ntriplesString());
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidIRI() throws Exception {
- factory.createIRI("<no_brackets>");
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidLiteralLang() throws Exception {
- factory.createLiteral("Example", "with space");
- }
-
- @Test(expected = Exception.class)
- public void testInvalidTriplePredicate() {
- BlankNode subject = factory.createBlankNode("b1");
- BlankNode predicate = factory.createBlankNode("b2");
- BlankNode object = factory.createBlankNode("b3");
- factory.createTriple(subject, (IRI) predicate, object);
- }
-
- @Test
- public void hashCodeBlankNode() throws Exception {
- BlankNode bnode1 = factory.createBlankNode();
- assertEquals(bnode1.uniqueReference().hashCode(), bnode1.hashCode());
- }
-
- @Test
- public void hashCodeIRI() throws Exception {
- IRI iri = factory.createIRI("http://example.com/");
- assertEquals(iri.getIRIString().hashCode(), iri.hashCode());
- }
-
- @Test
- public void hashCodeLiteral() throws Exception {
- Literal literal = factory.createLiteral("Hello");
- assertEquals(Objects.hash(
- literal.getLexicalForm(),
- literal.getDatatype(),
- literal.getLanguageTag()
- ),
- literal.hashCode());
- }
-
- @Test
- public void hashCodeTriple() throws Exception {
- IRI iri = factory.createIRI("http://example.com/");
- Triple triple = factory.createTriple(iri, iri, iri);
- assertEquals(Objects.hash(iri, iri, iri),
- triple.hashCode());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java
new file mode 100644
index 0000000..c664da8
--- /dev/null
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java
@@ -0,0 +1,334 @@
+/**
+ * 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.api;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotSame;
+
+import java.util.Objects;
+
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test RDF implementation (and thus its RDFTerm implementations)
+ * <p>
+ * To add to your implementation's tests, create a subclass with a name ending
+ * in <code>Test</code> and provide {@link #createFactory()} which minimally
+ * supports one of the operations, but ideally supports all operations.
+ *
+ * @see RDF
+ */
+public abstract class AbstractRDFTest {
+
+ private RDF factory;
+
+ /**
+ *
+ * This method must be overridden by the implementing test to provide a
+ * factory for the test to create {@link Literal}, {@link IRI} etc.
+ *
+ * @return {@link RDF} instance to be tested.
+ */
+ protected abstract RDF createFactory();
+
+ @Before
+ public void setUp() {
+ factory = createFactory();
+ }
+
+ @Test
+ public void testCreateBlankNode() throws Exception {
+ BlankNode bnode = factory.createBlankNode();
+
+ BlankNode bnode2 = factory.createBlankNode();
+ assertNotEquals(
+ "Second blank node has not got a unique internal identifier",
+ bnode.uniqueReference(), bnode2.uniqueReference());
+ }
+
+ @Test
+ public void testCreateBlankNodeIdentifierEmpty() throws Exception {
+ try {
+ factory.createBlankNode("");
+ } catch (IllegalArgumentException e) {
+ // Expected exception
+ }
+ }
+
+ @Test
+ public void testCreateBlankNodeIdentifier() throws Exception {
+ factory.createBlankNode("example1");
+ }
+
+ @Test
+ public void testCreateBlankNodeIdentifierTwice() throws Exception {
+ BlankNode bnode1, bnode2, bnode3;
+ bnode1 = factory.createBlankNode("example1");
+ bnode2 = factory.createBlankNode("example1");
+ bnode3 = factory.createBlankNode("differ");
+ // We don't know what the identifier is, but it MUST be the same
+ assertEquals(bnode1.uniqueReference(), bnode2.uniqueReference());
+ // We don't know what the ntriplesString is, but it MUST be the same
+ assertEquals(bnode1.ntriplesString(), bnode2.ntriplesString());
+ // and here it MUST differ
+ assertNotEquals(bnode1.uniqueReference(),
+ bnode3.uniqueReference());
+ assertNotEquals(bnode1.ntriplesString(), bnode3.ntriplesString());
+ }
+
+ @Test
+ public void testCreateBlankNodeIdentifierTwiceDifferentFactories() throws Exception {
+ BlankNode bnode1, differentFactory;
+ bnode1 = factory.createBlankNode();
+ // it MUST differ from a second factory
+ differentFactory = createFactory().createBlankNode();
+
+ // NOTE: We can't make similar assumption if we provide a
+ // name to createBlankNode(String) as its documentation
+ // only says:
+ //
+ // * BlankNodes created using this method with the same parameter, for
+ // * different instances of RDFFactory, SHOULD NOT be equivalent.
+ //
+ // https://github.com/apache/incubator-commonsrdf/pull/7#issuecomment-92312779
+ assertNotEquals(bnode1, differentFactory);
+ assertNotEquals(bnode1.uniqueReference(),
+ differentFactory.uniqueReference());
+ // but we can't require:
+ //assertNotEquals(bnode1.ntriplesString(), differentFactory.ntriplesString());
+ }
+
+
+ @Test
+ public void testCreateGraph() {
+ Graph graph = factory.createGraph();
+
+ assertEquals("Graph was not empty", 0, graph.size());
+ graph.add(factory.createBlankNode(),
+ factory.createIRI("http://example.com/"),
+ factory.createBlankNode());
+
+ Graph graph2 = factory.createGraph();
+ assertNotSame(graph, graph2);
+ assertEquals("Graph was empty after adding", 1, graph.size());
+ assertEquals("New graph was not empty", 0, graph2.size());
+ }
+
+ @Test
+ public void testCreateIRI() throws Exception {
+ IRI example = factory.createIRI("http://example.com/");
+
+ assertEquals("http://example.com/", example.getIRIString());
+ assertEquals("<http://example.com/>", example.ntriplesString());
+
+ IRI term = factory.createIRI("http://example.com/vocab#term");
+ assertEquals("http://example.com/vocab#term", term.getIRIString());
+ assertEquals("<http://example.com/vocab#term>", term.ntriplesString());
+
+ // and now for the international fun!
+
+ IRI latin1 = factory.createIRI("http://acc�nt.example.com/premi�re");
+ assertEquals("http://acc�nt.example.com/premi�re",
+ latin1.getIRIString());
+ assertEquals("<http://acc�nt.example.com/premi�re>",
+ latin1.ntriplesString());
+
+ IRI cyrillic = factory.createIRI("http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430");
+ assertEquals("http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430",
+ cyrillic.getIRIString());
+ assertEquals("<http://example.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435/\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430>",
+ cyrillic.ntriplesString());
+
+ IRI deseret = factory.createIRI("http://\U00010400.example.com/\U00010400");
+ assertEquals("http://\U00010400.example.com/\U00010400", deseret.getIRIString());
+ assertEquals("<http://\U00010400.example.com/\U00010400>", deseret.ntriplesString());
+ }
+
+ @Test
+ public void testCreateLiteral() throws Exception {
+ Literal example = factory.createLiteral("Example");
+ assertEquals("Example", example.getLexicalForm());
+ assertFalse(example.getLanguageTag().isPresent());
+ assertEquals("http://www.w3.org/2001/XMLSchema#string", example
+ .getDatatype().getIRIString());
+ // http://lists.w3.org/Archives/Public/public-rdf-comments/2014Dec/0004.html
+ assertEquals("\"Example\"", example.ntriplesString());
+ }
+
+ @Test
+ public void testCreateLiteralDateTime() throws Exception {
+ Literal dateTime = factory
+ .createLiteral(
+ "2014-12-27T00:50:00T-0600",
+ factory.createIRI("http://www.w3.org/2001/XMLSchema#dateTime"));
+ assertEquals("2014-12-27T00:50:00T-0600", dateTime.getLexicalForm());
+ assertFalse(dateTime.getLanguageTag().isPresent());
+ assertEquals("http://www.w3.org/2001/XMLSchema#dateTime", dateTime
+ .getDatatype().getIRIString());
+ assertEquals(
+ "\"2014-12-27T00:50:00T-0600\"^^<http://www.w3.org/2001/XMLSchema#dateTime>",
+ dateTime.ntriplesString());
+ }
+
+ @Test
+ public void testCreateLiteralLang() throws Exception {
+ Literal example = factory.createLiteral("Example", "en");
+
+ assertEquals("Example", example.getLexicalForm());
+ assertEquals("en", example.getLanguageTag().get());
+ assertEquals("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",
+ example.getDatatype().getIRIString());
+ assertEquals("\"Example\"@en", example.ntriplesString());
+ }
+
+ @Test
+ public void testCreateLiteralLangISO693_3() throws Exception {
+ // see https://issues.apache.org/jira/browse/JENA-827
+ Literal vls = factory.createLiteral("Herbert Van de Sompel", "vls"); // JENA-827
+
+ assertEquals("vls", vls.getLanguageTag().get());
+ assertEquals("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",
+ vls.getDatatype().getIRIString());
+ assertEquals("\"Herbert Van de Sompel\"@vls", vls.ntriplesString());
+ }
+
+ @Test
+ public void testCreateLiteralString() throws Exception {
+ Literal example = factory.createLiteral("Example", factory
+ .createIRI("http://www.w3.org/2001/XMLSchema#string"));
+ assertEquals("Example", example.getLexicalForm());
+ assertFalse(example.getLanguageTag().isPresent());
+ assertEquals("http://www.w3.org/2001/XMLSchema#string", example
+ .getDatatype().getIRIString());
+ // http://lists.w3.org/Archives/Public/public-rdf-comments/2014Dec/0004.html
+ assertEquals("\"Example\"", example.ntriplesString());
+ }
+
+ @Test
+ public void testCreateTripleBnodeBnode() {
+ BlankNode subject = factory.createBlankNode("b1");
+ IRI predicate = factory.createIRI("http://example.com/pred");
+ BlankNode object = factory.createBlankNode("b2");
+ Triple triple = factory.createTriple(subject, predicate, object);
+
+ // bnode equivalence should be OK as we used the same
+ // factory and have not yet inserted Triple into a Graph
+ assertEquals(subject, triple.getSubject());
+ assertEquals(predicate, triple.getPredicate());
+ assertEquals(object, triple.getObject());
+ }
+
+ @Test
+ public void testCreateTripleBnodeIRI() {
+ BlankNode subject = factory.createBlankNode("b1");
+ IRI predicate = factory.createIRI("http://example.com/pred");
+ IRI object = factory.createIRI("http://example.com/obj");
+ Triple triple = factory.createTriple(subject, predicate, object);
+
+ // bnode equivalence should be OK as we used the same
+ // factory and have not yet inserted Triple into a Graph
+ assertEquals(subject, triple.getSubject());
+ assertEquals(predicate, triple.getPredicate());
+ assertEquals(object, triple.getObject());
+ }
+
+ @Test
+ public void testCreateTripleBnodeTriple() {
+ BlankNode subject = factory.createBlankNode();
+ IRI predicate = factory.createIRI("http://example.com/pred");
+ Literal object = factory.createLiteral("Example", "en");
+ Triple triple = factory.createTriple(subject, predicate, object);
+
+ // bnode equivalence should be OK as we used the same
+ // factory and have not yet inserted Triple into a Graph
+ assertEquals(subject, triple.getSubject());
+ assertEquals(predicate, triple.getPredicate());
+ assertEquals(object, triple.getObject());
+ }
+
+ @Test
+ public void testPossiblyInvalidBlankNode() throws Exception {
+ BlankNode withColon;
+ try {
+ withColon = factory.createBlankNode("with:colon");
+ } catch (IllegalArgumentException ex) {
+ // Good!
+ return;
+ }
+ // Factory allows :colon, which is OK as long as it's not causing an
+ // invalid ntriplesString
+ assertFalse(withColon.ntriplesString().contains("with:colon"));
+
+ // and creating it twice gets the same ntriplesString
+ assertEquals(withColon.ntriplesString(),
+ factory.createBlankNode("with:colon").ntriplesString());
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInvalidIRI() throws Exception {
+ factory.createIRI("<no_brackets>");
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInvalidLiteralLang() throws Exception {
+ factory.createLiteral("Example", "with space");
+ }
+
+ @Test(expected = Exception.class)
+ public void testInvalidTriplePredicate() {
+ BlankNode subject = factory.createBlankNode("b1");
+ BlankNode predicate = factory.createBlankNode("b2");
+ BlankNode object = factory.createBlankNode("b3");
+ factory.createTriple(subject, (IRI) predicate, object);
+ }
+
+ @Test
+ public void hashCodeBlankNode() throws Exception {
+ BlankNode bnode1 = factory.createBlankNode();
+ assertEquals(bnode1.uniqueReference().hashCode(), bnode1.hashCode());
+ }
+
+ @Test
+ public void hashCodeIRI() throws Exception {
+ IRI iri = factory.createIRI("http://example.com/");
+ assertEquals(iri.getIRIString().hashCode(), iri.hashCode());
+ }
+
+ @Test
+ public void hashCodeLiteral() throws Exception {
+ Literal literal = factory.createLiteral("Hello");
+ assertEquals(Objects.hash(
+ literal.getLexicalForm(),
+ literal.getDatatype(),
+ literal.getLanguageTag()
+ ),
+ literal.hashCode());
+ }
+
+ @Test
+ public void hashCodeTriple() throws Exception {
+ IRI iri = factory.createIRI("http://example.com/");
+ Triple triple = factory.createTriple(iri, iri, iri);
+ assertEquals(Objects.hash(iri, iri, iri),
+ triple.hashCode());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java b/jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java
new file mode 100644
index 0000000..87a4618
--- /dev/null
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.rdf.jena;
+
+import org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.RDF;
+
+public class JenaRDFTest extends AbstractRDFTest {
+
+ @Override
+ public RDF createFactory() {
+ return new JenaRDF();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
deleted file mode 100644
index 870546a..0000000
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.rdf.jena;
-
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.RDF;
-
-public class TestRDFTermFactoryJena extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDF createFactory() {
- return new JenaRDF();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdFactoryTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdFactoryTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdFactoryTest.java
deleted file mode 100644
index 22010f7..0000000
--- a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdFactoryTest.java
+++ /dev/null
@@ -1,56 +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 org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.RDF;
-import org.junit.Assume;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class JsonLdFactoryTest extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDF createFactory() {
- return new JsonLdRDF();
- }
-
- // TODO: Add support for checking for invalid lang/iri/blanknode IDs
-
- @Test
- @Override
- public void testInvalidLiteralLang() throws Exception {
- Assume.assumeFalse("JSONLD-Java does not validate lang strings", false);
- super.testInvalidLiteralLang();
- }
-
- @Test
- @Override
- public void testInvalidIRI() throws Exception {
- Assume.assumeFalse("JSONLD-Java does not validate IRIs", false);
- super.testInvalidIRI();
- }
-
- @Ignore
- @Test
- @Override
- public void testPossiblyInvalidBlankNode() throws Exception {
- // TODO: Fix blank node in ntriplesString()
- super.testPossiblyInvalidBlankNode();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
new file mode 100644
index 0000000..14099e8
--- /dev/null
+++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdRDFTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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 org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Assume;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class JsonLdRDFTest extends AbstractRDFTest {
+
+ @Override
+ public RDF createFactory() {
+ return new JsonLdRDF();
+ }
+
+ // TODO: Add support for checking for invalid lang/iri/blanknode IDs
+
+ @Test
+ @Override
+ public void testInvalidLiteralLang() throws Exception {
+ Assume.assumeFalse("JSONLD-Java does not validate lang strings", false);
+ super.testInvalidLiteralLang();
+ }
+
+ @Test
+ @Override
+ public void testInvalidIRI() throws Exception {
+ Assume.assumeFalse("JSONLD-Java does not validate IRIs", false);
+ super.testInvalidIRI();
+ }
+
+ @Ignore
+ @Test
+ @Override
+ public void testPossiblyInvalidBlankNode() throws Exception {
+ // TODO: Fix blank node in ntriplesString()
+ super.testPossiblyInvalidBlankNode();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java
deleted file mode 100644
index 0a44a5e..0000000
--- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rdf.rdf4j;
-
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.RDF;
-import org.junit.Assume;
-
-public class MemoryRDFTermFactoryTest extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDF createFactory() {
- return new MemoryGraphTest.MemoryStoreRDF();
- }
-
- @Override
- public void testInvalidLiteralLang() throws Exception {
- Assume.assumeTrue("RDF4J doesn't check Lang strings",false);
- super.testInvalidLiteralLang();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryStoreRDFTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryStoreRDFTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryStoreRDFTest.java
new file mode 100644
index 0000000..fd4efcb
--- /dev/null
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryStoreRDFTest.java
@@ -0,0 +1,37 @@
+/**
+ * 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.rdf4j;
+
+import org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Assume;
+
+public class MemoryStoreRDFTest extends AbstractRDFTest {
+
+ @Override
+ public RDF createFactory() {
+ return new MemoryGraphTest.MemoryStoreRDF();
+ }
+
+ @Override
+ public void testInvalidLiteralLang() throws Exception {
+ Assume.assumeTrue("RDF4J doesn't check Lang strings",false);
+ super.testInvalidLiteralLang();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JTest.java
new file mode 100644
index 0000000..c10ea9a
--- /dev/null
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JTest.java
@@ -0,0 +1,37 @@
+/**
+ * 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.rdf4j;
+
+import org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Assume;
+
+public class RDF4JTest extends AbstractRDFTest {
+
+ @Override
+ public RDF createFactory() {
+ return new RDF4J();
+ }
+
+ @Override
+ public void testInvalidLiteralLang() throws Exception {
+ Assume.assumeTrue("RDF4J doesn't check Lang strings",false);
+ super.testInvalidLiteralLang();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java
deleted file mode 100644
index 29c8ab0..0000000
--- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rdf.rdf4j;
-
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.RDF;
-import org.junit.Assume;
-
-public class Rdf4JRDFTermFactoryTest extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDF createFactory() {
- return new RDF4J();
- }
-
- @Override
- public void testInvalidLiteralLang() throws Exception {
- Assume.assumeTrue("RDD4J doesn't check Lang strings",false);
- super.testInvalidLiteralLang();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/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
deleted file mode 100644
index 3167243..0000000
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java
+++ /dev/null
@@ -1,46 +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 org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.IRI;
-import org.apache.commons.rdf.api.RDF;
-
-import java.net.URI;
-
-/**
- * Test simple IRI without relative IRI support.
- * <p>
- * Ensures that {@link AbstractRDFTermFactoryTest#testCreateIRIRelative()} is
- * correctly skipped (without causing an error).
- */
-public class SimpleNoRelativeIRIRDFTermFactoryTest extends
- AbstractRDFTermFactoryTest {
- @Override
- public RDF createFactory() {
- return new SimpleRDF() {
- @Override
- public IRI createIRI(String iri) {
- if (!URI.create(iri).isAbsolute()) {
- throw new IllegalArgumentException("IRIs must be absolute");
- }
- return super.createIRI(iri);
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDTest.java
new file mode 100644
index 0000000..abec6c0
--- /dev/null
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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 org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.RDF;
+
+import java.net.URI;
+
+/**
+ * Test simple IRI without relative IRI support.
+ * <p>
+ * Ensures that {@link AbstractRDFTest#testCreateIRIRelative()} is
+ * correctly skipped (without causing an error).
+ */
+public class SimpleNoRelativeIRIRDTest extends
+ AbstractRDFTest {
+ @Override
+ public RDF createFactory() {
+ return new SimpleRDF() {
+ @Override
+ public IRI createIRI(String iri) {
+ if (!URI.create(iri).isAbsolute()) {
+ throw new IllegalArgumentException("IRIs must be absolute");
+ }
+ return super.createIRI(iri);
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/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
deleted file mode 100644
index 816eef9..0000000
--- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.rdf.simple;
-
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
-import org.apache.commons.rdf.api.RDF;
-
-/**
- * Simple RDF Test
- */
-public class SimpleRDFTermFactoryTest extends AbstractRDFTermFactoryTest {
-
- @Override
- public RDF createFactory() {
- return new SimpleRDF();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/de6842f9/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java
new file mode 100644
index 0000000..31915de
--- /dev/null
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java
@@ -0,0 +1,33 @@
+/**
+ * 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 org.apache.commons.rdf.api.AbstractRDFTest;
+import org.apache.commons.rdf.api.RDF;
+
+/**
+ * Simple RDF Test
+ */
+public class SimpleRDFTest extends AbstractRDFTest {
+
+ @Override
+ public RDF createFactory() {
+ return new SimpleRDF();
+ }
+
+}
[03/12] incubator-commonsrdf git commit: avoid infinite loop! :)
Posted by st...@apache.org.
avoid infinite loop! :)
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/49cba1f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/49cba1f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/49cba1f9
Branch: refs/heads/COMMONSRDF-46
Commit: 49cba1f99fc67538c4f24e4e06c7f3a51126a309
Parents: 98d56f8
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Oct 27 16:48:52 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Oct 27 16:48:52 2016 +0100
----------------------------------------------------------------------
.../org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/49cba1f9/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
index f9a1e74..be37449 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
@@ -111,7 +111,7 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
@Override
protected RDF4JParser prepareForParsing() throws IOException, IllegalStateException {
- RDF4JParser c = prepareForParsing();
+ RDF4JParser c = super.prepareForParsing();
// Ensure we have an RDF4JFactory for conversion.
// We'll make a new one if user has provided a non-RDF4J factory
c.rdf4jTermFactory = (RDF4JFactory) getRdfTermFactory().filter(RDF4JFactory.class::isInstance)
[07/12] incubator-commonsrdf git commit: Avoid space at end of line -
" ; " -> "; "
Posted by st...@apache.org.
Avoid space at end of line - " ;" -> ";"
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/b7016f02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/b7016f02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/b7016f02
Branch: refs/heads/COMMONSRDF-46
Commit: b7016f020c468cf696be0435fca58ad8cd7c2bb1
Parents: 2e160b5
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 28 11:02:48 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 28 11:02:48 2016 +0100
----------------------------------------------------------------------
.../rdf/jena/impl/AbstractJenaRDFTerm.java | 2 +-
.../commons/rdf/jena/TestBlankNodeJena.java | 8 +++---
.../apache/commons/rdf/jena/TestGraphJena.java | 6 ++---
.../jena/TestJenaGraphToCommonsRDFGraph.java | 26 ++++++++++----------
.../rdf/jena/TestRDFTermFactoryJena.java | 6 ++---
5 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b7016f02/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractJenaRDFTerm.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractJenaRDFTerm.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractJenaRDFTerm.java
index 9c0d7ec..fd117a2 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractJenaRDFTerm.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AbstractJenaRDFTerm.java
@@ -25,7 +25,7 @@ import org.apache.jena.riot.out.NodeFmtLib;
class AbstractJenaRDFTerm implements JenaRDFTerm, RDFTerm {
private Node node;
- // static private PrefixMapping empty = new PrefixMappingImpl() ;
+ // static private PrefixMapping empty = new PrefixMappingImpl();
protected AbstractJenaRDFTerm(Node node) {
this.node = node;
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b7016f02/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
index a3db975..abe8080 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
@@ -20,8 +20,8 @@ package org.apache.commons.rdf.jena;
import java.util.UUID;
-import org.apache.commons.rdf.api.AbstractBlankNodeTest ;
-import org.apache.commons.rdf.api.BlankNode ;
+import org.apache.commons.rdf.api.AbstractBlankNodeTest;
+import org.apache.commons.rdf.api.BlankNode;
import org.apache.commons.rdf.jena.impl.InternalJenaFactory;
public class TestBlankNodeJena extends AbstractBlankNodeTest {
@@ -35,12 +35,12 @@ public class TestBlankNodeJena extends AbstractBlankNodeTest {
@Override
protected BlankNode getBlankNode() {
- return internalJenaFactory.createBlankNode(SALT) ;
+ return internalJenaFactory.createBlankNode(SALT);
}
@Override
protected BlankNode getBlankNode(String identifier) {
- return internalJenaFactory.createBlankNode(identifier, SALT) ;
+ return internalJenaFactory.createBlankNode(identifier, SALT);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b7016f02/jena/src/test/java/org/apache/commons/rdf/jena/TestGraphJena.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestGraphJena.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestGraphJena.java
index a11fdc6..296c42d 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestGraphJena.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestGraphJena.java
@@ -18,14 +18,14 @@
package org.apache.commons.rdf.jena;
-import org.apache.commons.rdf.api.AbstractGraphTest ;
-import org.apache.commons.rdf.api.RDF ;
+import org.apache.commons.rdf.api.AbstractGraphTest;
+import org.apache.commons.rdf.api.RDF;
public class TestGraphJena extends AbstractGraphTest {
@Override
public RDF createFactory() {
- return new JenaRDF() ;
+ return new JenaRDF();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b7016f02/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
index 51cfa4c..50bb1ff 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java
@@ -28,13 +28,13 @@ import java.nio.file.StandardCopyOption;
import org.apache.commons.rdf.api.BlankNode;
import org.apache.commons.rdf.api.BlankNodeOrIRI;
-import org.apache.commons.rdf.api.Graph ;
+import org.apache.commons.rdf.api.Graph;
import org.apache.commons.rdf.api.RDFTerm;
import org.apache.commons.rdf.api.Triple;
import org.apache.commons.rdf.simple.Types;
-import org.apache.jena.riot.Lang ;
-import org.apache.jena.riot.RDFDataMgr ;
-import org.apache.jena.sparql.graph.GraphFactory ;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.sparql.graph.GraphFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -60,13 +60,13 @@ public class TestJenaGraphToCommonsRDFGraph {
@Test
public void jenaToCommonsRDF() throws Exception {
- org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem() ;
- RDFDataMgr.read(jGraph, turtleFile.toUri().toString()) ;
+ org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem();
+ RDFDataMgr.read(jGraph, turtleFile.toUri().toString());
- JenaRDF factory = new JenaRDF() ;
+ JenaRDF factory = new JenaRDF();
// "graph" is a CommonsRDF graph
- Graph graph = factory.asGraph(jGraph) ;
+ Graph graph = factory.asGraph(jGraph);
@@ -115,7 +115,7 @@ public class TestJenaGraphToCommonsRDFGraph {
JenaLiteral foo = factory.createLiteral("foo");
graph.add(s2,
p2,
- foo) ;
+ foo);
assertEquals(4, graph.size());
assertTrue(graph.contains(s2,p2,foo));
@@ -123,11 +123,11 @@ public class TestJenaGraphToCommonsRDFGraph {
assertTrue(jGraph.contains(s2.asJenaNode(), p2.asJenaNode(), foo.asJenaNode()));
if (DEBUG) {
- System.out.println("==== Write CommonsRDF graph\n") ;
- graph.stream().forEach(System.out::println) ;
+ System.out.println("==== Write CommonsRDF graph\n");
+ graph.stream().forEach(System.out::println);
// And its in the Jena graph
- System.out.println("\n==== Write Jena graph directly\n") ;
- RDFDataMgr.write(System.out, jGraph, Lang.TTL) ;
+ System.out.println("\n==== Write Jena graph directly\n");
+ RDFDataMgr.write(System.out, jGraph, Lang.TTL);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b7016f02/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
index 327f218..870546a 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestRDFTermFactoryJena.java
@@ -18,14 +18,14 @@
package org.apache.commons.rdf.jena;
-import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest ;
-import org.apache.commons.rdf.api.RDF ;
+import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest;
+import org.apache.commons.rdf.api.RDF;
public class TestRDFTermFactoryJena extends AbstractRDFTermFactoryTest {
@Override
public RDF createFactory() {
- return new JenaRDF() ;
+ return new JenaRDF();
}
}