Return-Path: X-Original-To: apmail-jena-commits-archive@www.apache.org Delivered-To: apmail-jena-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78F29177DE for ; Fri, 24 Apr 2015 17:42:13 +0000 (UTC) Received: (qmail 94670 invoked by uid 500); 24 Apr 2015 17:42:13 -0000 Delivered-To: apmail-jena-commits-archive@jena.apache.org Received: (qmail 94632 invoked by uid 500); 24 Apr 2015 17:42:13 -0000 Mailing-List: contact commits-help@jena.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jena.apache.org Delivered-To: mailing list commits@jena.apache.org Received: (qmail 94623 invoked by uid 99); 24 Apr 2015 17:42:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2015 17:42:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2FC68E0F7D; Fri, 24 Apr 2015 17:42:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: andy@apache.org To: commits@jena.apache.org Date: Fri, 24 Apr 2015 17:42:13 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] jena git commit: Remove functions that use FileManager (which was ignored) Repository: jena Updated Branches: refs/heads/jena3 72fd5768b -> d2afc57c0 Remove functions that use FileManager (which was ignored) Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/463582a3 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/463582a3 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/463582a3 Branch: refs/heads/jena3 Commit: 463582a3aeb50244fa30781370d30793bc63f6fc Parents: 72fd576 Author: Andy Seaborne Authored: Fri Apr 24 18:12:56 2015 +0100 Committer: Andy Seaborne Committed: Fri Apr 24 18:12:56 2015 +0100 ---------------------------------------------------------------------- .../org/apache/jena/query/DatasetFactory.java | 314 +++++++++---------- 1 file changed, 157 insertions(+), 157 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/463582a3/jena-arq/src/main/java/org/apache/jena/query/DatasetFactory.java ---------------------------------------------------------------------- diff --git a/jena-arq/src/main/java/org/apache/jena/query/DatasetFactory.java b/jena-arq/src/main/java/org/apache/jena/query/DatasetFactory.java index fd82272..fdd6739 100644 --- a/jena-arq/src/main/java/org/apache/jena/query/DatasetFactory.java +++ b/jena-arq/src/main/java/org/apache/jena/query/DatasetFactory.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.jena.query; +package org.apache.jena.query ; import java.util.List ; @@ -34,235 +34,235 @@ import org.apache.jena.util.FileManager ; /** Make Datasets and DataSources in various ways */ -public class DatasetFactory -{ +public class DatasetFactory { /** Create an in-memory, modifiable Dataset */ - public static Dataset createMem() { return create(DatasetGraphFactory.createMem()) ; } - - /** Create an in-memory, modifiable Dataset. - * New graphs must be explicitly added using .addGraph. + public static Dataset createMem() { + return create(DatasetGraphFactory.createMem()) ; + } + + /** + * Create an in-memory, modifiable Dataset. New graphs must be explicitly + * added using .addGraph. */ - public static Dataset createMemFixed() { return create(DatasetGraphFactory.createMemFixed()) ; } + public static Dataset createMemFixed() { + return create(DatasetGraphFactory.createMemFixed()) ; + } - /** Create an in-memory, modifyable Dataset - * @deprecated Use createMem + /** + * Create a dataset with the given model as the default graph + * + * @param model + * The model for the default graph + * @return Dataset */ - @Deprecated - public static Dataset create() { return createMem() ; } - - /** Create a dataset with the given model as the default graph - * @param model The model for the default graph - * @return Dataset - */ - public static Dataset create(Model model) - { return new DatasetImpl(model) ; } - - /** Create a dataset: clone the dataset structure of named graohs, and share the graphs themselves. - * @param dataset Dataset to clone structure from. - * @return Dataset - */ - public static Dataset create(Dataset dataset) - { return new DatasetImpl(dataset) ; } - - /** Wrap a datasetgraph to make a mutable dataset - * @param dataset DatasetGraph - * @return Dataset - */ - public static Dataset create(DatasetGraph dataset) - { return DatasetImpl.wrap(dataset) ; } - - /** Create a dataset based on a list of URIs : these are merged into the default graph of the dataset. + public static Dataset create(Model model) { + return new DatasetImpl(model) ; + } + + /** + * Create a dataset: clone the dataset structure of named graohs, and share + * the graphs themselves. * - * @param uriList URIs merged to form the default dataset + * @param dataset + * Dataset to clone structure from. * @return Dataset */ - - public static Dataset create(List uriList) - { return create(uriList, null, null, null) ; } - - /** Create a dataset with a default graph and no named graphs + public static Dataset create(Dataset dataset) { + return new DatasetImpl(dataset) ; + } + + /** + * Wrap a datasetgraph to make a mutable dataset * - * @param uri URIs merged to form the default dataset + * @param dataset + * DatasetGraph * @return Dataset */ - - public static Dataset create(String uri) - { return create(uri, null, null, null) ; } + public static Dataset create(DatasetGraph dataset) { + return DatasetImpl.wrap(dataset) ; + } - /** Create a dataset based on a list of URIs : these are merged into the default graph of the dataset. + /** + * Create a dataset based on a list of URIs : these are merged into the + * default graph of the dataset. * - * @param uriList URIs merged to form the default dataset - * @param fileManager + * @param uriList + * URIs merged to form the default dataset * @return Dataset */ - - public static Dataset create(List uriList, FileManager fileManager) - { return create(uriList, null, fileManager, null) ; } - - /** Create a dataset based on a list of URIs : these are merged into the default graph of the dataset. + + public static Dataset create(List uriList) { + return create(uriList, null, null) ; + } + + /** + * Create a dataset with a default graph and no named graphs + * + * @param uri + * URIs merged to form the default dataset + * @return Dataset + */ + + public static Dataset create(String uri) { + return create(uri, null, null) ; + } + + /** + * Create a dataset based on a list of URIs : these are merged into the + * default graph of the dataset. * - * @param uri graph to be loaded into the unnamed, default graph + * @param uriList + * URIs merged to form the default dataset * @param fileManager * @return Dataset */ - - public static Dataset create(String uri, FileManager fileManager) - { return create(uri, null, fileManager, null) ; } - /** Create a named graph container of graphs based on a list of URIs. + /** + * Create a named graph container of graphs based on a list of URIs. * * @param namedSourceList - * @param fileManager * @return Dataset */ - - public static Dataset createNamed(List namedSourceList, FileManager fileManager) - { return create((List)null, namedSourceList, fileManager, null) ; } - - /** Create a dataset based on two list of URIs. - * The first lists is used to create the background (unnamed graph) by merging, the - * second is used to create the collection of named graphs. - * - * (Jena calls graphs "Models" and triples "Statements") + + public static Dataset createNamed(List namedSourceList) { + return create((List)null, namedSourceList, null) ; + } + + /** + * Create a dataset based on two list of URIs. The first lists is used to + * create the background (unnamed graph) by merging, the second is used to + * create the collection of named graphs. + * + * (Jena calls graphs "Models" and triples "Statements") * - * @param uriList graphs to be loaded into the unnamed, default graph - * @param namedSourceList graphs to be atatched as named graphs + * @param uriList + * graphs to be loaded into the unnamed, default graph + * @param namedSourceList + * graphs to be atatched as named graphs * @return Dataset */ - - public static Dataset create(List uriList, List namedSourceList) - { - return create(uriList, namedSourceList, null, null) ; + + public static Dataset create(List uriList, List namedSourceList) { + return create(uriList, namedSourceList, null) ; } - /** Create a dataset container based on two list of URIs. - * The first is used to create the background (unnamed graph), the - * second is used to create the collection of named graphs. - * - * (Jena calls graphs "Models" and triples "Statements") + /** + * Create a dataset container based on two list of URIs. The first is used + * to create the background (unnamed graph), the second is used to create + * the collection of named graphs. + * + * (Jena calls graphs "Models" and triples "Statements") * - * @param uri graph to be loaded into the unnamed, default graph - * @param namedSourceList graphs to be attached as named graphs + * @param uri + * graph to be loaded into the unnamed, default graph + * @param namedSourceList + * graphs to be attached as named graphs * @return Dataset */ - - public static Dataset create(String uri, List namedSourceList) - { - return create(uri, namedSourceList, null, null) ; + + public static Dataset create(String uri, List namedSourceList) { + return create(uri, namedSourceList, null) ; } - /** Create a named graph container based on two list of URIs. - * The first is used to create the background (unnamed graph), the - * second is used to create the collection of named graphs. - * - * (Jena calls graphs "Models" and triples "Statements") + /** + * Create a named graph container based on two list of URIs. The first is + * used to create the background (unnamed graph), the second is used to + * create the collection of named graphs. * - * @param uri graph to be loaded into the unnamed, default graph - * @param namedSourceList graphs to be atatched as named graphs - * @param fileManager - * @param baseURI baseURI for relative URI expansion + * (Jena calls graphs "Models" and triples "Statements") + * + * @param uri + * graph to be loaded into the unnamed, default graph + * @param namedSourceList + * graphs to be atatched as named graphs + * @param baseURI + * baseURI for relative URI expansion * @return Dataset */ - - public static Dataset create(String uri, List namedSourceList, - FileManager fileManager, String baseURI) - { + + public static Dataset create(String uri, List namedSourceList, String baseURI) { return DatasetUtils.createDataset(uri, namedSourceList, baseURI) ; } - - - /** Create a named graph container based on two list of URIs. - * The first is used to create the background (unnamed graph), the - * second is used to create the collection of named graphs. - * - * (Jena calls graphs "Models" and triples "Statements") + + /** + * Create a named graph container based on two list of URIs. The first is + * used to create the background (unnamed graph), the second is used to + * create the collection of named graphs. * - * @param uriList graphs to be loaded into the unnamed, default graph - * @param namedSourceList graphs to be atatched as named graphs - * @param fileManager - * @param baseURI baseURI for relative URI expansion + * (Jena calls graphs "Models" and triples "Statements") + * + * @param uriList + * graphs to be loaded into the unnamed, default graph + * @param namedSourceList + * graphs to be atatched as named graphs + * @param baseURI + * baseURI for relative URI expansion * @return Dataset - * @deprecated FileManager argument has no effect */ - - @Deprecated - public static Dataset create(List uriList, List namedSourceList, - FileManager fileManager, String baseURI) - { + + public static Dataset create(List uriList, List namedSourceList, String baseURI) { return DatasetUtils.createDataset(uriList, namedSourceList, baseURI) ; } - -// public static Dataset make(Dataset ds) -// { -// DataSourceImpl ds2 = new DataSourceImpl(ds) ; -// return ds2 ; -// } - -// public static Dataset make(Dataset ds, Graph defaultGraph) -// { -// DataSourceImpl ds2 = new DataSourceImpl(ds) ; -// ds2.setDefaultGraph(defaultGraph) ; -// return ds2 ; -// } - - public static Dataset make(Dataset ds, Model defaultModel) - { + + public static Dataset make(Dataset ds, Model defaultModel) { Dataset ds2 = new DatasetImpl(ds) ; ds2.setDefaultModel(defaultModel) ; - return ds2 ; + return ds2 ; } - + // Assembler. - /** Assembler a dataset from the model in a file + /** + * Assembler a dataset from the model in a file * - * @param filename The filename + * @param filename + * The filename * @return Dataset */ - public static Dataset assemble(String filename) - { + public static Dataset assemble(String filename) { Model model = FileManager.get().loadModel(filename) ; return assemble(model) ; } - - /** Assembler a dataset from the model in a file + + /** + * Assembler a dataset from the model in a file * - * @param filename The filename - * @param resourceURI URI for the dataset to assembler + * @param filename + * The filename + * @param resourceURI + * URI for the dataset to assembler * @return Dataset */ - public static Dataset assemble(String filename, String resourceURI) - { + public static Dataset assemble(String filename, String resourceURI) { Model model = FileManager.get().loadModel(filename) ; - Resource r = model.createResource(resourceURI) ; + Resource r = model.createResource(resourceURI) ; return assemble(r) ; } - /** Assembler a dataset from the model + /** + * Assembler a dataset from the model * * @param model * @return Dataset */ - public static Dataset assemble(Model model) - { + public static Dataset assemble(Model model) { Resource r = GraphUtils.findRootByType(model, DatasetAssembler.getType()) ; if ( r == null ) - throw new ARQException("No root found for type <"+DatasetAssembler.getType()+">") ; - + throw new ARQException("No root found for type <" + DatasetAssembler.getType() + ">") ; + return assemble(r) ; } - - /** Assembler a dataset from a resource + + /** + * Assembler a dataset from a resource * - * @param resource The resource for the dataset + * @param resource + * The resource for the dataset * @return Dataset */ - - public static Dataset assemble(Resource resource) - { + + public static Dataset assemble(Resource resource) { Dataset ds = (Dataset)Assembler.general.open(resource) ; return ds ; } - - }