
org.ontoware.rdf2go.ModelFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rdf2go.api Show documentation
Show all versions of rdf2go.api Show documentation
RDF2go is an implementation-independent Java API with the design
goals: portability (hence the name), performance and ease of
implementation.
This project was started at FZI Forschungszentrum Informatik Karlsruhe, Germany - www.fzi.de
The newest version!
/**
* LICENSE INFORMATION
*
* Copyright 2005-2008 by FZI (http://www.fzi.de). Licensed under a BSD license
* (http://www.opensource.org/licenses/bsd-license.php) = Max Völkel
* = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe,
* Germany = 2010
*
* Further project information at http://semanticweb.org/wiki/RDF2Go
*/
package org.ontoware.rdf2go;
import java.util.Properties;
import org.ontoware.rdf2go.exception.ModelRuntimeException;
import org.ontoware.rdf2go.exception.ReasoningNotSupportedException;
import org.ontoware.rdf2go.model.Model;
import org.ontoware.rdf2go.model.ModelSet;
import org.ontoware.rdf2go.model.QueryResultTable;
import org.ontoware.rdf2go.model.node.URI;
/**
* RDF2Go adapters have to implement this interface to be able to create Models
* and ModelSets.
*
* Property keys are defined in this interface (Reasoning, Storage).
*
* @author voelkel
*
*/
public interface ModelFactory {
/**
* The Property key to indicate the Reasoning state in the properties. Legal
* values are:
*
* - NONE (default)
*
- RDFS
*
- OWL
*
*/
static final String REASONING = "Reasoning";
/**
* The Property key to indicate where to store the model or modelset. Legal
* values are:
*
* - MEMORY (default, stores in-memory)
*
- any absolute or relative path, in Java syntax ("/")
*
*/
static final String STORAGE = "Storage";
static final String STORAGE_VALUE_MEMORY = "MEMORY";
// ////////////////////////////////
// Model
/**
* Create a default in-memory ModelSet with no inferencing.
*
* @return a Model implementation.
* @throws ModelRuntimeException if the adapter could not create the model
*/
Model createModel() throws ModelRuntimeException;
/**
* Create a default in-memory ModelSet with no inferencing and the given
* context URI. All statements added to this model will have this context as
* the context.
*
* @return a Model implementation bound to the given context URI.
* @throws ModelRuntimeException if the adapter could not create the model
*/
Model createModel(URI contextURI) throws ModelRuntimeException;
/**
* Create a new Model with inferencing. Type of reasoning is passed.
*
* @param reasoning the type of reasoning that is needed
* @return a model with reasoning support
* @throws ModelRuntimeException if the adapter could not create the Model
* @throws ReasoningNotSupportedException if the passed kind of reasoning is
* not supported.
*/
Model createModel(Reasoning reasoning) throws ReasoningNotSupportedException,
ModelRuntimeException;
/**
* Create a Model configured by the given properties. You have to look at
* the adapter documentation to see which properties do what.
*
* @param properties configures the to-be-created Model
* @return the created Model
* @throws ModelRuntimeException if the adapter could not create the Model
* @throws ReasoningNotSupportedException if the passed kind of reasoning is
* not supported.
*/
Model createModel(Properties properties) throws ModelRuntimeException;
// ///////////////////////////
// ModelSet
/**
* create a default in-memory ModelSet with no inferencing.
*
* @return a ModelSet implementation.
* @throws ModelRuntimeException
*/
ModelSet createModelSet() throws ModelRuntimeException;
/**
* Create a default in-memory ModelSet with given inferencing. Type of
* reasoning is passed.
*
* @param reasoning the type of reasoning that is needed
* @return the created ModelSet
* @throws ModelRuntimeException
* @throws ReasoningNotSupportedException if the passed kind of reasoning is
* not supported.
* @throws ModelRuntimeException if the adapter could not create the model
*/
ModelSet createModelSet(Reasoning reasoning) throws ReasoningNotSupportedException,
ModelRuntimeException;
/**
* Create a ModelSet configured by the given properties. You have to look at
* the adapter documentation to see which properties do what.
*
* @param properties - configures the model creation
* @return the created ModelSet
* @throws ModelRuntimeException if the adapter could not create the Model
* @throws ReasoningNotSupportedException if the passed kind of reasoning is
* not supported.
*/
ModelSet createModelSet(Properties p) throws ModelRuntimeException;
/**
* @param url SPARQL endpoint URL, never null
* @param query SPARQL query, never null
* @return the result of executing the given SPARQL query against the remote
* URL.
* @throws UnsupportedOperationException if this underlying implemention
* does not support asking remote SPARQL endpoiints.
*/
QueryResultTable sparqlSelect(String url, String query);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy