MUDROD: Mining and Utilizing Dataset Relevancy from
- Oceanographic Datasets to Improve Data Discovery and Access.
- MUDROD is a semantic discovery and search project.
+ Mining and Utilizing Dataset Relevancy from
+ Oceanographic Datasets to Improve Data Discovery and Access.
2017
@@ -128,7 +127,7 @@
2.1.0
3.0.4
1.0.1
- 0.8.0
+ 0.8.1
3.3.0
UTF-8
5.2.0
@@ -175,7 +174,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.19.1
+ 2.22.0
1
true
@@ -453,6 +452,27 @@
0.7.1
compile
+
+
+ org.locationtech.spatial4j
+ spatial4j
+ 0.6
+ compile
+
+
+ com.vividsolutions
+ jts
+ 1.13
+ compile
+
+
+ xerces
+ xercesImpl
+
+
+
diff --git a/service/pom.xml b/service/pom.xml
index 3d98af5..a5d631a 100644
--- a/service/pom.xml
+++ b/service/pom.xml
@@ -34,8 +34,8 @@
mudrod-service
war
- Mudrod :: Service
- Mudrod WebService implementation.
+ SDAP Search :: Service
+ SDAP Search WebService.
@@ -87,36 +87,30 @@
gson
+
+ javax.xml.bind
+ jaxb-api
+ 2.2.11
+
+
+ com.sun.xml.bind
+ jaxb-core
+ 2.2.11
+
+
+ com.sun.xml.bind
+ jaxb-impl
+ 2.2.11
+
+
+ javax.activation
+ activation
+ 1.1.1
+
-
- org.apache.tomcat.maven
- tomcat7-maven-plugin
- 2.2
-
- 8080
-
- -Djava.awt.headless=true
- -Dfile.encoding=UTF-8
- -server -Xms1536m -Xmx1536m
- -XX:NewSize=256m -XX:MaxNewSize=256m
- -XX:PermSize=256m
- -XX:+DisableExplicitGC
- -XX:+UseConcMarkSweepGC
- -XX:+CMSIncrementalMode
- -XX:+CMSIncrementalPacing
- -XX:CMSIncrementalDutyCycleMin=0
- -XX:-TraceClassUnloading
-
-
-
- ${basedir}/src/main/webapp/META-INF/context.xml
-
- /${project.build.finalName}
-
-
org.apache.maven.plugins
maven-war-plugin
@@ -205,10 +199,10 @@
-
+
- cHJvamVjdHxnb3YubmFzYS5qcGwubXVkcm9kLm11ZHJvZC1zZXJ2aWNlfDIwMTktMDUtMDJ8dHJ1ZXwtMSNNQ3dDRkZ6QXBGdzA4dUdJVGtYcml3ckJRbis5WjdLWkFoUWgyaVRZS2EwVTF3NGlObWxlRDlDVzJoaWE5UT09
- f3f4ce56-816e-4f1d-963e-e7936ee846c5
+ cHJvamVjdHxvcmcuYXBhY2hlLnNkYXAubXVkcm9kLXNlcnZpY2V8MjAyMC0wNS0zMHx0cnVlfC0xI01Dd0NGR044TXZUS292ZWUydXVFNENBeEhGTGU5d00wQWhSdVVGSndUZEF1ZGhBajZ0YnVnTGxDY3dlS0VnPT0=
jax-rs
@@ -231,7 +222,7 @@
-
+
diff --git a/service/src/main/java/org/apache/sdap/mudrod/services/MudrodContextListener.java b/service/src/main/java/org/apache/sdap/mudrod/services/MudrodContextListener.java
index 7d89508..1c469d6 100644
--- a/service/src/main/java/org/apache/sdap/mudrod/services/MudrodContextListener.java
+++ b/service/src/main/java/org/apache/sdap/mudrod/services/MudrodContextListener.java
@@ -23,7 +23,7 @@
import org.apache.sdap.mudrod.main.MudrodEngine;
import org.apache.sdap.mudrod.ssearch.Ranker;
import org.apache.sdap.mudrod.ssearch.Searcher;
-import org.apache.sdap.mudrod.tools.EONETIngester;
+import org.apache.sdap.mudrod.tools.EventIngester;
import java.util.Properties;
@@ -64,11 +64,11 @@ public void contextInitialized(ServletContextEvent arg0) {
ServletContext ctx = arg0.getServletContext();
Searcher searcher = new Searcher(props, es, null);
Ranker ranker = new Ranker(props, es, me.getSparkDriver());
- EONETIngester eonetIngester = new EONETIngester(props, es, null);
+ EventIngester eonetIngester = new EventIngester(props, es, null);
ctx.setAttribute("MudrodInstance", me);
ctx.setAttribute("MudrodSearcher", searcher);
ctx.setAttribute("MudrodRanker", ranker);
- ctx.setAttribute("MudrodEONETIngester", eonetIngester);
+ ctx.setAttribute("MudrodEventIngester", eonetIngester);
}
}
diff --git a/service/src/main/java/org/apache/sdap/mudrod/services/eonet/EONETIngestionResource.java b/service/src/main/java/org/apache/sdap/mudrod/services/eonet/EONETIngestionResource.java
index 9bbc1cd..11209e2 100644
--- a/service/src/main/java/org/apache/sdap/mudrod/services/eonet/EONETIngestionResource.java
+++ b/service/src/main/java/org/apache/sdap/mudrod/services/eonet/EONETIngestionResource.java
@@ -13,9 +13,12 @@
*/
package org.apache.sdap.mudrod.services.eonet;
+import java.io.InputStream;
+
import javax.servlet.ServletContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
+import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
@@ -23,7 +26,7 @@
import javax.ws.rs.core.Response;
import org.apache.sdap.mudrod.main.MudrodEngine;
-import org.apache.sdap.mudrod.tools.EONETIngester;
+import org.apache.sdap.mudrod.tools.EventIngester;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,31 +37,75 @@
* Earth Observatory Natural Event Tracker (EONET) data into
* the MUDROD search server.
*/
-@Path("/eonet")
+@Path("/event")
public class EONETIngestionResource {
private static final Logger LOG = LoggerFactory.getLogger(EONETIngestionResource.class);
- private EONETIngester eonetIngester;
+ private EventIngester eventIngester;
private MudrodEngine mEngine;
public EONETIngestionResource(@Context ServletContext sc) {
this.mEngine = (MudrodEngine) sc.getAttribute("MudrodInstance");
- this.eonetIngester = (EONETIngester) sc.getAttribute("MudrodEONETIngester");
+ this.eventIngester = (EventIngester) sc.getAttribute("MudrodEventIngester");
}
@GET
@Path("/status")
- @Produces("text/html")
+ @Produces(MediaType.TEXT_PLAIN)
public Response status() {
return Response.ok("This is MUDROD EONET Ingestion Resource: running correctly...
").build();
}
@GET
- @Path("/ingestAllEvents")
+ @Path("/ingestAllEonetEvents")
@Produces(MediaType.APPLICATION_JSON)
- @Consumes("text/plain")
+ @Consumes(MediaType.TEXT_PLAIN)
public Response executeEONETIngestion() {
- String result = eonetIngester.acquireAllEvents(mEngine);
+ String result = eventIngester.ingestAllEonetEvents(mEngine);
+ String json = new Gson().toJson(result);
+ LOG.info("Response received: {}", json);
+ return Response.ok(json, MediaType.APPLICATION_JSON).build();
+ }
+
+ /**
+ * POST an {@link java.io.InputStream} JSON array of events.
+ * It is important that the JSON complies with the following
+ * structure
+ *
+ * {code
+ * [
+ * {
+ * "id": ""EONET_1014"",
+ * "title": ""Koryaksky Volcano, Russia"",
+ * "description": """",
+ * "link": ""https://eonet.sci.gsfc.nasa.gov/api/v2.1/events/EONET_1014"",
+ * "closed": ""2009-08-27T00:00:00Z"",
+ * "categories": [
+ * "{"id":12,"title":"Volcanoes"}",
+ * ...
+ * ],
+ * "sources": [
+ * "{"id":"SIVolcano","url":"http://volcano.si.edu/volcano.cfm?vn=300090"}",
+ * ...
+ * ],
+ * "geometries": [
+ * "{"date":"2008-12-23T00:00:00Z","type":"Point","coordinates":[158.712,53.321]}",
+ * ...
+ * ]
+ * }
+ * ]
+ *
+ * }
+ *
+ * @param is the {@link java.io.InputStream} containing the JSON snippet above.
+ * @return a JSON string representing the response result.
+ */
+ @POST
+ @Path("/ingestEventsJSON")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes("*/*")
+ public Response executeEventJSONIngestion(InputStream is) {
+ String result = eventIngester.ingestEventsJSON(mEngine, is);
String json = new Gson().toJson(result);
LOG.info("Response received: {}", json);
return Response.ok(json, MediaType.APPLICATION_JSON).build();
diff --git a/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java b/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
index d31d1f4..580b088 100644
--- a/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
+++ b/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
@@ -15,6 +15,7 @@
import org.apache.sdap.mudrod.main.MudrodConstants;
import org.apache.sdap.mudrod.main.MudrodEngine;
+import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,12 +60,12 @@ public Response status() {
public Response searchDatasetDetail(@QueryParam("shortname") String shortName) {
Properties config = mEngine.getConfig();
String dataDetailJson = null;
- try {
- String query = "Dataset-ShortName:\"" + shortName + "\"";
- dataDetailJson = mEngine.getESDriver().searchByQuery(config.getProperty(MudrodConstants.ES_INDEX_NAME), config.getProperty(MudrodConstants.RAW_METADATA_TYPE), query, true);
- } catch (InterruptedException | ExecutionException | IOException e) {
- LOG.error("Error whilst searching for a Dataset-ShortName: ", e);
- }
+ String query = "Dataset-ShortName:\"" + shortName + "\"";
+ dataDetailJson = mEngine.getESDriver().searchByQuery(
+ config.getProperty(
+ MudrodConstants.ES_INDEX_NAME),
+ QueryBuilders.queryStringQuery(query),
+ true, config.getProperty(MudrodConstants.RAW_METADATA_TYPE));
LOG.info("Response received: {}", dataDetailJson);
return Response.ok(dataDetailJson, MediaType.APPLICATION_JSON).build();
}
diff --git a/service/src/main/webapp/META-INF/context.xml b/service/src/main/webapp/META-INF/context.xml
index 1fc4b99..b826a50 100644
--- a/service/src/main/webapp/META-INF/context.xml
+++ b/service/src/main/webapp/META-INF/context.xml
@@ -13,6 +13,6 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
-
+
diff --git a/sonar-project.properties b/sonar-project.properties
index 8121889..0befc4b 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -12,7 +12,7 @@
# under the License.
# must be unique in a given SonarQube instance
-sonar.projectKey=org.apache.sdap.mudrod:mudrod-parent
+sonar.projectKey=org.apache.sdap:mudrod-parent
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
#sonar.projectName=Mudrod :: Parent
#sonar.projectVersion=0.0.1-SNAPSHOT
diff --git a/web/META-INF/resources/partials/metadataResults.html b/web/META-INF/resources/partials/metadataResults.html
index 8daf6e7..618a8e6 100755
--- a/web/META-INF/resources/partials/metadataResults.html
+++ b/web/META-INF/resources/partials/metadataResults.html
@@ -33,7 +33,7 @@
Re
No related searches found
@@ -46,5 +46,30 @@
+
+
+
+
+
+
+
Re
+
+
+ No related events found
+
+
+
+

+
+
+
+
+
\ No newline at end of file
diff --git a/web/META-INF/resources/partials/search.html b/web/META-INF/resources/partials/search.html
index 5844cd1..79e18c3 100644
--- a/web/META-INF/resources/partials/search.html
+++ b/web/META-INF/resources/partials/search.html
@@ -24,7 +24,7 @@ Oceanographic Data Discovery