uk.ac.open.kmi.watson.services
Class WatsonSearch

java.lang.Object
  extended by uk.ac.open.kmi.watson.services.WatsonService
      extended by uk.ac.open.kmi.watson.services.WatsonSearch

public class WatsonSearch
extends WatsonService

Main Watson search service.

Author:
mda99

Field Summary
static int ENT_ANYLITERAL_INFO
          for entInfo: request the information about the literal relations of the entity
static int ENT_ANYRELATIONFROM_INFO
          for entInfo: request the information about the relations from the entity
static int ENT_ANYRELATIONTO_INFO
          for entInfo: request the information about the relations to the entity
static int ENT_COMMENT_INFO
          for entInfo: request the information about the comment of the entity
static int ENT_LABEL_INFO
          for entInfo: request the information about the label of the entity
static int ENT_TYPE_INFO
          for entInfo: request the information about the type of the entity
static int SC_COMMENTS_INFO
          for scInfo: request the information about the comments of the ontology
static int SC_DLEXPR_INFO
          for scInfo: request the information about the size of the semantic document
static int SC_IMPORTEDBY_INFO
          for scInfo: request the information about the ontologies importing the semantic document
static int SC_IMPORTS_INFO
          for scInfo: request the information about the imported ontologies in the semantic document
static int SC_LABELS_INFO
          for scInfo: request the information about the labels of the ontology
static int SC_LANGUAGES_INFO
          for scInfo: request the information about the languages used in the semantic document
static int SC_LOCATION_INFO
          for scInfo: request the information about the Dl Expressiveness used in the semantic document
static int SC_NBCLASSES_INFO
          for scInfo: request the information about the number of classes in the semantic document
static int SC_NBINDIS_INFO
          for scInfo: request the information about the number of individuals in the semantic document
static int SC_NBPROPS_INFO
          for scInfo: request the information about the number of properties in the semantic document
static int SC_NBSTATS_INFO
          for scInfo: request the information about the number of statements in the semantic document
static int SC_SIZE_INFO
          for scInfo: request the information about the languages used in the semantic document
 
Fields inherited from class uk.ac.open.kmi.watson.services.WatsonService
CLASS, COMMENT, EXACT_MATCH, INDIVIDUAL, LABEL, LITERAL, LOCAL_NAME, NS, PROPERTY, TOKEN_MATCH
 
Constructor Summary
WatsonSearch()
           
 
Method Summary
 SemanticContentResult[] searchBestCoverageWithRestriction(java.lang.String[] keywords, int scopeModifier, int entityTypeModifier, int matchTechnique, int scInfo, int entInfo)
          Same as searchWatsonWithKeywords, but returns does not require that documents match all the keywords.
 SemanticContentResult[] searchWatsonWithKeywords(java.lang.String[] keywords, int scopeModifier, int entityTypeModifier, int matchTechnique, int scInfo, int entInfo)
          Main Watson Search function: Returns structures corresponding to semantic documents, containing a list of matching entities that match the query.
 SemanticContentResult[] searchWatsonWithKeywordsWithLimit(java.lang.String[] keywords, int scopeModifier, int entityTypeModifier, int matchTechnique, int scInfo, int entInfo, int limit)
          Same as searchWatsonWithKeywords, but returns only the first documents (up to the given limit).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SC_LANGUAGES_INFO

public static final int SC_LANGUAGES_INFO
for scInfo: request the information about the languages used in the semantic document

See Also:
Constant Field Values

SC_SIZE_INFO

public static final int SC_SIZE_INFO
for scInfo: request the information about the languages used in the semantic document

See Also:
Constant Field Values

SC_DLEXPR_INFO

public static final int SC_DLEXPR_INFO
for scInfo: request the information about the size of the semantic document

See Also:
Constant Field Values

SC_LOCATION_INFO

public static final int SC_LOCATION_INFO
for scInfo: request the information about the Dl Expressiveness used in the semantic document

See Also:
Constant Field Values

SC_NBCLASSES_INFO

public static final int SC_NBCLASSES_INFO
for scInfo: request the information about the number of classes in the semantic document

See Also:
Constant Field Values

SC_NBPROPS_INFO

public static final int SC_NBPROPS_INFO
for scInfo: request the information about the number of properties in the semantic document

See Also:
Constant Field Values

SC_NBINDIS_INFO

public static final int SC_NBINDIS_INFO
for scInfo: request the information about the number of individuals in the semantic document

See Also:
Constant Field Values

SC_NBSTATS_INFO

public static final int SC_NBSTATS_INFO
for scInfo: request the information about the number of statements in the semantic document

See Also:
Constant Field Values

SC_IMPORTS_INFO

public static final int SC_IMPORTS_INFO
for scInfo: request the information about the imported ontologies in the semantic document

See Also:
Constant Field Values

