Package fi.tuni.ens.atme.mei.prdquerylib
Class Client
- java.lang.Object
-
- fi.tuni.ens.atme.mei.prdquerylib.Client
-
public class Client extends Object
Janaka Nawagamuwa created on 19/08/2021
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_PRD_ONTOLOGY_LOCATION
Default PRD model locationstatic String
PRODUCT_MODEL_NS
the product model ontology name space url
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.jena.query.QueryExecution
loadTemplate(String name, Map<String,Object> params, boolean usePellet)
gets a query execution that is based on a sparql query in a file.org.apache.jena.query.QueryExecution
loadTemplate(String name, Map<String,Object> params, Map<String,Object> litParams, boolean usePellet)
gets a query execution that is based on a sparql query in a file.List<ProcessStep>
queryAllProcessSteps()
void
setPrdOntology(InputStream input)
void
setPrdOntology(String fileName)
Set the resource instance ontology of the client.
-
-
-
Field Detail
-
PRODUCT_MODEL_NS
public static final String PRODUCT_MODEL_NS
the product model ontology name space url- See Also:
- Constant Field Values
-
DEFAULT_PRD_ONTOLOGY_LOCATION
public static final String DEFAULT_PRD_ONTOLOGY_LOCATION
Default PRD model location- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Client
public Client()
-
Client
public Client(String fileName)
-
-
Method Detail
-
setPrdOntology
public void setPrdOntology(String fileName)
Set the resource instance ontology of the client.This assumes that the new ontology uses the same resource, capability and process taxonomy models that were processed when the client was built.
- Parameters:
fileName
- the ontology file or url
-
setPrdOntology
public void setPrdOntology(InputStream input)
-
queryAllProcessSteps
public List<ProcessStep> queryAllProcessSteps()
-
loadTemplate
public org.apache.jena.query.QueryExecution loadTemplate(String name, Map<String,Object> params, boolean usePellet) throws IOException
gets a query execution that is based on a sparql query in a file.- Parameters:
name
- the name of the query templateparams
- IRI parameters used to replace variables in the template with actual values. Represents resources in the ontology.usePellet
- true use pellet to execute query, false use Jena (no reasoning in query)- Returns:
- query execution ready for execution
- Throws:
IOException
- if template file is not found
-
loadTemplate
public org.apache.jena.query.QueryExecution loadTemplate(String name, Map<String,Object> params, Map<String,Object> litParams, boolean usePellet) throws IOException
gets a query execution that is based on a sparql query in a file.- Parameters:
name
- the name of the query template fileparams
- IRI parameters used to replace variables in the template with actual values. Represents resources in the ontology.litParams
- parameters that are literals e.g. strings, numbersusePellet
- true use pellet to execute query, false use Jena (no reasoning in query)- Returns:
- query execution ready for execution
- Throws:
IOException
- if template file is not found
-
-