org.apache.stanbol.entityhub.servicesapi.query
Interface QueryService


public interface QueryService

This interface defines the Java API for searching Entities.

Author:
Rupert Westenthaler TODO Currently unused

Method Summary
 QueryResultList<? extends Representation> find(Query query)
          Searches for entities based on the parsed FieldQuery and returns representations as defined by the selected fields of the query.
 QueryResultList<String> findReferences(Query query)
          Searches for entities based on the parsed FieldQuery and returns the references (ids).
 QueryResultList<? extends Entity> findSigns(Query query)
          Searches for Signs based on the parsed FieldQuery and returns the selected Signs including the whole representation.
 Collection<String> getSupportedQueryTypes()
          Getter for the types of queries supported by this implementation.
 

Method Detail

findReferences

QueryResultList<String> findReferences(Query query)
                                       throws IOException,
                                              UnsupportedQueryTypeException
Searches for entities based on the parsed FieldQuery and returns the references (ids). Note that selected fields of the query are ignored.

Parameters:
query - the query
Returns:
the references of the found entities
Throws:
IOException - If the referenced Site is not accessible
UnsupportedQueryTypeException - if the type of the parsed query is not supported by this query service. Or in other words if the value of Query.getQueryType() is not part of the collections returned by getSupportedQueryTypes().

find

QueryResultList<? extends Representation> find(Query query)
                                               throws IOException,
                                                      UnsupportedQueryTypeException
Searches for entities based on the parsed FieldQuery and returns representations as defined by the selected fields of the query. Note that if the query defines also Constraints for selected fields, that the returned representation will only contain values selected by such constraints.

Parameters:
query - the query
Returns:
the found entities as representation containing only the selected fields and there values.
Throws:
IOException - If the referenced Site is not accessible
UnsupportedQueryTypeException - if the type of the parsed query is not supported by this query service. Or in other words if the value of Query.getQueryType() is not part of the collections returned by getSupportedQueryTypes().

findSigns

QueryResultList<? extends Entity> findSigns(Query query)
                                            throws IOException,
                                                   UnsupportedQueryTypeException
Searches for Signs based on the parsed FieldQuery and returns the selected Signs including the whole representation. Note that selected fields of the query are ignored.

Parameters:
query - the query
Returns:
All Entities selected by the Query.
Throws:
IOException - If the referenced Site is not accessible
UnsupportedQueryTypeException - if the type of the parsed query is not supported by this query service. Or in other words if the value of Query.getQueryType() is not part of the collections returned by getSupportedQueryTypes().

getSupportedQueryTypes

Collection<String> getSupportedQueryTypes()
Getter for the types of queries supported by this implementation. Query.getQueryType() is used to check if a query is supported.

Returns:
the ids of the supported query types.


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.