SC_IMPORTEDBY_INFO

public static final int SC_IMPORTEDBY_INFO
for scInfo: request the information about the ontologies importing the semantic document

See Also:
Constant Field Values

SC_LABELS_INFO

public static final int SC_LABELS_INFO
for scInfo: request the information about the labels of the ontology

See Also:
Constant Field Values

SC_COMMENTS_INFO

public static final int SC_COMMENTS_INFO
for scInfo: request the information about the comments of the ontology

See Also:
Constant Field Values

ENT_TYPE_INFO

public static final int ENT_TYPE_INFO
for entInfo: request the information about the type of the entity

See Also:
Constant Field Values

ENT_LABEL_INFO

public static final int ENT_LABEL_INFO
for entInfo: request the information about the label of the entity

See Also:
Constant Field Values

ENT_COMMENT_INFO

public static final int ENT_COMMENT_INFO
for entInfo: request the information about the comment of the entity

See Also:
Constant Field Values

ENT_ANYRELATIONFROM_INFO

public static final int ENT_ANYRELATIONFROM_INFO
for entInfo: request the information about the relations from the entity

See Also:
Constant Field Values

ENT_ANYRELATIONTO_INFO

public static final int ENT_ANYRELATIONTO_INFO
for entInfo: request the information about the relations to the entity

See Also:
Constant Field Values

ENT_ANYLITERAL_INFO

public static final int ENT_ANYLITERAL_INFO
for entInfo: request the information about the literal relations of the entity

See Also:
Constant Field Values
Constructor Detail

WatsonSearch

public WatsonSearch()
Method Detail

searchWatsonWithKeywords

public SemanticContentResult[] searchWatsonWithKeywords(java.lang.String[] keywords,
                                                        int scopeModifier,
                                                        int entityTypeModifier,
                                                        int matchTechnique,
                                                        int scInfo,
                                                        int entInfo)
Main Watson Search function: Returns structures corresponding to semantic documents, containing a list of matching entities that match the query. The query corresponds to the set of keywords, together with the scope modifier (allows to restricts to some part of the entity, like the label or comment) and the entity modifier (allows to restrict to some type of entities, like classes, properties and individuals).

Parameters:
keywords - the list of keywords
scopeModifier - the scope modifier (LOCAL_NAME, LABEL, etc.)
entityTypeModifier - (CLASS, PROPERTY, INDIVIDUAL)
matchTechnique - (EXACT_MATCH or PARTIAL_MATCH)
scInfo - indicates the information that will actually be transmitted about the Semantic Contents (documents) retrieved
entInfo - indicates the information that will actually be transmitted about the entities retrieved
Returns:
An array of SemanticContentResult(s) containing all the requested information about the document matching the query.

searchWatsonWithKeywordsWithLimit

public SemanticContentResult[] searchWatsonWithKeywordsWithLimit(java.lang.String[] keywords,
                                                                 int scopeModifier,
                                                                 int entityTypeModifier,
                                                                 int matchTechnique,
                                                                 int scInfo,
                                                                 int entInfo,
                                                                 int limit)
Same as searchWatsonWithKeywords, but returns only the first documents (up to the given limit).

Parameters:
keywords - the list of keywords
scopeModifier - the scope modifier (LOCAL_NAME, LABEL, etc.)
entityTypeModifier - (CLASS, PROPERTY, INDIVIDUAL)
matchTechnique - (EXACT_MATCH or PARTIAL_MATCH)
scInfo - indicates the information that will actually be transmitted about the Semantic Contents (documents) retrieved
entInfo - indicates the information that will actually be transmitted about the entities retrieved
limit - indicates how many documents should be returned
Returns:
An array of SemanticContentResult(s) containing all the requested information about the document matching the query.

searchBestCoverageWithRestriction

public SemanticContentResult[] searchBestCoverageWithRestriction(java.lang.String[] keywords,
                                                                 int scopeModifier,
                                                                 int entityTypeModifier,
                                                                 int matchTechnique,
                                                                 int scInfo,
                                                                 int entInfo)
Same as searchWatsonWithKeywords, but returns does not require that documents match all the keywords. Returns the documents that cover best (match a maximal subset of the keywords) the query. This can take very long with more than 10 keywords, and even serveral days with more than 15.

Parameters:
keywords - the list of keywords
scopeModifier - the scope modifier (LOCAL_NAME, LABEL, etc.)
entityTypeModifier - (CLASS, PROPERTY, INDIVIDUAL)
matchTechnique - (EXACT_MATCH or PARTIAL_MATCH)
scInfo - indicates the information that will actually be transmitted about the Semantic Contents (documents) retrieved
entInfo - indicates the information that will actually be transmitted about the entities retrieved
Returns:
An array of SemanticContentResult(s) containing all the requested information about the document matching the query.