Class SparqlQueryDataGetter
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterBase
-
- edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter
-
- All Implemented Interfaces:
DataGetter
public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter
-
-
Field Summary
Fields Modifier and Type Field Description static StringdefaultVarNameForResults-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterBase
CONTEXT_DISPLAY_MODEL, REQUEST_DISPLAY_MODEL, REQUEST_JENA_ONT_MODEL
-
-
Constructor Summary
Constructors Constructor Description SparqlQueryDataGetter(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String dataGetterURI)Constructor with display model and data getter URI that will be called by reflection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String dataGetterURI)Configure this instance based on the URI and display model.protected Map<String,Object>doQueryOnModel(String q, org.apache.jena.rdf.model.Model queryModel)Do the query and return a result.protected Map<String,Object>doQueryOnRDFService(String q)Do the query and return a result.Map<String,Object>getData(Map<String,Object> pageData)Get data.-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterBase
getModel
-
-
-
-
Field Detail
-
defaultVarNameForResults
public static final String defaultVarNameForResults
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SparqlQueryDataGetter
public SparqlQueryDataGetter(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String dataGetterURI)
Constructor with display model and data getter URI that will be called by reflection.
-
-
Method Detail
-
configure
protected void configure(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String dataGetterURI)
Configure this instance based on the URI and display model.
-
getData
public Map<String,Object> getData(Map<String,Object> pageData)
Description copied from interface:DataGetterGet data. Throwing an Exception is acceptable.- Specified by:
getDatain interfaceDataGetter- Parameters:
pageData- any values already generated by data getters or the controller. Might be immutable, and should not be modified within the method.- Returns:
- data to add to valueMap. Might be empty, but should not be null.
-
doQueryOnRDFService
protected Map<String,Object> doQueryOnRDFService(String q)
Do the query and return a result. This is in its own method, with protected access, to make testing easy.
-
-