ai.grakn.graql.ComputeQuery Maven / Gradle / Ivy
/*
* GRAKN.AI - THE KNOWLEDGE GRAPH
* Copyright (C) 2018 Grakn Labs Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package ai.grakn.graql;
import ai.grakn.GraknTx;
import ai.grakn.concept.ConceptId;
import ai.grakn.concept.Label;
import ai.grakn.exception.GraqlQueryException;
import ai.grakn.graql.answer.Answer;
import javax.annotation.CheckReturnValue;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import static ai.grakn.util.GraqlSyntax.Compute.Algorithm;
import static ai.grakn.util.GraqlSyntax.Compute.Argument;
import static ai.grakn.util.GraqlSyntax.Compute.Method;
import static ai.grakn.util.GraqlSyntax.Compute.Parameter;
/**
* Graql Compute Query: to perform distributed analytics OLAP computation on Grakn
* @param return type of ComputeQuery
*/
public interface ComputeQuery extends Query {
/**
* @param tx the graph to execute the compute query on
* @return a ComputeQuery with the graph set
*/
@Override
ComputeQuery withTx(GraknTx tx);
/**
* @param fromID is the Concept ID of in which compute path query will start from
* @return A ComputeQuery with the fromID set
*/
ComputeQuery from(ConceptId fromID);
/**
* @return a String representing the name of the compute query method
*/
Method method();
/**
* @return a Concept ID in which which compute query will start from
*/
@CheckReturnValue
Optional from();
/**
* @param toID is the Concept ID in which compute query will stop at
* @return A ComputeQuery with the toID set
*/
ComputeQuery to(ConceptId toID);
/**
* @return a Concept ID in which which compute query will stop at
*/
@CheckReturnValue
Optional to();
/**
* @param types is an array of concept types in which the compute query would apply to
* @return a ComputeQuery with the of set
*/
ComputeQuery of(String type, String... types);
/**
* @param types is an array of concept types in which the compute query would apply to
* @return a ComputeQuery with the of set
*/
ComputeQuery of(Collection
© 2015 - 2024 Weber Informatics LLC | Privacy Policy