Skip to content

Geoportal SPARQL Sample

mhogeweg edited this page Dec 25, 2012 · 2 revisions

Introduction

The Esri Geoportal Server supports a SPARQL endpoint. SPARQL is a query language that allows for describing relationships in RDF. The Geoportal's SPARQL endpoint allows users to query for specific records based on the presence and content of records in its catalog.

The SPARQL functionality is still under research and design as we seek use cases for what users want from the Geoportal SPARQL endpoint. To deploy the SPARQL capability for your geoportal, you can do the customization described in this topic. The result will be a simple interface available at http://your_server_name/geoportal/index.jsp that supports interacting with the SPARQL functionality. Let us know your input - use cases, enhancement ideas, clients that consume SPARQL, etc - we value this feedback!

Apply the Sample to your Geoportal

Instructions to apply the sample to an existing geoportal implementation are below. Note, this has been developed for geoportal version 1.2.2; prior versions may work as well.

  • Download the file package for the customization here.
  • Unzip the file and go into its \\LuceneSparqlParserWeb\ directory. Copy the index.jsp file to your \webapps\geoportal location
  • Copy the contents of the META-INF folder into the \webapps\geoportal\META-INF location (you can make a backup copy of the existing context.xml file if there is already one there, and overwrite it with the one in the package)
  • Open your \webapps\geoportal\WEB-INF folder and make a backup copy of the existing web.xml file. Now, open the web.xml file from the WEB-INF folder in the package, and copy everything between the opening <servlet> tag and closing &lt;/servletmapping&gt;</servlet> tags, the section shown below:
<servlet>
  <servlet-name>SparqlServlet</servlet-name>
  <servlet-class>com.esri.sparql.SparqlServlet</servlet-class>
  <init-param>
    <param-name>indexLocation</param-name>
    <param-value>/data/geoportalserver/index</param-value>
  </init-param>
</servlet>
<servlet-mapping>
  <servlet-name>SparqlServlet</servlet-name>
  <url-pattern>/SparqlServlet</url-pattern>
</servlet-mapping>
  • Paste this snippet near the end of the \webapps\geoportal\WEB-INF\web.xml file, just before the <session-config> tag. Update the <param-value>/data/geoportalserver/index to the location of the lucene index your geoportal uses (this is configured in the gpt.xml file in the lucene/indexLocation parameter). After updating the web.xml with this, save the file.
  • Go to the \\LuceneSparqlParserWeb\WEB-INF\lib folder, and copy the .jar files there. Paste them into your <Tomcat>\webapps\geoportal\WEB-INF\lib location
  • Go to the \\LuceneSparqlParserWeb\WEB-INF\classes folder and copy the com folder. Paste this into your <Tomcat>\webapps\geoportal\WEB-INF\classes folder
  • Restart your geoportal web application. You should be able to go to the http://your_server_name/geoportal/index.jsp location and see the GeoSPARQL interface.

Back to Customizations
Clone this wiki locally