You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by su...@apache.org on 2012/04/17 07:25:37 UTC

svn commit: r1326932 - in /incubator/stanbol/trunk/contenthub: search/related/ search/related/src/main/java/org/apache/stanbol/contenthub/search/related/ search/related/src/main/java/org/apache/stanbol/contenthub/search/related/wordnet/ search/related/...

Author: suat
Date: Tue Apr 17 05:25:36 2012
New Revision: 1326932

URL: http://svn.apache.org/viewvc?rev=1326932&view=rev
Log:
STANBOL-586: Removed the functionality providing related keyword retrieval from wordnet.

Removed:
    incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/wordnet/
    incubator/stanbol/trunk/contenthub/search/related/src/main/resources/
Modified:
    incubator/stanbol/trunk/contenthub/search/related/pom.xml
    incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/RelatedKeywordSearchManagerImpl.java
    incubator/stanbol/trunk/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/related/RelatedKeywordSearchManager.java
    incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/RelatedKeywordResource.java

Modified: incubator/stanbol/trunk/contenthub/search/related/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/search/related/pom.xml?rev=1326932&r1=1326931&r2=1326932&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/search/related/pom.xml (original)
+++ incubator/stanbol/trunk/contenthub/search/related/pom.xml Tue Apr 17 05:25:36 2012
@@ -35,12 +35,6 @@ Finds related keywords from various type
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Embed-Dependency>jaws</Embed-Dependency>
-            <Export-Package>edu.smu.tspell.*</Export-Package>
-          </instructions>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
@@ -86,12 +80,6 @@ Finds related keywords from various type
       <groupId>com.hp.hpl.jena</groupId>
       <artifactId>arq</artifactId>
     </dependency>
-
-    <!-- Jaws Wordnet client -->
-    <dependency>
-      <groupId>edu.smu.tspell</groupId>
-      <artifactId>jaws</artifactId>
-    </dependency>
   </dependencies>
 
   <repositories>

Modified: incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/RelatedKeywordSearchManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/RelatedKeywordSearchManagerImpl.java?rev=1326932&r1=1326931&r2=1326932&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/RelatedKeywordSearchManagerImpl.java (original)
+++ incubator/stanbol/trunk/contenthub/search/related/src/main/java/org/apache/stanbol/contenthub/search/related/RelatedKeywordSearchManagerImpl.java Tue Apr 17 05:25:36 2012
@@ -29,7 +29,6 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.stanbol.contenthub.search.related.ontologyresource.OntologyResourceSearch;
 import org.apache.stanbol.contenthub.search.related.referencedsite.ReferencedSiteSearch;
-import org.apache.stanbol.contenthub.search.related.wordnet.WordnetSearch;
 import org.apache.stanbol.contenthub.servicesapi.search.SearchException;
 import org.apache.stanbol.contenthub.servicesapi.search.featured.SearchResult;
 import org.apache.stanbol.contenthub.servicesapi.search.related.RelatedKeyword;
@@ -83,11 +82,6 @@ public class RelatedKeywordSearchManager
         relatedKeywordsMap.put(keyword, relatedKeywords);
         return new RelatedKeywordSearchResult(relatedKeywordsMap);
     }
-    
-    @Override
-    public SearchResult getRelatedKeywordsFromWordnet(String keyword) throws SearchException {
-        return getRelatedKeywordsFrom(keyword, WordnetSearch.class);
-    }
 
     @Override
     public SearchResult getRelatedKeywordsFromOntology(String keyword, String ontologyURI) throws SearchException {

Modified: incubator/stanbol/trunk/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/related/RelatedKeywordSearchManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/related/RelatedKeywordSearchManager.java?rev=1326932&r1=1326931&r2=1326932&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/related/RelatedKeywordSearchManager.java (original)
+++ incubator/stanbol/trunk/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/related/RelatedKeywordSearchManager.java Tue Apr 17 05:25:36 2012
@@ -70,20 +70,6 @@ public interface RelatedKeywordSearchMan
     SearchResult getRelatedKeywordsFromAllSources(String keyword, String ontologyURI) throws SearchException;
 
     /**
-     * Searches related keywords in the Wordnet database for the given <code>keyword</code>.
-     * 
-     * @param keyword
-     *            Keyword for which related keywords will be obtained
-     * @return a {@link SearchResult} instance which encapsulates the related keyword {@link Map}. This map
-     *         would have a single key which is the given <code>keyword</code>. The value corresponding to the
-     *         key is another map. It also has a single key which indicates the "Wordnet" source. Value
-     *         corresponding to this key contains {@link List} of {@link RelatedKeyword}s obtained from
-     *         Wordnet.
-     * @throws SearchException
-     */
-    SearchResult getRelatedKeywordsFromWordnet(String keyword) throws SearchException;
-
-    /**
      * Searches related keywords from the ontology specified by <code>ontologyURI</code> for the given
      * <code>keyword</code>.
      * 

Modified: incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/RelatedKeywordResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/RelatedKeywordResource.java?rev=1326932&r1=1326931&r2=1326932&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/RelatedKeywordResource.java (original)
+++ incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/RelatedKeywordResource.java Tue Apr 17 05:25:36 2012
@@ -116,7 +116,7 @@ public class RelatedKeywordResource exte
             return Response.status(Status.BAD_REQUEST).build();
         }
 
-        keyword = RestUtil.nullify(keyword);
+		keyword = RestUtil.nullify(keyword);
         if (keyword == null) {
             String msg = "RelatedKeywordResource.findAllRelatedKeywords requires \"keyword\" parameter. \"graphURI\" is optional";
             log.error(msg);
@@ -131,39 +131,6 @@ public class RelatedKeywordResource exte
     }
 
     /**
-     * HTTP GET method to retrieve related keywords from Wordnet. If a Wordnet database is not installed into
-     * Contenthub, this method cannot find any related keywords.
-     * 
-     * @param keyword
-     *            The keyword whose related keywords will be retrieved from Wordnet.
-     * @param headers
-     *            HTTP headers
-     * @return JSON string which is constructed by {@link SearchResultWriter}. {@link SearchResult} returned
-     *         by {@link RelatedKeywordSearchManager#getRelatedKeywordsFromWordnet(String)} contains only related keywords from Wordnet. (No
-     *         resultant documents or facet fields are returned within the {@link SearchResult}).
-     * @throws SearchException
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("/wordnet")
-    public final Response findWordnetRelatedKeywords(@QueryParam("keyword") String keyword,
-                                                     @Context HttpHeaders headers) throws SearchException {
-        if (!RestUtil.isJSONaccepted(headers)) {
-            return Response.status(Status.BAD_REQUEST).build();
-        }
-
-        keyword = RestUtil.nullify(keyword);
-        if (keyword == null) {
-            String msg = "RelatedKeywordResource.findWordnetRelatedKeywords requires \"keyword\" parameter.";
-            log.error(msg);
-            throw new IllegalArgumentException(msg);
-        }
-
-        SearchResult searchResult = relatedKeywordSearchManager.getRelatedKeywordsFromWordnet(keyword);
-        return prepareResponse(searchResult, headers);
-    }
-
-    /**
      * HTTP GET method to retrieve related keywords from ontology resources. Given the ontology URI, this
      * method looks for subsumption/hierarchy relations among the concepts to come up with related keywords.
      *