it.uniroma2.art.owlart.models
Class OWLArtModelFactory<MC extends ModelConfiguration>

java.lang.Object
  extended by it.uniroma2.art.owlart.models.OWLArtModelFactory<MC>
All Implemented Interfaces:
ModelFactory<MC>

public class OWLArtModelFactory<MC extends ModelConfiguration>
extends java.lang.Object
implements ModelFactory<MC>

a standard implementation of ModelFactory which takes the duty of loading basic vocabularies of the RDF family (RDF, RDFS, OWL) according to the specific type of model which is being loaded

Author:
Armando Stellato

Method Summary
 void checkVocabularyData(BaseRDFTripleModel model, java.util.Collection<java.lang.String> namespaces)
          populates a model with standard definitions for vocabularies associated to namespaces, if the vocabulary has not already been loaded in the model by its specific ModelFactory implementation
the model is only populated if isPopulatingW3CVocabularies() amounts to true
 void checkVocabularyData(BaseRDFTripleModel rep, java.lang.String vocNS, java.net.URL vocDataURL)
          populates a model with standard definitions for vocabulary associated to vocNS by loading the rdf file from vocDataURL
the model is only populated if isPopulatingW3CVocabularies() amounts to true
 void closeModel(BaseRDFTripleModel rep)
          closes the Model, by releasing all of its resources
 MC createModelConfigurationObject()
          gets the first available model configuration from the loaded ModelFactory implementation
<MCImpl extends MC>
MCImpl
createModelConfigurationObject(java.lang.Class<MCImpl> mcclass)
           
<MCImpl extends MC>
MCImpl
createModelConfigurationObject(java.lang.Class<MCImpl> mcclass, java.io.File propertyFile)
           
 MC createModelConfigurationObject(java.io.File propertyFile)
          this method is a short cut for the two calls: createModelConfigurationObject(Class): with class set to the first ModelConfiguration available for the loaded ModelFactory implementation ModelConfiguration.loadParameters(File): invoked from the modelConfiguration created on the previous call, on the propertyFile passed as argument of this method
static
<MC extends ModelConfiguration>
OWLArtModelFactory<MC>
createModelFactory(ModelFactory<MC> mf)
          basic factory which creates an instance of this class by encapsulating a ModelFactory plain implementation and adding vocabulary management to it
 java.util.Collection<java.lang.Class<? extends MC>> getModelConfigurations()
           
 boolean isPopulatingW3CVocabularies()
          tells if the factory to create graphs for the proper W3C vocabularies in the models which it creates, if they are not already available.
<T extends RDFModel>
T
loadModel(java.lang.Class<T> modelClass, java.lang.String baseuri, java.lang.String persistenceDirectory)
           
<T extends RDFModel>
T
loadModel(java.lang.Class<T> modelClass, java.lang.String baseuri, java.lang.String persistenceDirectory, ModelConfiguration conf)
           
 OWLModel loadOWLModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
           
<MCImpl extends MC>
OWLModel
loadOWLModel(java.lang.String baseuri, java.lang.String repositoryDirectory, MCImpl conf)
          loads/creates a OWLModel from/in directory persistenceDirectory
<MCImpl extends MC>
BaseRDFTripleModel
loadRDFBaseModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
           
<MCImpl extends MC>
BaseRDFTripleModel
loadRDFBaseModel(java.lang.String baseuri, java.lang.String repositoryDirectory, MCImpl conf)
          loads/creates a BaseRDFTripleModel from/in directory persistenceDirectory
<MCImpl extends MC>
RDFModel
loadRDFModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
           
<MCImpl extends MC>
RDFModel
loadRDFModel(java.lang.String baseuri, java.lang.String repositoryDirectory, MCImpl conf)
          loads/creates a RDFModel from/in directory persistenceDirectory
 RDFSModel loadRDFSModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
           
<MCImpl extends MC>
RDFSModel
loadRDFSModel(java.lang.String baseuri, java.lang.String repositoryDirectory, MCImpl conf)
          loads/creates a RDFSModel from/in directory persistenceDirectory
 SKOSModel loadSKOSModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
           
<MCImpl extends MC>
SKOSModel
loadSKOSModel(java.lang.String baseuri, java.lang.String persistenceDirectory, MCImpl conf)
          loads/creates a SKOSModel from/in directory persistenceDirectory
 SKOSXLModel loadSKOSXLModel(java.lang.String baseuri, java.lang.String repositoryDirectory)
          shortcut for loadSKOSXLModel(String, String, ModelConfiguration) with a standard ModelConfiguration
<MCImpl extends MC>
SKOSXLModel
loadSKOSXLModel(java.lang.String baseuri, java.lang.String persistenceDirectory, MCImpl conf)
          loads/creates a SKOSXLModel from/in directory persistenceDirectory
 TripleQueryModelHTTPConnection loadTripleQueryHTTPConnection(java.lang.String endpointURL)
          accesses a SPARQL endpoint available at the given endpointURL
 void setPopulatingW3CVocabularies(boolean pref)
          instructs the factory to create graphs for the proper W3C vocabularies in the models which it creates, if they are not already available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createModelFactory

public static <MC extends ModelConfiguration> OWLArtModelFactory<MC> createModelFactory(ModelFactory<MC> mf)
basic factory which creates an instance of this class by encapsulating a ModelFactory plain implementation and adding vocabulary management to it

Parameters:
mf -
Returns:

closeModel

public void closeModel(BaseRDFTripleModel rep)
                throws ModelUpdateException
Description copied from interface: ModelFactory
closes the Model, by releasing all of its resources

Specified by:
closeModel in interface ModelFactory<MC extends ModelConfiguration>
Throws:
ModelUpdateException

loadRDFBaseModel

public <MCImpl extends MC> BaseRDFTripleModel loadRDFBaseModel(java.lang.String baseuri,
                                                               java.lang.String repositoryDirectory,
                                                               MCImpl conf)
                                    throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a BaseRDFTripleModel from/in directory persistenceDirectory

Specified by:
loadRDFBaseModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadRDFBaseModel

public <MCImpl extends MC> BaseRDFTripleModel loadRDFBaseModel(java.lang.String baseuri,
                                                               java.lang.String repositoryDirectory)
                                    throws ModelCreationException
Throws:
ModelCreationException

loadRDFModel

public <MCImpl extends MC> RDFModel loadRDFModel(java.lang.String baseuri,
                                                 java.lang.String repositoryDirectory,
                                                 MCImpl conf)
                      throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a RDFModel from/in directory persistenceDirectory

Specified by:
loadRDFModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadRDFModel

public <MCImpl extends MC> RDFModel loadRDFModel(java.lang.String baseuri,
                                                 java.lang.String repositoryDirectory)
                      throws ModelCreationException
Throws:
ModelCreationException

loadRDFSModel

public <MCImpl extends MC> RDFSModel loadRDFSModel(java.lang.String baseuri,
                                                   java.lang.String repositoryDirectory,
                                                   MCImpl conf)
                        throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a RDFSModel from/in directory persistenceDirectory

Specified by:
loadRDFSModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadRDFSModel

public RDFSModel loadRDFSModel(java.lang.String baseuri,
                               java.lang.String repositoryDirectory)
                        throws ModelCreationException
Throws:
ModelCreationException

loadOWLModel

public <MCImpl extends MC> OWLModel loadOWLModel(java.lang.String baseuri,
                                                 java.lang.String repositoryDirectory,
                                                 MCImpl conf)
                      throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a OWLModel from/in directory persistenceDirectory

Specified by:
loadOWLModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadOWLModel

public OWLModel loadOWLModel(java.lang.String baseuri,
                             java.lang.String repositoryDirectory)
                      throws ModelCreationException
Throws:
ModelCreationException

loadSKOSModel

public <MCImpl extends MC> SKOSModel loadSKOSModel(java.lang.String baseuri,
                                                   java.lang.String persistenceDirectory,
                                                   MCImpl conf)
                        throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a SKOSModel from/in directory persistenceDirectory

Specified by:
loadSKOSModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadSKOSModel

public SKOSModel loadSKOSModel(java.lang.String baseuri,
                               java.lang.String repositoryDirectory)
                        throws ModelCreationException
Throws:
ModelCreationException

loadSKOSXLModel

public <MCImpl extends MC> SKOSXLModel loadSKOSXLModel(java.lang.String baseuri,
                                                       java.lang.String persistenceDirectory,
                                                       MCImpl conf)
                            throws ModelCreationException
Description copied from interface: ModelFactory
loads/creates a SKOSXLModel from/in directory persistenceDirectory

Specified by:
loadSKOSXLModel in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadSKOSXLModel

public SKOSXLModel loadSKOSXLModel(java.lang.String baseuri,
                                   java.lang.String repositoryDirectory)
                            throws ModelCreationException
shortcut for loadSKOSXLModel(String, String, ModelConfiguration) with a standard ModelConfiguration

Parameters:
baseuri -
repositoryDirectory -
Returns:
Throws:
ModelCreationException

loadTripleQueryHTTPConnection

public TripleQueryModelHTTPConnection loadTripleQueryHTTPConnection(java.lang.String endpointURL)
                                                             throws ModelCreationException
Description copied from interface: ModelFactory
accesses a SPARQL endpoint available at the given endpointURL

Specified by:
loadTripleQueryHTTPConnection in interface ModelFactory<MC extends ModelConfiguration>
Returns:
Throws:
ModelCreationException

