From 51051e3cd9d7b6493f24892be11ed6b3e7acb1ca Mon Sep 17 00:00:00 2001 From: Julia Damerow Date: Mon, 24 Apr 2017 15:28:39 -0700 Subject: [PATCH] Prepare Release (#174) * [CCP-218] Changes for displaying merged ids and merged concepts. (#163) When user searches with the word net id that has been merged, the merged concept will be displayed, Previously the wrapper of the word net was displayed but from now the merged concept itself will be displayed. Also the RESTFul apis will display the merged ids of the concepts. * [CCP-210] Concept search requires atleast one search parameter (#166) * [CCP-210] Concept search requires atleast one search parameter From now on concept search rest api requires atleast one search parameter. If no parameter is provided, the system returns the error message "No search condition present" and return 400 http status code. Previously the system went into 500 error when no parameter is provided. * [CCP-210] Review comments fix. * Story/ccp 202 (#168) * [CCP-174] Made session timeout as 4 hours (#138) * [CCP-174] hotfix to master Updated session timeout to 4 hours * [CCP-174] Changed the comments to four hours * Story/ccp 202 master (#158) * [CCP-202] Integration test for master branch * [CCP-202-master] Changes for test case for master branch Added all the applicable test cases for master branch. Few test cases such as json and validations are temporarily removed. Will be added once the develop integration test branch is merged to master. * [CCP-202-master] Removed unwanted files. Removed unwanted files. Will be added when their corresponding test cases are added in integration test. * [CCP-202-master] Added security context for luceneDAO * [CCP-202-master] Review comments fix * [CCP-202] Added correct expected output. These test cases will be fixed when develop branch is getting merged. * [CCP-202-master] Removed word net database. * [CCP-202-master] Added logger statements for downloads manager and integration test * [CCP-202-master] Added log4j config file for integration test * Caught all exceptions and logged errors. * [CCP-202-master] Created new file before loading from dropbox. * Logger level changed to error for exceptions Changed the way fileoutputstream is instantiated Closing resources are handled in same try block. * [CCP-202-master] Made sure security context is setup only when required. * [CCP-202-master] Changed the correct file name * [CCP-202] Fixes for test case in master branch * [CCP-202] Reverted to master branch code base. * [CCP-202-master] Loggers are logged as error in exception catch blocks * Fix XML * [CCP-202] Changes for integration tests. 1) Most of the files had trailing spaces. Removed those spaces. 2) Made sure correct error message is returned when there are no entries in concept look up 3) For multiple entries returned in concept look up, alternative ids were missing in the output. Made sure the json and xml files contains the alternative ids. * [CCP-202] Removed duplicated files due to conflicts * [CCP-202] unit test changes for correct error message when concept is not found * [CCP-202] Changes for Concept look up IT test cases. * [CCP-202] Changes for not considering ordering. Ordering in output will not be tested. * [CCP-202] Dependancy changes * Bug/CCP-211 (#167) * [CCP-211] Removed the backslash "/" in concept entry Back slash has been removed in equalsTo and similarTo in concept entry. This has been removed in setter because lucene gets the values from the object using reflection and not the getters so changes are made while loading the values. Also from now on any insertion of equalsTo and simialrTo will not be having "/". Also any search with "/" at the end needs to be removed. This will be done using spring conversion service. * [CCP-211] Changes for concept search of equals and similar to Before searching for equals and similar to, we can check if equals and similar to contains a back slash in the end of the url. If so we remove the backslash and search on lucene. Also while inserting the values on to lucene we check for the backslash. * [CCP-211] Formatting changes * [CCP-211] Review comments changes Handled multiple equalsTo and similarTo string values. used PropertyDescriptor for getting and setting values. Included exceptions in unit test cases. * [CCP-211] Review comments changes. Moved operators, similarTo and equalsTo to bean class. pre processing of typeUri and numberOfPages in concept search class. This is because typeUri and numberOfpAges needs dependency that needs to be injected which is not possible in ConceptsearchParameters. * [CCP-211] Review comments fix. * [CCP-211] Changes for review comments. Made sure correct operator is used while querying lucene. Number of pages is loaded correctly. * [CCP-211] Test case fix. Removed iterating the transient fields using Property descriptor. * [CCP-218] Changes for displaying merged ids and merged concepts. (#163) When user searches with the word net id that has been merged, the merged concept will be displayed, Previously the wrapper of the word net was displayed but from now the merged concept itself will be displayed. Also the RESTFul apis will display the merged ids of the concepts. * [CCP-211] Review comments fixes. Changed the if conditions to ternary operator. Fixed a bug in getSimilarTo() in conceptEntry * [CCP-211] Review comments changes Added comments on why transient field modifier is used. Used ternary operator to get the number of records per page. * [CCP-211] Review comments changes * [CCP-221] Changes for selecting the rows in datable. (#170) * [CCP-221] Changes for selecting the rows in datable. * [CCP-221] Review comments. changed the wordnetId to wordnetid in jsp. Added word field while creating concept wrapper. Word details can be entered by user when concept wrapper is being created. * [CCP-221] Changes for setting the correct word. Word field is set with the maximum word length. When a selection is removed the word field is updated accordingly. * [CCP-221] Formatting changes * [CCP-222] Deletion is done before merging (#172) * [CCP-222] Deletion is done before merging Deletion is done before merging, because once the concepts are merged, the change made in the getConceptEntry in ConceptManager always fetches the merged concept. Because of this instead of fetching the original concept and setting it to deleted, we set the delete flag on the merged concept. * [CCP-222] Pushed deletion after creating the concept. As per best practice, deletion is performed after creating the merged concepts. deletion is performed on the database that existed before creating the merged concepts. If this is not done, when the code searches for the word net concept, instead of returning the word net concept, the system returns the merged concept. The same applies to local CCP concepts as well. * [CCP-222] Passed the concept entry instead of the id Instead of passing the id and fetching the entry from the id in delete method, the delete method accepts the concept entry instead of the id and deletes the corresponding concept entry that has been passed. * [CCP-222] Made sure one method is used for deletion of concept * Bug/CCP-228 (#173) * [CCP-228] Changes for populating the data on error Added a backing bean and changes to jQuery to populate the selected word net ids for the wrappers. * [CCP-228] Added validator for concept add wrapper. Spring validator is added for concept wrapper screen. Previously errors are passed by checking on the controller layer. * [CCP-228] Review comments fix. Added test cases for ConceptWrapperService Added javadoc for ConceptWrapperService Removed request parameter from addConcept in ConceptWrapperController. * [CCP-228] Review comments changes Renamed the method name in test case files/ removed the logger statement in js Updated javadoc * Bug/CCP-209 (#169) * [CCP-209] Introduced the new short words * [CCP-209] Changes for short word searching. * [CCP-209] Formatting changes * [CCP-209] Used boolean queries instead of query parser * [CCP-209] Review comments fixes * [CCP-209] Changes for integration test * [CCP-209] Variable name changes * [CCP-209] Integration test changes. Made sure all the xml responses are validated using xml() method in MockMvc Changed the ordering in multipleEntry return for xml. * Made xml as string due to encoding problems * Changed concept list to text field. This is because if there are any spaces in the concept list such as "Vogon web" , the phrase query is not working if the spaced words are used using a string field. So changed to text field. * [CCP-209] Removed the spaces in search. * [CCP-209] Analyze the short term field with standard analyzer * [CCP-209] Changed concept list to string field * [CCP-209] Changed the non tokenized fields to use boolean query. * [CCP-209] Fixed review comments Removed the additional field name and used the untokenized with the existing luceneFieldName. * [CCP-209] Review comments changes Introduced keywordAnalyzer for searching shorter words. * [CCP-209] Review comments changes Rename constant field name. * [CCP-209] Added wild card query. Users can perform search using the wild card characters in query. * [CCP-209] Changes for stemming search. Previous to this change stemming search was not performed. From now on search on word field will return stem words as well as results. Sorting is done based on the relevance. Updates to integration tests to support stem searching. * [CCP-209] Changes for wildcard search. Added integration tests for wild card search and made sure results are sorted based on relevancy in wild card search. * [CCP-209] Changes for unit test cases. Output of unit test cases are changed because of using LinkedhashMap instead of hash map in concept lookup to retain ordering of results from lucene. * [CCP-209] Added print statement in integration test * [CCP-209] Ignore Attribute order is set to true in XMLUnit * [CCP-209] Comparison of XML is done in a recursive fashion. * [CCP-209] Added recursive validation for xml Previously test case were failing due to ordering issue in xml. but that is fixed by using XmlUnit RecursiveElementNameTextQualifier. Spring in built uses XmlUnit but does not set this ElementQualifier. * [CCP-227] Added a field for supporting wildcardsearch * [CCP-209] Review comments fix Merged the if and else condition. Extracted a method for building the query. Added javadoc for wild card search query method. * [CCP-209] Changes for searching words as per comments When user searches for "scott miller", the search results will contain "scott miller" "miller scott" "scott D.miller". Need to fix short term search. * [CCP-209] Fix for short word search. included short word search. * [CCP-209] Review comments fix. Included wild card search in short term field search. * [CCP-209] Removed wildcard search from short term field * [CCP-209] Fix for integration tests * [CCP-209] Added the search for description. Description test case was not working fine due to the stop word a. Readded the test case. * [CCP-209] Review comments changes Changes to if else block and removed unused code. * [CCP-209] Removed blank lines. * [CCP-227] Changes for deleting word net concepts. (#171) * [CCP-227] Changes for editing a concept. When a concept is edited, its wordnet entries are updated accordingly. Previously when a concept wrapper is edited the wordnet entries were not updated. * [CCP-227] Changes for deleting the word net concept A new method has been introduced in concept manager to delete the concept directly without fetching the concept and deleting that wrapper. * [CCP-227] Updates to javadoc review comments * [CCP-227] Added description for the fields * [CCP-227] Review comments changes Instead of passing the concept edit bean, the word net details are passed to the edit method. * [CCP-227] Fixed merge conflicts issue * [CCP-227] Removed the logic of getting entry in client Client should just retrieve the concept entry. Removed the logic of retrieving the word net entries and added it to the manager layers. * [CCP-227] Review comments changes * [CCP-227] Review comments fix * [CCP-227] Review comments fix. * [CCP-227] Deleted the concept in index instead of updating in client. * [CCP-227] Renamed method from deleteIndex to deleteFromIndex --- .../edu/asu/conceptpower/IntegrationTest.java | 3 + .../conceptpower/rest/ConceptIDLookupIT.java | 38 +- .../conceptpower/rest/ConceptLookupIT.java | 61 +- .../conceptpower/rest/ConceptSearchIT.java | 114 +++- .../output/conceptLookUpForMultipletEntry.xml | 2 +- .../output/conceptLookUpWordNetEntry.json | 26 +- .../conceptSearchNoSearchParameters.json | 1 + .../conceptSearchNoSearchParameters.xml | 1 + .../output/conceptWithWordAndPos.json | 2 +- .../output/conceptWithWordAndPos.xml | 2 +- .../conceptWithWordPosAndDescription.json | 26 +- .../conceptWithWordPosAndDescription.xml | 2 +- .../conceptWithWordPosAndSimilarTo.json | 29 +- .../output/wildCardSearchConceptLookUp1.json | 1 + .../output/wildCardSearchConceptLookUp1.xml | 1 + .../app/bean/ConceptEditBean.java | 9 + .../app/constants/LuceneFieldNames.java | 1 + .../app/core/IConceptManager.java | 18 +- .../app/core/impl/ConceptManager.java | 50 +- .../conceptpower/app/db/DatabaseClient.java | 27 +- .../app/db/objectdb/ConceptDBManager.java | 112 ---- .../app/db4o/IConceptDBManager.java | 4 +- .../app/lucene/impl/LuceneUtility.java | 169 ++++-- .../conceptpower/app/reflect/LuceneField.java | 15 +- .../app/service/IConceptEditService.java | 33 ++ .../app/service/IConceptWrapperService.java | 30 + .../app/service/impl/ConceptEditService.java | 75 +++ .../app/service/impl/ConceptMergeService.java | 31 +- .../service/impl/ConceptWrapperService.java | 77 +++ .../ConceptWrapperAddBeanValidator.java | 25 + .../asu/conceptpower/core/ConceptEntry.java | 49 +- .../conceptpower/rest/ConceptIDLookup.java | 52 ++ .../asu/conceptpower/rest/ConceptLookup.java | 4 +- .../asu/conceptpower/rest/ConceptSearch.java | 70 ++- .../rest/ConceptSearchParameterValidator.java | 27 + .../rest/ConceptSearchParameters.java | 26 +- .../conceptpower/rest/SearchParamters.java | 2 + .../web/ConceptDeleteController.java | 2 +- .../web/ConceptEditController.java | 8 +- .../web/ConceptWrapperAddController.java | 121 ++-- .../web/backing/ConceptWrapperAddBean.java | 78 +++ .../webapp/WEB-INF/spring/root-context.xml | 2 + .../webapp/WEB-INF/tiles/skeleton-nonav.jsp | 3 + .../main/webapp/WEB-INF/tiles/skeleton.jsp | 3 + .../views/auth/concepts/ConceptEditView.jsp | 5 +- .../auth/concepts/ConceptListConceptsView.jsp | 2 +- .../auth/concepts/ConceptWrapperAddView.jsp | 132 ++++- .../src/main/webapp/WEB-INF/views/home.jsp | 2 +- .../datatable/css/jquery.dataTables.min.css | 527 ++++++++++++++++++ .../impl/ConceptWrapperServiceTest.java | 136 +++++ .../conceptpower/rest/ConceptSearchTest.java | 17 +- .../src/test/resources/root-context-test.xml | 2 + .../resources/unitTestOutput/wordNetEntry.xml | 2 +- .../unitTestOutput/wordnetEntry.json | 2 +- 54 files changed, 1846 insertions(+), 413 deletions(-) create mode 100644 Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.json create mode 100644 Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.xml create mode 100644 Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.json create mode 100644 Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.xml delete mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/objectdb/ConceptDBManager.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptEditService.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptWrapperService.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptEditService.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptWrapperService.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/validation/ConceptWrapperAddBeanValidator.java create mode 100644 Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/backing/ConceptWrapperAddBean.java create mode 100644 Conceptpower+Spring/src/main/webapp/resources/js/datatable/css/jquery.dataTables.min.css create mode 100644 Conceptpower+Spring/src/test/java/edu/asu/conceptpower/app/service/impl/ConceptWrapperServiceTest.java diff --git a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/IntegrationTest.java b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/IntegrationTest.java index 32ddd3fc8..621bad28c 100644 --- a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/IntegrationTest.java +++ b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/IntegrationTest.java @@ -1,6 +1,8 @@ package edu.asu.conceptpower; import java.security.Principal; + +import org.custommonkey.xmlunit.XMLUnit; import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -40,6 +42,7 @@ public String getName() { @Before public void setup() throws Exception { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + XMLUnit.setIgnoreAttributeOrder(true); if (!isSetupDone) { this.mockMvc.perform(MockMvcRequestBuilders.post("/auth/indexConcepts").principal(principal)); MvcResult mr = null; diff --git a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptIDLookupIT.java b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptIDLookupIT.java index 9ee423abe..470f5cccb 100644 --- a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptIDLookupIT.java +++ b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptIDLookupIT.java @@ -4,8 +4,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.apache.commons.io.IOUtil; +import org.custommonkey.xmlunit.Diff; +import org.custommonkey.xmlunit.XMLAssert; +import org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier; import org.junit.Test; import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import edu.asu.conceptpower.IntegrationTest; @@ -65,10 +69,13 @@ public void test_getConceptById_successForConceptWrapperInJson() throws Exceptio public void test_getConceptById_successForWordNetIdInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/wordNetConcept.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/Concept").param("id", "WID-02380464-N-01-polo_pony") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/Concept") + .param("id", "WID-02380464-N-01-polo_pony").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getConceptById_successForWordNetIdInXml", xmlDifference, + true); } @@ -84,20 +91,27 @@ public void test_getConceptById_invalidWordNetIdInXml() throws Exception { public void test_getConceptById_successForLocalConceptIdInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/conceptForLocalId.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/Concept").param("id", "CONdf62c00c-f4a9-4564-9dd6-c9b955650f3a") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/Concept") + .param("id", "CONdf62c00c-f4a9-4564-9dd6-c9b955650f3a").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getConceptById_successForLocalConceptIdInXml", + xmlDifference, + true); } @Test public void test_getConceptById_successForConceptWrapperInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/conceptWrapper.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/Concept").param("id", "CONe7fbf694-5609-4691-bca8-916526c2ba6a") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/Concept") + .param("id", "CONe7fbf694-5609-4691-bca8-916526c2ba6a").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getConceptById_successForConceptWrapperInXml", + xmlDifference, true); } } diff --git a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptLookupIT.java b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptLookupIT.java index 92e77c51c..5f03f09dd 100644 --- a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptLookupIT.java +++ b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptLookupIT.java @@ -6,8 +6,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.apache.commons.io.IOUtil; +import org.custommonkey.xmlunit.Diff; +import org.custommonkey.xmlunit.XMLAssert; +import org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier; import org.junit.Test; import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; @@ -48,30 +52,63 @@ public void test_getWordNetEntry_successForMultipleEntryInJson() throws Exceptio public void test_getWordNetEntry_successForSingleEntryInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/conceptLookUpWordNetEntry.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/ConceptLookup/Douglas Weiner/noun") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/ConceptLookup/Douglas Weiner/noun") + .accept(MediaType.APPLICATION_XML_VALUE)).andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getWordNetEntry_successForSingleEntryInXml", + xmlDifference, + true); } @Test public void test_getWordNetEntry_noResultsInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/conceptEntryNotFound.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/ConceptLookup/Gustav Robert Kirchhoff/verb") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders + .get("/ConceptLookup/Gustav Robert Kirchhoff/verb").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getWordNetEntry_noResultsInXml", + xmlDifference, true); } @Test public void test_getWordNetEntry_successForMultipleEntryInXml() throws Exception { final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptLookUpForMultipletEntry.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/ConceptLookup/Douglas/noun") - .accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().xml(output)).andExpect(status().isOk()); + + MvcResult mvcResult = this.mockMvc.perform( + MockMvcRequestBuilders.get("/ConceptLookup/Douglas/noun").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getWordNetEntry_successForMultipleEntryInXml", + xmlDifference, true); } + @Test + public void test_getWordNetEntry_searchWithWildCardOneOrMoreCharactersInXml() throws Exception { + final String output = IOUtil.toString( + this.getClass().getClassLoader().getResourceAsStream("output/wildCardSearchConceptLookUp1.xml")); + MvcResult mvcResult = this.mockMvc.perform( + MockMvcRequestBuilders.get("/ConceptLookup/Dougl*/noun").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_getWordNetEntry_searchWithWildCardOneOrMoreCharactersInXml", + xmlDifference, true); + } + + @Test + public void test_getWordNetEntry_searchWithWildCardOneOrMoreCharactersInJson() throws Exception { + final String output = IOUtil.toString( + this.getClass().getClassLoader().getResourceAsStream("output/wildCardSearchConceptLookUp1.json")); + this.mockMvc + .perform(MockMvcRequestBuilders.get("/ConceptLookup/Dougl*/noun") + .accept(MediaType.APPLICATION_JSON_VALUE)) + .andExpect(content().json(output)).andExpect(status().isOk()); + } } diff --git a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptSearchIT.java b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptSearchIT.java index 7f041f47a..d90977633 100644 --- a/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptSearchIT.java +++ b/Conceptpower+Spring/src/integration-test/java/edu/asu/conceptpower/rest/ConceptSearchIT.java @@ -6,8 +6,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.apache.commons.io.IOUtil; +import org.custommonkey.xmlunit.Diff; +import org.custommonkey.xmlunit.XMLAssert; +import org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier; import org.junit.Test; import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import edu.asu.conceptpower.IntegrationTest; @@ -136,9 +140,9 @@ public void test_searchConcept_searchWithWordPosAndDescriptionInJson() throws Ex this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndDescription.json")); this.mockMvc - .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Douglas Weiner") - .param("pos", "noun").param("description", "American 20th century environmentalist") - .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_JSON_VALUE)) + .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "indian pony").param("pos", "noun") + .param("description", "small native range horse").param("operator", SearchParamters.OP_AND) + .accept(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().json(output, false)).andExpect(status().isOk()); } @@ -149,10 +153,15 @@ public void test_searchConcept_searchWithWordAndPosInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordAndPos.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "einstein").param("pos", "noun") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordAndPosInXml", + xmlDifference, true); } @Test @@ -161,11 +170,14 @@ public void test_searchConcept_noResultsInXml() throws Exception { final String output = IOUtil .toString(this.getClass().getClassLoader().getResourceAsStream("output/noResults.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Gustav Robert Kirchhoff") .param("pos", "verb").param("concept_list", "VogonWeb Concepts") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_noResultsInXml", xmlDifference, true); } @@ -174,11 +186,16 @@ public void test_searchConcept_searchWithWordAndPosAndEqualToInXml() throws Exce final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndEqualTo.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Abbott Henderson Thayer") .param("pos", "noun").param("equal_to", "http://viaf.org/viaf/55043769") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordAndPosAndEqualToInXml", + xmlDifference, true); } @@ -188,11 +205,16 @@ public void test_searchConcept_searchWithWordAndPosAndSimilarToInXml() throws Ex final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndSimilarTo.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Douglas Weiner") .param("pos", "noun").param("similar_to", "http://viaf.org/viaf/248802520") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordAndPosAndSimilarToInXml", + xmlDifference, true); } @Test @@ -200,20 +222,30 @@ public void test_searchConcept_searchWithWordPosAndPaginationInXml() throws Exce final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndPagination1.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "einstein").param("pos", "noun") .param("number_of_records_per_page", "2").param("page", "1") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordPosAndPaginationInXml", + xmlDifference, true); final String output2 = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndPagination2.xml")); - this.mockMvc + mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "einstein").param("pos", "noun") .param("number_of_records_per_page", "2").param("page", "2") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output2)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + xmlDifference = new Diff(output2, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordPosAndPaginationInXml", + xmlDifference, true); } @@ -223,11 +255,16 @@ public void test_searchConcept_searchWithWordPosAndTypeIdInXml() throws Exceptio final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndTypeId.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Almira Hart Lincoln Phelps") .param("pos", "noun").param("type_id", "986a7cc9-c0c1-4720-b344-853f08c136ab") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordPosAndTypeIdInXml", + xmlDifference, true); } @@ -237,12 +274,17 @@ public void test_searchConcept_searchWithWordPosAndTypeUriInXml() throws Excepti final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndTypeUri.xml")); - this.mockMvc + MvcResult mvcResult = this.mockMvc .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Almira Hart Lincoln Phelps") .param("pos", "noun") .param("type_uri", "http://www.digitalhps.org/types/TYPE_986a7cc9-c0c1-4720-b344-853f08c136ab") .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordPosAndTypeUriInXml", + xmlDifference, true); } @@ -252,11 +294,35 @@ public void test_searchConcept_searchWithWordPosAndDescriptionInXml() throws Exc final String output = IOUtil.toString( this.getClass().getClassLoader().getResourceAsStream("output/conceptWithWordPosAndDescription.xml")); - this.mockMvc - .perform(MockMvcRequestBuilders.get("/ConceptSearch").param("word", "Douglas Weiner") - .param("pos", "noun").param("description", "American 20th century environmentalist") - .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) - .andExpect(content().string(output)).andExpect(status().isOk()); + MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/ConceptSearch") + .param("word", "indian pony").param("pos", "noun").param("description", "small native range horse") + .param("operator", SearchParamters.OP_AND).accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(status().isOk()).andReturn(); + + Diff xmlDifference = new Diff(output, mvcResult.getResponse().getContentAsString()); + xmlDifference.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); + XMLAssert.assertXMLEqual("Similarlity failed in test_searchConcept_searchWithWordPosAndDescriptionInXml", + xmlDifference, true); + + } + + @Test + public void test_searchConcept_failureNoValidSearchParametersInXml() throws Exception { + final String output = IOUtil.toString( + this.getClass().getClassLoader().getResourceAsStream("output/conceptSearchNoSearchParameters.xml")); + + this.mockMvc.perform(MockMvcRequestBuilders.get("/ConceptSearch").accept(MediaType.APPLICATION_XML_VALUE)) + .andExpect(content().xml(output)).andExpect(status().isBadRequest()); + + } + + @Test + public void test_searchConcept_failureNoValidSearchParametersInJson() throws Exception { + final String output = IOUtil.toString( + this.getClass().getClassLoader().getResourceAsStream("output/conceptSearchNoSearchParameters.json")); + + this.mockMvc.perform(MockMvcRequestBuilders.get("/ConceptSearch").accept(MediaType.APPLICATION_JSON_VALUE)) + .andExpect(content().json(output)).andExpect(status().isBadRequest()); } diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpForMultipletEntry.xml b/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpForMultipletEntry.xml index 6d9fcfd6c..7f644b8df 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpForMultipletEntry.xml +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpForMultipletEntry.xml @@ -1 +1 @@ -http://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bDouglasNOUNSimilar to conceptVogonWeb Conceptsadminhttp://viaf.org/viaf/248802520E21 PersonfalseWID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bhttp://www.digitalhps.org/concepts/WID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianedgar douglas adriannounEnglish physiologist who conducted research into the function of neurons; 1st baron of Cambridge (1889-1997)WordNetWID-10808886-N-01-Adrian,WID-10808886-N-03-Baron_Adrian,falseWID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbanksdouglas fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-03-Douglas_Elton_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firbig-cone douglas firnoundouglas fir of California having cones 4-8 inches longWordNetWID-11629047-N-01-big-cone_spruce,WID-11629047-N-03-Pseudotsuga_macrocarpa,falseWID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonjames douglas morrisonnounUnited States rock singer (1943-1971)WordNetWID-11192533-N-01-Morrison,WID-11192533-N-02-Jim_Morrison,falseWID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcroftsir john douglas cockcroftnounBritish physicist who (with Ernest Walton in 1931) first split an atom (1897-1967)WordNetWID-10903918-N-01-Cockcroft,WID-10903918-N-02-Sir_John_Cockcroft,falseWID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.edward douglas white jr.nounUnited States jurist appointed chief justice of the United States Supreme Court in 1910 by President Taft; noted for his work on antitrust legislation (1845-1921)WordNetWID-11384291-N-01-White,WID-11384291-N-02-Edward_White,WID-11384291-N-03-Edward_D._White,falseWID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firdouglas firnountall evergreen timber tree of western North America having resinous wood and short needlesWordNetfalseWID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.douglas fairbanks jr.nounUnited States film actor; son of Douglas Elton Fairbanks, (1909-2000)WordNetWID-10965550-N-01-Fairbanks,falseWID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurdouglas macarthurnounUnited States general who served as chief of staff and commanded Allied forces in the South Pacific during World War II; he accepted the surrender of Japan (1880-1964)WordNetWID-11146670-N-01-MacArthur,falseWID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firdouglas firnounstrong durable timber of a douglas firWordNetfalseWID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucedouglas sprucenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbanksdouglas elton fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-02-Douglas_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firgreen douglas firnounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglasstephen a. douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-03-Stephen_Arnold_Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyray douglas bradburynounUnited States writer of science fiction (born 1920)WordNetWID-10860444-N-01-Bradbury,WID-10860444-N-02-Ray_Bradbury,falseWID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockdouglas hemlocknounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithian douglas smithnounRhodesian statesman who declared independence of Zimbabwe from Great Britain (born in 1919)WordNetWID-11306297-N-01-Smith,WID-11306297-N-02-Ian_Smith,falseWID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4Douglas WeinernounAmerican 20th century environmentalistVogonWeb Conceptstesthttp://viaf.org/viaf/283748929adminhttp://viaf.org/viaf/248802520[]falsehttp://www.digitalhps.org/concepts/http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4http://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirreldouglas squirrelnounfar western United States counterpart of the red squirrelWordNetWID-02357585-N-01-chickeree,WID-02357585-N-03-Tamiasciurus_douglasi,falseWID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Mooredouglas moorenounUnited States composer of works noted for their use of the American vernacular (1893-1969)WordNetWID-11190024-N-01-Moore,falseWID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinedouglas pinenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglasstephen arnold douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-02-Stephen_A._Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-03-Stephen_Arnold_Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglashttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakeymary douglas leakeynounEnglish paleontologist (the wife of Louis Leakey) who discovered the Zinjanthropus skull that was 1,750,000 years old (1913-1996)WordNetWID-11121876-N-01-Leakey,WID-11121876-N-02-Mary_Leakey,falseWID-11121876-N-03-Mary_Douglas_Leakeyhttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakey \ No newline at end of file +http://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bDouglasNOUNSimilar to conceptVogonWeb Conceptsadminhttp://viaf.org/viaf/248802520E21 PersonfalseWID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bhttp://www.digitalhps.org/concepts/WID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbanksdouglas fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-03-Douglas_Elton_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firdouglas firnounstrong durable timber of a douglas firWordNetfalseWID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firdouglas firnountall evergreen timber tree of western North America having resinous wood and short needlesWordNetfalseWID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockdouglas hemlocknounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurdouglas macarthurnounUnited States general who served as chief of staff and commanded Allied forces in the South Pacific during World War II; he accepted the surrender of Japan (1880-1964)WordNetWID-11146670-N-01-MacArthur,falseWID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Mooredouglas moorenounUnited States composer of works noted for their use of the American vernacular (1893-1969)WordNetWID-11190024-N-01-Moore,falseWID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinedouglas pinenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucedouglas sprucenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirreldouglas squirrelnounfar western United States counterpart of the red squirrelWordNetWID-02357585-N-01-chickeree,WID-02357585-N-03-Tamiasciurus_douglasi,falseWID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglasstephen a. douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-03-Stephen_Arnold_Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4Douglas WeinernounAmerican 20th century environmentalistVogonWeb Conceptstesthttp://viaf.org/viaf/283748929adminhttp://viaf.org/viaf/248802520[]falsehttp://www.digitalhps.org/concepts/http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4http://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firbig-cone douglas firnoundouglas fir of California having cones 4-8 inches longWordNetWID-11629047-N-01-big-cone_spruce,WID-11629047-N-03-Pseudotsuga_macrocarpa,falseWID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbanksdouglas elton fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-02-Douglas_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.douglas fairbanks jr.nounUnited States film actor; son of Douglas Elton Fairbanks, (1909-2000)WordNetWID-10965550-N-01-Fairbanks,falseWID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianedgar douglas adriannounEnglish physiologist who conducted research into the function of neurons; 1st baron of Cambridge (1889-1997)WordNetWID-10808886-N-01-Adrian,WID-10808886-N-03-Baron_Adrian,falseWID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.edward douglas white jr.nounUnited States jurist appointed chief justice of the United States Supreme Court in 1910 by President Taft; noted for his work on antitrust legislation (1845-1921)WordNetWID-11384291-N-01-White,WID-11384291-N-02-Edward_White,WID-11384291-N-03-Edward_D._White,falseWID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firgreen douglas firnounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithian douglas smithnounRhodesian statesman who declared independence of Zimbabwe from Great Britain (born in 1919)WordNetWID-11306297-N-01-Smith,WID-11306297-N-02-Ian_Smith,falseWID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonjames douglas morrisonnounUnited States rock singer (1943-1971)WordNetWID-11192533-N-01-Morrison,WID-11192533-N-02-Jim_Morrison,falseWID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakeymary douglas leakeynounEnglish paleontologist (the wife of Louis Leakey) who discovered the Zinjanthropus skull that was 1,750,000 years old (1913-1996)WordNetWID-11121876-N-01-Leakey,WID-11121876-N-02-Mary_Leakey,falseWID-11121876-N-03-Mary_Douglas_Leakeyhttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakeyhttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyray douglas bradburynounUnited States writer of science fiction (born 1920)WordNetWID-10860444-N-01-Bradbury,WID-10860444-N-02-Ray_Bradbury,falseWID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcroftsir john douglas cockcroftnounBritish physicist who (with Ernest Walton in 1931) first split an atom (1897-1967)WordNetWID-10903918-N-01-Cockcroft,WID-10903918-N-02-Sir_John_Cockcroft,falseWID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglasstephen arnold douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-02-Stephen_A._Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-03-Stephen_Arnold_Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglas \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpWordNetEntry.json b/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpWordNetEntry.json index d300a4253..fc2ad65ed 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpWordNetEntry.json +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptLookUpWordNetEntry.json @@ -1 +1,25 @@ -{"conceptEntries":[{"id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","lemma":"Douglas Weiner","pos":"noun","description":"American 20th century environmentalist","conceptList":"VogonWeb Concepts","deleted":false,"alternativeIds":[{"concept_id":"","concept_uri":"http://www.digitalhps.org/concepts/"},{"concept_id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4"}],"concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","creator_id":"test","equal_to":"http://viaf.org/viaf/283748929","modified_by":"admin","similar_to":"http://viaf.org/viaf/248802520","synonym_ids":"[]","wordnet_id":""}],"pagination":null} \ No newline at end of file +{ + "conceptEntries": [{ + "id": "CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "lemma": "Douglas Weiner", + "pos": "noun", + "description": "American 20th century environmentalist", + "conceptList": "VogonWeb Concepts", + "deleted": false, + "concept_uri": "http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "creator_id": "test", + "equal_to": "http://viaf.org/viaf/283748929", + "modified_by": "admin", + "similar_to": "http://viaf.org/viaf/248802520", + "synonym_ids": "[]", + "wordnet_id": "", + "alternativeIds": [{ + "concept_id": "", + "concept_uri": "http://www.digitalhps.org/concepts/" + }, { + "concept_id": "CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "concept_uri": "http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4" + }] + }], + "pagination": null +} \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.json b/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.json new file mode 100644 index 000000000..180907392 --- /dev/null +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.json @@ -0,0 +1 @@ +[{"message":"No valid search parameters present."}] \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.xml b/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.xml new file mode 100644 index 000000000..73d2d7ea1 --- /dev/null +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptSearchNoSearchParameters.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.json b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.json index 0260a7903..a3c41d6a3 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.json +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.json @@ -1 +1 @@ -{"conceptEntries":[{"id":"WID-10954498-N-01-Einstein","lemma":"einstein","pos":"noun","description":"physicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-10954498-N-01-Einstein","concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-01-Einstein"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-01-Einstein","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10954498-N-02-Albert_Einstein,","wordnet_id":"WID-10954498-N-01-Einstein"},{"id":"WID-10126926-N-05-Einstein","lemma":"einstein","pos":"noun","description":"someone who has exceptional intellectual ability and originality; \"Mozart was a child genius\"; \"he's smart but he's no Einstein\"","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-10126926-N-05-Einstein","concept_uri":"http://www.digitalhps.org/concepts/WID-10126926-N-05-Einstein"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-10126926-N-05-Einstein","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10126926-N-01-genius,WID-10126926-N-02-mastermind,WID-10126926-N-03-brain,WID-10126926-N-04-brainiac,","wordnet_id":"WID-10126926-N-05-Einstein"}],"pagination":{"pageNumber":1,"totalNumberOfRecords":4}} \ No newline at end of file +{"conceptEntries":[{"id":"WID-10954498-N-01-Einstein","lemma":"einstein","pos":"noun","description":"physicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-10954498-N-01-Einstein","concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-01-Einstein"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-01-Einstein","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10954498-N-02-Albert_Einstein,","wordnet_id":"WID-10954498-N-01-Einstein"},{"id":"WID-10126926-N-05-Einstein","lemma":"einstein","pos":"noun","description":"someone who has exceptional intellectual ability and originality; \"Mozart was a child genius\"; \"he's smart but he's no Einstein\"","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-10126926-N-05-Einstein","concept_uri":"http://www.digitalhps.org/concepts/WID-10126926-N-05-Einstein"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-10126926-N-05-Einstein","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10126926-N-01-genius,WID-10126926-N-02-mastermind,WID-10126926-N-03-brain,WID-10126926-N-04-brainiac,","wordnet_id":"WID-10126926-N-05-Einstein"},{"id":"WID-10954498-N-02-Albert_Einstein","lemma":"albert einstein","pos":"noun","description":"physicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-10954498-N-02-Albert_Einstein","concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-02-Albert_Einstein"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-10954498-N-02-Albert_Einstein","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10954498-N-01-Einstein,","wordnet_id":"WID-10954498-N-02-Albert_Einstein"},{"id":"WID-05875723-N-01-Bose-Einstein_statistics","lemma":"bose-einstein statistics","pos":"noun","description":"(physics) statistical law obeyed by a system of particles whose wave function is not changed when two particles are interchanged (the Pauli exclusion principle does not apply)","conceptList":"WordNet","deleted":false,"alternativeIds":[{"concept_id":"WID-05875723-N-01-Bose-Einstein_statistics","concept_uri":"http://www.digitalhps.org/concepts/WID-05875723-N-01-Bose-Einstein_statistics"}],"concept_uri":"http://www.digitalhps.org/concepts/WID-05875723-N-01-Bose-Einstein_statistics","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"","wordnet_id":"WID-05875723-N-01-Bose-Einstein_statistics"}],"pagination":{"pageNumber":1,"totalNumberOfRecords":4}} \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.xml b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.xml index 3b9b199f8..2bbfc42a6 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.xml +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordAndPos.xml @@ -1 +1 @@ -http://www.digitalhps.org/concepts/WID-10954498-N-01-Einsteineinsteinnounphysicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)WordNetWID-10954498-N-02-Albert_Einstein,falseWID-10954498-N-01-Einsteinhttp://www.digitalhps.org/concepts/WID-10954498-N-01-Einsteinhttp://www.digitalhps.org/concepts/WID-10126926-N-05-Einsteineinsteinnounsomeone who has exceptional intellectual ability and originality; "Mozart was a child genius"; "he's smart but he's no Einstein"WordNetWID-10126926-N-01-genius,WID-10126926-N-02-mastermind,WID-10126926-N-03-brain,WID-10126926-N-04-brainiac,falseWID-10126926-N-05-Einsteinhttp://www.digitalhps.org/concepts/WID-10126926-N-05-Einstein \ No newline at end of file +http://www.digitalhps.org/concepts/WID-10954498-N-01-Einsteineinsteinnounphysicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)WordNetWID-10954498-N-02-Albert_Einstein,falseWID-10954498-N-01-Einsteinhttp://www.digitalhps.org/concepts/WID-10954498-N-01-Einsteinhttp://www.digitalhps.org/concepts/WID-10126926-N-05-Einsteineinsteinnounsomeone who has exceptional intellectual ability and originality; "Mozart was a child genius"; "he's smart but he's no Einstein"WordNetWID-10126926-N-01-genius,WID-10126926-N-02-mastermind,WID-10126926-N-03-brain,WID-10126926-N-04-brainiac,falseWID-10126926-N-05-Einsteinhttp://www.digitalhps.org/concepts/WID-10126926-N-05-Einsteinhttp://www.digitalhps.org/concepts/WID-10954498-N-02-Albert_Einsteinalbert einsteinnounphysicist born in Germany who formulated the special theory of relativity and the general theory of relativity; Einstein also proposed that light consists of discrete quantized bundles of energy (later called photons) (1879-1955)WordNetWID-10954498-N-01-Einstein,falseWID-10954498-N-02-Albert_Einsteinhttp://www.digitalhps.org/concepts/WID-10954498-N-02-Albert_Einsteinhttp://www.digitalhps.org/concepts/WID-05875723-N-01-Bose-Einstein_statisticsbose-einstein statisticsnoun(physics) statistical law obeyed by a system of particles whose wave function is not changed when two particles are interchanged (the Pauli exclusion principle does not apply)WordNetfalseWID-05875723-N-01-Bose-Einstein_statisticshttp://www.digitalhps.org/concepts/WID-05875723-N-01-Bose-Einstein_statistics \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.json b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.json index a2255d16d..12ef7591b 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.json +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.json @@ -1 +1,25 @@ -{"conceptEntries":[{"id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","lemma":"Douglas Weiner","pos":"noun","description":"American 20th century environmentalist","conceptList":"VogonWeb Concepts","deleted":false,"alternativeIds":[{"concept_id":"","concept_uri":"http://www.digitalhps.org/concepts/"},{"concept_id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4"}],"concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","creator_id":"test","equal_to":"http://viaf.org/viaf/283748929","modified_by":"admin","similar_to":"http://viaf.org/viaf/248802520","synonym_ids":"[]","wordnet_id":""}],"pagination":{"pageNumber":1,"totalNumberOfRecords":1}} \ No newline at end of file +{ + "conceptEntries": [{ + "id": "WID-02382039-N-02-Indian_pony", + "lemma": "indian pony", + "pos": "noun", + "description": "a small native range horse", + "conceptList": "WordNet", + "deleted": false, + "concept_uri": "http://www.digitalhps.org/concepts/WID-02382039-N-02-Indian_pony", + "creator_id": "", + "equal_to": "", + "modified_by": "", + "similar_to": "", + "synonym_ids": "WID-02382039-N-01-cayuse,", + "wordnet_id": "WID-02382039-N-02-Indian_pony", + "alternativeIds": [{ + "concept_id": "WID-02382039-N-02-Indian_pony", + "concept_uri": "http://www.digitalhps.org/concepts/WID-02382039-N-02-Indian_pony" + }] + }], + "pagination": { + "pageNumber": 1, + "totalNumberOfRecords": 1 + } +} \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.xml b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.xml index e745c9886..03b315ecc 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.xml +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndDescription.xml @@ -1 +1 @@ -http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4Douglas WeinernounAmerican 20th century environmentalistVogonWeb Conceptstesthttp://viaf.org/viaf/283748929adminhttp://viaf.org/viaf/248802520[]falsehttp://www.digitalhps.org/concepts/http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4 \ No newline at end of file +http://www.digitalhps.org/concepts/WID-02382039-N-02-Indian_ponyindian ponynouna small native range horseWordNetWID-02382039-N-01-cayuse,falseWID-02382039-N-02-Indian_ponyhttp://www.digitalhps.org/concepts/WID-02382039-N-02-Indian_pony \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndSimilarTo.json b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndSimilarTo.json index a2255d16d..68e8d6c3e 100644 --- a/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndSimilarTo.json +++ b/Conceptpower+Spring/src/integration-test/resources/output/conceptWithWordPosAndSimilarTo.json @@ -1 +1,28 @@ -{"conceptEntries":[{"id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","lemma":"Douglas Weiner","pos":"noun","description":"American 20th century environmentalist","conceptList":"VogonWeb Concepts","deleted":false,"alternativeIds":[{"concept_id":"","concept_uri":"http://www.digitalhps.org/concepts/"},{"concept_id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4"}],"concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","creator_id":"test","equal_to":"http://viaf.org/viaf/283748929","modified_by":"admin","similar_to":"http://viaf.org/viaf/248802520","synonym_ids":"[]","wordnet_id":""}],"pagination":{"pageNumber":1,"totalNumberOfRecords":1}} \ No newline at end of file +{ + "conceptEntries": [{ + "id": "CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "lemma": "Douglas Weiner", + "pos": "noun", + "description": "American 20th century environmentalist", + "conceptList": "VogonWeb Concepts", + "deleted": false, + "concept_uri": "http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "creator_id": "test", + "equal_to": "http://viaf.org/viaf/283748929", + "modified_by": "admin", + "similar_to": "http://viaf.org/viaf/248802520", + "synonym_ids": "[]", + "wordnet_id": "", + "alternativeIds": [{ + "concept_id": "", + "concept_uri": "http://www.digitalhps.org/concepts/" + }, { + "concept_id": "CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4", + "concept_uri": "http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4" + }] + }], + "pagination": { + "pageNumber": 1, + "totalNumberOfRecords": 1 + } +} \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.json b/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.json new file mode 100644 index 000000000..f9efebedd --- /dev/null +++ b/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.json @@ -0,0 +1 @@ +{"conceptEntries":[{"id":"WID-10941515-N-01-Douglass","lemma":"douglass","pos":"noun","description":"United States abolitionist who escaped from slavery and became an influential writer and lecturer in the North (1817-1895)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10941515-N-01-Douglass","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10941515-N-02-Frederick_Douglass,","wordnet_id":"WID-10941515-N-01-Douglass","alternativeIds":[{"concept_id":"WID-10941515-N-01-Douglass","concept_uri":"http://www.digitalhps.org/concepts/WID-10941515-N-01-Douglass"}]},{"id":"CON0252cf48-4233-495d-94ae-42480b0fd82b","lemma":"Douglas","pos":"NOUN","description":"Similar to concept","conceptList":"VogonWeb Concepts","type":{"type_id":"986a7cc9-c0c1-4720-b344-853f08c136ab","type_uri":"http://www.digitalhps.org/types/TYPE_986a7cc9-c0c1-4720-b344-853f08c136ab","type_name":"E21 Person"},"deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82b","creator_id":"admin","equal_to":"","modified_by":"","similar_to":"http://viaf.org/viaf/248802520","synonym_ids":"","wordnet_id":"WID-10941206-N-01-Douglas","alternativeIds":[{"concept_id":"CON0252cf48-4233-495d-94ae-42480b0fd82b","concept_uri":"http://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82b"},{"concept_id":"WID-10941206-N-01-Douglas","concept_uri":"http://www.digitalhps.org/concepts/WID-10941206-N-01-Douglas"}]},{"id":"WID-02357585-N-03-Tamiasciurus_douglasi","lemma":"tamiasciurus douglasi","pos":"noun","description":"far western United States counterpart of the red squirrel","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-02357585-N-03-Tamiasciurus_douglasi","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-02357585-N-01-chickeree,WID-02357585-N-02-Douglas_squirrel,","wordnet_id":"WID-02357585-N-03-Tamiasciurus_douglasi","alternativeIds":[{"concept_id":"WID-02357585-N-03-Tamiasciurus_douglasi","concept_uri":"http://www.digitalhps.org/concepts/WID-02357585-N-03-Tamiasciurus_douglasi"}]},{"id":"WID-10941515-N-02-Frederick_Douglass","lemma":"frederick douglass","pos":"noun","description":"United States abolitionist who escaped from slavery and became an influential writer and lecturer in the North (1817-1895)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10941515-N-02-Frederick_Douglass","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10941515-N-01-Douglass,","wordnet_id":"WID-10941515-N-02-Frederick_Douglass","alternativeIds":[{"concept_id":"WID-10941515-N-02-Frederick_Douglass","concept_uri":"http://www.digitalhps.org/concepts/WID-10941515-N-02-Frederick_Douglass"}]},{"id":"WID-11882972-N-02-Cardamine_douglasii","lemma":"cardamine douglasii","pos":"noun","description":"small perennial herb of cooler regions of North America with racemose purple flowers","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11882972-N-02-Cardamine_douglasii","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11882972-N-01-purple_cress,","wordnet_id":"WID-11882972-N-02-Cardamine_douglasii","alternativeIds":[{"concept_id":"WID-11882972-N-02-Cardamine_douglasii","concept_uri":"http://www.digitalhps.org/concepts/WID-11882972-N-02-Cardamine_douglasii"}]},{"id":"WID-12857204-N-03-Micromeria_douglasii","lemma":"micromeria douglasii","pos":"noun","description":"trailing perennial evergreen herb of northwestern United States with small white flowers; used medicinally","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-12857204-N-03-Micromeria_douglasii","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-12857204-N-01-yerba_buena,WID-12857204-N-02-Micromeria_chamissonis,WID-12857204-N-04-Satureja_douglasii,","wordnet_id":"WID-12857204-N-03-Micromeria_douglasii","alternativeIds":[{"concept_id":"WID-12857204-N-03-Micromeria_douglasii","concept_uri":"http://www.digitalhps.org/concepts/WID-12857204-N-03-Micromeria_douglasii"}]},{"id":"WID-12857204-N-04-Satureja_douglasii","lemma":"satureja douglasii","pos":"noun","description":"trailing perennial evergreen herb of northwestern United States with small white flowers; used medicinally","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-12857204-N-04-Satureja_douglasii","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-12857204-N-01-yerba_buena,WID-12857204-N-02-Micromeria_chamissonis,WID-12857204-N-03-Micromeria_douglasii,","wordnet_id":"WID-12857204-N-04-Satureja_douglasii","alternativeIds":[{"concept_id":"WID-12857204-N-04-Satureja_douglasii","concept_uri":"http://www.digitalhps.org/concepts/WID-12857204-N-04-Satureja_douglasii"}]},{"id":"WID-12022821-N-02-Tanacetum_douglasii","lemma":"tanacetum douglasii","pos":"noun","description":"lightly hairy rhizomatous perennial having aromatic feathery leaves and stems bearing open clusters of small buttonlike yellow flowers; sand dunes of Pacific coast of North America","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-12022821-N-02-Tanacetum_douglasii","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-12022821-N-01-northern_dune_tansy,","wordnet_id":"WID-12022821-N-02-Tanacetum_douglasii","alternativeIds":[{"concept_id":"WID-12022821-N-02-Tanacetum_douglasii","concept_uri":"http://www.digitalhps.org/concepts/WID-12022821-N-02-Tanacetum_douglasii"}]},{"id":"WID-10965361-N-02-Douglas_Fairbanks","lemma":"douglas fairbanks","pos":"noun","description":"United States film actor noted for his swashbuckling roles (1883-1939)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbanks","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10965361-N-01-Fairbanks,WID-10965361-N-03-Douglas_Elton_Fairbanks,WID-10965361-N-04-Julius_Ullman,","wordnet_id":"WID-10965361-N-02-Douglas_Fairbanks","alternativeIds":[{"concept_id":"WID-10965361-N-02-Douglas_Fairbanks","concept_uri":"http://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbanks"}]},{"id":"WID-11628678-N-01-douglas_fir","lemma":"douglas fir","pos":"noun","description":"strong durable timber of a douglas fir","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_fir","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"","wordnet_id":"WID-11628678-N-01-douglas_fir","alternativeIds":[{"concept_id":"WID-11628678-N-01-douglas_fir","concept_uri":"http://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_fir"}]},{"id":"WID-11628456-N-01-douglas_fir","lemma":"douglas fir","pos":"noun","description":"tall evergreen timber tree of western North America having resinous wood and short needles","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_fir","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"","wordnet_id":"WID-11628456-N-01-douglas_fir","alternativeIds":[{"concept_id":"WID-11628456-N-01-douglas_fir","concept_uri":"http://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_fir"}]},{"id":"WID-11628793-N-04-douglas_hemlock","lemma":"douglas hemlock","pos":"noun","description":"lofty douglas fir of northwestern North America having short needles and egg-shaped cones","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlock","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,","wordnet_id":"WID-11628793-N-04-douglas_hemlock","alternativeIds":[{"concept_id":"WID-11628793-N-04-douglas_hemlock","concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlock"}]},{"id":"WID-11146670-N-02-Douglas_MacArthur","lemma":"douglas macarthur","pos":"noun","description":"United States general who served as chief of staff and commanded Allied forces in the South Pacific during World War II; he accepted the surrender of Japan (1880-1964)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthur","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11146670-N-01-MacArthur,","wordnet_id":"WID-11146670-N-02-Douglas_MacArthur","alternativeIds":[{"concept_id":"WID-11146670-N-02-Douglas_MacArthur","concept_uri":"http://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthur"}]},{"id":"WID-11190024-N-02-Douglas_Moore","lemma":"douglas moore","pos":"noun","description":"United States composer of works noted for their use of the American vernacular (1893-1969)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Moore","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11190024-N-01-Moore,","wordnet_id":"WID-11190024-N-02-Douglas_Moore","alternativeIds":[{"concept_id":"WID-11190024-N-02-Douglas_Moore","concept_uri":"http://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Moore"}]},{"id":"WID-11628793-N-03-douglas_pine","lemma":"douglas pine","pos":"noun","description":"lofty douglas fir of northwestern North America having short needles and egg-shaped cones","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pine","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,","wordnet_id":"WID-11628793-N-03-douglas_pine","alternativeIds":[{"concept_id":"WID-11628793-N-03-douglas_pine","concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pine"}]},{"id":"WID-11628793-N-02-douglas_spruce","lemma":"douglas spruce","pos":"noun","description":"lofty douglas fir of northwestern North America having short needles and egg-shaped cones","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_spruce","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11628793-N-01-green_douglas_fir,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,","wordnet_id":"WID-11628793-N-02-douglas_spruce","alternativeIds":[{"concept_id":"WID-11628793-N-02-douglas_spruce","concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_spruce"}]},{"id":"WID-02357585-N-02-Douglas_squirrel","lemma":"douglas squirrel","pos":"noun","description":"far western United States counterpart of the red squirrel","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirrel","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-02357585-N-01-chickeree,WID-02357585-N-03-Tamiasciurus_douglasi,","wordnet_id":"WID-02357585-N-02-Douglas_squirrel","alternativeIds":[{"concept_id":"WID-02357585-N-02-Douglas_squirrel","concept_uri":"http://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirrel"}]},{"id":"WID-10941206-N-02-Stephen_A._Douglas","lemma":"stephen a. douglas","pos":"noun","description":"United States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglas","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10941206-N-01-Douglas,WID-10941206-N-03-Stephen_Arnold_Douglas,WID-10941206-N-04-Little_Giant,","wordnet_id":"WID-10941206-N-02-Stephen_A._Douglas","alternativeIds":[{"concept_id":"WID-10941206-N-02-Stephen_A._Douglas","concept_uri":"http://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglas"}]},{"id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","lemma":"Douglas Weiner","pos":"noun","description":"American 20th century environmentalist","conceptList":"VogonWeb Concepts","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","creator_id":"test","equal_to":"http://viaf.org/viaf/283748929","modified_by":"admin","similar_to":"http://viaf.org/viaf/248802520","synonym_ids":"[]","wordnet_id":"","alternativeIds":[{"concept_id":"","concept_uri":"http://www.digitalhps.org/concepts/"},{"concept_id":"CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4","concept_uri":"http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4"}]},{"id":"WID-11629047-N-02-big-cone_douglas_fir","lemma":"big-cone douglas fir","pos":"noun","description":"douglas fir of California having cones 4-8 inches long","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_fir","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11629047-N-01-big-cone_spruce,WID-11629047-N-03-Pseudotsuga_macrocarpa,","wordnet_id":"WID-11629047-N-02-big-cone_douglas_fir","alternativeIds":[{"concept_id":"WID-11629047-N-02-big-cone_douglas_fir","concept_uri":"http://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_fir"}]},{"id":"WID-10965361-N-03-Douglas_Elton_Fairbanks","lemma":"douglas elton fairbanks","pos":"noun","description":"United States film actor noted for his swashbuckling roles (1883-1939)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbanks","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10965361-N-01-Fairbanks,WID-10965361-N-02-Douglas_Fairbanks,WID-10965361-N-04-Julius_Ullman,","wordnet_id":"WID-10965361-N-03-Douglas_Elton_Fairbanks","alternativeIds":[{"concept_id":"WID-10965361-N-03-Douglas_Elton_Fairbanks","concept_uri":"http://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbanks"}]},{"id":"WID-10965550-N-02-Douglas_Fairbanks_Jr.","lemma":"douglas fairbanks jr.","pos":"noun","description":"United States film actor; son of Douglas Elton Fairbanks, (1909-2000)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10965550-N-01-Fairbanks,","wordnet_id":"WID-10965550-N-02-Douglas_Fairbanks_Jr.","alternativeIds":[{"concept_id":"WID-10965550-N-02-Douglas_Fairbanks_Jr.","concept_uri":"http://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr."}]},{"id":"WID-10808886-N-02-Edgar_Douglas_Adrian","lemma":"edgar douglas adrian","pos":"noun","description":"English physiologist who conducted research into the function of neurons; 1st baron of Cambridge (1889-1997)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrian","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10808886-N-01-Adrian,WID-10808886-N-03-Baron_Adrian,","wordnet_id":"WID-10808886-N-02-Edgar_Douglas_Adrian","alternativeIds":[{"concept_id":"WID-10808886-N-02-Edgar_Douglas_Adrian","concept_uri":"http://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrian"}]},{"id":"WID-11384291-N-04-Edward_Douglas_White_Jr.","lemma":"edward douglas white jr.","pos":"noun","description":"United States jurist appointed chief justice of the United States Supreme Court in 1910 by President Taft; noted for his work on antitrust legislation (1845-1921)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11384291-N-01-White,WID-11384291-N-02-Edward_White,WID-11384291-N-03-Edward_D._White,","wordnet_id":"WID-11384291-N-04-Edward_Douglas_White_Jr.","alternativeIds":[{"concept_id":"WID-11384291-N-04-Edward_Douglas_White_Jr.","concept_uri":"http://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr."}]},{"id":"WID-11628793-N-01-green_douglas_fir","lemma":"green douglas fir","pos":"noun","description":"lofty douglas fir of northwestern North America having short needles and egg-shaped cones","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_fir","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,","wordnet_id":"WID-11628793-N-01-green_douglas_fir","alternativeIds":[{"concept_id":"WID-11628793-N-01-green_douglas_fir","concept_uri":"http://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_fir"}]},{"id":"WID-11306297-N-03-Ian_Douglas_Smith","lemma":"ian douglas smith","pos":"noun","description":"Rhodesian statesman who declared independence of Zimbabwe from Great Britain (born in 1919)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smith","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11306297-N-01-Smith,WID-11306297-N-02-Ian_Smith,","wordnet_id":"WID-11306297-N-03-Ian_Douglas_Smith","alternativeIds":[{"concept_id":"WID-11306297-N-03-Ian_Douglas_Smith","concept_uri":"http://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smith"}]},{"id":"WID-11192533-N-03-James_Douglas_Morrison","lemma":"james douglas morrison","pos":"noun","description":"United States rock singer (1943-1971)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrison","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11192533-N-01-Morrison,WID-11192533-N-02-Jim_Morrison,","wordnet_id":"WID-11192533-N-03-James_Douglas_Morrison","alternativeIds":[{"concept_id":"WID-11192533-N-03-James_Douglas_Morrison","concept_uri":"http://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrison"}]},{"id":"WID-11121876-N-03-Mary_Douglas_Leakey","lemma":"mary douglas leakey","pos":"noun","description":"English paleontologist (the wife of Louis Leakey) who discovered the Zinjanthropus skull that was 1,750,000 years old (1913-1996)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakey","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-11121876-N-01-Leakey,WID-11121876-N-02-Mary_Leakey,","wordnet_id":"WID-11121876-N-03-Mary_Douglas_Leakey","alternativeIds":[{"concept_id":"WID-11121876-N-03-Mary_Douglas_Leakey","concept_uri":"http://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakey"}]},{"id":"WID-10860444-N-03-Ray_Douglas_Bradbury","lemma":"ray douglas bradbury","pos":"noun","description":"United States writer of science fiction (born 1920)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradbury","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10860444-N-01-Bradbury,WID-10860444-N-02-Ray_Bradbury,","wordnet_id":"WID-10860444-N-03-Ray_Douglas_Bradbury","alternativeIds":[{"concept_id":"WID-10860444-N-03-Ray_Douglas_Bradbury","concept_uri":"http://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradbury"}]},{"id":"WID-10903918-N-03-Sir_John_Douglas_Cockcroft","lemma":"sir john douglas cockcroft","pos":"noun","description":"British physicist who (with Ernest Walton in 1931) first split an atom (1897-1967)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcroft","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10903918-N-01-Cockcroft,WID-10903918-N-02-Sir_John_Cockcroft,","wordnet_id":"WID-10903918-N-03-Sir_John_Douglas_Cockcroft","alternativeIds":[{"concept_id":"WID-10903918-N-03-Sir_John_Douglas_Cockcroft","concept_uri":"http://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcroft"}]},{"id":"WID-10941206-N-03-Stephen_Arnold_Douglas","lemma":"stephen arnold douglas","pos":"noun","description":"United States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)","conceptList":"WordNet","deleted":false,"concept_uri":"http://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglas","creator_id":"","equal_to":"","modified_by":"","similar_to":"","synonym_ids":"WID-10941206-N-01-Douglas,WID-10941206-N-02-Stephen_A._Douglas,WID-10941206-N-04-Little_Giant,","wordnet_id":"WID-10941206-N-03-Stephen_Arnold_Douglas","alternativeIds":[{"concept_id":"WID-10941206-N-03-Stephen_Arnold_Douglas","concept_uri":"http://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglas"}]}],"pagination":null} \ No newline at end of file diff --git a/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.xml b/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.xml new file mode 100644 index 000000000..9d0073b19 --- /dev/null +++ b/Conceptpower+Spring/src/integration-test/resources/output/wildCardSearchConceptLookUp1.xml @@ -0,0 +1 @@ +http://www.digitalhps.org/concepts/WID-10941515-N-01-DouglassdouglassnounUnited States abolitionist who escaped from slavery and became an influential writer and lecturer in the North (1817-1895)WordNetWID-10941515-N-02-Frederick_Douglass,falseWID-10941515-N-01-Douglasshttp://www.digitalhps.org/concepts/WID-10941515-N-01-Douglasshttp://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bDouglasNOUNSimilar to conceptVogonWeb Conceptsadminhttp://viaf.org/viaf/248802520E21 PersonfalseWID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/CON0252cf48-4233-495d-94ae-42480b0fd82bhttp://www.digitalhps.org/concepts/WID-10941206-N-01-Douglashttp://www.digitalhps.org/concepts/WID-02357585-N-03-Tamiasciurus_douglasitamiasciurus douglasinounfar western United States counterpart of the red squirrelWordNetWID-02357585-N-01-chickeree,WID-02357585-N-02-Douglas_squirrel,falseWID-02357585-N-03-Tamiasciurus_douglasihttp://www.digitalhps.org/concepts/WID-02357585-N-03-Tamiasciurus_douglasihttp://www.digitalhps.org/concepts/WID-10941515-N-02-Frederick_Douglassfrederick douglassnounUnited States abolitionist who escaped from slavery and became an influential writer and lecturer in the North (1817-1895)WordNetWID-10941515-N-01-Douglass,falseWID-10941515-N-02-Frederick_Douglasshttp://www.digitalhps.org/concepts/WID-10941515-N-02-Frederick_Douglasshttp://www.digitalhps.org/concepts/WID-11882972-N-02-Cardamine_douglasiicardamine douglasiinounsmall perennial herb of cooler regions of North America with racemose purple flowersWordNetWID-11882972-N-01-purple_cress,falseWID-11882972-N-02-Cardamine_douglasiihttp://www.digitalhps.org/concepts/WID-11882972-N-02-Cardamine_douglasiihttp://www.digitalhps.org/concepts/WID-12857204-N-03-Micromeria_douglasiimicromeria douglasiinountrailing perennial evergreen herb of northwestern United States with small white flowers; used medicinallyWordNetWID-12857204-N-01-yerba_buena,WID-12857204-N-02-Micromeria_chamissonis,WID-12857204-N-04-Satureja_douglasii,falseWID-12857204-N-03-Micromeria_douglasiihttp://www.digitalhps.org/concepts/WID-12857204-N-03-Micromeria_douglasiihttp://www.digitalhps.org/concepts/WID-12857204-N-04-Satureja_douglasiisatureja douglasiinountrailing perennial evergreen herb of northwestern United States with small white flowers; used medicinallyWordNetWID-12857204-N-01-yerba_buena,WID-12857204-N-02-Micromeria_chamissonis,WID-12857204-N-03-Micromeria_douglasii,falseWID-12857204-N-04-Satureja_douglasiihttp://www.digitalhps.org/concepts/WID-12857204-N-04-Satureja_douglasiihttp://www.digitalhps.org/concepts/WID-12022821-N-02-Tanacetum_douglasiitanacetum douglasiinounlightly hairy rhizomatous perennial having aromatic feathery leaves and stems bearing open clusters of small buttonlike yellow flowers; sand dunes of Pacific coast of North AmericaWordNetWID-12022821-N-01-northern_dune_tansy,falseWID-12022821-N-02-Tanacetum_douglasiihttp://www.digitalhps.org/concepts/WID-12022821-N-02-Tanacetum_douglasiihttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbanksdouglas fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-03-Douglas_Elton_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-02-Douglas_Fairbankshttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firdouglas firnounstrong durable timber of a douglas firWordNetfalseWID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628678-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firdouglas firnountall evergreen timber tree of western North America having resinous wood and short needlesWordNetfalseWID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628456-N-01-douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockdouglas hemlocknounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11628793-N-04-douglas_hemlockhttp://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurdouglas macarthurnounUnited States general who served as chief of staff and commanded Allied forces in the South Pacific during World War II; he accepted the surrender of Japan (1880-1964)WordNetWID-11146670-N-01-MacArthur,falseWID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11146670-N-02-Douglas_MacArthurhttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Mooredouglas moorenounUnited States composer of works noted for their use of the American vernacular (1893-1969)WordNetWID-11190024-N-01-Moore,falseWID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11190024-N-02-Douglas_Moorehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinedouglas pinenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-02-douglas_spruce,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-11628793-N-03-douglas_pinehttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucedouglas sprucenounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-01-green_douglas_fir,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-11628793-N-02-douglas_sprucehttp://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirreldouglas squirrelnounfar western United States counterpart of the red squirrelWordNetWID-02357585-N-01-chickeree,WID-02357585-N-03-Tamiasciurus_douglasi,falseWID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-02357585-N-02-Douglas_squirrelhttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglasstephen a. douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-03-Stephen_Arnold_Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-02-Stephen_A._Douglashttp://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4Douglas WeinernounAmerican 20th century environmentalistVogonWeb Conceptstesthttp://viaf.org/viaf/283748929adminhttp://viaf.org/viaf/248802520[]falsehttp://www.digitalhps.org/concepts/http://www.digitalhps.org/concepts/CONe40a6b36-dbaa-46c7-96ea-2c6a1cb080a4http://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firbig-cone douglas firnoundouglas fir of California having cones 4-8 inches longWordNetWID-11629047-N-01-big-cone_spruce,WID-11629047-N-03-Pseudotsuga_macrocarpa,falseWID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-11629047-N-02-big-cone_douglas_firhttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbanksdouglas elton fairbanksnounUnited States film actor noted for his swashbuckling roles (1883-1939)WordNetWID-10965361-N-01-Fairbanks,WID-10965361-N-02-Douglas_Fairbanks,WID-10965361-N-04-Julius_Ullman,falseWID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-10965361-N-03-Douglas_Elton_Fairbankshttp://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.douglas fairbanks jr.nounUnited States film actor; son of Douglas Elton Fairbanks, (1909-2000)WordNetWID-10965550-N-01-Fairbanks,falseWID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-10965550-N-02-Douglas_Fairbanks_Jr.http://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianedgar douglas adriannounEnglish physiologist who conducted research into the function of neurons; 1st baron of Cambridge (1889-1997)WordNetWID-10808886-N-01-Adrian,WID-10808886-N-03-Baron_Adrian,falseWID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-10808886-N-02-Edgar_Douglas_Adrianhttp://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.edward douglas white jr.nounUnited States jurist appointed chief justice of the United States Supreme Court in 1910 by President Taft; noted for his work on antitrust legislation (1845-1921)WordNetWID-11384291-N-01-White,WID-11384291-N-02-Edward_White,WID-11384291-N-03-Edward_D._White,falseWID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11384291-N-04-Edward_Douglas_White_Jr.http://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firgreen douglas firnounlofty douglas fir of northwestern North America having short needles and egg-shaped conesWordNetWID-11628793-N-02-douglas_spruce,WID-11628793-N-03-douglas_pine,WID-11628793-N-04-douglas_hemlock,WID-11628793-N-05-Oregon_fir,WID-11628793-N-06-Oregon_pine,WID-11628793-N-07-Pseudotsuga_menziesii,falseWID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-11628793-N-01-green_douglas_firhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithian douglas smithnounRhodesian statesman who declared independence of Zimbabwe from Great Britain (born in 1919)WordNetWID-11306297-N-01-Smith,WID-11306297-N-02-Ian_Smith,falseWID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/WID-11306297-N-03-Ian_Douglas_Smithhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonjames douglas morrisonnounUnited States rock singer (1943-1971)WordNetWID-11192533-N-01-Morrison,WID-11192533-N-02-Jim_Morrison,falseWID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-11192533-N-03-James_Douglas_Morrisonhttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakeymary douglas leakeynounEnglish paleontologist (the wife of Louis Leakey) who discovered the Zinjanthropus skull that was 1,750,000 years old (1913-1996)WordNetWID-11121876-N-01-Leakey,WID-11121876-N-02-Mary_Leakey,falseWID-11121876-N-03-Mary_Douglas_Leakeyhttp://www.digitalhps.org/concepts/WID-11121876-N-03-Mary_Douglas_Leakeyhttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyray douglas bradburynounUnited States writer of science fiction (born 1920)WordNetWID-10860444-N-01-Bradbury,WID-10860444-N-02-Ray_Bradbury,falseWID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-10860444-N-03-Ray_Douglas_Bradburyhttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcroftsir john douglas cockcroftnounBritish physicist who (with Ernest Walton in 1931) first split an atom (1897-1967)WordNetWID-10903918-N-01-Cockcroft,WID-10903918-N-02-Sir_John_Cockcroft,falseWID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-10903918-N-03-Sir_John_Douglas_Cockcrofthttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglasstephen arnold douglasnounUnited States politician who proposed that individual territories be allowed to decide whether they would have slavery; he engaged in a famous series of debates with Abraham Lincoln (1813-1861)WordNetWID-10941206-N-01-Douglas,WID-10941206-N-02-Stephen_A._Douglas,WID-10941206-N-04-Little_Giant,falseWID-10941206-N-03-Stephen_Arnold_Douglashttp://www.digitalhps.org/concepts/WID-10941206-N-03-Stephen_Arnold_Douglas \ No newline at end of file diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/bean/ConceptEditBean.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/bean/ConceptEditBean.java index 15c146037..a84235101 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/bean/ConceptEditBean.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/bean/ConceptEditBean.java @@ -33,6 +33,7 @@ public class ConceptEditBean { private boolean fromHomeScreen; private String luceneError; private String wordnetIds; + private String existingWordnetIds; public String getConcept() { return concept; @@ -205,4 +206,12 @@ public String getWordnetIds() { public void setWordnetIds(String wordnetIds) { this.wordnetIds = wordnetIds; } + + public String getExistingWordnetIds() { + return existingWordnetIds; + } + + public void setExistingWordnetIds(String existingWordnetIds) { + this.existingWordnetIds = existingWordnetIds; + } } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/constants/LuceneFieldNames.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/constants/LuceneFieldNames.java index 8009ffef6..d22e19141 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/constants/LuceneFieldNames.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/constants/LuceneFieldNames.java @@ -16,4 +16,5 @@ public interface LuceneFieldNames { public final static String WORDNETID = "wordnetid"; public final static String CONCEPTTYPE = "conceptType"; public final static String MERGED_IDS = "mergedIds"; + public final static String UNTOKENIZED_SUFFIX = "_untokenized"; } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/IConceptManager.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/IConceptManager.java index 88f098ee9..debe3d0a3 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/IConceptManager.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/IConceptManager.java @@ -121,8 +121,6 @@ public abstract String addConceptListEntry(ConceptEntry entry, String userName) public abstract void storeModifiedConcept(ConceptEntry entry, String userName) throws LuceneException, IllegalAccessException, IndexerRunningException; - public abstract void deleteConcept(String id, String userName) throws LuceneException, IndexerRunningException; - /** * Fetches the concept wrapped entries based on the wordnet id * @@ -168,4 +166,20 @@ public ConceptEntry[] getConceptListEntriesForWordPOS(String word, String pos, S int page, int numberOfRecordsPerPage) throws LuceneException, IllegalAccessException, IndexerRunningException; + /** + * + * This method deletes the concept that is passed as a parameter. + * + * @param entry + * @param userName + * @throws LuceneException + * @throws IndexerRunningException + */ + public void deleteConcept(ConceptEntry entry, String userName) throws LuceneException, IndexerRunningException; + + public void updateIndex(ConceptEntry entry, String userName) + throws IllegalAccessException, LuceneException, IndexerRunningException; + + public void deleteFromIndex(String id, String userName) throws LuceneException, IndexerRunningException; + } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/impl/ConceptManager.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/impl/ConceptManager.java index 9e20f5224..f38f84d67 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/impl/ConceptManager.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/core/impl/ConceptManager.java @@ -77,6 +77,14 @@ public ConceptEntry getConceptEntry(String id) { return entries[0]; } + List entriesList = client.getWrapperEntryByWordnetId(id); + if (entriesList != null && !entriesList.isEmpty()) { + ConceptEntry conceptEntry = entriesList.get(0); + fillConceptEntry(conceptEntry); + alternativeIdService.addAlternativeIds(id, conceptEntry); + return conceptEntry; + } + ConceptEntry entry = client.getEntry(id); if (entry != null) { fillConceptEntry(entry); @@ -103,8 +111,7 @@ public ConceptEntry getConceptEntry(String id) { */ @Override public ConceptEntry getWordnetConceptEntry(String wordnetId) throws LuceneException { - ConceptEntry entry = wordnetManager.getConcept(wordnetId); - return entry; + return wordnetManager.getConcept(wordnetId); } /* @@ -470,7 +477,6 @@ public void storeModifiedConcept(ConceptEntry entry, String userName) changeEvent.setUserName(userName); changeEvent.setType(ChangeEventTypes.MODIFICATION); entry.addNewChangeEvent(changeEvent); - indexService.updateConceptEntry(entry, userName); client.update(entry, DBNames.DICTIONARY_DB); @@ -511,23 +517,28 @@ private String generateUniqueId() { return builder.toString(); } + /** + * This method deletes the concept that is passed as a parameter. If a null + * value is passed as a concept, this method does nothing. + */ @Override - public void deleteConcept(String id, String userName) throws LuceneException, IndexerRunningException { - ConceptEntry concept = getConceptEntry(id); - concept.setDeleted(true); - ChangeEvent changeEvent = new ChangeEvent(); - changeEvent.setType(ChangeEventTypes.DELETION); - changeEvent.setDate(new Date()); - changeEvent.setUserName(userName); - concept.addNewChangeEvent(changeEvent); - client.update(concept, DBNames.DICTIONARY_DB); - indexService.deleteById(concept.getId(), userName); + public void deleteConcept(ConceptEntry concept, String userName) throws LuceneException, IndexerRunningException { + if (concept != null) { + concept.setDeleted(true); + ChangeEvent changeEvent = new ChangeEvent(); + changeEvent.setType(ChangeEventTypes.DELETION); + changeEvent.setDate(new Date()); + changeEvent.setUserName(userName); + concept.addNewChangeEvent(changeEvent); + client.update(concept, DBNames.DICTIONARY_DB); + indexService.deleteById(concept.getId(), userName); + } } @Override public ConceptEntry getConceptWrappedEntryByWordNetId(String wordNetID) throws IllegalAccessException, LuceneException, IndexerRunningException { - List conceptEntries = client.getConceptByWordnetId(wordNetID); + List conceptEntries = client.getWrapperEntryByWordnetId(wordNetID); for (ConceptEntry entry : conceptEntries) { // Wordnet is also added because lucene doesn't do an exact search // on fields @@ -562,4 +573,15 @@ public List getConceptEntriedByConceptListName(String conceptListN alternativeIdService.addAlternativeIds(conceptEntries); return conceptEntries; } + + @Override + public void updateIndex(ConceptEntry entry, String userName) + throws IllegalAccessException, LuceneException, IndexerRunningException { + indexService.updateConceptEntry(entry, userName); + } + + @Override + public void deleteFromIndex(String id, String userName) throws LuceneException, IndexerRunningException { + indexService.deleteById(id, userName); + } } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/DatabaseClient.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/DatabaseClient.java index 37bf1382f..39479e577 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/DatabaseClient.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/DatabaseClient.java @@ -2,6 +2,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.List; @@ -49,25 +50,7 @@ public void init() { @Override public ConceptEntry getEntry(String id) { ConceptEntry exampleEntry = new ConceptEntry(); - - // check if there is a wrapper for wordnet entry - exampleEntry.setId(null); - exampleEntry.setWordnetId(id); - - ConceptEntry[] dictionaryResults = getEntriesByFieldContains("wordnetid", id); - // ObjectSet results = dictionaryClient - // .queryByExample(exampleEntry); - - // there should only be exactly one object with this id - if (dictionaryResults.length == 1) - return dictionaryResults[0]; - exampleEntry.setId(id); - exampleEntry.setWordnetId(null); - - /* - * check if there is a concept with this id - */ ObjectSet results = dictionaryClient.queryByExample(exampleEntry); // there should only be exactly one object with this id if (results.size() == 1) @@ -77,12 +60,8 @@ public ConceptEntry getEntry(String id) { } @Override - public List getConceptByWordnetId(String wordnetId) { - ConceptEntry entry = new ConceptEntry(); - entry.setWordnetId(wordnetId); - - ObjectSet entries = dictionaryClient.queryByExample(entry); - return entries; + public List getWrapperEntryByWordnetId(String wordnetId) { + return Arrays.asList(getEntriesByFieldContains("wordnetid", wordnetId)); } /* diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/objectdb/ConceptDBManager.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/objectdb/ConceptDBManager.java deleted file mode 100644 index 34b7171bc..000000000 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db/objectdb/ConceptDBManager.java +++ /dev/null @@ -1,112 +0,0 @@ -package edu.asu.conceptpower.app.db.objectdb; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; - -import edu.asu.conceptpower.app.db.IDatabaseManager; -import edu.asu.conceptpower.app.db4o.IConceptDBManager; -import edu.asu.conceptpower.core.ConceptEntry; -import edu.asu.conceptpower.core.ConceptList; - -public class ConceptDBManager implements IConceptDBManager { - - @Autowired - private IDatabaseManager dbManager; - - @Override - public ConceptEntry getEntry(String id) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List queryByExample(Object example) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConceptEntry[] getEntriesByFieldContains(String field, - String containsString) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConceptEntry[] getEntriesForWord(String word, String pos) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConceptEntry[] getSynonymsPointingToId(String id) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConceptEntry[] getEntriesForWord(String word) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConceptList getConceptList(String name) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getAllElementsOfType(Class clazz) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getAllEntriesFromList(String conceptList, int pageNo, int pageSize, String sortBy, - int sortDirection) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void store(Object element, String databasename) { - // TODO Auto-generated method stub - - } - - @Override - public void update(ConceptEntry entry, String databasename) { - // TODO Auto-generated method stub - - } - - @Override - public void deleteConceptList(String name) { - // TODO Auto-generated method stub - - } - - @Override - public void update(ConceptList list, String listname, String databasename) { - // TODO Auto-generated method stub - - } - - public List getConceptByWordnetId(String wordnetId) { - return null; - } - - @Override - public List getAllEntriesFromList(String listname) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getAllEntriesByTypeId(String typeId) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db4o/IConceptDBManager.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db4o/IConceptDBManager.java index 8438aa64b..1cb0d05eb 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db4o/IConceptDBManager.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/db4o/IConceptDBManager.java @@ -45,10 +45,10 @@ public abstract List getAllEntriesFromList(String conceptList, int public abstract void update(ConceptList list, String listname, String databasename); - List getConceptByWordnetId(String wordnetId); - public List getAllEntriesFromList(String listname); public List getAllEntriesByTypeId(String typeId); + public List getWrapperEntryByWordnetId(String wordnetId); + } \ No newline at end of file diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/lucene/impl/LuceneUtility.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/lucene/impl/LuceneUtility.java index fe9232daf..5c09ef2d3 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/lucene/impl/LuceneUtility.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/lucene/impl/LuceneUtility.java @@ -21,6 +21,7 @@ import javax.annotation.PreDestroy; import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.analysis.core.WhitespaceAnalyzer; import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper; import org.apache.lucene.analysis.standard.StandardAnalyzer; @@ -33,15 +34,20 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.Term; -import org.apache.lucene.queryparser.classic.ParseException; -import org.apache.lucene.queryparser.classic.QueryParser; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.Query; +import org.apache.lucene.search.MultiTermQuery; +import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.ScoreDoc; +import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopScoreDocCollector; +import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.util.QueryBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -96,6 +102,9 @@ public class LuceneUtility implements ILuceneUtility { @Autowired private WhitespaceAnalyzer whiteSpaceAnalyzer; + @Autowired + private KeywordAnalyzer keywordAnalyzer; + @Autowired private Environment env; @@ -192,6 +201,11 @@ public void insertConcept(ConceptEntry entry, String userName) throws LuceneExce } } + + if (searchFieldAnnotation.isShortPhraseSearchable()) { + doc.add(new StringField(searchFieldAnnotation.lucenefieldName() + LuceneFieldNames.UNTOKENIZED_SUFFIX, + String.valueOf(contentOfField), Field.Store.YES)); + } } } } @@ -293,6 +307,7 @@ private Document createIndividualDocument(IDictionary dict, IWordID wordId) { Document doc = new Document(); String lemma = wordId.getLemma().replace("_", " "); doc.add(new TextField(LuceneFieldNames.WORD, lemma, Field.Store.YES)); + doc.add(new StringField(LuceneFieldNames.WORD + LuceneFieldNames.UNTOKENIZED_SUFFIX, lemma, Field.Store.YES)); doc.add(new StringField(LuceneFieldNames.POS, wordId.getPOS().toString(), Field.Store.YES)); IWord word = dict.getWord(wordId); @@ -435,69 +450,47 @@ public ConceptEntry[] queryIndex(Map fieldMap, String operator, int numberOfRecordsPerPage) throws LuceneException, IllegalAccessException { Map analyzerPerField = new HashMap<>(); - - if (operator == null) { - operator = SearchParamters.OP_AND; + BooleanClause.Occur occur = BooleanClause.Occur.SHOULD; + if (operator == null || operator.equalsIgnoreCase(SearchParamters.OP_AND)) { + occur = BooleanClause.Occur.MUST; } - StringBuffer queryString = new StringBuffer(); - int firstEntry = 1; - java.lang.reflect.Field[] fields = ConceptEntry.class.getDeclaredFields(); + for (java.lang.reflect.Field field : fields) { - SearchField search = field.getAnnotation(SearchField.class); LuceneField luceneFieldAnnotation = field.getAnnotation(LuceneField.class); - if (search != null) { - String searchString = fieldMap.get(search.fieldName()); - - if(searchString != null){ - if (firstEntry != 1) - queryString.append(" " + operator + " "); - firstEntry++; - queryString.append(luceneFieldAnnotation.lucenefieldName() + ":"); - - StringBuffer searchBuffer = new StringBuffer("("); - String[] searchParts = searchString.split(" "); - - boolean quoteOpen = false; - for (String term : searchParts) { - if (!quoteOpen && !term.trim().isEmpty()) { - searchBuffer.append("+"); - } - - searchBuffer.append(QueryParser.escape(term) + " "); - - if (term.startsWith("\"")) { - quoteOpen = true; - } - - if (term.endsWith("\"")) { - quoteOpen = false; - } - } - - if (quoteOpen) { - int idxLastQuote = searchBuffer.lastIndexOf("\""); - searchBuffer.replace(idxLastQuote, idxLastQuote+1, ""); - } - searchBuffer.append(")"); - queryString.append(searchBuffer.toString()); - if (!luceneFieldAnnotation.isTokenized()) { - // If the field is not tokenzied, then the field needs - // to be analyzed using a whitespaceanalyzer, rather - // than standard analyzer. This is because for non - // tokenized strings we need exact matches and not all - // the nearest matches. - analyzerPerField.put(luceneFieldAnnotation.lucenefieldName(), whiteSpaceAnalyzer); - } + if (luceneFieldAnnotation != null) { + if (!luceneFieldAnnotation.isShortPhraseSearchable() && !luceneFieldAnnotation.isTokenized()) { + // If the field is not tokenzied, then the field needs to be + // analyzed using a whitespaceanalyzer, rather than standard + // analyzer. This is because for non tokenized strings we + // need exact matches and not all the nearest matches. + analyzerPerField.put(luceneFieldAnnotation.lucenefieldName(), whiteSpaceAnalyzer); + } if(luceneFieldAnnotation.isShortPhraseSearchable()) { + analyzerPerField.put(luceneFieldAnnotation.lucenefieldName() + LuceneFieldNames.UNTOKENIZED_SUFFIX, + keywordAnalyzer); } - } + } PerFieldAnalyzerWrapper perFieldAnalyzerWrapper = new PerFieldAnalyzerWrapper(standardAnalyzer, analyzerPerField); + QueryBuilder qBuild = new QueryBuilder(perFieldAnalyzerWrapper); + BooleanQuery.Builder builder = new BooleanQuery.Builder(); + + for (java.lang.reflect.Field field : fields) { + SearchField search = field.getAnnotation(SearchField.class); + LuceneField luceneFieldAnnotation = field.getAnnotation(LuceneField.class); + if (search != null) { + String searchString = fieldMap.get(search.fieldName()); + if (searchString != null) { + buildQuery(occur, perFieldAnalyzerWrapper, qBuild, builder, luceneFieldAnnotation, searchString); + } + } + } + List concepts = new ArrayList(); try { @@ -521,8 +514,8 @@ public ConceptEntry[] queryIndex(Map fieldMap, String operator, startIndex = 0; hitsPerPage = numberOfResults; } - Query q = new QueryParser("", perFieldAnalyzerWrapper).parse(queryString.toString()); - searcher.search(q, collector); + + searcher.search(builder.build(), collector); // If page number is more than the available results, we just pass // empty result. TopDocs topDocs = collector.topDocs(startIndex, hitsPerPage); @@ -537,14 +530,74 @@ public ConceptEntry[] queryIndex(Map fieldMap, String operator, catch (IOException ex) { throw new LuceneException("Issues in querying lucene index. Please retry", ex); - } catch (ParseException e) { - throw new LuceneException("Issues in framing the query", e); } logger.debug("Number of concepts retrieved from lucene = " + concepts.size()); return concepts.toArray(new ConceptEntry[concepts.size()]); } + private void buildQuery(BooleanClause.Occur occur, PerFieldAnalyzerWrapper perFieldAnalyzerWrapper, + QueryBuilder qBuild, BooleanQuery.Builder builder, LuceneField luceneFieldAnnotation, String searchString) { + if (luceneFieldAnnotation.isTokenized()) { + BooleanQuery.Builder tokenizedQueryBuilder = new BooleanQuery.Builder(); + buildTokenizedOrWildCardQuery(luceneFieldAnnotation, searchString, tokenizedQueryBuilder); + + if (luceneFieldAnnotation.isShortPhraseSearchable()) { + BooleanQuery.Builder rootQueryBuilder = new BooleanQuery.Builder(); + rootQueryBuilder.add(tokenizedQueryBuilder.build(), Occur.SHOULD); + // Short word searching + BooleanQuery.Builder shortWordSearchQueryBuilder = new BooleanQuery.Builder(); + shortWordSearchQueryBuilder.add( + new PhraseQuery(luceneFieldAnnotation.lucenefieldName() + LuceneFieldNames.UNTOKENIZED_SUFFIX, + searchString), + Occur.SHOULD); + + rootQueryBuilder.add(shortWordSearchQueryBuilder.build(), Occur.SHOULD); + tokenizedQueryBuilder = rootQueryBuilder; + } + builder.add(tokenizedQueryBuilder.build(), occur); + + } else { + if (luceneFieldAnnotation.isWildCardSearchEnabled()) { + createWildCardSearchQuery(luceneFieldAnnotation, searchString, builder, occur); + } else { + builder.add(new BooleanClause( + new TermQuery(new Term(luceneFieldAnnotation.lucenefieldName(), searchString)), occur)); + } + } + } + + private void buildTokenizedOrWildCardQuery(LuceneField luceneFieldAnnotation, String searchString, + BooleanQuery.Builder tokenizedQueryBuilder) { + for (String searchValue : searchString.split(" ")) { + if (luceneFieldAnnotation.isWildCardSearchEnabled()) { + createWildCardSearchQuery(luceneFieldAnnotation, searchValue, tokenizedQueryBuilder, Occur.MUST); + } else { + tokenizedQueryBuilder.add(new PhraseQuery(luceneFieldAnnotation.lucenefieldName(), searchValue), + Occur.MUST); + } + } + } + + /** + * This method adds the wild card query to the query builder when the + * luceneFieldAnnotation has enabled wild card search. This wild card query + * is added with an 'OR' condition in the queryBuilder. + * + * @param luceneFieldAnnotation + * @param searchString + * @param queryBuilder + */ + private void createWildCardSearchQuery(LuceneField luceneFieldAnnotation, String searchString, + BooleanQuery.Builder queryBuilder, Occur occur) { + if (luceneFieldAnnotation.isWildCardSearchEnabled()) { + Term t = new Term(luceneFieldAnnotation.lucenefieldName(), searchString.toLowerCase()); + WildcardQuery wildCardQuery = new WildcardQuery(t); + wildCardQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE); + queryBuilder.add(wildCardQuery, occur); + } + } + private int calculateStartIndex(int page, int numberOfRecordsPerPage) { return (page - 1) * numberOfRecordsPerPage; } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/reflect/LuceneField.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/reflect/LuceneField.java index d382eb170..6ca6c3390 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/reflect/LuceneField.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/reflect/LuceneField.java @@ -9,7 +9,18 @@ @Retention(RetentionPolicy.RUNTIME) public @interface LuceneField { - String lucenefieldName(); - boolean isTokenized(); + String lucenefieldName(); + boolean isTokenized(); boolean isMultiple(); + + /** + * This will be set to true if we need to index the field twice (first + * tokenized, second non tokenized) to support short phrase search such as + * "be". + * + * @return + */ + boolean isShortPhraseSearchable() default false; + + boolean isWildCardSearchEnabled() default false; } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptEditService.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptEditService.java new file mode 100644 index 000000000..e1710e950 --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptEditService.java @@ -0,0 +1,33 @@ +package edu.asu.conceptpower.app.service; + +import edu.asu.conceptpower.app.exceptions.IndexerRunningException; +import edu.asu.conceptpower.app.exceptions.LuceneException; +import edu.asu.conceptpower.core.ConceptEntry; + +public interface IConceptEditService { + + /** + * This method edits the concept by updating the concept in the database and + * lucene index. + * + * Apart from updating the concept, this method adds and removes the wordnet + * entries from the lucene index and database. + * + * @param conceptEntry + * - Concept entry to be updated in the database and lucene. + * @param oldWordnetIds + * - Wordnet ids that belonged to the concept entry before the + * updation. Comma separated string. + * @param updatedWordnetIds + * - Newly added wordnet ids to the concept entry. Comma + * separated string. + * @param userName + * - UserName of the user who is updating the concept. + * @throws IllegalAccessException + * @throws LuceneException + * @throws IndexerRunningException + */ + public void editConcepts(ConceptEntry conceptEntry, String oldWordnetIds, String updatedWordnetIds, String userName) + throws IllegalAccessException, LuceneException, IndexerRunningException; + +} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptWrapperService.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptWrapperService.java new file mode 100644 index 000000000..c71dd2c97 --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/IConceptWrapperService.java @@ -0,0 +1,30 @@ +package edu.asu.conceptpower.app.service; + +import java.util.Map; + +public interface IConceptWrapperService { + + /** + * This method fetches all the concept types within the Conceptpower system + * and returns a map containing the concept type id as the key and concept + * type name as the value. + * + * If there are no ConceptTypes in the Conceptpower system, then an empty + * map is returned. + * + * @return + */ + public Map fetchAllConceptTypes(); + + /** + * This method fetches all the concept lists within the Conceptpower system + * and returns a map containing the concept list name as the key and concept + * list name as the value as well. + * + * If there are no ConceptLists in the Conceptpower system, then an empty + * map is returned. + * + * @return + */ + public Map fetchAllConceptLists(); +} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptEditService.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptEditService.java new file mode 100644 index 000000000..20c750ef7 --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptEditService.java @@ -0,0 +1,75 @@ +package edu.asu.conceptpower.app.service.impl; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import edu.asu.conceptpower.app.core.IConceptManager; +import edu.asu.conceptpower.app.exceptions.IndexerRunningException; +import edu.asu.conceptpower.app.exceptions.LuceneException; +import edu.asu.conceptpower.app.service.IConceptEditService; +import edu.asu.conceptpower.app.wordnet.Constants; +import edu.asu.conceptpower.core.ConceptEntry; + +@Service +public class ConceptEditService implements IConceptEditService { + + @Autowired + private IConceptManager conceptManager; + + /** + * This method adds all the wordnet concepts to the database and lucene + * index that are removed from wordnet id field of wrapper. The next step is + * to remove all the wordnet concepts from database and lucene index that + * are added to the wordnet id field of the wrapper. Finally the concept is + * updated in the lucene index and database. + * + * + * If conceptEntry is null, this method just returns without editing the + * concept. Else the concept entry is updated in the database and lucene + * index. + * + */ + @Override + public void editConcepts(ConceptEntry conceptEntry, String oldWordnetIds, String updatedWordnetIds, String userName) + throws IllegalAccessException, LuceneException, IndexerRunningException { + + if (conceptEntry == null) { + return; + } + + Set oldWordnetIdsSet = new HashSet(Arrays.asList(oldWordnetIds.split(","))); + Set updatedWordnetIdsSet = new HashSet(Arrays.asList(updatedWordnetIds.split(","))); + oldWordnetIdsSet.removeAll(updatedWordnetIdsSet); + updateWordnetConcepts(oldWordnetIdsSet, userName); + deleteWordNetConcepts(conceptEntry.getWordnetId(), userName); + conceptManager.storeModifiedConcept(conceptEntry, userName); + } + + private void updateWordnetConcepts(Set oldWordnetIds, String userName) + throws LuceneException, IllegalAccessException, IndexerRunningException { + for (String wordnetId : oldWordnetIds) { + if (!wordnetId.trim().equalsIgnoreCase("")) { + ConceptEntry entry = conceptManager.getWordnetConceptEntry(wordnetId); + entry.setConceptList(Constants.WORDNET_DICTIONARY); + conceptManager.updateIndex(entry, userName); + } + } + } + + private void deleteWordNetConcepts(String wordnetIds, String userName) + throws LuceneException, IndexerRunningException { + if (wordnetIds != null) { + String[] wordnetIdArray = wordnetIds.split(","); + for (String wordnetId : wordnetIdArray) { + if (!wordnetId.trim().equalsIgnoreCase("")) { + conceptManager.deleteFromIndex(wordnetId, userName); + } + } + } + } + +} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptMergeService.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptMergeService.java index 5fdea6bb5..8b9c61db4 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptMergeService.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptMergeService.java @@ -1,7 +1,10 @@ package edu.asu.conceptpower.app.service.impl; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; @@ -109,6 +112,9 @@ public void mergeConcepts(ConceptsMergeBean conceptsMergeBean, String userName) throws LuceneException, IndexerRunningException, IllegalAccessException, DictionaryDoesNotExistException, DictionaryModifyException { + Map localCCPConceptMap = fetchLocalCCPConcepts(conceptsMergeBean.getMergeIds(), + conceptsMergeBean.getSelectedConceptId()); + if (conceptsMergeBean.getSelectedConceptId().trim().equals("")) { // Add ConceptEntry entry = new ConceptEntry(); @@ -121,12 +127,23 @@ public void mergeConcepts(ConceptsMergeBean conceptsMergeBean, String userName) conceptManager.storeModifiedConcept(entry, userName); } - deleteMergedConcepts(userName, conceptsMergeBean); + deleteMergedConcepts(userName, conceptsMergeBean, localCCPConceptMap); + } + + private Map fetchLocalCCPConcepts(Set mergeIds,String selectedConceptId) { + Map localCCPConceptMap = new HashMap<>(); + for (String id : mergeIds) { + if (IdType.SPECIFIC_WORDNET_CONCEPT_ID != conceptTypesService.getConceptTypeByConceptId(id) + && !id.equalsIgnoreCase(selectedConceptId.trim())) { + localCCPConceptMap.put(id, conceptManager.getConceptEntry(id)); + } + } + return localCCPConceptMap; } - private void deleteMergedConcepts(String userName, ConceptsMergeBean conceptsMergeBean) - throws LuceneException, IndexerRunningException, IllegalAccessException, - DictionaryDoesNotExistException, DictionaryModifyException { + private void deleteMergedConcepts(String userName, ConceptsMergeBean conceptsMergeBean, + Map localCCPConceptMap) throws LuceneException, IndexerRunningException, + IllegalAccessException, DictionaryDoesNotExistException, DictionaryModifyException { for (String id : conceptsMergeBean.getMergeIds()) { if (IdType.SPECIFIC_WORDNET_CONCEPT_ID == conceptTypesService.getConceptTypeByConceptId(id)) { @@ -135,9 +152,9 @@ private void deleteMergedConcepts(String userName, ConceptsMergeBean conceptsMer // because changeevent object needs to be updated for // deletion correctly. String conceptWrapperId = createConceptWrapperById(id, userName, conceptsMergeBean); - conceptManager.deleteConcept(conceptWrapperId, userName); + conceptManager.deleteConcept(conceptManager.getConceptEntry(conceptWrapperId), userName); } else if (!id.equalsIgnoreCase(conceptsMergeBean.getSelectedConceptId().trim())) { - conceptManager.deleteConcept(id, userName); + conceptManager.deleteConcept(localCCPConceptMap.get(id), userName); } } } @@ -145,7 +162,7 @@ private void deleteMergedConcepts(String userName, ConceptsMergeBean conceptsMer private String createConceptWrapperById(String wrapperId, String userName, ConceptsMergeBean conceptsMergeBean) throws IllegalAccessException, DictionaryDoesNotExistException, DictionaryModifyException, LuceneException, IndexerRunningException { - ConceptEntry entry = conceptManager.getConceptEntry(wrapperId); + ConceptEntry entry = conceptManager.getWordnetConceptEntry(wrapperId); // Creating concept wrapper with all the values, because in future we // will be including manipulations on deleted wrappers as well. // WrapperId has been added to delete the wordnet id. If this wordnet diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptWrapperService.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptWrapperService.java new file mode 100644 index 000000000..f8560d4dd --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/service/impl/ConceptWrapperService.java @@ -0,0 +1,77 @@ +package edu.asu.conceptpower.app.service.impl; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import edu.asu.conceptpower.app.core.IConceptListManager; +import edu.asu.conceptpower.app.core.IConceptTypeManger; +import edu.asu.conceptpower.app.service.IConceptWrapperService; +import edu.asu.conceptpower.core.ConceptList; +import edu.asu.conceptpower.core.ConceptType; + +/** + * This class acts as a helper class for ConceptWrapperAddController. This class + * helps for fetching the concept list and concept type details within the + * Conceptpower system. + * + * @author karthikeyanmohan + * + */ +@Service +public class ConceptWrapperService implements IConceptWrapperService { + + @Autowired + private IConceptListManager conceptListManager; + + @Autowired + private IConceptTypeManger conceptTypesManager; + + /** + * This method fetches all the concept types within the Conceptpower system + * and returns a map containing the concept type id as the key and concept + * type name as the value. + * + * If there are no ConceptTypes in the Conceptpower system, then an empty + * map is returned. + */ + @Override + public Map fetchAllConceptTypes() { + ConceptType[] allTypes = conceptTypesManager.getAllTypes(); + Map types = new LinkedHashMap(); + if (allTypes == null || allTypes.length == 0) { + return types; + } + for (ConceptType conceptType : allTypes) { + types.put(conceptType.getTypeId(), conceptType.getTypeName()); + } + return types; + } + + /** + * This method fetches all the concept lists within the Conceptpower system + * and returns a map containing the concept list name as the key and concept + * list name as the value as well. + * + * If there are no ConceptLists in the Conceptpower system, then an empty + * map is returned. + * + * @return + */ + @Override + public Map fetchAllConceptLists() { + List allLists = conceptListManager.getAllConceptLists(); + Map lists = new LinkedHashMap(); + if (allLists == null || allLists.isEmpty()) { + return lists; + } + for (ConceptList conceptList : allLists) { + lists.put(conceptList.getConceptListName(), conceptList.getConceptListName()); + } + return lists; + } + +} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/validation/ConceptWrapperAddBeanValidator.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/validation/ConceptWrapperAddBeanValidator.java new file mode 100644 index 000000000..cacb277f5 --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/app/validation/ConceptWrapperAddBeanValidator.java @@ -0,0 +1,25 @@ +package edu.asu.conceptpower.app.validation; + +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.validation.ValidationUtils; +import org.springframework.validation.Validator; + +import edu.asu.conceptpower.web.backing.ConceptWrapperAddBean; + +@Component +public class ConceptWrapperAddBeanValidator implements Validator { + + @Override + public boolean supports(Class clazz) { + return ConceptWrapperAddBean.class.isAssignableFrom(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "word", "name.required"); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "selectedConceptList", "list.required"); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "selectedType", "types.required"); + } + +} diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/core/ConceptEntry.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/core/ConceptEntry.java index 759c850bb..f8aede9fb 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/core/ConceptEntry.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/core/ConceptEntry.java @@ -2,10 +2,12 @@ import java.io.Serializable; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import javax.persistence.Entity; import javax.persistence.Id; @@ -37,7 +39,7 @@ public class ConceptEntry implements Serializable { private String wordnetId; @SearchField(fieldName = SearchFieldNames.WORD) - @LuceneField(lucenefieldName = LuceneFieldNames.WORD, isTokenized = true, isMultiple = false) + @LuceneField(lucenefieldName = LuceneFieldNames.WORD, isTokenized = true, isMultiple = false, isShortPhraseSearchable = true, isWildCardSearchEnabled = true) private String word; @SearchField(fieldName = SearchFieldNames.DESCRIPTION) @@ -185,13 +187,28 @@ public void setTypeId(String typeId) { /** * A string containing URIs of authority file records or control vocabulary * entries that are equal to an entry. + * */ public String getEqualTo() { return equalTo; } - public void setEqualTo(String equalTo) { - this.equalTo = equalTo; + /** + * If a slash "/" is present at the end of the equal, this method removes + * the slash from end of equal and assigns the value to equalTo. For example + * if equal="http://viaf.org/viaf/110275452/", then this method assigns + * "http://viaf.org/viaf/110275452" to equalTo + * + * @param equalTo + */ + public void setEqualTo(String equal) { + if (equal != null) { + List equalsTo = Arrays.asList(equal.split(",")); + this.equalTo = equalsTo.stream().map(i -> removeTrailingBackSlashAndTrim(i)) + .collect(Collectors.joining(",")); + } else { + this.equalTo = equal; + } } /** @@ -268,13 +285,28 @@ public void setConceptList(String conceptList) { /** * A string containing URIs of authority file records or control vocabulary * entries that are similar to an entry. + * */ public String getSimilarTo() { return similarTo; } - public void setSimilarTo(String similarTo) { - this.similarTo = similarTo; + /** + * If a slash "/" is present at the end of the similar, this method removes + * the slash from end of similar and assigns the value to similarTo. For + * example if similar="http://viaf.org/viaf/110275452/", then this method + * assigns similarTo to "http://viaf.org/viaf/110275452" + * + * @param similarTo + */ + public void setSimilarTo(String similar) { + if (similar != null) { + List similarToList = Arrays.asList(similar.split(",")); + this.similarTo = similarToList.stream().map(i -> removeTrailingBackSlashAndTrim(i)) + .collect(Collectors.joining(",")); + } else { + this.similarTo = similar; + } } /** @@ -428,4 +460,11 @@ public String getMergedIds() { public void setMergedIds(String mergedIds) { this.mergedIds = mergedIds; } + + private String removeTrailingBackSlashAndTrim(String val) { + if (val.endsWith("/")) { + return val.substring(0, val.length() - 1).trim(); + } + return val.trim(); + } } \ No newline at end of file diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptIDLookup.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptIDLookup.java index 82f98ed44..b466cca12 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptIDLookup.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptIDLookup.java @@ -1,7 +1,10 @@ package edu.asu.conceptpower.rest; import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -98,4 +101,53 @@ public class ConceptIDLookup { } + /** + * This method provides concept information for the rest interface of the + * form + * "http://[server.url]/conceptpower/rest/Concept?id={IDs of concept seperated by ,}" + * + * @param req + * Holds the HTTP request information + * @return XML containing concept information + * @throws JsonProcessingException + */ + @RequestMapping(value = "/Concepts", method = RequestMethod.GET, produces = { MediaType.APPLICATION_XML_VALUE, + MediaType.APPLICATION_JSON_VALUE }) + public @ResponseBody ResponseEntity getConceptByIds(@RequestParam String ids, + @RequestHeader(value = "Accept", defaultValue = MediaType.APPLICATION_XML_VALUE) String acceptHeader) + throws JsonProcessingException { + + if (ids == null || ids.trim().isEmpty()) { + return new ResponseEntity(HttpStatus.BAD_REQUEST); + } + + String[] wordnetIds = ids.split(","); + + if (wordnetIds == null) { + return new ResponseEntity(HttpStatus.BAD_REQUEST); + } + + Set conceptEntries = new HashSet<>(); + for (String wordnetId : wordnetIds) { + if (!wordnetId.trim().equalsIgnoreCase("")) { + conceptEntries.add(conceptManager.getConceptEntry(wordnetId)); + } + } + + IConceptMessage msg = messageFactory.getMessageFactory(acceptHeader).createConceptMessage(); + Map entryMap = new LinkedHashMap<>(); + if (conceptEntries != null && !conceptEntries.isEmpty()) { + for (ConceptEntry entry : conceptEntries) { + ConceptType type = null; + if (typeManager != null && entry.getTypeId() != null && !entry.getTypeId().trim().isEmpty()) { + type = typeManager.getType(entry.getTypeId()); + } + entryMap.put(entry, type); + } + } + + return new ResponseEntity(msg.getAllConceptEntriesAndPaginationDetails(entryMap, null), HttpStatus.OK); + + } + } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptLookup.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptLookup.java index 63552fe4c..12a9e6811 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptLookup.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptLookup.java @@ -1,6 +1,6 @@ package edu.asu.conceptpower.rest; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import org.slf4j.Logger; @@ -96,7 +96,7 @@ public class ConceptLookup { } private Map generateEntryMap(ConceptEntry[] entries) { - Map entryMap = new HashMap(); + Map entryMap = new LinkedHashMap(); for (ConceptEntry entry : entries) { ConceptType type = null; diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearch.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearch.java index 91b69c304..443a19acf 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearch.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearch.java @@ -1,6 +1,10 @@ package edu.asu.conceptpower.rest; +import java.beans.IntrospectionException; +import java.beans.PropertyDescriptor; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @@ -71,6 +75,7 @@ private void initBinder(WebDataBinder binder) { } private static final Logger logger = LoggerFactory.getLogger(ConceptSearch.class); + private static final Object[] EMPTY_OBJECT = new Object[] {}; /** * This method provides information of a concept for a rest interface of the @@ -82,6 +87,8 @@ private void initBinder(WebDataBinder binder) { * @return * @throws JsonProcessingException * @throws IndexerRunningException + * @throws IntrospectionException + * @throws InvocationTargetException */ @RequestMapping(value = "/ConceptSearch", method = RequestMethod.GET, produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }) @@ -89,46 +96,47 @@ private void initBinder(WebDataBinder binder) { @Validated ConceptSearchParameters conceptSearchParameters, BindingResult result, @RequestHeader(value = "Accept", defaultValue = MediaType.APPLICATION_XML_VALUE) String acceptHeader) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException, - IndexerRunningException { + IndexerRunningException, IntrospectionException, InvocationTargetException { if (result.hasErrors()) { IConceptMessage msg = messageFactory.getMessageFactory(acceptHeader).createConceptMessage(); String errorMessage = msg.getErrorMessages(result.getAllErrors()); return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); } - Map searchFields = new HashMap(); - String operator = SearchParamters.OP_AND; - int page = 1; + preprocessConceptSearchParameterBean(conceptSearchParameters); + int page = conceptSearchParameters.getPage() != null ? conceptSearchParameters.getPage() : 1; + Map searchFields = new HashMap(); for (Field field : conceptSearchParameters.getClass().getDeclaredFields()) { - field.setAccessible(true); - if (field.getName().equalsIgnoreCase("type_uri")) { - if (field.get(conceptSearchParameters) != null) { - searchFields.put("type_id", - uriHelper.getTypeId(String.valueOf(field.get(conceptSearchParameters)))); - } - } else if (SearchParamters.OPERATOR.equalsIgnoreCase(field.getName())) { - // If the value is null, then operator will be OR by default - if (field.get(conceptSearchParameters) != null) { - operator = String.valueOf(field.get(conceptSearchParameters)).toUpperCase(); + /** + * Cobertura adds the below field to keep track of which code has + * been accessed. + * + * public static final transient int[] __cobertura_counters; + * + * In order to avoid iterating this transient field we are checking + * for the modifier type before adding the fields to the searchField + * map. + */ + if (!Modifier.isTransient(field.getModifiers())) { + PropertyDescriptor descriptor = new PropertyDescriptor(field.getName(), ConceptSearchParameters.class); + if (descriptor.getReadMethod().invoke(conceptSearchParameters, EMPTY_OBJECT) != null) { + searchFields.put(field.getName().trim(), + String.valueOf(descriptor.getReadMethod().invoke(conceptSearchParameters, EMPTY_OBJECT))); } - } else if (SearchParamters.PAGE.equalsIgnoreCase(field.getName())) { - page = field.get(conceptSearchParameters) != null ? (Integer) field.get(conceptSearchParameters) : page; - } else if (SearchParamters.NUMBER_OF_RECORDS_PER_PAGE.equalsIgnoreCase(field.getName())) { - numberOfRecordsPerPage = field.get(conceptSearchParameters) != null - ? (Integer) field.get(conceptSearchParameters) : numberOfRecordsPerPage; - } else if (field.get(conceptSearchParameters) != null) { - searchFields.put(field.getName().trim(), String.valueOf(field.get(conceptSearchParameters)).trim()); } } ConceptEntry[] searchResults = null; int totalNumberOfRecords = 0; try { - totalNumberOfRecords = manager.getTotalNumberOfRecordsForSearch(searchFields, operator); - searchResults = manager.searchForConceptByPageNumberAndFieldMap(searchFields, operator, page, - numberOfRecordsPerPage); + totalNumberOfRecords = manager.getTotalNumberOfRecordsForSearch(searchFields, + conceptSearchParameters.getOperator()); + searchResults = manager.searchForConceptByPageNumberAndFieldMap(searchFields, + conceptSearchParameters.getOperator(), page, + conceptSearchParameters.getNumber_of_records_per_page() != null + ? conceptSearchParameters.getNumber_of_records_per_page() : numberOfRecordsPerPage); } catch (LuceneException ex) { logger.error("Lucene Exception", ex); return new ResponseEntity(ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); @@ -148,6 +156,20 @@ private void initBinder(WebDataBinder binder) { HttpStatus.OK); } + /** + * + * This method is used for setting the correct values for concept search + * parameters. + * + * @param conceptSearchParameters + * @return + */ + private void preprocessConceptSearchParameterBean(ConceptSearchParameters conceptSearchParameters) { + if (conceptSearchParameters.getType_uri() != null) { + conceptSearchParameters.setType_id(uriHelper.getTypeId(conceptSearchParameters.getType_uri())); + } + } + private void createEntryMap(ConceptEntry[] searchResults, Map entryMap) { for (ConceptEntry entry : searchResults) { ConceptType type = null; diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameterValidator.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameterValidator.java index c7feb19ff..319c269de 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameterValidator.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameterValidator.java @@ -1,5 +1,9 @@ package edu.asu.conceptpower.rest; +import java.lang.reflect.Field; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.Validator; @@ -17,6 +21,8 @@ @Component public class ConceptSearchParameterValidator implements Validator { + private final Logger logger = LoggerFactory.getLogger(ConceptSearchParameterValidator.class); + @Override public boolean supports(Class clazz) { return ConceptSearchParameters.class.isAssignableFrom(clazz); @@ -25,6 +31,10 @@ public boolean supports(Class clazz) { @Override public void validate(Object target, Errors errors) { ConceptSearchParameters conceptSearchParameter = (ConceptSearchParameters) target; + + if (!hasAtLeastOneNonEmpty(conceptSearchParameter)) { + errors.reject("invalidSearch", "No valid search parameters present."); + } if (conceptSearchParameter.getPos() != null && !POS.posValues.contains(conceptSearchParameter.getPos().toLowerCase())) { errors.reject("pos", "Please enter correct pos value."); } @@ -36,4 +46,21 @@ public void validate(Object target, Errors errors) { } } + private boolean hasAtLeastOneNonEmpty(ConceptSearchParameters conceptSearchParameters) { + Field[] fields = ConceptSearchParameters.class.getDeclaredFields(); + for (Field field : fields) { + field.setAccessible(true); + try { + if (field.get(conceptSearchParameters) != null) { + return true; + } + } catch (IllegalArgumentException e) { + logger.error("IllegalArgumentException", e); + } catch (IllegalAccessException ie) { + logger.error("IllegalAccessException", ie); + } + } + return false; + } + } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameters.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameters.java index 01b7d440b..548aa54fe 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameters.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/ConceptSearchParameters.java @@ -1,5 +1,9 @@ package edu.asu.conceptpower.rest; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public class ConceptSearchParameters { private String type_uri; @@ -25,7 +29,7 @@ public void setType_uri(String type_uri) { } public String getOperator() { - return operator; + return this.operator == null ? SearchParamters.OP_AND : this.operator; } public void setOperator(String operator) { @@ -43,6 +47,10 @@ public void setPage(Integer page) { } public String getSimilar_to() { + if (this.similar_to != null) { + List similarList = Arrays.asList(this.similar_to.split(",")); + return similarList.stream().map(i -> removeTrailingBackSlash(i)).collect(Collectors.joining(",")); + } return similar_to; } @@ -82,10 +90,7 @@ public void setWord(String word) { * @return */ public String getPos() { - if (pos != null) { - return pos.toLowerCase(); - } - return pos; + return this.pos != null ? this.pos.toLowerCase() : this.pos; } public void setPos(String pos) { @@ -135,10 +140,21 @@ public void setNumber_of_records_per_page(Integer number_of_records_per_page) { } public String getEqual_to() { + if (this.equal_to != null) { + List equalsList = Arrays.asList(this.equal_to.split(",")); + return equalsList.stream().map(i -> removeTrailingBackSlash(i)).collect(Collectors.joining(",")); + } return equal_to; } public void setEqual_to(String equal_to) { this.equal_to = equal_to; } + + private String removeTrailingBackSlash(String val) { + if (val.endsWith("/")) { + return val.substring(0, val.length() - 1); + } + return val; + } } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/SearchParamters.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/SearchParamters.java index 24a822f62..97ed2e609 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/SearchParamters.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/rest/SearchParamters.java @@ -7,4 +7,6 @@ public interface SearchParamters { public final static String OP_OR = "OR"; public final static String PAGE = "page"; public final static String NUMBER_OF_RECORDS_PER_PAGE = "number_of_records_per_page"; + public final static String EQUAL_TO = "equal_to"; + public final static String SIMILAR_TO = "similar_to"; } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptDeleteController.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptDeleteController.java index 91309edcd..5f627b1ec 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptDeleteController.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptDeleteController.java @@ -128,7 +128,7 @@ public ModelAndView confirmDelete(@PathVariable("id") String id, return model; } - conceptManager.deleteConcept(id, principal.getName()); + conceptManager.deleteConcept(conceptManager.getConceptEntry(id), principal.getName()); if (fromHomeScreenDelete.equalsIgnoreCase("true")) { model.setViewName("redirect:/login"); return model; diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptEditController.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptEditController.java index eac29c94f..488552688 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptEditController.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptEditController.java @@ -32,6 +32,7 @@ import edu.asu.conceptpower.app.core.IIndexService; import edu.asu.conceptpower.app.exceptions.IndexerRunningException; import edu.asu.conceptpower.app.exceptions.LuceneException; +import edu.asu.conceptpower.app.service.IConceptEditService; import edu.asu.conceptpower.app.users.IUserManager; import edu.asu.conceptpower.app.wrapper.ConceptEntryWrapper; import edu.asu.conceptpower.app.wrapper.IConceptWrapperCreator; @@ -66,6 +67,9 @@ public class ConceptEditController { @Autowired private IIndexService indexService; + @Autowired + private IConceptEditService conceptEditService; + @Value("#{messages['INDEXER_RUNNING']}") private String indexerRunning; @@ -112,6 +116,7 @@ public String prepareEditConcept(@PathVariable("conceptid") String conceptid, conceptEditBean.setConceptId(concept.getId()); conceptEditBean.setConceptEntryList(new ArrayList()); conceptEditBean.setWordnetIds(concept.getWordnetId()); + conceptEditBean.setExistingWordnetIds(concept.getWordnetId()); model.addAttribute("conceptId", concept.getId()); return "/auth/conceptlist/editconcept"; } @@ -181,7 +186,8 @@ public ModelAndView confirmEdit(@PathVariable("id") String id, HttpServletReques return model; } - conceptManager.storeModifiedConcept(conceptEntry, principal.getName()); + conceptEditService.editConcepts(conceptEntry, conceptEditBean.getExistingWordnetIds(), + conceptEditBean.getWordnetIds(), principal.getName()); if (conceptEditBean.isFromHomeScreen()) { model.setViewName("redirect:/home/conceptsearch?word=" + conceptEditBean.getWord() + "&pos=" diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptWrapperAddController.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptWrapperAddController.java index f2ceab755..0c32b1cdc 100644 --- a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptWrapperAddController.java +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptWrapperAddController.java @@ -2,9 +2,7 @@ import java.security.Principal; import java.util.Arrays; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import javax.servlet.http.HttpServletRequest; @@ -18,24 +16,28 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import edu.asu.conceptpower.app.core.IConceptListManager; import edu.asu.conceptpower.app.core.IConceptManager; -import edu.asu.conceptpower.app.core.IConceptTypeManger; import edu.asu.conceptpower.app.core.IIndexService; import edu.asu.conceptpower.app.exceptions.DictionaryDoesNotExistException; import edu.asu.conceptpower.app.exceptions.DictionaryModifyException; import edu.asu.conceptpower.app.exceptions.IndexerRunningException; import edu.asu.conceptpower.app.exceptions.LuceneException; +import edu.asu.conceptpower.app.service.IConceptWrapperService; +import edu.asu.conceptpower.app.validation.ConceptWrapperAddBeanValidator; import edu.asu.conceptpower.app.wordnet.Constants; import edu.asu.conceptpower.app.wrapper.ConceptEntryWrapper; import edu.asu.conceptpower.app.wrapper.IConceptWrapperCreator; import edu.asu.conceptpower.core.ConceptEntry; -import edu.asu.conceptpower.core.ConceptList; -import edu.asu.conceptpower.core.ConceptType; +import edu.asu.conceptpower.web.backing.ConceptWrapperAddBean; /** * This class provides methods required for creating concept wrappers @@ -53,19 +55,24 @@ public class ConceptWrapperAddController { private IConceptManager conceptManager; @Autowired - private IConceptListManager conceptListManager; - - @Autowired - private IConceptTypeManger conceptTypesManager; + private IIndexService indexService; @Autowired - private IIndexService indexService; + private IConceptWrapperService conceptWrapperService; @Value("#{messages['INDEXER_RUNNING']}") private String indexerRunning; + @Autowired + private ConceptWrapperAddBeanValidator conceptWrapperAddBeanValidator; + private static final Logger logger = LoggerFactory.getLogger(ConceptWrapperAddController.class); + @InitBinder + private void initBinder(WebDataBinder binder) { + binder.setValidator(conceptWrapperAddBeanValidator); + } + /** * This method provides required information for concept wrapper creation * @@ -75,25 +82,11 @@ public class ConceptWrapperAddController { * page */ @RequestMapping(value = "auth/conceptlist/addconceptwrapper") - public String prepareConceptWrapperAdd(HttpServletRequest req, ModelMap model) { - - if (req.getAttribute("errormsg") != null) - model.addAttribute("errormsg", req.getAttribute("errormsg")); - - ConceptType[] allTypes = conceptTypesManager.getAllTypes(); - Map types = new LinkedHashMap(); - for (ConceptType conceptType : allTypes) { - types.put(conceptType.getTypeId(), conceptType.getTypeName()); - } - - model.addAttribute("types", types); - - List allLists = conceptListManager.getAllConceptLists(); - Map lists = new LinkedHashMap(); - for (ConceptList conceptList : allLists) { - lists.put(conceptList.getConceptListName(), conceptList.getConceptListName()); - } - model.addAttribute("lists", lists); + public String prepareConceptWrapperAdd(@ModelAttribute ConceptWrapperAddBean conceptWrapperAddBean, + HttpServletRequest req, ModelMap model) { + model.addAttribute("types", conceptWrapperService.fetchAllConceptTypes()); + model.addAttribute("lists", conceptWrapperService.fetchAllConceptLists()); + model.addAttribute("conceptWrapperAddBean", conceptWrapperAddBean); return "/auth/conceptlist/addconceptwrapper"; } @@ -112,37 +105,39 @@ public String prepareConceptWrapperAdd(HttpServletRequest req, ModelMap model) { * @throws IndexerRunningException */ @RequestMapping(value = "auth/conceptlist/addconceptwrapper/add", method = RequestMethod.POST) - public String addConcept(HttpServletRequest req, Principal principal, Model model) - throws DictionaryDoesNotExistException, DictionaryModifyException, LuceneException, IllegalAccessException, IndexerRunningException { - - if (req.getParameter("lists") == null || req.getParameter("lists").trim().isEmpty()) { - req.setAttribute("errormsg", "You have to select a concept list."); - return "forward:/auth/conceptlist/addconceptwrapper"; + public String addConcept(@Validated @ModelAttribute ConceptWrapperAddBean conceptWrapperAddBean, + BindingResult result, Principal principal, Model model) throws DictionaryDoesNotExistException, + DictionaryModifyException, LuceneException, IllegalAccessException, IndexerRunningException { + + if (result.hasErrors()) { + model.addAttribute("types", conceptWrapperService.fetchAllConceptTypes()); + model.addAttribute("lists", conceptWrapperService.fetchAllConceptLists()); + return "/auth/conceptlist/addconceptwrapper"; } - String[] wrappers = req.getParameter("wrapperids").split(Constants.CONCEPT_SEPARATOR); - if (wrappers.length > 0) { - ConceptEntry conceptEntry = new ConceptEntry(); - conceptEntry.setWord(conceptManager.getConceptEntry(wrappers[0]).getWord().replace("_", " ")); - conceptEntry.setPos(conceptManager.getConceptEntry(wrappers[0]).getPos()); - conceptEntry.setSynonymIds(req.getParameter("synonymsids")); - conceptEntry.setWordnetId(req.getParameter("wrapperids")); - conceptEntry.setConceptList(req.getParameter("lists")); - conceptEntry.setDescription(req.getParameter("description")); - conceptEntry.setEqualTo(req.getParameter("equals")); - conceptEntry.setSimilarTo(req.getParameter("similar")); - conceptEntry.setTypeId(req.getParameter("types")); - conceptEntry.setCreatorId(principal.getName()); - + + String[] wrappers = conceptWrapperAddBean.getWrapperids().split(Constants.CONCEPT_SEPARATOR); + if (wrappers.length > 0) { + ConceptEntry conceptEntry = new ConceptEntry(); + conceptEntry.setWord(conceptWrapperAddBean.getWord()); + conceptEntry.setPos(conceptManager.getConceptEntry(wrappers[0]).getPos()); + conceptEntry.setSynonymIds(conceptWrapperAddBean.getSynonymids()); + conceptEntry.setWordnetId(conceptWrapperAddBean.getWrapperids()); + conceptEntry.setConceptList(conceptWrapperAddBean.getSelectedConceptList()); + conceptEntry.setDescription(conceptWrapperAddBean.getDescription()); + conceptEntry.setEqualTo(conceptWrapperAddBean.getEquals()); + conceptEntry.setSimilarTo(conceptWrapperAddBean.getSimilar()); + conceptEntry.setTypeId(conceptWrapperAddBean.getSelectedType()); + conceptEntry.setCreatorId(principal.getName()); + if (indexService.isIndexerRunning()) { model.addAttribute("show_error_alert", true); model.addAttribute("error_alert_msg", indexerRunning); - // Need to include command Object return "forward:/auth/conceptlist/addconceptwrapper"; } conceptManager.addConceptListEntry(conceptEntry, principal.getName()); - } + } - return "redirect:/auth/" + req.getParameter("lists") + "/concepts"; + return "redirect:/auth/" + conceptWrapperAddBean.getSelectedConceptList() + "/concepts"; } /** @@ -157,7 +152,8 @@ public String addConcept(HttpServletRequest req, Principal principal, Model mode * @throws IllegalAccessException */ @RequestMapping(value = "/auth/conceptlist/addconceptwrapper/conceptsearch", method = RequestMethod.POST) - public String search(HttpServletRequest req, ModelMap model) throws LuceneException, IllegalAccessException { + public String search(@ModelAttribute ConceptWrapperAddBean conceptWrapperAddBean, HttpServletRequest req, + ModelMap model) throws LuceneException, IllegalAccessException { String concept = req.getParameter("name"); String pos = req.getParameter("pos"); @@ -182,20 +178,9 @@ public String search(HttpServletRequest req, ModelMap model) throws LuceneExcept List foundConcepts = wrapperCreator.createWrappers(found); model.addAttribute("result", foundConcepts); } - ConceptType[] allTypes = conceptTypesManager.getAllTypes(); - Map types = new LinkedHashMap(); - for (ConceptType conceptType : allTypes) { - types.put(conceptType.getTypeId(), conceptType.getTypeName()); - } - - model.addAttribute("types", types); - - List allLists = conceptListManager.getAllConceptLists(); - Map lists = new LinkedHashMap(); - for (ConceptList conceptList : allLists) { - lists.put(conceptList.getConceptListName(), conceptList.getConceptListName()); - } - model.addAttribute("lists", lists); + model.addAttribute("types", conceptWrapperService.fetchAllConceptTypes()); + model.addAttribute("lists", conceptWrapperService.fetchAllConceptLists()); + model.addAttribute("conceptWrapperAddBean", conceptWrapperAddBean); return "/auth/conceptlist/addconceptwrapper"; } diff --git a/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/backing/ConceptWrapperAddBean.java b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/backing/ConceptWrapperAddBean.java new file mode 100644 index 000000000..e193e3a04 --- /dev/null +++ b/Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/backing/ConceptWrapperAddBean.java @@ -0,0 +1,78 @@ +package edu.asu.conceptpower.web.backing; + +public class ConceptWrapperAddBean { + + private String word; + private String selectedConceptList; + private String description; + private String synonymids; + private String selectedType; + private String equals; + private String similar; + private String wrapperids; + + public String getWord() { + return word; + } + + public void setWord(String word) { + this.word = word; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getWrapperids() { + return wrapperids; + } + + public void setWrapperids(String wrapperids) { + this.wrapperids = wrapperids; + } + + public String getEquals() { + return equals; + } + + public void setEquals(String equals) { + this.equals = equals; + } + + public String getSimilar() { + return similar; + } + + public void setSimilar(String similar) { + this.similar = similar; + } + + public String getSelectedConceptList() { + return selectedConceptList; + } + + public void setSelectedConceptList(String selectedConceptList) { + this.selectedConceptList = selectedConceptList; + } + + public String getSelectedType() { + return selectedType; + } + + public void setSelectedType(String selectedType) { + this.selectedType = selectedType; + } + + public String getSynonymids() { + return synonymids; + } + + public void setSynonymids(String synonymids) { + this.synonymids = synonymids; + } + +} diff --git a/Conceptpower+Spring/src/main/webapp/WEB-INF/spring/root-context.xml b/Conceptpower+Spring/src/main/webapp/WEB-INF/spring/root-context.xml index d36fa7d14..56c14367f 100644 --- a/Conceptpower+Spring/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/Conceptpower+Spring/src/main/webapp/WEB-INF/spring/root-context.xml @@ -54,6 +54,8 @@ class="org.apache.lucene.analysis.standard.StandardAnalyzer"> + diff --git a/Conceptpower+Spring/src/main/webapp/WEB-INF/tiles/skeleton-nonav.jsp b/Conceptpower+Spring/src/main/webapp/WEB-INF/tiles/skeleton-nonav.jsp index dd88036de..450cc763f 100644 --- a/Conceptpower+Spring/src/main/webapp/WEB-INF/tiles/skeleton-nonav.jsp +++ b/Conceptpower+Spring/src/main/webapp/WEB-INF/tiles/skeleton-nonav.jsp @@ -35,6 +35,9 @@ + +