Repository: incubator-commonsrdf Updated Branches: refs/heads/master 6aa5a5d0d -> 413dd09a6
RDFTermFactory -> RDFFactory Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/c82f15ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/c82f15ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/c82f15ee Branch: refs/heads/master Commit: c82f15ee25b0cbee4528a3a72b37503182bd01cc Parents: 0bb9369 Author: Stian Soiland-Reyes <st...@apache.org> Authored: Wed Oct 19 17:03:09 2016 +0100 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Wed Oct 19 17:03:09 2016 +0100 ---------------------------------------------------------------------- .../org/apache/commons/rdf/api/BlankNode.java | 6 +- .../java/org/apache/commons/rdf/api/Quad.java | 2 +- .../org/apache/commons/rdf/api/RDFFactory.java | 278 +++++++++++++++++++ .../apache/commons/rdf/api/RDFTermFactory.java | 278 ------------------- .../java/org/apache/commons/rdf/api/Triple.java | 2 +- .../apache/commons/rdf/api/package-info.java | 2 +- .../commons/rdf/experimental/RDFParser.java | 12 +- .../commons/rdf/api/AbstractGraphTest.java | 14 +- .../rdf/api/AbstractRDFTermFactoryTest.java | 14 +- .../rdf/api/DefaultRDFTermFactoryTest.java | 6 +- examples/src/example/UserGuideTest.java | 4 +- .../apache/commons/rdf/jena/JenaFactory.java | 42 +-- .../rdf/jena/experimental/JenaRDFParser.java | 4 +- .../apache/commons/rdf/jena/TestGraphJena.java | 4 +- .../jena/TestJenaGraphToCommonsRDFGraph.java | 4 +- .../rdf/jena/TestRDFTermFactoryJena.java | 4 +- .../commons/rdf/jsonldjava/JsonLdFactory.java | 4 +- .../rdf/jsonldjava/JsonLdFactoryTest.java | 4 +- .../commons/rdf/jsonldjava/JsonLdGraphTest.java | 4 +- .../apache/commons/rdf/rdf4j/RDF4JFactory.java | 6 +- .../org/apache/commons/rdf/rdf4j/GraphTest.java | 4 +- .../commons/rdf/rdf4j/MemoryGraphTest.java | 6 +- .../rdf/rdf4j/MemoryRDFTermFactoryTest.java | 4 +- .../commons/rdf/rdf4j/NativeStoreGraphTest.java | 6 +- .../rdf/rdf4j/Rdf4JRDFTermFactoryTest.java | 4 +- .../commons/rdf/simple/BlankNodeImpl.java | 6 +- .../rdf/simple/SimpleRDFTermFactory.java | 6 +- .../simple/experimental/AbstractRDFParser.java | 26 +- .../commons/rdf/simple/DefaultGraphTest.java | 10 +- .../rdf/simple/DummyRDFParserBuilder.java | 4 +- .../commons/rdf/simple/SimpleGraphTest.java | 4 +- .../SimpleNoRelativeIRIRDFTermFactoryTest.java | 4 +- .../simple/SimpleRDFTermFactoryLookupTest.java | 8 +- .../rdf/simple/SimpleRDFTermFactoryTest.java | 6 +- .../commons/rdf/simple/TestWritingGraph.java | 4 +- .../experimental/AbstractRDFParserTest.java | 4 +- 36 files changed, 400 insertions(+), 400 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/BlankNode.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/BlankNode.java b/api/src/main/java/org/apache/commons/rdf/api/BlankNode.java index 40a44e8..efa4dfb 100644 --- a/api/src/main/java/org/apache/commons/rdf/api/BlankNode.java +++ b/api/src/main/java/org/apache/commons/rdf/api/BlankNode.java @@ -50,8 +50,8 @@ import java.util.UUID; * A BlankNode SHOULD contain a {@link UUID}-derived string as part of its * universally unique {@link #uniqueReference()}. * - * @see RDFTermFactory#createBlankNode() - * @see RDFTermFactory#createBlankNode(String) + * @see RDFFactory#createBlankNode() + * @see RDFFactory#createBlankNode(String) * @see <a href="http://www.w3.org/TR/rdf11-concepts/#dfn-blank-node">RDF-1.1 * Blank Node</a> */ @@ -62,7 +62,7 @@ public interface BlankNode extends BlankNodeOrIRI { * <p> * The reference string MUST universally and uniquely identify this blank * node. That is, different blank nodes created separately in different JVMs - * or from different {@link RDFTermFactory} instances MUST NOT have the same + * or from different {@link RDFFactory} instances MUST NOT have the same * reference string. * <p> * The {@link #uniqueReference()} of two <code>BlankNode</code> instances http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/Quad.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/Quad.java b/api/src/main/java/org/apache/commons/rdf/api/Quad.java index 6ce9a95..494600f 100644 --- a/api/src/main/java/org/apache/commons/rdf/api/Quad.java +++ b/api/src/main/java/org/apache/commons/rdf/api/Quad.java @@ -30,7 +30,7 @@ import java.util.Optional; * * @since 0.3.0-incubating * @see Dataset - * @see RDFTermFactory#createQuad(BlankNodeOrIRI,BlankNodeOrIRI,IRI,RDFTerm) + * @see RDFFactory#createQuad(BlankNodeOrIRI,BlankNodeOrIRI,IRI,RDFTerm) * @see <a href="http://www.w3.org/TR/2014/NOTE-rdf11-datasets-20140225/">RDF * 1.1: On Semantics of RDF Datasets</a> * @see <a href="http://www.w3.org/TR/rdf11-concepts/#section-dataset"> </a> http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/RDFFactory.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/RDFFactory.java b/api/src/main/java/org/apache/commons/rdf/api/RDFFactory.java new file mode 100644 index 0000000..2e97a03 --- /dev/null +++ b/api/src/main/java/org/apache/commons/rdf/api/RDFFactory.java @@ -0,0 +1,278 @@ +/** + * 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 java.io.Serializable; +import java.util.Locale; + +/** + * Factory for creating RDFTerm and Graph instances. + * <p> + * It is not specified how an implementation should provide a RDFFactory. + * <p> + * If an implementation does not support a particular method (e.g. it requires + * additional parameters or can't create graphs), then it MAY throw + * {@link UnsupportedOperationException}, as provided by the <code>default</code> + * implementations in this interface. + * <p> + * If a factory method does not allow or support a provided parameter, e.g. + * because an IRI is considered invalid, then it SHOULD throw + * {@link IllegalArgumentException}. + * + * @see RDFTerm + * @see Graph + * @see Quad + */ +public interface RDFFactory { + + /** + * Create a new blank node. + * <p> + * The returned blank node MUST NOT be equal to any existing + * {@link BlankNode} instances according to {@link BlankNode#equals(Object)}. + * + * @return A new, unique {@link BlankNode} + * @throws UnsupportedOperationException + * If the operation is not supported. + */ + default BlankNode createBlankNode() throws UnsupportedOperationException { + throw new UnsupportedOperationException( + "createBlankNode() not supported"); + } + + /** + * Create a blank node based on the given name. + * <p> + * All {@link BlankNode}s created with the given <code>name</code> + * <em>on a particular instance</em> of <code>RDFFactory</code> MUST be + * equivalent according to {@link BlankNode#equals(Object)}, + * <p> + * The returned BlankNode MUST NOT be equal to <code>BlankNode</code> + * instances returned for any other <code>name</code> or those returned from + * {@link #createBlankNode()}. + * <p> + * The returned BlankNode SHOULD NOT be equivalent to any BlankNodes created + * on a <em>different</em> <code>RDFFactory</code> instance, e.g. + * different instances of <code>RDFFactory</code> should produce + * different blank nodes for the same <code>name</code> unless they + * purposely are intending to create equivalent {@link BlankNode} + * instances (e.g. a reinstated {@link Serializable} factory). + * + * @param name + * A non-empty, non-null, String that is unique to this blank + * node in the context of this {@link RDFFactory}. + * @return A BlankNode for the given name + * @throws UnsupportedOperationException + * If the operation is not supported. + */ + default BlankNode createBlankNode(String name) + throws UnsupportedOperationException { + throw new UnsupportedOperationException( + "createBlankNode(String) not supported"); + } + + /** + * Create a new graph. + * + * It is undefined if the graph will be persisted by any underlying storage + * mechanism. + * + * @return A new Graph + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Graph createGraph() throws UnsupportedOperationException { + throw new UnsupportedOperationException("createGraph() not supported"); + } + + /** + * Create a new dataset. + * + * It is undefined if the dataset will be persisted by any underlying storage + * mechanism. + * + * @return A new Dataset + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Dataset createDataset() throws UnsupportedOperationException { + throw new UnsupportedOperationException("createDataset() not supported"); + } + + /** + * Create an IRI from a (possibly escaped) String. + * + * The provided iri string MUST be valid according to the <a + * href="http://www.w3.org/TR/rdf11-concepts/#dfn-iri">W3C RDF-1.1 IRI</a> + * definition. + * + * @param iri Internationalized Resource Identifier + * @return A new IRI + * @throws IllegalArgumentException If the provided string is not acceptable, e.g. does not + * conform to the RFC3987 syntax. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default IRI createIRI(String iri) throws IllegalArgumentException, + UnsupportedOperationException { + throw new UnsupportedOperationException( + "createIRI(String) not supported"); + } + + /** + * Create a simple literal. + * + * The provided lexical form should not be escaped in any sense, e.g. should + * not include "quotes" unless those are part of the literal value. + * + * The returned Literal MUST have a {@link Literal#getLexicalForm()} that is + * equal to the provided lexical form, MUST NOT have a + * {@link Literal#getLanguageTag()} present, and SHOULD return a + * {@link Literal#getDatatype()} that is equal to the IRI + * <code>http://www.w3.org/2001/XMLSchema#string</code>. + * + * @param lexicalForm The literal value in plain text + * @return The created Literal + * @throws IllegalArgumentException If the provided lexicalForm is not acceptable, e.g. because + * it is too large for an underlying storage. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Literal createLiteral(String lexicalForm) + throws IllegalArgumentException, UnsupportedOperationException { + throw new UnsupportedOperationException( + "createLiteral(String) not supported"); + } + + /** + * Create a literal with the specified data type. + * + * The provided lexical form should not be escaped in any sense, e.g. should + * not include "quotes" unless those are part of the literal value. + * + * It is RECOMMENDED that the provided dataType is one of the <a + * href="http://www.w3.org/TR/rdf11-concepts/#xsd-datatypes">RDF-compatible + * XSD types</a>. + * + * The provided lexical form SHOULD be in the <a + * href="http://www.w3.org/TR/rdf11-concepts/#dfn-lexical-space">lexical + * space</a> of the provided dataType. + * + * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} that + * is equal to the provided lexicalForm, MUST NOT have a + * {@link Literal#getLanguageTag()} present, and MUST return a + * {@link Literal#getDatatype()} that is equivalent to the provided dataType + * IRI. + * + * @param lexicalForm The literal value + * @param dataType The data type IRI for the literal value, e.g. + * <code>http://www.w3.org/2001/XMLSchema#integer</code> + * @return The created Literal + * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. + * because the provided dataType is not permitted. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Literal createLiteral(String lexicalForm, IRI dataType) + throws IllegalArgumentException, UnsupportedOperationException { + throw new UnsupportedOperationException( + "createLiteral(String) not supported"); + } + + /** + * Create a language-tagged literal. + * + * The provided lexical form should not be escaped in any sense, e.g. should + * not include "quotes" unless those are part of the literal value. + * + * The provided language tag MUST be valid according to <a + * href="http://tools.ietf.org/html/bcp47">BCP47</a>, e.g. <code>en</code>. + * + * The provided language tag <a + * href="http://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string" + * >MAY be converted to lower case</a>. + * + * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} which + * is equal to the provided lexicalForm, MUST return a + * {@link Literal#getDatatype()} that is equal to the IRI + * <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#langString</code>, and + * MUST have a {@link Literal#getLanguageTag()} present which SHOULD be + * equal to the provided language tag (compared as + * {@link String#toLowerCase(Locale)} using {@link Locale#ENGLISH}). + * + * @param lexicalForm The literal value + * @param languageTag The non-empty language tag as defined by <a + * href="http://tools.ietf.org/html/bcp47">BCP47</a> + * @return The created Literal + * @throws IllegalArgumentException If the provided values are not acceptable, e.g. because the + * languageTag was syntactically invalid. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Literal createLiteral(String lexicalForm, String languageTag) + throws IllegalArgumentException, UnsupportedOperationException { + throw new UnsupportedOperationException( + "createLiteral(String,String) not supported"); + } + + /** + * Create a triple. + * + * The returned Triple SHOULD have a {@link Triple#getSubject()} that is + * equal to the provided subject, a {@link Triple#getPredicate()} that is + * equal to the provided predicate, and a {@link Triple#getObject()} that is + * equal to the provided object. + * + * @param subject The IRI or BlankNode that is the subject of the triple + * @param predicate The IRI that is the predicate of the triple + * @param object The IRI, BlankNode or Literal that is the object of the triple + * @return The created Triple + * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. + * because a Literal has a lexicalForm that is too large for an + * underlying storage. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Triple createTriple(BlankNodeOrIRI subject, IRI predicate, + RDFTerm object) throws IllegalArgumentException, + UnsupportedOperationException { + throw new UnsupportedOperationException( + "createTriple(BlankNodeOrIRI,IRI,RDFTerm) not supported"); + } + + /** + * Create a quad. + * <p> + * The returned Quad SHOULD have a + * {@link Quad#getGraphName()} that is equal to the provided graphName, a + * {@link Quad#getSubject()} that is + * equal to the provided subject, a {@link Quad#getPredicate()} that is + * equal to the provided predicate, and a {@link Quad#getObject()} that is + * equal to the provided object. + * + * @param graphName The IRI or BlankNode that this quad belongs to, or <code>null</code> for the default graph + * @param subject The IRI or BlankNode that is the subject of the quad + * @param predicate The IRI that is the predicate of the quad + * @param object The IRI, BlankNode or Literal that is the object of the quad + * @return The created Quad + * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. + * because a Literal has a lexicalForm that is too large for an + * underlying storage. + * @throws UnsupportedOperationException If the operation is not supported. + */ + default Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, + RDFTerm object) throws IllegalArgumentException, + UnsupportedOperationException { + throw new UnsupportedOperationException( + "createQuad(BlankNodeOrIRI,BlankNodeOrIRI,IRI,RDFTerm) not supported"); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/RDFTermFactory.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/RDFTermFactory.java b/api/src/main/java/org/apache/commons/rdf/api/RDFTermFactory.java deleted file mode 100644 index 17758b6..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/RDFTermFactory.java +++ /dev/null @@ -1,278 +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 java.io.Serializable; -import java.util.Locale; - -/** - * Factory for creating RDFTerm and Graph instances. - * <p> - * It is not specified how an implementation should provide a RDFTermFactory. - * <p> - * If an implementation does not support a particular method (e.g. it requires - * additional parameters or can't create graphs), then it MAY throw - * {@link UnsupportedOperationException}, as provided by the <code>default</code> - * implementations in this interface. - * <p> - * If a factory method does not allow or support a provided parameter, e.g. - * because an IRI is considered invalid, then it SHOULD throw - * {@link IllegalArgumentException}. - * - * @see RDFTerm - * @see Graph - * @see Quad - */ -public interface RDFTermFactory { - - /** - * Create a new blank node. - * <p> - * The returned blank node MUST NOT be equal to any existing - * {@link BlankNode} instances according to {@link BlankNode#equals(Object)}. - * - * @return A new, unique {@link BlankNode} - * @throws UnsupportedOperationException - * If the operation is not supported. - */ - default BlankNode createBlankNode() throws UnsupportedOperationException { - throw new UnsupportedOperationException( - "createBlankNode() not supported"); - } - - /** - * Create a blank node based on the given name. - * <p> - * All {@link BlankNode}s created with the given <code>name</code> - * <em>on a particular instance</em> of <code>RDFTermFactory</code> MUST be - * equivalent according to {@link BlankNode#equals(Object)}, - * <p> - * The returned BlankNode MUST NOT be equal to <code>BlankNode</code> - * instances returned for any other <code>name</code> or those returned from - * {@link #createBlankNode()}. - * <p> - * The returned BlankNode SHOULD NOT be equivalent to any BlankNodes created - * on a <em>different</em> <code>RDFTermFactory</code> instance, e.g. - * different instances of <code>RDFTermFactory</code> should produce - * different blank nodes for the same <code>name</code> unless they - * purposely are intending to create equivalent {@link BlankNode} - * instances (e.g. a reinstated {@link Serializable} factory). - * - * @param name - * A non-empty, non-null, String that is unique to this blank - * node in the context of this {@link RDFTermFactory}. - * @return A BlankNode for the given name - * @throws UnsupportedOperationException - * If the operation is not supported. - */ - default BlankNode createBlankNode(String name) - throws UnsupportedOperationException { - throw new UnsupportedOperationException( - "createBlankNode(String) not supported"); - } - - /** - * Create a new graph. - * - * It is undefined if the graph will be persisted by any underlying storage - * mechanism. - * - * @return A new Graph - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Graph createGraph() throws UnsupportedOperationException { - throw new UnsupportedOperationException("createGraph() not supported"); - } - - /** - * Create a new dataset. - * - * It is undefined if the dataset will be persisted by any underlying storage - * mechanism. - * - * @return A new Dataset - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Dataset createDataset() throws UnsupportedOperationException { - throw new UnsupportedOperationException("createDataset() not supported"); - } - - /** - * Create an IRI from a (possibly escaped) String. - * - * The provided iri string MUST be valid according to the <a - * href="http://www.w3.org/TR/rdf11-concepts/#dfn-iri">W3C RDF-1.1 IRI</a> - * definition. - * - * @param iri Internationalized Resource Identifier - * @return A new IRI - * @throws IllegalArgumentException If the provided string is not acceptable, e.g. does not - * conform to the RFC3987 syntax. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default IRI createIRI(String iri) throws IllegalArgumentException, - UnsupportedOperationException { - throw new UnsupportedOperationException( - "createIRI(String) not supported"); - } - - /** - * Create a simple literal. - * - * The provided lexical form should not be escaped in any sense, e.g. should - * not include "quotes" unless those are part of the literal value. - * - * The returned Literal MUST have a {@link Literal#getLexicalForm()} that is - * equal to the provided lexical form, MUST NOT have a - * {@link Literal#getLanguageTag()} present, and SHOULD return a - * {@link Literal#getDatatype()} that is equal to the IRI - * <code>http://www.w3.org/2001/XMLSchema#string</code>. - * - * @param lexicalForm The literal value in plain text - * @return The created Literal - * @throws IllegalArgumentException If the provided lexicalForm is not acceptable, e.g. because - * it is too large for an underlying storage. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Literal createLiteral(String lexicalForm) - throws IllegalArgumentException, UnsupportedOperationException { - throw new UnsupportedOperationException( - "createLiteral(String) not supported"); - } - - /** - * Create a literal with the specified data type. - * - * The provided lexical form should not be escaped in any sense, e.g. should - * not include "quotes" unless those are part of the literal value. - * - * It is RECOMMENDED that the provided dataType is one of the <a - * href="http://www.w3.org/TR/rdf11-concepts/#xsd-datatypes">RDF-compatible - * XSD types</a>. - * - * The provided lexical form SHOULD be in the <a - * href="http://www.w3.org/TR/rdf11-concepts/#dfn-lexical-space">lexical - * space</a> of the provided dataType. - * - * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} that - * is equal to the provided lexicalForm, MUST NOT have a - * {@link Literal#getLanguageTag()} present, and MUST return a - * {@link Literal#getDatatype()} that is equivalent to the provided dataType - * IRI. - * - * @param lexicalForm The literal value - * @param dataType The data type IRI for the literal value, e.g. - * <code>http://www.w3.org/2001/XMLSchema#integer</code> - * @return The created Literal - * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. - * because the provided dataType is not permitted. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Literal createLiteral(String lexicalForm, IRI dataType) - throws IllegalArgumentException, UnsupportedOperationException { - throw new UnsupportedOperationException( - "createLiteral(String) not supported"); - } - - /** - * Create a language-tagged literal. - * - * The provided lexical form should not be escaped in any sense, e.g. should - * not include "quotes" unless those are part of the literal value. - * - * The provided language tag MUST be valid according to <a - * href="http://tools.ietf.org/html/bcp47">BCP47</a>, e.g. <code>en</code>. - * - * The provided language tag <a - * href="http://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string" - * >MAY be converted to lower case</a>. - * - * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} which - * is equal to the provided lexicalForm, MUST return a - * {@link Literal#getDatatype()} that is equal to the IRI - * <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#langString</code>, and - * MUST have a {@link Literal#getLanguageTag()} present which SHOULD be - * equal to the provided language tag (compared as - * {@link String#toLowerCase(Locale)} using {@link Locale#ENGLISH}). - * - * @param lexicalForm The literal value - * @param languageTag The non-empty language tag as defined by <a - * href="http://tools.ietf.org/html/bcp47">BCP47</a> - * @return The created Literal - * @throws IllegalArgumentException If the provided values are not acceptable, e.g. because the - * languageTag was syntactically invalid. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Literal createLiteral(String lexicalForm, String languageTag) - throws IllegalArgumentException, UnsupportedOperationException { - throw new UnsupportedOperationException( - "createLiteral(String,String) not supported"); - } - - /** - * Create a triple. - * - * The returned Triple SHOULD have a {@link Triple#getSubject()} that is - * equal to the provided subject, a {@link Triple#getPredicate()} that is - * equal to the provided predicate, and a {@link Triple#getObject()} that is - * equal to the provided object. - * - * @param subject The IRI or BlankNode that is the subject of the triple - * @param predicate The IRI that is the predicate of the triple - * @param object The IRI, BlankNode or Literal that is the object of the triple - * @return The created Triple - * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. - * because a Literal has a lexicalForm that is too large for an - * underlying storage. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Triple createTriple(BlankNodeOrIRI subject, IRI predicate, - RDFTerm object) throws IllegalArgumentException, - UnsupportedOperationException { - throw new UnsupportedOperationException( - "createTriple(BlankNodeOrIRI,IRI,RDFTerm) not supported"); - } - - /** - * Create a quad. - * <p> - * The returned Quad SHOULD have a - * {@link Quad#getGraphName()} that is equal to the provided graphName, a - * {@link Quad#getSubject()} that is - * equal to the provided subject, a {@link Quad#getPredicate()} that is - * equal to the provided predicate, and a {@link Quad#getObject()} that is - * equal to the provided object. - * - * @param graphName The IRI or BlankNode that this quad belongs to, or <code>null</code> for the default graph - * @param subject The IRI or BlankNode that is the subject of the quad - * @param predicate The IRI that is the predicate of the quad - * @param object The IRI, BlankNode or Literal that is the object of the quad - * @return The created Quad - * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g. - * because a Literal has a lexicalForm that is too large for an - * underlying storage. - * @throws UnsupportedOperationException If the operation is not supported. - */ - default Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, - RDFTerm object) throws IllegalArgumentException, - UnsupportedOperationException { - throw new UnsupportedOperationException( - "createQuad(BlankNodeOrIRI,BlankNodeOrIRI,IRI,RDFTerm) not supported"); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/Triple.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/Triple.java b/api/src/main/java/org/apache/commons/rdf/api/Triple.java index 9e7f140..9e359d7 100644 --- a/api/src/main/java/org/apache/commons/rdf/api/Triple.java +++ b/api/src/main/java/org/apache/commons/rdf/api/Triple.java @@ -26,7 +26,7 @@ import java.util.Objects; * 25 February 2014.<br> * * @see Quad - * @see RDFTermFactory#createTriple(BlankNodeOrIRI,IRI,RDFTerm) + * @see RDFFactory#createTriple(BlankNodeOrIRI,IRI,RDFTerm) * @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple" >RDF-1.1 * Triple</a> */ http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/api/package-info.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/package-info.java b/api/src/main/java/org/apache/commons/rdf/api/package-info.java index 5fd5f5b..19d1462 100644 --- a/api/src/main/java/org/apache/commons/rdf/api/package-info.java +++ b/api/src/main/java/org/apache/commons/rdf/api/package-info.java @@ -30,7 +30,7 @@ * {@link org.apache.commons.rdf.api.BlankNode}. * <p> * Implementations of this API should provide an - * {@link org.apache.commons.rdf.api.RDFTermFactory} to facilitate + * {@link org.apache.commons.rdf.api.RDFFactory} to facilitate * creation of these objects. * <p> * All the {@link org.apache.commons.rdf.api.RDFTerm} objects are immutable, http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/main/java/org/apache/commons/rdf/experimental/RDFParser.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/experimental/RDFParser.java b/api/src/main/java/org/apache/commons/rdf/experimental/RDFParser.java index d0b8776..e77926d 100644 --- a/api/src/main/java/org/apache/commons/rdf/experimental/RDFParser.java +++ b/api/src/main/java/org/apache/commons/rdf/experimental/RDFParser.java @@ -32,7 +32,7 @@ import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.RDFSyntax; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; /** @@ -100,25 +100,25 @@ public interface RDFParser { } /** - * Specify which {@link RDFTermFactory} to use for generating + * Specify which {@link RDFFactory} to use for generating * {@link RDFTerm}s. * <p> * This option may be used together with {@link #target(Graph)} to * override the implementation's default factory and graph. * <p> - * <strong>Warning:</strong> Using the same {@link RDFTermFactory} for + * <strong>Warning:</strong> Using the same {@link RDFFactory} for * multiple {@link #parse()} calls may accidentally merge * {@link BlankNode}s having the same label, as the parser may - * use the {@link RDFTermFactory#createBlankNode(String)} method + * use the {@link RDFFactory#createBlankNode(String)} method * from the parsed blank node labels. * * @see #target(Graph) * @param rdfTermFactory - * {@link RDFTermFactory} to use for generating RDFTerms. + * {@link RDFFactory} to use for generating RDFTerms. * @return An {@link RDFParser} that will use the specified * rdfTermFactory */ - RDFParser rdfTermFactory(RDFTermFactory rdfTermFactory); + RDFParser rdfTermFactory(RDFFactory rdfTermFactory); /** * Specify the content type of the RDF syntax to parse. http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 d7b3fbc..bd68f51 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 @@ -41,18 +41,18 @@ import org.junit.Test; * <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 - * must support {@link RDFTermFactory#createGraph()} and - * {@link RDFTermFactory#createIRI(String)}, but ideally support all operations. + * must support {@link RDFFactory#createGraph()} and + * {@link RDFFactory#createIRI(String)}, but ideally support all operations. * <p> * This test uses try-with-resources blocks for calls to {@link Graph#stream()} * and {@link Graph#iterate()}. * * @see Graph - * @see RDFTermFactory + * @see RDFFactory */ public abstract class AbstractGraphTest { - protected RDFTermFactory factory; + protected RDFFactory factory; protected Graph graph; protected IRI alice; protected IRI bob; @@ -67,7 +67,7 @@ public abstract class AbstractGraphTest { protected Literal companyName; protected Triple bobNameTriple; - public abstract RDFTermFactory createFactory(); + public abstract RDFFactory createFactory(); @Before public void createGraphAndAdd() { @@ -413,7 +413,7 @@ public abstract class AbstractGraphTest { * Make a new graph with two BlankNodes - each with a different uniqueReference */ private Graph createGraph1() { - RDFTermFactory factory1 = createFactory(); + RDFFactory factory1 = createFactory(); IRI name = factory1.createIRI("http://xmlns.com/foaf/0.1/name"); Graph g1 = factory1.createGraph(); @@ -465,7 +465,7 @@ public abstract class AbstractGraphTest { } private Graph createGraph2() { - RDFTermFactory factory2 = createFactory(); + RDFFactory factory2 = createFactory(); IRI name = factory2.createIRI("http://xmlns.com/foaf/0.1/name"); Graph g2 = factory2.createGraph(); http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 17dd05f..412b812 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 @@ -29,26 +29,26 @@ import org.junit.Before; import org.junit.Test; /** - * Test RDFTermFactory implementation (and thus its RDFTerm implementations) + * Test RDFFactory 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 RDFTermFactory + * @see RDFFactory */ public abstract class AbstractRDFTermFactoryTest { - private RDFTermFactory factory; + private RDFFactory factory; /** - * testCreate a new, distinct {@link RDFTermFactory} object using the + * testCreate a new, distinct {@link RDFFactory} object using the * implementation being tested here. * - * @return a new, distinct {@link RDFTermFactory} object using the + * @return a new, distinct {@link RDFFactory} object using the * implementation being tested here */ - public abstract RDFTermFactory createFactory(); + public abstract RDFFactory createFactory(); @Before public void setUp() { @@ -126,7 +126,7 @@ public abstract class AbstractRDFTermFactoryTest { // only says: // // * BlankNodes created using this method with the same parameter, for - // * different instances of RDFTermFactory, SHOULD NOT be equivalent. + // * different instances of RDFFactory, SHOULD NOT be equivalent. // // https://github.com/apache/incubator-commonsrdf/pull/7#issuecomment-92312779 } catch (UnsupportedOperationException ex) { http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/api/src/test/java/org/apache/commons/rdf/api/DefaultRDFTermFactoryTest.java ---------------------------------------------------------------------- diff --git a/api/src/test/java/org/apache/commons/rdf/api/DefaultRDFTermFactoryTest.java b/api/src/test/java/org/apache/commons/rdf/api/DefaultRDFTermFactoryTest.java index 674140d..d7db514 100644 --- a/api/src/test/java/org/apache/commons/rdf/api/DefaultRDFTermFactoryTest.java +++ b/api/src/test/java/org/apache/commons/rdf/api/DefaultRDFTermFactoryTest.java @@ -18,15 +18,15 @@ package org.apache.commons.rdf.api; /** - * The default RDFTermFactory might be useless (every method throws + * The default RDFFactory might be useless (every method throws * UnsupportedOperationException), but this test ensures that * AbstractRDFTermFactoryTest does not fall over on unsupported operations. */ public class DefaultRDFTermFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { - return new RDFTermFactory() { + public RDFFactory createFactory() { + return new RDFFactory() { }; } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/examples/src/example/UserGuideTest.java ---------------------------------------------------------------------- diff --git a/examples/src/example/UserGuideTest.java b/examples/src/example/UserGuideTest.java index ee8ad97..44623b3 100644 --- a/examples/src/example/UserGuideTest.java +++ b/examples/src/example/UserGuideTest.java @@ -32,7 +32,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.apache.commons.rdf.api.TripleLike; import org.apache.commons.rdf.simple.SimpleRDFTermFactory; @@ -42,7 +42,7 @@ import org.junit.Test; public class UserGuideTest { - private RDFTermFactory factory; + private RDFFactory factory; @Before public void factory() { http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/jena/src/main/java/org/apache/commons/rdf/jena/JenaFactory.java ---------------------------------------------------------------------- diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaFactory.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaFactory.java index 0d735c7..0a5b44b 100644 --- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaFactory.java +++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaFactory.java @@ -31,7 +31,7 @@ import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.QuadLike; import org.apache.commons.rdf.api.RDFSyntax; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.apache.commons.rdf.api.TripleLike; import org.apache.commons.rdf.jena.impl.InternalJenaFactory; @@ -48,7 +48,7 @@ import org.apache.jena.sparql.core.DatasetGraph; import org.apache.jena.sparql.graph.GraphFactory; /** - * RDFTermFactory with Jena-backed objects. + * RDFFactory with Jena-backed objects. * <p> * This factory can also convert existing objects from/to Jena with methods like * {@link #fromJena(org.apache.jena.graph.Graph)} and {@link #toJena(Graph)}. @@ -56,9 +56,9 @@ import org.apache.jena.sparql.graph.GraphFactory; * For the purpose of {@link BlankNode} identity, this factory will use an internal * {@link UUID} as a salt. See {@link BlankNode#uniqueReference()} for details. * - * @see RDFTermFactory + * @see RDFFactory */ -public final class JenaFactory implements RDFTermFactory { +public final class JenaFactory implements RDFFactory { private static InternalJenaFactory internalJenaFactory = new InternalJenaFactory(){}; @@ -203,7 +203,7 @@ public final class JenaFactory implements RDFTermFactory { * {@link Node#getBlankNodeId()} for the purpose of its * {@link BlankNode#uniqueReference()}. * - * @see #fromJena(RDFTermFactory, Node) + * @see #fromJena(RDFFactory, Node) * * @param node * The Jena Node to adapt. It's {@link Node#isConcrete()} must be @@ -220,13 +220,13 @@ public final class JenaFactory implements RDFTermFactory { * Convert from Jena {@link Node} to any Commons RDF implementation. * <p> * Note that if the {@link Node#isBlank()}, then the factory's - * {@link RDFTermFactory#createBlankNode(String)} will be used, meaning - * that care should be taken if reusing an {@link RDFTermFactory} instance + * {@link RDFFactory#createBlankNode(String)} will be used, meaning + * that care should be taken if reusing an {@link RDFFactory} instance * for multiple conversion sessions. * * @see #fromJena(Node) * - * @param factory {@link RDFTermFactory} to use for creating {@link RDFTerm}. + * @param factory {@link RDFFactory} to use for creating {@link RDFTerm}. * @param node * The Jena Node to adapt. It's {@link Node#isConcrete()} must be * <code>true</code>. @@ -234,7 +234,7 @@ public final class JenaFactory implements RDFTermFactory { * @throws ConversionException If the {@link Node} can't be represented as an {@link RDFTerm}, e.g. * if the node is not concrete or represents a variable in Jena. */ - public static RDFTerm fromJena(RDFTermFactory factory, Node node) { + public static RDFTerm fromJena(RDFFactory factory, Node node) { if (node == null) { return null; } @@ -268,7 +268,7 @@ public final class JenaFactory implements RDFTermFactory { * {@link Node#getBlankNodeId()} for the purpose of its * {@link BlankNode#uniqueReference()}. * - * @see #fromJena(RDFTermFactory, org.apache.jena.graph.Triple) + * @see #fromJena(RDFFactory, org.apache.jena.graph.Triple) * * @param triple * Jena {@link org.apache.jena.graph.Triple} to adapt @@ -293,7 +293,7 @@ public final class JenaFactory implements RDFTermFactory { * {@link Node#getBlankNodeId()} for the purpose of its * {@link BlankNode#uniqueReference()}. * - * @see #fromJena(RDFTermFactory, org.apache.jena.graph.Triple) + * @see #fromJena(RDFFactory, org.apache.jena.graph.Triple) * * @param triple * Jena triple @@ -342,13 +342,13 @@ public final class JenaFactory implements RDFTermFactory { * {@link Triple}. * <p> * Note that if any of the triple's nodes {@link Node#isBlank()}, then the factory's - * {@link RDFTermFactory#createBlankNode(String)} will be used, meaning - * that care should be taken if reusing an {@link RDFTermFactory} instance + * {@link RDFFactory#createBlankNode(String)} will be used, meaning + * that care should be taken if reusing an {@link RDFFactory} instance * for multiple conversion sessions. * * @see #fromJena(org.apache.jena.graph.Triple) * - * @param factory {@link RDFTermFactory} to use for creating the {@link Triple} and its + * @param factory {@link RDFFactory} to use for creating the {@link Triple} and its * {@link RDFTerm}s. * @param triple * Jena triple @@ -357,7 +357,7 @@ public final class JenaFactory implements RDFTermFactory { * if any of the triple's nodes are not concrete or the triple * is a generalized triple */ - public static Triple fromJena(RDFTermFactory factory, org.apache.jena.graph.Triple triple) + public static Triple fromJena(RDFFactory factory, org.apache.jena.graph.Triple triple) throws ConversionException{ if (factory instanceof JenaFactory) { // No need to convert, just wrap @@ -478,15 +478,15 @@ public final class JenaFactory implements RDFTermFactory { * RDF {@link Quad}. * <p> * Note that if any of the quad's nodes {@link Node#isBlank()}, then the - * factory's {@link RDFTermFactory#createBlankNode(String)} will be used, - * meaning that care should be taken if reusing an {@link RDFTermFactory} + * factory's {@link RDFFactory#createBlankNode(String)} will be used, + * meaning that care should be taken if reusing an {@link RDFFactory} * instance for multiple conversion sessions. * * @see #fromJena(org.apache.jena.sparql.core.Quad) * @see #fromJenaGeneralized(org.apache.jena.sparql.core.Quad) * * @param factory - * {@link RDFTermFactory} to use for creating the {@link Triple} + * {@link RDFFactory} to use for creating the {@link Triple} * and its {@link RDFTerm}s. * @param quad * Jena {@link org.apache.jena.sparql.core.Quad} to adapt @@ -495,7 +495,7 @@ public final class JenaFactory implements RDFTermFactory { * if any of the quad's nodes are not concrete or the quad * is a generalized quad */ - public static Quad fromJena(RDFTermFactory factory, org.apache.jena.sparql.core.Quad quad) { + public static Quad fromJena(RDFFactory factory, org.apache.jena.sparql.core.Quad quad) { if (factory instanceof JenaFactory) { // No need to convert, just wrap return ((JenaFactory) factory).fromJena(quad); @@ -535,14 +535,14 @@ public final class JenaFactory implements RDFTermFactory { * {@link RDFDataMgr#parse(StreamRDF, String)}. * * @param factory - * {@link RDFTermFactory} to use for creating {@link RDFTerm}s + * {@link RDFFactory} to use for creating {@link RDFTerm}s * and {@link Quad}s. * @param consumer * A {@link Consumer} of {@link Quad}s * @return A {@link StreamRDF} that will stream converted quads to the * consumer */ - public static StreamRDF streamJenaToCommonsRDF(RDFTermFactory factory, Consumer<Quad> consumer) { + public static StreamRDF streamJenaToCommonsRDF(RDFFactory factory, Consumer<Quad> consumer) { return new StreamRDFBase() { @Override public void quad(org.apache.jena.sparql.core.Quad quad) { http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/jena/src/main/java/org/apache/commons/rdf/jena/experimental/JenaRDFParser.java ---------------------------------------------------------------------- diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/experimental/JenaRDFParser.java b/jena/src/main/java/org/apache/commons/rdf/jena/experimental/JenaRDFParser.java index 19a8a63..f14532c 100644 --- a/jena/src/main/java/org/apache/commons/rdf/jena/experimental/JenaRDFParser.java +++ b/jena/src/main/java/org/apache/commons/rdf/jena/experimental/JenaRDFParser.java @@ -26,7 +26,7 @@ import java.util.function.Consumer; import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.QuadLike; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.TripleLike; import org.apache.commons.rdf.experimental.RDFParser; import org.apache.commons.rdf.jena.JenaGraph; @@ -43,7 +43,7 @@ public class JenaRDFParser extends AbstractRDFParser<JenaRDFParser> implements R private Consumer<TripleLike> generalizedConsumerTriple; private Consumer<QuadLike<RDFTerm>> generalizedConsumerQuad; - protected RDFTermFactory createRDFTermFactory() { + protected RDFFactory createRDFTermFactory() { return new JenaFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 ebccc6e..5690721 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 @@ -19,12 +19,12 @@ package org.apache.commons.rdf.jena; import org.apache.commons.rdf.api.AbstractGraphTest ; -import org.apache.commons.rdf.api.RDFTermFactory ; +import org.apache.commons.rdf.api.RDFFactory ; public class TestGraphJena extends AbstractGraphTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new JenaFactory() ; } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 1a7b4e0..7f08382 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 @@ -24,7 +24,7 @@ import java.nio.file.Path; import java.nio.file.StandardCopyOption; import org.apache.commons.rdf.api.Graph ; -import org.apache.commons.rdf.api.RDFTermFactory ; +import org.apache.commons.rdf.api.RDFFactory ; import org.apache.jena.riot.Lang ; import org.apache.jena.riot.RDFDataMgr ; import org.apache.jena.sparql.graph.GraphFactory ; @@ -59,7 +59,7 @@ public class TestJenaGraphToCommonsRDFGraph { Graph graph = new JenaFactory().fromJena(jGraph) ; // Add to CommonsRDF Graph - RDFTermFactory rft = new JenaFactory() ; + RDFFactory rft = new JenaFactory() ; graph.add(rft.createIRI("http://example/s2"), rft.createIRI("http://example/p2"), rft.createLiteral("foo")) ; http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 ae423da..6ca14b7 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 @@ -19,12 +19,12 @@ package org.apache.commons.rdf.jena; import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest ; -import org.apache.commons.rdf.api.RDFTermFactory ; +import org.apache.commons.rdf.api.RDFFactory ; public class TestRDFTermFactoryJena extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new JenaFactory() ; } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java ---------------------------------------------------------------------- diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java index a66fd3d..0dd8486 100644 --- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java +++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdFactory.java @@ -28,14 +28,14 @@ import org.apache.commons.rdf.api.Graph; import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Literal; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.apache.commons.rdf.simple.Types; import com.github.jsonldjava.core.RDFDataset; import com.github.jsonldjava.core.RDFDataset.Node; -public final class JsonLdFactory implements RDFTermFactory { +public final class JsonLdFactory implements RDFFactory { final String bnodePrefix; http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 index e7c68ea..02b2695 100644 --- 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 @@ -18,14 +18,14 @@ package org.apache.commons.rdf.jsonldjava; import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.junit.Ignore; import org.junit.Test; public class JsonLdFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new JsonLdFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphTest.java ---------------------------------------------------------------------- diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphTest.java index 46bc73e..1f98c74 100644 --- a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphTest.java +++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphTest.java @@ -18,12 +18,12 @@ package org.apache.commons.rdf.jsonldjava; import org.apache.commons.rdf.api.AbstractGraphTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; public class JsonLdGraphTest extends AbstractGraphTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new JsonLdFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JFactory.java ---------------------------------------------------------------------- diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JFactory.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JFactory.java index 7d4eabe..6b3717b 100644 --- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JFactory.java +++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JFactory.java @@ -32,7 +32,7 @@ import org.apache.commons.rdf.api.Dataset; import org.apache.commons.rdf.api.Graph; import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.apache.commons.rdf.api.TripleLike; import org.apache.commons.rdf.rdf4j.impl.InternalRDF4JFactory; @@ -51,7 +51,7 @@ import org.eclipse.rdf4j.sail.Sail; import org.eclipse.rdf4j.sail.memory.MemoryStore; /** - * RDF4J implementation of RDFTermFactory. + * RDF4J implementation of RDFFactory. * <p> * The {@link #RDF4JFactory()} constructor uses a {@link SimpleValueFactory} * to create corresponding RDF4J {@link Value} instances. Alternatively, this @@ -99,7 +99,7 @@ import org.eclipse.rdf4j.sail.memory.MemoryStore; * therefore uses a unique {@link RDF4JFactory} internally. * */ -public final class RDF4JFactory implements RDFTermFactory { +public final class RDF4JFactory implements RDFFactory { /** * InternalRDF4JFactory is deliberately abstract http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/GraphTest.java ---------------------------------------------------------------------- diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/GraphTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/GraphTest.java index 07b60c2..8cba53e 100644 --- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/GraphTest.java +++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/GraphTest.java @@ -18,12 +18,12 @@ package org.apache.commons.rdf.rdf4j; import org.apache.commons.rdf.api.AbstractGraphTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; public class GraphTest extends AbstractGraphTest{ @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new RDF4JFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java ---------------------------------------------------------------------- diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java index c275e67..ce449bf 100644 --- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java +++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java @@ -24,7 +24,7 @@ import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Literal; import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.sail.Sail; @@ -33,7 +33,7 @@ import org.eclipse.rdf4j.sail.memory.model.MemValueFactory; public class MemoryGraphTest extends AbstractGraphTest { - public static final class MemoryStoreFactory implements RDFTermFactory { + public static final class MemoryStoreFactory implements RDFFactory { RDF4JFactory rdf4jFactory = new RDF4JFactory(new MemValueFactory()); @@ -82,7 +82,7 @@ public class MemoryGraphTest extends AbstractGraphTest { } @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new MemoryStoreFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 index 8ba235d..07d6a13 100644 --- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java +++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryRDFTermFactoryTest.java @@ -18,13 +18,13 @@ package org.apache.commons.rdf.rdf4j; import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.junit.Assume; public class MemoryRDFTermFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new MemoryGraphTest.MemoryStoreFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java ---------------------------------------------------------------------- diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java index 77ee128..9a5ab50 100644 --- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java +++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java @@ -27,7 +27,7 @@ import org.apache.commons.rdf.api.BlankNodeOrIRI; import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Literal; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryResult; import org.eclipse.rdf4j.repository.sail.SailRepository; @@ -49,7 +49,7 @@ import org.junit.rules.Timeout; */ public class NativeStoreGraphTest extends AbstractGraphTest { - public final class NativeStoreFactory implements RDFTermFactory { + public final class NativeStoreFactory implements RDFFactory { RDF4JFactory rdf4jFactory = new RDF4JFactory(getRepository().getValueFactory()); @@ -145,7 +145,7 @@ public class NativeStoreGraphTest extends AbstractGraphTest { // } @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new NativeStoreFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/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 index 9dbbf4b..4e075ac 100644 --- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java +++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/Rdf4JRDFTermFactoryTest.java @@ -18,13 +18,13 @@ package org.apache.commons.rdf.rdf4j; import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.junit.Assume; public class Rdf4JRDFTermFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new RDF4JFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java ---------------------------------------------------------------------- diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java index 81c6848..dab2f12 100644 --- a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java +++ b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java @@ -47,13 +47,13 @@ final class BlankNodeImpl implements BlankNode, SimpleRDFTerm { // Build a semi-URN - to be hashed for a name-based UUID below // Both the scope and the id are used to create the UUID, ensuring that // a caller can reliably create the same bnode if necessary by sending - // in the same scope to RDFTermFactory.createBlankNode(String) + // in the same scope to RDFFactory.createBlankNode(String) String uuidInput = "urn:uuid:" + uuidSalt + "#" + name; // The above is not a good value for this.id, as the id // needs to be further escaped for // ntriplesString() (there are no restrictions on - // RDFTermFactory.createBlankNode(String) ). + // RDFFactory.createBlankNode(String) ). // Rather than implement ntriples escaping here, and knowing @@ -63,7 +63,7 @@ final class BlankNodeImpl implements BlankNode, SimpleRDFTerm { // // A side-effect from this is that the blank node identifier // is not preserved or shown in ntriplesString. In a way - // this is a feature, not a bug. as the contract for RDFTermFactory + // this is a feature, not a bug. as the contract for RDFFactory // has no such requirement. this.uniqueReference = UUID.nameUUIDFromBytes( uuidInput.getBytes(StandardCharsets.UTF_8)).toString(); http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java ---------------------------------------------------------------------- diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java index 4f54d03..4aee07a 100644 --- a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java +++ b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java @@ -27,17 +27,17 @@ import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Literal; import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.RDFTerm; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; /** - * A simple implementation of RDFTermFactory. + * A simple implementation of RDFFactory. * <p> * The {@link RDFTerm} and {@link Graph} instances created by this factory are * simple in-memory Implementations that are not thread-safe or efficient, but * which may be useful for testing and prototyping purposes. */ -public class SimpleRDFTermFactory implements RDFTermFactory { +public class SimpleRDFTermFactory implements RDFFactory { /** * Marker interface to say that this RDFTerm is part of the http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java ---------------------------------------------------------------------- diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java index 9b07699..ef93136 100644 --- a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java +++ b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java @@ -33,7 +33,7 @@ import org.apache.commons.rdf.api.Graph; import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Quad; import org.apache.commons.rdf.api.RDFSyntax; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.experimental.RDFParser; import org.apache.commons.rdf.simple.SimpleRDFTermFactory; @@ -63,15 +63,15 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> private static final ExecutorService threadpool = Executors.newCachedThreadPool(r -> new Thread(threadGroup, r)); // Basically only used for creating IRIs - private static RDFTermFactory internalRdfTermFactory = new SimpleRDFTermFactory(); + private static RDFFactory internalRdfTermFactory = new SimpleRDFTermFactory(); /** - * Get the set {@link RDFTermFactory}, if any. + * Get the set {@link RDFFactory}, if any. * - * @return The {@link RDFTermFactory} to use, or {@link Optional#empty()} if + * @return The {@link RDFFactory} to use, or {@link Optional#empty()} if * it has not been set */ - public Optional<RDFTermFactory> getRdfTermFactory() { + public Optional<RDFFactory> getRdfTermFactory() { return rdfTermFactory; } @@ -200,7 +200,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> } - private Optional<RDFTermFactory> rdfTermFactory = Optional.empty(); + private Optional<RDFFactory> rdfTermFactory = Optional.empty(); private Optional<RDFSyntax> contentTypeSyntax = Optional.empty(); private Optional<String> contentType = Optional.empty(); private Optional<IRI> base = Optional.empty(); @@ -227,7 +227,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> } @Override - public T rdfTermFactory(RDFTermFactory rdfTermFactory) { + public T rdfTermFactory(RDFFactory rdfTermFactory) { AbstractRDFParser<T> c = clone(); c.rdfTermFactory = Optional.ofNullable(rdfTermFactory); return c.asT(); @@ -501,20 +501,20 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> /** - * Create a new {@link RDFTermFactory} for a parse session. + * Create a new {@link RDFFactory} for a parse session. * <p> * This is called by {@link #parse()} to set - * {@link #rdfTermFactory(RDFTermFactory)} if it is + * {@link #rdfTermFactory(RDFFactory)} if it is * {@link Optional#empty()}. * <p> * As parsed blank nodes might be made with - * {@link RDFTermFactory#createBlankNode(String)}, + * {@link RDFFactory#createBlankNode(String)}, * each call to this method SHOULD return - * a new RDFTermFactory instance. + * a new RDFFactory instance. * - * @return A new {@link RDFTermFactory} + * @return A new {@link RDFFactory} */ - protected RDFTermFactory createRDFTermFactory() { + protected RDFFactory createRDFTermFactory() { return new SimpleRDFTermFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java index 57fec35..4b100b3 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/DefaultGraphTest.java @@ -20,20 +20,20 @@ package org.apache.commons.rdf.simple; import org.apache.commons.rdf.api.AbstractGraphTest; import org.apache.commons.rdf.api.Graph; import org.apache.commons.rdf.api.IRI; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; /** - * Ensure AbstractGraphTest does not crash if the RDFTermFactory throws + * Ensure AbstractGraphTest does not crash if the RDFFactory throws * UnsupportedOperationException */ public class DefaultGraphTest extends AbstractGraphTest { @Override - public RDFTermFactory createFactory() { - // The most minimal RDFTermFactory that would still + public RDFFactory createFactory() { + // The most minimal RDFFactory that would still // make sense with a Graph - return new RDFTermFactory() { + return new RDFFactory() { @Override public Graph createGraph() throws UnsupportedOperationException { return new GraphImpl(new SimpleRDFTermFactory()); http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java b/simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java index 769202f..c635aff 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/DummyRDFParserBuilder.java @@ -23,7 +23,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.experimental.RDFParser; import org.apache.commons.rdf.simple.experimental.AbstractRDFParser; import org.apache.commons.rdf.simple.experimental.RDFParseException; @@ -50,7 +50,7 @@ public class DummyRDFParserBuilder extends AbstractRDFParser<DummyRDFParserBuild @Override protected void parseSynchronusly() throws IOException, IllegalStateException, RDFParseException { // From parseSynchronusly both of these are always present - RDFTermFactory factory = getRdfTermFactory().get(); + RDFFactory factory = getRdfTermFactory().get(); Consumer<Quad> t = getTarget(); // well - each parsing is unique. This should hopefully http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java index 14f14a6..e5de520 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java @@ -20,7 +20,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.junit.Assume; import org.junit.Test; @@ -30,7 +30,7 @@ import org.junit.Test; public class SimpleGraphTest extends AbstractGraphTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new SimpleRDFTermFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java index 8e57d27..5c35de6 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleNoRelativeIRIRDFTermFactoryTest.java @@ -19,7 +19,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import java.net.URI; @@ -32,7 +32,7 @@ import java.net.URI; public class SimpleNoRelativeIRIRDFTermFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new SimpleRDFTermFactory() { @Override public IRI createIRI(String iri) { http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryLookupTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryLookupTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryLookupTest.java index 2fdeba7..96f64ca 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryLookupTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryLookupTest.java @@ -24,17 +24,17 @@ import static org.junit.Assert.assertTrue; import java.util.Iterator; import java.util.ServiceLoader; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.junit.Test; public class SimpleRDFTermFactoryLookupTest { @Test public void testServiceLoaderLookup() { - ServiceLoader<RDFTermFactory> loader = ServiceLoader.load(RDFTermFactory.class); + ServiceLoader<RDFFactory> loader = ServiceLoader.load(RDFFactory.class); - Iterator<RDFTermFactory> iterator = loader.iterator(); - RDFTermFactory factory = iterator.next(); + Iterator<RDFFactory> iterator = loader.iterator(); + RDFFactory factory = iterator.next(); assertTrue(factory instanceof SimpleRDFTermFactory); assertFalse(iterator.hasNext()); http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java index 9ef2a35..0cfabb4 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java @@ -18,15 +18,15 @@ package org.apache.commons.rdf.simple; import org.apache.commons.rdf.api.AbstractRDFTermFactoryTest; -import org.apache.commons.rdf.api.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; /** - * Simple RDFTermFactory Test + * Simple RDFFactory Test */ public class SimpleRDFTermFactoryTest extends AbstractRDFTermFactoryTest { @Override - public RDFTermFactory createFactory() { + public RDFFactory createFactory() { return new SimpleRDFTermFactory(); } http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java index a674664..1ed2e8f 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java @@ -29,7 +29,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -53,7 +53,7 @@ public class TestWritingGraph { private static Graph graph; - private static RDFTermFactory factory; + private static RDFFactory factory; @BeforeClass public static void createGraph() throws Exception { http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/c82f15ee/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java ---------------------------------------------------------------------- diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java index 7f3822b..f003c09 100644 --- a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java +++ b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java @@ -34,7 +34,7 @@ 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.RDFTermFactory; +import org.apache.commons.rdf.api.RDFFactory; import org.apache.commons.rdf.api.Triple; import org.apache.commons.rdf.experimental.RDFParser; import org.apache.commons.rdf.simple.DummyRDFParserBuilder; @@ -48,7 +48,7 @@ import org.junit.rules.ExpectedException; public class AbstractRDFParserTest { - private RDFTermFactory factory = new SimpleRDFTermFactory(); + private RDFFactory factory = new SimpleRDFTermFactory(); private DummyRDFParserBuilder dummyParser = new DummyRDFParserBuilder(); private Path testNt;