001: /*
002: * LICENSE INFORMATION
003: * Copyright 2005-2007 by FZI (http://www.fzi.de).
004: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
005: * <OWNER> = Max Völkel
006: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
007: * <YEAR> = 2007
008: *
009: * Project information at http://semweb4j.org/rdf2go
010: */
011: package org.ontoware.rdf2go;
012:
013: import java.util.Properties;
014:
015: import org.ontoware.rdf2go.exception.ModelRuntimeException;
016: import org.ontoware.rdf2go.exception.ReasoningNotSupportedException;
017: import org.ontoware.rdf2go.model.Model;
018: import org.ontoware.rdf2go.model.ModelSet;
019: import org.ontoware.rdf2go.model.node.URI;
020:
021: /**
022: * RDF2Go adapters have toi implement this interface to be able to create Models
023: * and ModelSets.
024: *
025: * Property keys are defined in this interface (Reasoning, Storage).
026: *
027: * @author voelkel
028: *
029: */
030: public interface ModelFactory {
031:
032: /**
033: * The Property key to indicate the Reasoning state in the properties. Legal
034: * values are:
035: * <ul>
036: * <li>NONE (default)
037: * <li>RDFS
038: * <li>OWL
039: * </ul>
040: */
041: static final String REASONING = "Reasoning";
042:
043: /**
044: * The Property key to indicate where to store the model or modelset. Legal
045: * values are:
046: * <ul>
047: * <li>MEMORY (default, stores in-memory)
048: * <li>any absolute or relative path, in Java syntax ("/")
049: * </ul>
050: */
051: static final String STORAGE = "Storage";
052:
053: static final String STORAGE_VALUE_MEMORY = "MEMORY";
054:
055: // ////////////////////////////////
056: // Model
057:
058: /**
059: * Create a default in-memory ModelSet with no inferencing.
060: *
061: * @return a Model implementation.
062: * @throws ModelRuntimeException
063: * if the adapter could not create the model
064: */
065: Model createModel() throws ModelRuntimeException;
066:
067: /**
068: * Create a default in-memory ModelSet with no inferencing and the given
069: * context URI. All statements added to this model will have this context as
070: * the context of each statement.
071: *
072: * @return a Model implementation bound to the given context URI.
073: * @throws ModelRuntimeException
074: * if the adapter could not create the model
075: */
076: Model createModel(URI contextURI) throws ModelRuntimeException;
077:
078: /**
079: * Create a new Model with inferencing. Type of reasoning is passed.
080: *
081: * @param reasoning
082: * the type of reasoning that is needed
083: * @return a model with reasoning support
084: * @throws ModelRuntimeException
085: * if the adapter could not create the Model
086: * @throws ReasoningNotSupportedException
087: * if the passed kind of reasoning is not supported.
088: */
089: Model createModel(Reasoning reasoning)
090: throws ReasoningNotSupportedException,
091: ModelRuntimeException;
092:
093: /**
094: * Create a Model configured by the given properties. You have to look at
095: * the adapter documentation to see which properties do what.
096: *
097: * @throws ModelRuntimeException
098: * if the adapter could not create the Model
099: * @throws ReasoningNotSupportedException
100: * if the passed kind of reasoning is not supported.
101: * @param properties
102: * configures the to-be-created Model
103: * @return the created Model
104: * @throws ModelRuntimeException
105: */
106: Model createModel(Properties p) throws ModelRuntimeException;
107:
108: // ///////////////////////////
109: // ModelSet
110:
111: /**
112: * create a default in-memory ModelSet with no inferencing.
113: *
114: * @return a ModelSet implementation.
115: * @throws NotImplementedException
116: * a RuntimeException if this method is not implemented. Should
117: * not happen.
118: */
119: ModelSet createModelSet() throws ModelRuntimeException;
120:
121: /**
122: * Create a default in-memory ModelSet with given inferencing. Type of
123: * reasoning is passed.
124: *
125: * @param reasoning
126: * the type of reasoning that is needed
127: * @return the created ModelSet
128: * @throws ModelRuntimeException
129: * @throws ReasoningNotSupportedException
130: * if the passed kind of reasoning is not supported.
131: * @throws ModelRuntimeException
132: * if the adapter could not create the model
133: */
134: ModelSet createModelSet(Reasoning reasoning)
135: throws ReasoningNotSupportedException,
136: ModelRuntimeException;
137:
138: /**
139: * Create a ModelSet configured by the given properties. You have to look at
140: * the adapter documentation to see which properties do what.
141: *
142: * @param properties -
143: * configures the model creation
144: * @return the created ModelSet
145: * @throws ModelRuntimeException
146: * if the adapter could not create the Model
147: * @throws ReasoningNotSupportedException
148: * if the passed kind of reasoning is not supported.
149: */
150: ModelSet createModelSet(Properties p) throws ModelRuntimeException;
151:
152: }
|