commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [08/22] commons-rdf git commit: Module names, directory names, and artifact names should match.
Date Mon, 30 Oct 2017 14:57:08 GMT
http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/main/resources/META-INF/LICENSE b/commons-rdf-simple/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/commons-rdf-simple/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/main/resources/META-INF/NOTICE b/commons-rdf-simple/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..6147016
--- /dev/null
+++ b/commons-rdf-simple/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,5 @@
+Apache Commons RDF
+Copyright 2015-2016 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDF
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDF b/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDF
new file mode 100644
index 0000000..4003034
--- /dev/null
+++ b/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDF
@@ -0,0 +1 @@
+org.apache.commons.rdf.simple.SimpleRDF

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFTermFactory
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFTermFactory b/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFTermFactory
new file mode 100644
index 0000000..5a56ae6
--- /dev/null
+++ b/commons-rdf-simple/src/main/resources/META-INF/services/org.apache.commons.rdf.api.RDFTermFactory
@@ -0,0 +1 @@
+org.apache.commons.rdf.simple.SimpleRDFTermFactory

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/site/resources/profile.jacoco
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/site/resources/profile.jacoco b/commons-rdf-simple/src/site/resources/profile.jacoco
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/site/resources/profile.japicmp
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/site/resources/profile.japicmp b/commons-rdf-simple/src/site/resources/profile.japicmp
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
new file mode 100644
index 0000000..aa2359a
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
@@ -0,0 +1,43 @@
+/**
+ * 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.AbstractBlankNodeTest;
+import org.apache.commons.rdf.api.BlankNode;
+
+/**
+ * Concrete implementation of BlankNodeImpl test.
+ */
+public class BlankNodeImplTest extends AbstractBlankNodeTest {
+
+    // Fixed salt just for this test
+    private static UUID SALT = UUID.fromString("35019b59-18b3-4e74-8707-ec55f62a37d6");
+
+    @Override
+    protected BlankNode getBlankNode() {
+        return new BlankNodeImpl();
+    }
+
+    @Override
+    protected BlankNode getBlankNode(final String identifier) {
+        return new BlankNodeImpl(SALT, identifier);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java
new file mode 100644
index 0000000..02f37f4
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java
@@ -0,0 +1,93 @@
+/**
+ * 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.io.IOException;
+import java.util.UUID;
+import java.util.function.Consumer;
+
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.Quad;
+import org.apache.commons.rdf.api.RDF;
+import org.apache.commons.rdf.experimental.RDFParser;
+import org.apache.commons.rdf.simple.experimental.AbstractRDFParser;
+import org.apache.commons.rdf.simple.experimental.RDFParseException;
+
+/**
+ * For test purposes - a {@link RDFParser} that inserts information about what
+ * it has been asked to parse instead of actually parsing anything.
+ * <p>
+ * This always insert at least the triple equivalent to:
+ * 
+ * <pre>
+ *    &lt;urn:uuid:b7ac3fcc-4d86-4d28-8358-a1cd094974a6&gt; &lt;http://example.com/greeting&gt; "Hello world" .
+ * </pre>
+ * 
+ * Additional triples match the corresponding getter in AbstractRDFParser, e.g.:
+ * 
+ * <pre>
+ *   &lt;urn:uuid:b7ac3fcc-4d86-4d28-8358-a1cd094974a6&gt; &lt;http://example.com/base&gt; &lt;http://www.example.org/&gt; .
+ *   &lt;urn:uuid:b7ac3fcc-4d86-4d28-8358-a1cd094974a6&gt; &lt;http://example.com/sourceFile&gt; "/tmp/file.ttl" .
+ * </pre>
+ * 
+ *
+ */
+public class DummyRDFParserBuilder extends AbstractRDFParser<DummyRDFParserBuilder> {
+
+    @Override
+    protected void parseSynchronusly() throws IOException, IllegalStateException, RDFParseException {
+        // From parseSynchronusly both of these are always present
+        final RDF factory = getRdfTermFactory().get();
+        final Consumer<Quad> t = getTarget();
+
+        // well - each parsing is unique. This should hopefully
+        // catch any accidental double parsing
+        final IRI parsing = factory.createIRI("urn:uuid:" + UUID.randomUUID());
+        t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/greeting"),
+                factory.createLiteral("Hello world")));
+
+        // Now we'll expose the finalized AbstractRDFParser settings
+        // so they can be inspected by the junit test
+
+        if (getSourceIri().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/source"),
+                    getSourceIri().get()));
+        }
+        if (getSourceFile().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/source"),
+                    factory.createIRI(getSourceFile().get().toUri().toString())));
+        }
+        if (getSourceInputStream().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/source"),
+                    factory.createBlankNode()));
+        }
+
+        if (getBase().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/base"), getBase().get()));
+        }
+        if (getContentType().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/contentType"),
+                    factory.createLiteral(getContentType().get())));
+        }
+        if (getContentTypeSyntax().isPresent()) {
+            t.accept(factory.createQuad(null, parsing, factory.createIRI("http://example.com/contentTypeSyntax"),
+                    factory.createLiteral(getContentTypeSyntax().get().name())));
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java
new file mode 100644
index 0000000..630ab07
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java
@@ -0,0 +1,48 @@
+/**
+ * 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 static org.junit.Assert.*;
+
+import org.apache.commons.rdf.api.AbstractDatasetTest;
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Assume;
+import org.junit.Test;
+
+/**
+ * Test SimpleRDF with AbstractGraphTest
+ */
+public class SimpleDatasetTest extends AbstractDatasetTest {
+
+    @Override
+    public RDF createFactory() {
+        return new SimpleRDF();
+    }
+
+    @Test
+    public void datasetToString() {
+        Assume.assumeNotNull(aliceName, companyName);
+        //System.out.println(dataset);
+        assertTrue(
+                dataset.toString().contains("<http://example.com/alice> <http://xmlns.com/foaf/0.1/name> \"Alice\" <http://example.com/graph1> ."));
+        assertTrue(dataset.toString().contains(" <http://xmlns.com/foaf/0.1/name> \"A company\" _:"));
+        assertTrue(dataset.toString().contains("<http://example.com/alice> <http://xmlns.com/foaf/0.1/isPrimaryTopicOf> <http://example.com/graph1> ."));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
new file mode 100644
index 0000000..bbbad55
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java
@@ -0,0 +1,47 @@
+/**
+ * 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 static org.junit.Assert.assertTrue;
+
+import org.apache.commons.rdf.api.AbstractGraphTest;
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Assume;
+import org.junit.Test;
+
+/**
+ * Test SimpleRDF with AbstractGraphTest
+ */
+public class SimpleGraphTest extends AbstractGraphTest {
+
+    @Override
+    public RDF createFactory() {
+        return new SimpleRDF();
+    }
+
+    @Test
+    public void graphToString() {
+        Assume.assumeNotNull(aliceName, companyName);
+        // System.out.println(graph);
+        assertTrue(
+                graph.toString().contains("<http://example.com/alice> <http://xmlns.com/foaf/0.1/name> \"Alice\" ."));
+        assertTrue(graph.toString().contains(" <http://xmlns.com/foaf/0.1/name> \"A company\" ."));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTest.java
new file mode 100644
index 0000000..31915de
--- /dev/null
+++ b/commons-rdf-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();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
new file mode 100644
index 0000000..c79746e
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java
@@ -0,0 +1,40 @@
+/**
+ * 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 static org.junit.Assert.fail;
+
+import java.util.ServiceLoader;
+
+import org.apache.commons.rdf.api.RDF;
+import org.junit.Test;
+
+public class SimpleServiceLoaderTest {
+
+    @Test
+    public void testServiceLoaderLookup() {
+        final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
+        for (final RDF impl : loader) {
+            if (impl instanceof SimpleRDF) {
+                return; // yay
+            }
+        }
+        fail("SimpleRDF not found in ServiceLoader");
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
new file mode 100644
index 0000000..4f28af7
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
@@ -0,0 +1,152 @@
+/**
+ * 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 static org.junit.Assert.assertEquals;
+
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.apache.commons.rdf.api.Graph;
+import org.apache.commons.rdf.api.IRI;
+import org.apache.commons.rdf.api.RDF;
+import org.apache.commons.rdf.api.Triple;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test writing graph
+ */
+public class TestWritingGraph {
+
+    /*
+     * 200k triples should do - about 7 MB on disk. Override with
+     * -Dtriples=20000000 to exercise your memory banks.
+     */
+    private static final long TRIPLES = Long.getLong("triples", 200000L);
+
+    /**
+     * Run tests with -Dkeepfiles=true to inspect /tmp files *
+     */
+    private static boolean KEEP_FILES = Boolean.getBoolean("keepfiles");
+
+    private static Graph graph;
+
+    private static RDF factory;
+
+    @BeforeClass
+    public static void createGraph() throws Exception {
+        factory = new SimpleRDF();
+        graph = factory.createGraph();
+        final IRI subject = factory.createIRI("subj");
+        final IRI predicate = factory.createIRI("pred");
+        final List<IRI> types = new ArrayList<>(Types.values());
+        // Ensure we don't try to create a literal with rdf:langString but
+        // without a language tag
+        types.remove(Types.RDF_LANGSTRING);
+        Collections.shuffle(types);
+        for (int i = 0; i < TRIPLES; i++) {
+            if (i % 11 == 0) {
+                graph.add(subject, predicate, factory.createBlankNode("Example " + i));
+            } else if (i % 5 == 0) {
+                graph.add(subject, predicate, factory.createLiteral("Example " + i, "en"));
+            } else if (i % 3 == 0) {
+                graph.add(subject, predicate, factory.createLiteral("Example " + i, types.get(i % types.size())));
+            } else {
+                graph.add(subject, predicate, factory.createLiteral("Example " + i));
+            }
+        }
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+        graph.clear();
+        graph = null;
+    }
+
+    @Test
+    public void createGraphTiming() throws Exception {
+        createGraph();
+    }
+
+    @Test
+    public void countQuery() {
+        final IRI subject = factory.createIRI("subj");
+        final IRI predicate = factory.createIRI("pred");
+        final long count = graph.stream(subject, predicate, null).unordered().parallel().count();
+        // System.out.println("Counted - " + count);
+        assertEquals(count, TRIPLES);
+    }
+
+    public static String tripleAsString(final Triple t) {
+        return t.getSubject().ntriplesString() + " " + t.getPredicate().ntriplesString() + " "
+                + t.getObject().ntriplesString() + " .";
+    }
+
+    @Test
+    public void writeGraphFromStream() throws Exception {
+        final Path graphFile = Files.createTempFile("graph", ".nt");
+        if (KEEP_FILES) {
+            System.out.println("From stream: " + graphFile);
+        } else {
+            graphFile.toFile().deleteOnExit();
+        }
+
+        final Stream<CharSequence> stream = graph.stream().map(TestWritingGraph::tripleAsString);
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
+    }
+
+    @Test
+    public void writeGraphFromStreamFiltered() throws Exception {
+        final Path graphFile = Files.createTempFile("graph", ".nt");
+        if (KEEP_FILES) {
+            System.out.println("Filtered stream: " + graphFile);
+        } else {
+            graphFile.toFile().deleteOnExit();
+        }
+
+        final IRI subject = factory.createIRI("subj");
+        final IRI predicate = factory.createIRI("pred");
+        final Stream<CharSequence> stream = graph.stream(subject, predicate, null).map(TestWritingGraph::tripleAsString);
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
+
+    }
+
+    @Test
+    public void writeGraphFromStreamFilteredNoMatches() throws Exception {
+        final Path graphFile = Files.createTempFile("graph-empty-", ".nt");
+        if (KEEP_FILES) {
+            System.out.println("Filtered stream: " + graphFile);
+        } else {
+            graphFile.toFile().deleteOnExit();
+        }
+
+        final IRI subject = factory.createIRI("nonexistent");
+        final IRI predicate = factory.createIRI("pred");
+        final Stream<CharSequence> stream = graph.stream(subject, predicate, null).map(Object::toString);
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TypesTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TypesTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TypesTest.java
new file mode 100644
index 0000000..f199d9e
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TypesTest.java
@@ -0,0 +1,62 @@
+/**
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Tests for the {@link org.apache.commons.rdf.simple.Types} enumeration.
+ */
+public class TypesTest {
+
+    /**
+     * Test method for
+     * {@link org.apache.commons.rdf.simple.Types#getIRIString()} .
+     */
+    @Test
+    public final void testGetIRIString() {
+        assertEquals("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString", Types.RDF_LANGSTRING.getIRIString());
+    }
+
+    /**
+     * Test method for
+     * {@link org.apache.commons.rdf.simple.Types#ntriplesString()}.
+     */
+    @Test
+    public final void testNtriplesString() {
+        assertEquals("<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>", Types.RDF_LANGSTRING.ntriplesString());
+    }
+
+    /**
+     * Test method for
+     * {@link org.apache.commons.rdf.simple.Types#get(org.apache.commons.rdf.api.IRI)}
+     * .
+     */
+    @Test
+    public final void testGet() {
+        assertTrue(Types.get(new IRIImpl("http://www.w3.org/2001/XMLSchema#boolean")).isPresent());
+        assertEquals("http://www.w3.org/2001/XMLSchema#boolean",
+                Types.get(new IRIImpl("http://www.w3.org/2001/XMLSchema#boolean")).get().getIRIString());
+        assertFalse(Types.get(new IRIImpl("http://www.w3.org/2001/XMLSchema#nonExistent")).isPresent());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
----------------------------------------------------------------------
diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
new file mode 100644
index 0000000..68f686b
--- /dev/null
+++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
@@ -0,0 +1,279 @@
+/**
+ * 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.experimental;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeNotNull;
+import static org.apache.commons.rdf.api.RDFSyntax.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.concurrent.TimeUnit;
+
+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.RDFSyntax;
+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.experimental.RDFParser;
+import org.apache.commons.rdf.simple.DummyRDFParserBuilder;
+import org.apache.commons.rdf.simple.SimpleRDF;
+import org.apache.commons.rdf.simple.Types;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+public class AbstractRDFParserTest {
+
+    private final RDF factory = new SimpleRDF();
+
+    private final DummyRDFParserBuilder dummyParser = new DummyRDFParserBuilder();
+    private Path testNt;
+    private Path testTtl;
+    private Path testXml;
+
+	private Path symlink;
+    
+    @Before
+    public void createTempFile() throws IOException {
+        testNt = Files.createTempFile("test", ".nt");
+        testTtl = Files.createTempFile("test", ".ttl");
+        testXml = Files.createTempFile("test", ".xml");
+        // No need to populate the files as the dummy parser
+        // doesn't actually read anything
+        
+        // If supported, we'll make a symbolic link
+        Path symlinks = Files.createTempDirectory("symlinked");
+        try { 
+        	symlink = Files.createSymbolicLink(
+        				symlinks.resolve("linked.ttl"), testNt);
+        } catch (IOException|UnsupportedOperationException ex) {
+        	symlink = null;
+        }
+    }
+
+    @After
+    public void deleteTempFiles() throws IOException {
+        Files.deleteIfExists(testNt);
+        Files.deleteIfExists(testTtl);
+        Files.deleteIfExists(testXml);
+    }
+
+    @Test
+    public void guessRDFSyntax() throws Exception {
+        assertEquals(RDFSyntax.NTRIPLES, AbstractRDFParser.guessRDFSyntax(testNt).get());
+        assertEquals(RDFSyntax.TURTLE, AbstractRDFParser.guessRDFSyntax(testTtl).get());
+        assertFalse(AbstractRDFParser.guessRDFSyntax(testXml).isPresent());
+    }
+
+    private void checkGraph(final Graph g) throws Exception {
+        assertTrue(g.size() > 0);
+        final IRI greeting = factory.createIRI("http://example.com/greeting");
+        // Should only have parsed once!
+        assertEquals(1, g.stream(null, greeting, null).count());
+        final Triple triple = g.stream(null, greeting, null).findAny().get();
+        assertTrue(triple.getSubject() instanceof IRI);
+        final IRI parsing = (IRI) triple.getSubject();
+        assertTrue(parsing.getIRIString().startsWith("urn:uuid:"));
+
+        assertEquals("http://example.com/greeting", triple.getPredicate().getIRIString());
+
+        assertTrue(triple.getObject() instanceof Literal);
+        final Literal literal = (Literal) triple.getObject();
+        assertEquals("Hello world", literal.getLexicalForm());
+        assertFalse(literal.getLanguageTag().isPresent());
+        assertEquals(Types.XSD_STRING, literal.getDatatype());
+
+        // Check uniqueness of properties that are always present
+        assertEquals(1, g.stream(null, factory.createIRI("http://example.com/source"), null).count());
+
+        // Check optional properties that are unique
+        assertTrue(2 > g.stream(null, factory.createIRI("http://example.com/base"), null).count());
+        assertTrue(2 > g.stream(null, factory.createIRI("http://example.com/contentType"), null).count());
+        assertTrue(2 > g.stream(null, factory.createIRI("http://example.com/contentTypeSyntax"), null).count());
+    }
+
+    @Test
+    public void parseFile() throws Exception {
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(testNt).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        // FIXME: this could potentially break if the equivalent of /tmp
+        // includes
+        // international characters
+        assertEquals("<" + testNt.toUri().toString() + ">", firstPredicate(g, "source"));
+        // Should be set to the file path - after following symlinks
+        assertEquals("<" + testNt.toRealPath().toUri().toString() + ">", firstPredicate(g, "base"));
+
+        // Should NOT have guessed the content type
+        assertNull(firstPredicate(g, "contentType"));
+        assertNull(firstPredicate(g, "contentTypeSyntax"));
+    }
+
+    @Test
+    public void parseFileSymlink() throws Exception {
+    	// This test will typically not work in Windows
+    	// which requires system privileges to create symlinks 
+    	assumeNotNull(symlink);
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(symlink).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        assertEquals("<" + symlink.toUri().toString() + ">", firstPredicate(g, "source"));
+        assertEquals("<" + testNt.toRealPath().toUri().toString() + ">", firstPredicate(g, "base"));
+    }    
+
+    @Test
+    public void parseNoSource() throws Exception {
+        thrown.expect(IllegalStateException.class);
+        dummyParser.parse();
+    }
+
+    @Test
+    public void parseBaseAndContentTypeNoSource() throws Exception {
+        // Can set the other options, even without source()
+        final IRI base = dummyParser.createRDFTermFactory().createIRI("http://www.example.org/test.rdf");
+        final RDFParser parser = dummyParser.base(base).contentType(RDFSyntax.RDFXML);
+        thrown.expect(IllegalStateException.class);
+        thrown.expectMessage("No source has been set");
+        // but .parse() should fail
+        parser.parse();
+    }
+
+    @Test
+    public void parseFileMissing() throws Exception {
+        Files.delete(testNt);
+        // This should not fail yet
+        final RDFParser parser = dummyParser.source(testNt);
+        // but here:
+        thrown.expect(IOException.class);
+        parser.parse();
+    }
+
+    @Test
+    public void parseFileContentType() throws Exception {
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(testNt).contentType(RDFSyntax.NTRIPLES).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        // FIXME: this could potentially break if the equivalent of /tmp
+        // includes
+        // international characters
+        assertEquals("<" + testNt.toUri().toString() + ">", firstPredicate(g, "source"));
+        // Should be set to the file path - after following symlinks
+        assertEquals("<" + testNt.toRealPath().toUri().toString() + ">", firstPredicate(g, "base"));
+        assertEquals("\"" + RDFSyntax.NTRIPLES.name() + "\"", 
+                firstPredicate(g, "contentTypeSyntax"));
+        assertEquals("\"application/n-triples\"", firstPredicate(g, "contentType"));
+    }
+
+    private String firstPredicate(final Graph g, final String pred) {
+        return g.stream(null, factory.createIRI("http://example.com/" + pred), null).map(Triple::getObject)
+                .map(RDFTerm::ntriplesString).findAny().orElse(null);
+    }
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    @Test
+    public void parseInputStreamFailsIfBaseMissing() throws Exception {
+        final InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+        // Should not fail at this point
+        final RDFParser parser = dummyParser.source(inputStream);
+        // but here:
+        thrown.expect(IllegalStateException.class);
+        thrown.expectMessage("base iri required for inputstream source");
+        parser.parse();
+    }
+
+    @Test
+    public void parseInputStreamWithBase() throws Exception {
+        final InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+        final IRI base = dummyParser.createRDFTermFactory().createIRI("http://www.example.org/test.rdf");
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(inputStream).base(base).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        assertEquals("<http://www.example.org/test.rdf>", firstPredicate(g, "base"));
+        // in our particular debug output,
+        // bnode source indicates InputStream
+        assertTrue(firstPredicate(g, "source").startsWith("_:"));
+        assertNull(firstPredicate(g, "contentType"));
+        assertNull(firstPredicate(g, "contentTypeSyntax"));
+    }
+
+    @Test
+    public void parseInputStreamWithNQuads() throws Exception {
+        final InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(inputStream).contentType(RDFSyntax.NQUADS).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        assertNull(firstPredicate(g, "base"));
+        // in our particular debug output,
+        // bnode source indicates InputStream
+        assertTrue(firstPredicate(g, "source").startsWith("_:"));
+        assertEquals("\"application/n-quads\"", firstPredicate(g, "contentType"));
+        assertEquals("\"" + RDFSyntax.NQUADS.name() + "\"", 
+                firstPredicate(g, "contentTypeSyntax"));
+    }
+
+    @Test
+    public void parseIRI() throws Exception {
+        final IRI iri = dummyParser.createRDFTermFactory().createIRI("http://www.example.net/test.ttl");
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(iri).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        assertEquals("<http://www.example.net/test.ttl>", firstPredicate(g, "source"));
+        // No base - assuming the above IRI is always
+        // the base would break server-supplied base from
+        // any HTTP Location redirects and Content-Location header
+        assertNull(firstPredicate(g, "base"));
+        // ".ttl" in IRI string does not imply any content type
+        assertNull(firstPredicate(g, "contentType"));
+        assertNull(firstPredicate(g, "contentTypeSyntax"));
+
+    }
+
+    @Test
+    public void parseIRIBaseContentType() throws Exception {
+        final IRI iri = dummyParser.createRDFTermFactory().createIRI("http://www.example.net/test.ttl");
+        final Graph g = factory.createGraph();
+        final RDFParser parser = dummyParser.source(iri).base(iri).contentType(RDFSyntax.TURTLE).target(g);
+        parser.parse().get(5, TimeUnit.SECONDS);
+        checkGraph(g);
+        assertEquals("<http://www.example.net/test.ttl>", firstPredicate(g, "source"));
+        assertEquals("<http://www.example.net/test.ttl>", firstPredicate(g, "base"));
+        assertEquals("\"" + RDFSyntax.TURTLE.name() + "\"", 
+                firstPredicate(g, "contentTypeSyntax"));
+        assertEquals("\"text/turtle\"", firstPredicate(g, "contentType"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/examples/README.md
----------------------------------------------------------------------
diff --git a/examples/README.md b/examples/README.md
deleted file mode 100644
index 6d970e4..0000000
--- a/examples/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements. See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership. The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-
-# Examples of using Commons RDF
-
-[UserGuideTest.java](src/example/UserGuideTest.java) contains the source code
-of the examples in the 
-[Commons RDF user guide](http://commonsrdf.incubator.apache.org/userguide.html).
-
-## Usage
-
-Update [pom.xml](pom.xml) to the latest versions of `commons-rdf-api`
-and `commons-rdf-simple`.
-
-Ensure you have Java 8 installed and configured as `JAVA_HOME`.
-
-Use [Apache Maven 3](http://maven.apache.org/download.cgi) and run:
-
-    mvn clean install

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
deleted file mode 100644
index 995cfae..0000000
--- a/examples/pom.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <!-- NOTE: Deliberately not using parent pom and separate groupId/artifactId
-    
-    This module should not be built as part of a release.  
-    -->
-    <name>Commons RDF: Examples</name>
-    
-    <groupId>com.example</groupId> <!--  Change to your groupId -->
-    <artifactId>commons-rdf-examples</artifactId> <!-- Change to your artifactId -->
-    <version>0.1</version>
-
-    <properties>
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
-    </properties>
-
-    <build>
-      <!-- simplify folder structure for this example -
-           real projects should use regular
-           src/main/java
-           src/test/java
-      -->
-      <testSourceDirectory>src</testSourceDirectory>
-      <sourceDirectory>src-2</sourceDirectory> <!-- not used -->
-    </build>
-
-    <distributionManagement>
-      <site>
-        <id>commonsrdf-api-site</id>
-        <url>scm:svn:${commons.scmPubUrl}/examples/</url>
-      </site>
-    </distributionManagement>
-
-    <dependencies>
-    	<dependency>
-    		<groupId>org.apache.commons</groupId>
-    		<artifactId>commons-rdf-api</artifactId>
-        <!-- update to latest version -->
-    		<version>0.3.0</version>
-    	</dependency>
-    	<dependency>
-    		<groupId>org.apache.commons</groupId>
-    		<artifactId>commons-rdf-simple</artifactId>
-        <!-- update to latest version -->
-    		<version>0.3.0</version>
-    	</dependency>
-    	<dependency>
-    		<groupId>junit</groupId>
-    		<artifactId>junit</artifactId>
-    		<version>4.12</version>
-    		<scope>test</scope>
-    	</dependency>
-    </dependencies>
-
-    <repositories>
-      <!-- Only needed if testing  release of commons-rdf -->
-    	<repository>
-    		<id>apache.snapshots</id>
-    		<name>Apache Snapshot Repository</name>
-    		<url>http://repository.apache.org/snapshots</url>
-    		<releases>
-    			<enabled>false</enabled>
-    		</releases>
-    	</repository>
-    </repositories>
-
-</project>

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/examples/src/example/IntroToRDF.java
----------------------------------------------------------------------
diff --git a/examples/src/example/IntroToRDF.java b/examples/src/example/IntroToRDF.java
deleted file mode 100644
index 9de1297..0000000
--- a/examples/src/example/IntroToRDF.java
+++ /dev/null
@@ -1,149 +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 example;
-
-import java.util.Optional;
-import org.apache.commons.rdf.api.*;
-import org.apache.commons.rdf.simple.SimpleRDF;
-import org.apache.commons.rdf.simple.Types;
-
-/** See http://commonsrdf.incubator.apache.org/introduction.html
- */
-public class IntroToRDF {
-    public static void main(String[] args) {
-      RDF rdf = new SimpleRDF();
-
-      IRI alice = rdf.createIRI("Alice");
-      System.out.println(alice.ntriplesString());
-
-      IRI knows = rdf.createIRI("knows");
-      IRI bob = rdf.createIRI("Bob");
-
-      Triple aliceKnowsBob = rdf.createTriple(alice, knows, bob);
-      System.out.println(aliceKnowsBob.getSubject().ntriplesString());
-
-      System.out.println(aliceKnowsBob);
-
-      Graph graph = rdf.createGraph();
-      graph.add(aliceKnowsBob);
-
-      IRI charlie = rdf.createIRI("Charlie");
-
-      IRI plays = rdf.createIRI("plays");
-
-      IRI football = rdf.createIRI("Football");
-      IRI tennis = rdf.createIRI("Tennis");
-
-      graph.add(alice, knows, charlie);
-      graph.add(alice, plays, tennis);
-      graph.add(bob, knows, charlie);
-      graph.add(bob, plays, football);
-      graph.add(charlie, plays, tennis);
-
-      System.out.println("Who plays Tennis?");
-      for (Triple triple : graph.iterate(null, plays, tennis)) {
-          System.out.println(triple.getSubject());
-          System.out.println(plays.equals(triple.getPredicate()));
-          System.out.println(tennis.equals(triple.getObject()));
-      }
-
-      System.out.println("Who does Alice know?");
-      for (Triple triple : graph.iterate(alice, knows, null)) {
-          System.out.println(triple.getObject());
-      }
-
-
-      System.out.println("Does Alice anyone that plays Football?");
-      for (Triple triple : graph.iterate(alice, knows, null)) {
-          RDFTerm aliceFriend = triple.getObject();
-          if (! (aliceFriend instanceof BlankNodeOrIRI)) {
-              continue;
-          }
-          if (graph.contains( (BlankNodeOrIRI)aliceFriend, plays, football)) {
-              System.out.println("Yes, it is " + aliceFriend);
-          }
-      }
-
-      Literal aliceName = rdf.createLiteral("Alice W. Land");
-      IRI name = rdf.createIRI("name");
-      graph.add(alice, name, aliceName);
-
-      Optional<? extends Triple> nameTriple = graph.stream(alice, name, null).findAny();
-      if (nameTriple.isPresent()) {
-          System.out.println(nameTriple.get());
-      }
-
-
-      graph.stream(alice, name, null)
-              .findAny().map(Triple::getObject)
-              .filter(obj -> obj instanceof Literal)
-              .map(literalName -> ((Literal)literalName).getLexicalForm())
-              .ifPresent(System.out::println);
-
-      IRI playerRating = rdf.createIRI("playerRating");
-      Literal aliceRating = rdf.createLiteral("13.37", Types.XSD_FLOAT);
-      graph.add(alice, playerRating, aliceRating);
-
-      Literal footballInEnglish = rdf.createLiteral("football", "en");
-      Literal footballInNorwegian = rdf.createLiteral("fotball", "no");
-      graph.add(football, name, footballInEnglish);
-      graph.add(football, name, footballInNorwegian);
-
-      Literal footballInAmericanEnglish = rdf.createLiteral("soccer", "en-US");
-      graph.add(football, name, footballInAmericanEnglish);
-
-      BlankNode someone = rdf.createBlankNode();
-      graph.add(charlie, knows, someone);
-      graph.add(someone, plays, football);
-
-      BlankNode someoneElse = rdf.createBlankNode();
-      graph.add(charlie, knows, someoneElse);
-
-      for (Triple heKnows : graph.iterate(charlie, knows, null)) {
-          if (! (heKnows.getObject() instanceof BlankNodeOrIRI)) {
-              continue;
-          }
-          BlankNodeOrIRI who = (BlankNodeOrIRI)heKnows.getObject();
-          System.out.println("Charlie knows "+ who);
-          for (Triple whoPlays : graph.iterate(who, plays, null)) {
-              System.out.println("  who plays " + whoPlays.getObject());
-          }
-      }
-
-      // Delete previous BlankNode statements
-      graph.remove(null,null,someone);
-      graph.remove(someone,null,null);
-
-      // no Java variable for the new BlankNode instance
-      graph.add(charlie, knows, rdf.createBlankNode("someone"));
-      // at any point later (with the same RDF instance)
-      graph.add(rdf.createBlankNode("someone"), plays, football);
-
-      for (Triple heKnows : graph.iterate(charlie, knows, null)) {
-          if (! (heKnows.getObject() instanceof BlankNodeOrIRI)) {
-              continue;
-          }
-          BlankNodeOrIRI who = (BlankNodeOrIRI)heKnows.getObject();
-          System.out.println("Charlie knows "+ who);
-          for (Triple whoPlays : graph.iterate(who, plays, null)) {
-              System.out.println("  who plays " + whoPlays.getObject());
-          }
-      }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/examples/src/example/IntroToRDFTest.java
----------------------------------------------------------------------
diff --git a/examples/src/example/IntroToRDFTest.java b/examples/src/example/IntroToRDFTest.java
deleted file mode 100644
index 4399355..0000000
--- a/examples/src/example/IntroToRDFTest.java
+++ /dev/null
@@ -1,30 +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 example;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class IntroToRDFTest {
-
-  @Test
-  public void runIntroToRDF() {
-    IntroToRDF.main(new String[0]);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/examples/src/example/UserGuideTest.java
----------------------------------------------------------------------
diff --git a/examples/src/example/UserGuideTest.java b/examples/src/example/UserGuideTest.java
deleted file mode 100644
index f0ec618..0000000
--- a/examples/src/example/UserGuideTest.java
+++ /dev/null
@@ -1,259 +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 example;
-
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Optional;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-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.IRI;
-import org.apache.commons.rdf.api.Literal;
-import org.apache.commons.rdf.api.Quad;
-import org.apache.commons.rdf.api.QuadLike;
-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.api.TripleLike;
-import org.apache.commons.rdf.simple.SimpleRDF;
-import org.apache.commons.rdf.simple.Types;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UserGuideTest {
-
-    private RDF factory;
-
-    @Before
-    public void factory() {
-        factory = new SimpleRDF();
-    }
-
-    @Test
-    public void creating() throws Exception {
-        BlankNode aliceBlankNode = factory.createBlankNode();
-        IRI nameIri = factory.createIRI("http://example.com/name");
-        Literal aliceLiteral = factory.createLiteral("Alice");
-        Triple triple = factory.createTriple(aliceBlankNode, nameIri, aliceLiteral);
-
-        System.out.println(aliceBlankNode.ntriplesString());
-        System.out.println(nameIri.ntriplesString());
-        System.out.println(aliceLiteral.ntriplesString());
-
-    }
-
-    @Test
-    public void ntriples() throws Exception {
-        IRI iri = factory.createIRI("http://example.com/alice");
-        System.out.println(iri.getIRIString());
-
-        IRI iri2 = factory.createIRI("http://example.com/alice");
-        System.out.println(iri.equals(iri2));
-
-        IRI iri3 = factory.createIRI("http://example.com/alice/./");
-        System.out.println(iri.equals(iri3));
-
-        System.out.println(iri.equals("http://example.com/alice"));
-        System.out.println(iri.equals(factory.createLiteral("http://example.com/alice")));
-
-    }
-
-    @Test
-    public void blanknode() throws Exception {
-        BlankNode bnode = factory.createBlankNode();
-        System.out.println(bnode.equals(bnode));
-        System.out.println(bnode.equals(factory.createBlankNode()));
-
-        BlankNode b1 = factory.createBlankNode("b1");
-
-        System.out.println(b1.ntriplesString());
-
-        System.out.println(b1.equals(factory.createBlankNode("b1")));
-        System.out.println(b1.equals(new SimpleRDF().createBlankNode("b1")));
-
-        System.out.println(bnode.uniqueReference());
-    }
-
-    @Test
-    public void literal() throws Exception {
-        Literal literal = factory.createLiteral("Hello world!");
-        System.out.println(literal.ntriplesString());
-
-        String lexical = literal.getLexicalForm();
-        System.out.println(lexical);
-
-        IRI datatype = literal.getDatatype();
-        System.out.println(datatype.ntriplesString());
-
-        IRI xsdDouble = factory.createIRI("http://www.w3.org/2001/XMLSchema#double");
-        Literal literalDouble = factory.createLiteral("13.37", xsdDouble);
-        System.out.println(literalDouble.ntriplesString());
-
-        Literal literalDouble2 = factory.createLiteral("13.37", Types.XSD_DOUBLE);
-
-        System.out.println(Types.XSD_STRING.equals(literal.getDatatype()));
-
-        Literal inSpanish = factory.createLiteral("¡Hola, Mundo!", "es");
-        System.out.println(inSpanish.ntriplesString());
-        System.out.println(inSpanish.getLexicalForm());
-        System.out.println(inSpanish.getDatatype().ntriplesString());
-
-        Optional<String> tag = inSpanish.getLanguageTag();
-        if (tag.isPresent()) {
-            System.out.println(tag.get());
-        }
-
-        System.out.println(literal.getLanguageTag().isPresent());
-        System.out.println(literalDouble.getLanguageTag().isPresent());
-    }
-
-    @Test
-    public void triple() throws Exception {
-        BlankNodeOrIRI subject = factory.createBlankNode();
-        IRI predicate = factory.createIRI("http://example.com/says");
-        RDFTerm object = factory.createLiteral("Hello");
-        Triple triple = factory.createTriple(subject, predicate, object);
-
-        BlankNodeOrIRI subj = triple.getSubject();
-        System.out.println(subj.ntriplesString());
-
-        IRI pred = triple.getPredicate();
-        System.out.println(pred.getIRIString());
-
-        RDFTerm obj = triple.getObject();
-        System.out.println(obj.ntriplesString());
-
-        if (subj instanceof IRI) {
-            String s = ((IRI) subj).getIRIString();
-            System.out.println(s);
-        }
-        // ..
-        if (obj instanceof Literal) {
-            IRI type = ((Literal) obj).getDatatype();
-            System.out.println(type);
-        }
-
-        // Equal triples must have same s,p,o
-        System.out.println(triple.equals(factory.createTriple(subj, pred, obj)));
-    }
-
-    @Test
-    public void quad() throws Exception {
-        BlankNodeOrIRI graph = factory.createIRI("http://example.com/graph");
-        BlankNodeOrIRI subject = factory.createBlankNode();
-        IRI predicate = factory.createIRI("http://example.com/says");
-        RDFTerm object = factory.createLiteral("Hello");
-        Quad quad = factory.createQuad(graph, subject, predicate, object);
-
-        Optional<BlankNodeOrIRI> g = quad.getGraphName();
-        if (g.isPresent()) {
-            System.out.println(g.get().ntriplesString());
-        }
-
-        BlankNodeOrIRI subj = quad.getSubject();
-        System.out.println(subj.ntriplesString());
-
-        // null means default graph
-        Quad otherQuad = factory.createQuad(null, subject, predicate, object);
-        // Equal quads must have same g,s,p,o
-        System.out.println(quad.equals(otherQuad));
-
-        // all quads can be viewed as triples - "stripping" the graph
-        Triple asTriple = quad.asTriple();
-        Triple otherAsTriple = quad.asTriple();
-        System.out.println(asTriple.equals(otherAsTriple));
-
-        // NOTE: Quad does NOT extend Triple, however both Triple and Quad
-        // extend TripleLike
-
-        TripleLike a = quad;
-        TripleLike b = quad.asTriple();
-        // Unlike Triple and Quad, TripleLike does not mandate any .equals(),
-        // it just provides common access to getSubject(), getPredicate(),
-        // getObject()
-
-        // TripleLike supports generalized RDF - therefore all s/p/o are of type
-        // RDFTerm
-        RDFTerm s = a.getSubject();
-    }
-
-    @Test
-    public void graph() throws Exception {
-        IRI nameIri = factory.createIRI("http://example.com/name");
-        BlankNode aliceBlankNode = factory.createBlankNode();
-        Literal aliceLiteral = factory.createLiteral("Alice");
-        Triple triple = factory.createTriple(aliceBlankNode, nameIri, aliceLiteral);
-
-        Graph graph = factory.createGraph();
-
-        graph.add(triple);
-
-        IRI bob = factory.createIRI("http://example.com/bob");
-        Literal bobName = factory.createLiteral("Bob");
-        graph.add(bob, nameIri, bobName);
-
-        System.out.println(graph.contains(triple));
-
-        System.out.println(graph.contains(null, nameIri, bobName));
-
-        System.out.println(graph.size());
-
-        for (Triple t : graph.iterate()) {
-            System.out.println(t.getObject());
-        }
-
-        for (Triple t : graph.iterate(null, null, bobName)) {
-            System.out.println(t.getPredicate());
-        }
-
-        try (Stream<? extends Triple> triples = graph.stream()) {
-            Stream<RDFTerm> subjects = triples.map(t -> t.getObject());
-            String s = subjects.map(RDFTerm::ntriplesString).collect(Collectors.joining(" "));
-            System.out.println(s);
-        }
-
-        try (Stream<? extends Triple> named = graph.stream(null, nameIri, null)) {
-            Stream<? extends Triple> namedB = named.filter(t -> t.getObject().ntriplesString().contains("B"));
-            System.out.println(namedB.map(t -> t.getSubject()).findAny().get());
-        }
-
-        graph.remove(triple);
-        System.out.println(graph.contains(triple));
-
-        graph.remove(null, nameIri, null);
-
-        graph.clear();
-        System.out.println(graph.contains(null, null, null));
-
-    }
-
-    public static String tripleAsString(Triple t) {
-        return t.getSubject().ntriplesString() + " " + t.getPredicate().ntriplesString() + " "
-                + t.getObject().ntriplesString() + " .";
-    }
-
-    public static void writeGraph(Graph graph, Path graphFile) throws Exception {
-        Stream<CharSequence> stream = graph.stream().map(UserGuideTest::tripleAsString);
-        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
-    }
-}

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
deleted file mode 100644
index 7d9c44c..0000000
--- a/integration-tests/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.apache.commons</groupId>
-		<artifactId>commons-rdf-parent</artifactId>
-		<version>0.5.0-SNAPSHOT</version>
-	</parent>
-	<artifactId>commons-rdf-integration-tests</artifactId>
-	<name>Commons RDF Integration tests</name>
-	<dependencies>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>commons-rdf-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>commons-rdf-simple</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>commons-rdf-rdf4j</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>commons-rdf-jena</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<!-- NOTE: This might be quite version-sensitive (including transitives) 
-			See the JSONLDParsingTest.
-			 -->
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>commons-rdf-jsonld-java</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-	</dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/d59203ce/integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java
----------------------------------------------------------------------
diff --git a/integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java b/integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java
deleted file mode 100644
index f6082b7..0000000
--- a/integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java
+++ /dev/null
@@ -1,171 +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.integrationtests;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.rdf.api.BlankNode;
-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.RDF;
-import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.commons.rdf.api.Triple;
-import org.apache.commons.rdf.jena.JenaRDF;
-import org.apache.commons.rdf.jsonldjava.JsonLdRDF;
-import org.apache.commons.rdf.rdf4j.RDF4J;
-import org.apache.commons.rdf.simple.SimpleRDF;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
-public class AllToAllTest {
-
-    private final RDF nodeFactory;
-    private final RDF graphFactory;
-
-    public AllToAllTest(final Class<? extends RDF> from, final Class<? extends RDF> to)
-            throws InstantiationException, IllegalAccessException {
-        this.nodeFactory = from.newInstance();
-        this.graphFactory = to.newInstance();
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Parameters(name = "{index}: {0}->{1}")
-    public static Collection<Object[]> data() {
-        final List<Class> factories = Arrays.asList(SimpleRDF.class, JenaRDF.class, RDF4J.class, JsonLdRDF.class);
-        final Collection<Object[]> allToAll = new ArrayList<>();
-        for (final Class from : factories) {
-            for (final Class to : factories) {
-                // NOTE: we deliberately include self-to-self here
-                // to test two instances of the same implementation
-                allToAll.add(new Object[] { from, to });
-            }
-        }
-        return allToAll;
-    }
-
-    /**
-     * This test creates a {@link Graph} with the first {@link RDF},
-     * then inserts/queries with triples using {@link RDFTerm}s created with the
-     * second factory.
-     *
-     * @throws Exception
-     *             Just in case..
-     */
-    @Test
-    public void addTermsFromOtherFactory() throws Exception {
-        final Graph g = graphFactory.createGraph();
-        final BlankNode s = nodeFactory.createBlankNode();
-        final IRI p = nodeFactory.createIRI("http://example.com/p");
-        final Literal o = nodeFactory.createLiteral("Hello");
-
-        g.add(s, p, o);
-
-        // blankNode should still work with g.contains()
-        assertTrue(g.contains(s, p, o));
-        final Triple t1 = g.stream().findAny().get();
-
-        // Can't make assumptions about BlankNode equality - it might
-        // have been mapped to a different BlankNode.uniqueReference()
-        // assertEquals(s, t.getSubject());
-
-        assertEquals(p, t1.getPredicate());
-        assertEquals(o, t1.getObject());
-
-        final IRI s2 = nodeFactory.createIRI("http://example.com/s2");
-        g.add(s2, p, s);
-        assertTrue(g.contains(s2, p, s));
-
-        // This should be mapped to the same BlankNode
-        // (even if it has a different identifier), e.g.
-        // we should be able to do:
-
-        final Triple t2 = g.stream(s2, p, null).findAny().get();
-
-        final BlankNode bnode = (BlankNode) t2.getObject();
-        // And that (possibly adapted) BlankNode object should
-        // match the subject of t1 statement
-        assertEquals(bnode, t1.getSubject());
-        // And can be used as a key:
-        final Triple t3 = g.stream(bnode, p, null).findAny().get();
-        assertEquals(t1, t3);
-    }
-
-    /**
-     * This is a variation of {@link #addTermsFromOtherFactory()}, but here
-     * {@link Triple} is created in the "foreign" nodeFactory before adding to
-     * the graph.
-     * 
-     * @throws Exception
-     *             Just in case..
-     */
-    @Test
-    public void addTriplesFromOtherFactory() throws Exception {
-        final Graph g = graphFactory.createGraph();
-        final BlankNode s = nodeFactory.createBlankNode();
-        final IRI p = nodeFactory.createIRI("http://example.com/p");
-        final Literal o = nodeFactory.createLiteral("Hello");
-
-        final Triple srcT1 = nodeFactory.createTriple(s, p, o);
-        // This should work even with BlankNode as they are from the same
-        // factory
-        assertEquals(s, srcT1.getSubject());
-        assertEquals(p, srcT1.getPredicate());
-        assertEquals(o, srcT1.getObject());
-        g.add(srcT1);
-
-        // what about the blankNode within?
-        assertTrue(g.contains(srcT1));
-        final Triple t1 = g.stream().findAny().get();
-
-        // Can't make assumptions about BlankNode equality - it might
-        // have been mapped to a different BlankNode.uniqueReference()
-        // assertEquals(srcT1, t1);
-        // assertEquals(s, t1.getSubject());
-        assertEquals(p, t1.getPredicate());
-        assertEquals(o, t1.getObject());
-
-        final IRI s2 = nodeFactory.createIRI("http://example.com/s2");
-        final Triple srcT2 = nodeFactory.createTriple(s2, p, s);
-        g.add(srcT2);
-        assertTrue(g.contains(srcT2));
-
-        // This should be mapped to the same BlankNode
-        // (even if it has a different identifier), e.g.
-        // we should be able to do:
-
-        final Triple t2 = g.stream(s2, p, null).findAny().get();
-
-        final BlankNode bnode = (BlankNode) t2.getObject();
-        // And that (possibly adapted) BlankNode object should
-        // match the subject of t1 statement
-        assertEquals(bnode, t1.getSubject());
-        // And can be used as a key:
-        final Triple t3 = g.stream(bnode, p, null).findAny().get();
-        assertEquals(t1, t3);
-    }
-}


Mime
View raw message