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
- Navigate to the \\geoportal\WEB-INF\classes\gpt\config folder and open the gpt.xml file in a text editor
- Find the section where the <lucene> configuration is defined
- 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&term= "/> </adaptor>
- 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="
Caution:
do not forget to leave the query?threshold=0.25&term= part in the URL.
- Save the gpt.xml file.
- Restart the geoportal web application for the changes to take affect.
Note:
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.