org.apache.stanbol.entityhub.jersey.grefine
Class ReconcileQuery

java.lang.Object
  extended by org.apache.stanbol.entityhub.jersey.grefine.ReconcileQuery

public class ReconcileQuery
extends Object

Java Representation for Google Refine Reconciliation queries.

getTypes() and ReconcileValue.getId() do support 'prefix:localname' syntax for prefixes defined in the NamespaceEnum. Also defines methods for parsing single and multiple request strings.

Author:
Rupert Westenthaler

Nested Class Summary
static class ReconcileQuery.TYPE_STRICT
           
 
Field Summary
static Integer DEFAULT_LIMIT
          The default limit for suggestions if not explicitly parsed
static ReconcileQuery.TYPE_STRICT DEFAULT_TYPE_STRICT
          The default entity type mode if not explicitly parsed by the query
 
Constructor Summary
ReconcileQuery(String query, Collection<String> types)
           
 
Method Summary
 Integer getLimit()
           
 Iterable<Map.Entry<ReconcileProperty,Collection<ReconcileValue>>> getProperties()
           
 Collection<ReconcileValue> getProperty(String field)
           
 String getQuery()
           
 Set<String> getTypes()
           
 ReconcileQuery.TYPE_STRICT getTypeStrict()
           
static Map<String,ReconcileQuery> parseQueries(String queriesString, org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)
           
static ReconcileQuery parseQuery(String queryString, org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)
          Parses a Google Refine Reconcile Query from the parsed String.
 Collection<ReconcileValue> putProperty(String field, Collection<ReconcileValue> values, org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)
           
 Collection<ReconcileValue> removeProperty(String field)
           
 void setLimit(Integer limit)
           
 void setTypeStrict(ReconcileQuery.TYPE_STRICT typeStrict)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LIMIT

public static final Integer DEFAULT_LIMIT
The default limit for suggestions if not explicitly parsed


DEFAULT_TYPE_STRICT

public static final ReconcileQuery.TYPE_STRICT DEFAULT_TYPE_STRICT
The default entity type mode if not explicitly parsed by the query

Constructor Detail

ReconcileQuery

public ReconcileQuery(String query,
                      Collection<String> types)
Method Detail

getLimit

public final Integer getLimit()
Returns:
the limit

setLimit

public final void setLimit(Integer limit)
Parameters:
limit - the limit to set

getTypeStrict

public final ReconcileQuery.TYPE_STRICT getTypeStrict()
Returns:
the typeStrict

setTypeStrict

public final void setTypeStrict(ReconcileQuery.TYPE_STRICT typeStrict)
Parameters:
typeStrict - the typeStrict to set

getQuery

public final String getQuery()
Returns:
the query

getTypes

public final Set<String> getTypes()
Returns:
the types

putProperty

public Collection<ReconcileValue> putProperty(String field,
                                              Collection<ReconcileValue> values,
                                              org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)

removeProperty

public Collection<ReconcileValue> removeProperty(String field)

getProperty

public Collection<ReconcileValue> getProperty(String field)

getProperties

public Iterable<Map.Entry<ReconcileProperty,Collection<ReconcileValue>>> getProperties()

parseQueries

public static Map<String,ReconcileQuery> parseQueries(String queriesString,
                                                      org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)
                                               throws javax.ws.rs.WebApplicationException
Throws:
javax.ws.rs.WebApplicationException

parseQuery

public static ReconcileQuery parseQuery(String queryString,
                                        org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService nsPrefixService)
                                 throws javax.ws.rs.WebApplicationException
Parses a Google Refine Reconcile Query from the parsed String.

Parameters:
queryString - the string representation of the reconcile query
Returns:
the parsed ReconcileQuery object
Throws:
javax.ws.rs.WebApplicationException - Response.Status#BAD_REQUEST in case of the parsed string is not a well formated query. Unsupported Properties are silently ignored (warnings are still logged).


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