org.vertexium.query.Query Maven / Gradle / Ivy
package org.vertexium.query;
import org.vertexium.*;
import java.util.Collection;
import java.util.EnumSet;
public interface Query {
QueryResultsIterable vertices();
QueryResultsIterable vertices(EnumSet fetchHints);
QueryResultsIterable vertexIds();
QueryResultsIterable edges();
QueryResultsIterable edges(EnumSet fetchHints);
QueryResultsIterable edgeIds();
QueryResultsIterable extendedDataRows();
QueryResultsIterable extendedDataRows(EnumSet fetchHints);
QueryResultsIterable extendedDataRowIds();
@Deprecated
QueryResultsIterable edges(String label);
@Deprecated
QueryResultsIterable edges(String label, EnumSet fetchHints);
QueryResultsIterable elements();
QueryResultsIterable elements(EnumSet fetchHints);
QueryResultsIterable elementIds();
QueryResultsIterable extends VertexiumObject> search(EnumSet objectTypes, EnumSet fetchHints);
QueryResultsIterable extends VertexiumObject> search();
/**
* Queries for properties in the given range.
*
* @param propertyName Name of property.
* @param startValue Inclusive start value.
* @param endValue Inclusive end value.
* @return this
*/
Query range(String propertyName, T startValue, T endValue);
/**
* Queries for properties in the given range.
*
* @param propertyName Name of property.
* @param startValue Inclusive start value.
* @param inclusiveStartValue true, to include the start value
* @param endValue Inclusive end value.
* @param inclusiveEndValue true, to include the end value
* @return this
*/
Query range(String propertyName, T startValue, boolean inclusiveStartValue, T endValue, boolean inclusiveEndValue);
/**
* Adds an id filter to the query. When searching for elements this will limit the search to the elements with
* the given ids. When searching for extended data rows this will limit the search to the elements containing the
* extended data rows.
*
* @param ids The ids to filter on.
* @return The query object, allowing you to chain methods.
*/
Query hasId(String... ids);
/**
* Adds an id filter to the query. When searching for elements this will limit the search to the elements with
* the given ids. When searching for extended data rows this will limit the search to the elements containing the
* extended data rows.
*
* @param ids The ids to filter on.
* @return The query object, allowing you to chain methods.
*/
Query hasId(Iterable ids);
/**
* Adds a edge label filter to the query.
*
* @param edgeLabels The edge labels to filter on.
* @return The query object, allowing you to chain methods.
*/
Query hasEdgeLabel(String... edgeLabels);
/**
* Adds a edge label filter to the query.
*
* @param edgeLabels The edge labels to filter on.
* @return The query object, allowing you to chain methods.
*/
Query hasEdgeLabel(Collection edgeLabels);
/**
* Adds an authorization filter to the query.
*
* @param authorizations An element will match if it or any of its properties use one of the specified authorizations.
* @return The query object, allowing you to chain methods.
*/
Query hasAuthorization(String... authorizations);
/**
* Adds an authorization filter to the query.
*
* @param authorizations An element will match if it or any of its properties use one of the specified authorizations.
* @return The query object, allowing you to chain methods.
*/
Query hasAuthorization(Iterable authorizations);
/**
* Adds a extended data element filter to the query. This will query any table.
*
* @param elementType The type of element.
* @param elementId The element id
* @return The query object, allowing you to chain methods.
*/
Query hasExtendedData(ElementType elementType, String elementId);
/**
* Adds a extended data element filter to the query. This will limit the search to the supplied extended data
* records.
*
* @param elementType The type of element. null to search all element types.
* @param elementId The element id. null to search all elements.
* @param tableName The table name. null to search all tables.
* @return The query object, allowing you to chain methods.
*/
Query hasExtendedData(ElementType elementType, String elementId, String tableName);
/**
* Adds a multiple extended data element filter to the query. These will be or'ed together. This will limit the
* search to the supplied extended data records.
*
* @param filters The list of filters to be or'ed together.
* @return The query object, allowing you to chain methods.
*/
Query hasExtendedData(Iterable filters);
/**
* Adds a extended data table filter to the query.
*
* @param tableName The table name
* @return The query object, allowing you to chain methods.
*/
Query hasExtendedData(String tableName);
/**
* Adds an {@link Compare#EQUAL} filter to the query.
*
* @param propertyName The name of the property to query on.
* @param value The value of the property to query for.
* @return The query object, allowing you to chain methods.
*/
Query has(String propertyName, T value);
/**
* Adds an {@link Contains#NOT_IN} filter to the query.
*
* @param propertyName The name of the property to query on.
* @param value The value of the property to query for.
* @return The query object, allowing you to chain methods.
*/
Query hasNot(String propertyName, T value);
/**
* Adds a has filter to the query.
*
* @param propertyName The name of the property the element must contain.
* @return The query object, allowing you to chain methods.
*/
Query has(String propertyName);
/**
* Adds a filter to the query.
*
* @param propertyNames A document will match if it contains any properties specified.
* @return The query object, allowing you to chain methods.
*/
Query has(Iterable propertyNames);
/**
* Adds a hasNot filter to the query.
*
* @param propertyName The name of the property the element must not contain.
* @return The query object, allowing you to chain methods.
*/
Query hasNot(String propertyName);
/**
* Adds a filter to the query.
*
* @param propertyNames A document will match if it does not contain any properties specified.
* @return The query object, allowing you to chain methods.
*/
Query hasNot(Iterable propertyNames);
/**
* Adds a filter to the query.
*
* @param propertyName The name of the property to query on.
* @param predicate One of {@link Compare},
* {@link TextPredicate},
* or {@link GeoCompare}.
* @param value The value of the property to query for.
* @return The query object, allowing you to chain methods.
*/
Query has(String propertyName, Predicate predicate, T value);
/**
* Adds a filter to the query.
*
* @param propertyNames All properties to query on. A match in any of the given properties will cause a document to match.
* @param predicate One of {@link Compare},
* {@link TextPredicate},
* or {@link GeoCompare}.
* @param value The value of the property to query for.
* @return The query object, allowing you to chain methods.
*/
Query has(Iterable propertyNames, Predicate predicate, T value);
/**
* Adds a filter to the query.
*
* @param dataType All properties with a matching datatype will be queried on. A match in any of the selected properties will cause a document to match.
* @param predicate One of {@link Compare},
* {@link TextPredicate},
* or {@link GeoCompare}.
* @param value The value of the property to query for.
* @return The query object, allowing you to chain methods.
*/
Query has(Class dataType, Predicate predicate, T value);
/**
* Adds a has filter to the query.
*
* @param dataType A document will match if it contains any properties of the specified datatype.
* @return The query object, allowing you to chain methods.
*/
Query has(Class dataType);
/**
* Adds a hasNot filter to the query.
*
* @param dataType A document will match if it does not contain any properties of the specified datatype.
* @return The query object, allowing you to chain methods.
*/
Query hasNot(Class dataType);
/**
* Skips the given number of items.
*/
Query skip(int count);
/**
* Limits the number of items returned. null will return all elements.
*/
Query limit(Integer count);
/**
* Limits the number of items returned. null will return all elements.
*/
Query limit(Long count);
/**
* Sort the results by the given property name.
*
* @param propertyName The property to sort by.
* @param direction The direction to sort.
* @return The query object, allowing you to chain methods.
*/
Query sort(String propertyName, SortDirection direction);
/**
* Test to see if aggregation is supported.
*
* @param aggregation the aggregation to test.
* @return true, if the aggregation is supported
*/
boolean isAggregationSupported(Aggregation aggregation);
/**
* Add an aggregation to the query
*
* @param aggregation the aggregation to add.
* @return The query object, allowing you to chain methods.
*/
Query addAggregation(Aggregation aggregation);
/**
* Gets the added aggregations
*/
Iterable getAggregations();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy