Class RequestModelAccessImpl
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.modelaccess.impl.RequestModelAccessImpl
-
- All Implemented Interfaces:
RequestModelAccess
public class RequestModelAccessImpl extends Object implements RequestModelAccess
For each category of data structure, the pattern is the same: Build a key from the supplied options. If the cache contains a structure with that key, return it. Otherwise, create the requested structure, often from a simplified version. For example, if the request was for a LANGUAGE_AWARE RDFService, get the LANGUAGE_NEUTRAL RDFService and wrap it with langauge awareness. This second step is a recursive call, so we check again to see if the cache contains the new requested structure based on a modified key. If it does contain the structure, use it. Otherwise, create it. Eventually, we reach a request for the simplest structure, which we fetch from the ShortTermDataStructuresFactory. If the request includes language-awareness, the structure can be created from the language-neutral version. If language-awareness is disabled, the language-neutral structure will be cached under two different keys. ---------------------------------------- There are two hacks here to support model switching: one in the OntModels and one in the WebappDaoFactories. These are hacks for several reasons, not the least of which is that the model switching will not be available on WebappDaoFactories based on ASSERTIONS_ONLY or INFERENCES_ONLY, and similarly for the OntModel.
-
-
Constructor Summary
Constructors Constructor Description RequestModelAccessImpl(javax.servlet.http.HttpServletRequest req, ShortTermCombinedTripleSource source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()When finished, release any resources.org.apache.jena.query.DatasetgetDataset(ModelAccess.DatasetOption... options)Get a Dataset: CONTENT or CONFIGURATION, Language-aware or not.org.apache.jena.ontology.OntModelgetOntModel(ModelAccess.LanguageOption... options)Get the FULL_UNION OntModel: Language-aware or not.org.apache.jena.ontology.OntModelgetOntModel(String name, ModelAccess.LanguageOption... options)Get an OntModel: Language-aware or not.OntModelSelectorgetOntModelSelector(ModelAccess.OntModelSelectorOption... options)Get an OntModelSelector: Language-aware or not, ASSERTIONS or INFERENCES or both.RDFServicegetRDFService(ModelAccess.RdfServiceOption... options)Get an RDFService: CONTENT or CONFIGURATION, Language-aware or not.WebappDaoFactorygetWebappDaoFactory(ModelAccess.WebappDaoFactoryOption... options)Get a WebappDaoFactory: Filtered or not, Language-aware or not, ASSERTIONS or INFERENCES or both.voidsetSpecialWriteModel(org.apache.jena.ontology.OntModel mainOntModel)TODO Hack for model switching.StringtoString()
-
-
-
Constructor Detail
-
RequestModelAccessImpl
public RequestModelAccessImpl(javax.servlet.http.HttpServletRequest req, ShortTermCombinedTripleSource source)
-
-
Method Detail
-
close
public void close()
Description copied from interface:RequestModelAccessWhen finished, release any resources.- Specified by:
closein interfaceRequestModelAccess
-
getRDFService
public RDFService getRDFService(ModelAccess.RdfServiceOption... options)
Description copied from interface:RequestModelAccessGet an RDFService: CONTENT or CONFIGURATION, Language-aware or not.- Specified by:
getRDFServicein interfaceRequestModelAccess
-
getDataset
public org.apache.jena.query.Dataset getDataset(ModelAccess.DatasetOption... options)
Description copied from interface:RequestModelAccessGet a Dataset: CONTENT or CONFIGURATION, Language-aware or not.- Specified by:
getDatasetin interfaceRequestModelAccess
-
getOntModel
public org.apache.jena.ontology.OntModel getOntModel(ModelAccess.LanguageOption... options)
Description copied from interface:RequestModelAccessGet the FULL_UNION OntModel: Language-aware or not.- Specified by:
getOntModelin interfaceRequestModelAccess
-
getOntModel
public org.apache.jena.ontology.OntModel getOntModel(String name, ModelAccess.LanguageOption... options)
Description copied from interface:RequestModelAccessGet an OntModel: Language-aware or not.- Specified by:
getOntModelin interfaceRequestModelAccess
-
setSpecialWriteModel
public void setSpecialWriteModel(org.apache.jena.ontology.OntModel mainOntModel)
TODO Hack for model switching.
-
getOntModelSelector
public OntModelSelector getOntModelSelector(ModelAccess.OntModelSelectorOption... options)
Description copied from interface:RequestModelAccessGet an OntModelSelector: Language-aware or not, ASSERTIONS or INFERENCES or both.- Specified by:
getOntModelSelectorin interfaceRequestModelAccess
-
getWebappDaoFactory
public WebappDaoFactory getWebappDaoFactory(ModelAccess.WebappDaoFactoryOption... options)
Description copied from interface:RequestModelAccessGet a WebappDaoFactory: Filtered or not, Language-aware or not, ASSERTIONS or INFERENCES or both.- Specified by:
getWebappDaoFactoryin interfaceRequestModelAccess
-
-