Skip To Content

Enable Search Using an Ontology Service

Enable Search Using an Ontology Service

An ontology service allows users to search not only for a specific term, but also terms related to that term according to the ontology's definition of related terms. For more about using the ontology service once its configured in a Geoportal, see How to Search with an Ontology Service. This customisation assumes that your organisation has developed or currently uses an Ontology Service web application, and that the URL to this application is available from the server hosting the Geoportal Server.

Integrate the OntologyService with the Geoportal

  1. Navigate to the \\geoportal\WEB-INF\classes\gpt\config folder and open the gpt.xml file in a text editor
  2. Find the section where the <lucene> configuration is defined
  3. Find the commented out adapter section, and uncomment the code:
    <adaptor name="like"
     className="com.esri.gpt.catalog.lucene.StandardNetworkParserAdaptor">
            <attribute key="baseUrl" value=" http://serverName/OntologyService/query?threshold=0.25&amp;term= "/>
     </adaptor>
    
  4. Update the parameters in this section as described below:
    • name - name of the adaptor; will be used within user interface to call Ontology Service; can be short for convenience or leave as default "like". Tip: setting this to something intuitive for users, such as "like", may help with usability.
    • className - standard parser adaptor class supplied with the Geoportal. Do not change.
    • attribute key - "baseUrl"; required by standard parser adaptor. Do not change.
    • attribute value - ontology service base URL; replace host with your OntologyService web application's host server name, port with the servlet engine port number, and OntologyService with the name of your Ontology Service web application:
       "http://<host>:<port>/OntologyService/query?threshold=0.25&term="
      
      警告:

      do not forget to leave the query?threshold=0.25&term= part in the URL.

  5. Save the gpt.xml file.
  6. Restart the geoportal web application for the changes to take affect.
注:

If you would like to leverage multiple ontologies, you can do so by deploying multiple ontology services and referencing additional adapter parameters in gpt.xml.