loadModel

public <T extends RDFModel> T loadModel(java.lang.Class<T> modelClass,
                                        java.lang.String baseuri,
                                        java.lang.String persistenceDirectory,
                                        ModelConfiguration conf)
                             throws ModelCreationException
Throws:
ModelCreationException

loadModel

public <T extends RDFModel> T loadModel(java.lang.Class<T> modelClass,
                                        java.lang.String baseuri,
                                        java.lang.String persistenceDirectory)
                             throws ModelCreationException
Throws:
ModelCreationException

createModelConfigurationObject

public MC createModelConfigurationObject()
                                                             throws UnsupportedModelConfigurationException,
                                                                    UnloadableModelConfigurationException
gets the first available model configuration from the loaded ModelFactory implementation

Returns:
Throws:
UnsupportedModelConfigurationException
UnloadableModelConfigurationException

createModelConfigurationObject

public MC createModelConfigurationObject(java.io.File propertyFile)
                                                             throws UnsupportedModelConfigurationException,
                                                                    BadConfigurationException,
                                                                    java.io.IOException,
                                                                    UnloadableModelConfigurationException
this method is a short cut for the two calls:

Parameters:
propertyFile -
Returns:
Throws:
UnsupportedModelConfigurationException
BadConfigurationException
java.io.IOException
UnloadableModelConfigurationException

createModelConfigurationObject

public <MCImpl extends MC> MCImpl createModelConfigurationObject(java.lang.Class<MCImpl> mcclass)
                                                 throws UnsupportedModelConfigurationException,
                                                        UnloadableModelConfigurationException
Specified by:
createModelConfigurationObject in interface ModelFactory<MC extends ModelConfiguration>
Throws:
UnsupportedModelConfigurationException
UnloadableModelConfigurationException

createModelConfigurationObject

public <MCImpl extends MC> MCImpl createModelConfigurationObject(java.lang.Class<MCImpl> mcclass,
                                                                 java.io.File propertyFile)
                                                 throws UnsupportedModelConfigurationException,
                                                        UnloadableModelConfigurationException,
                                                        BadConfigurationException,
                                                        java.io.IOException
Throws:
UnsupportedModelConfigurationException
UnloadableModelConfigurationException
BadConfigurationException
java.io.IOException

getModelConfigurations

public java.util.Collection<java.lang.Class<? extends MC>> getModelConfigurations()
Specified by:
getModelConfigurations in interface ModelFactory<MC extends ModelConfiguration>

checkVocabularyData

public void checkVocabularyData(BaseRDFTripleModel model,
                                java.util.Collection<java.lang.String> namespaces)
                         throws ModelAccessException,
                                java.io.IOException,
                                ModelUpdateException,
                                UnsupportedRDFFormatException
populates a model with standard definitions for vocabularies associated to namespaces, if the vocabulary has not already been loaded in the model by its specific ModelFactory implementation
the model is only populated if isPopulatingW3CVocabularies() amounts to true

Parameters:
model -
namespaces -
Throws:
ModelAccessException
java.io.IOException
ModelUpdateException
UnsupportedRDFFormatException

checkVocabularyData

public void checkVocabularyData(BaseRDFTripleModel rep,
                                java.lang.String vocNS,
                                java.net.URL vocDataURL)
                         throws ModelAccessException,
                                java.io.IOException,
                                ModelUpdateException,
                                UnsupportedRDFFormatException
populates a model with standard definitions for vocabulary associated to vocNS by loading the rdf file from vocDataURL
the model is only populated if isPopulatingW3CVocabularies() amounts to true

Parameters:
rep -
vocNS -
vocDataURL -
Throws:
ModelAccessException
java.io.IOException
ModelUpdateException
UnsupportedRDFFormatException

setPopulatingW3CVocabularies

public void setPopulatingW3CVocabularies(boolean pref)
Description copied from interface: ModelFactory
instructs the factory to create graphs for the proper W3C vocabularies in the models which it creates, if they are not already available. An example of "proper" vocabularies is the list of {RDF, RDFS, OWL} if an OWLModel is being created

Specified by:
setPopulatingW3CVocabularies in interface ModelFactory<MC extends ModelConfiguration>

isPopulatingW3CVocabularies

public boolean isPopulatingW3CVocabularies()
Description copied from interface: ModelFactory
tells if the factory to create graphs for the proper W3C vocabularies in the models which it creates, if they are not already available. An example of "proper" vocabularies is the list of {RDF, RDFS, OWL} if an OWLModel is being created

Specified by:
isPopulatingW3CVocabularies in interface ModelFactory<MC extends ModelConfiguration>


Copyright © 2013 ART Group, University of Rome, Tor Vergata. All Rights Reserved.