Class Client


  • public class Client
    extends Object
    Janaka Nawagamuwa created on 19/08/2021
    • 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)
      • 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 template
        params - 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 file
        params - 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, numbers
        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