Search in sources :

Example 6 with IsTrue

use of uk.gov.gchq.koryphe.impl.predicate.IsTrue in project Gaffer by gchq.

the class FederatedOperationChainHandlerTest method createStore.

private FederatedStore createStore() throws OperationException {
    final Schema schema = new Schema.Builder().entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(TestTypes.ID_STRING).aggregate(false).build()).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).directed(TestTypes.DIRECTED_TRUE).aggregate(false).build()).type(TestTypes.ID_STRING, new TypeDefinition.Builder().clazz(String.class).build()).type(TestTypes.DIRECTED_TRUE, new TypeDefinition.Builder().clazz(Boolean.class).validateFunctions(new IsTrue()).build()).build();
    final FederatedStore store = (FederatedStore) Store.createStore("federatedGraph", schema, StoreProperties.loadStoreProperties(StreamUtil.openStream(FederatedStoreITs.class, "predefinedFederatedStore.properties")));
    final Context context = new Context();
    store.execute(new AddElements.Builder().input(elements).build(), context);
    return store;
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) AddElements(uk.gov.gchq.gaffer.operation.impl.add.AddElements) Schema(uk.gov.gchq.gaffer.store.schema.Schema) FederatedStoreITs(uk.gov.gchq.gaffer.federatedstore.integration.FederatedStoreITs) TypeDefinition(uk.gov.gchq.gaffer.store.schema.TypeDefinition) IsTrue(uk.gov.gchq.koryphe.impl.predicate.IsTrue) SchemaEdgeDefinition(uk.gov.gchq.gaffer.store.schema.SchemaEdgeDefinition) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) PredefinedFederatedStore(uk.gov.gchq.gaffer.federatedstore.PredefinedFederatedStore)

Example 7 with IsTrue

use of uk.gov.gchq.koryphe.impl.predicate.IsTrue in project Gaffer by gchq.

the class FederatedStoreUtilTest method createGraph.

protected Graph createGraph() {
    final Store store = mock(Store.class);
    final Schema schema = new Schema.Builder().entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(TestTypes.ID_STRING).aggregate(false).build()).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).directed(TestTypes.DIRECTED_TRUE).aggregate(false).build()).type(TestTypes.ID_STRING, new TypeDefinition.Builder().clazz(String.class).build()).type(TestTypes.DIRECTED_TRUE, new TypeDefinition.Builder().clazz(Boolean.class).validateFunctions(new IsTrue()).build()).build();
    given(store.getSchema()).willReturn(schema);
    given(store.getOriginalSchema()).willReturn(schema);
    StoreProperties storeProperties = new StoreProperties();
    given(store.getProperties()).willReturn(storeProperties);
    return new Graph.Builder().config(new GraphConfig.Builder().graphId("graphId").build()).store(store).build();
}
Also used : Schema(uk.gov.gchq.gaffer.store.schema.Schema) Store(uk.gov.gchq.gaffer.store.Store) TypeDefinition(uk.gov.gchq.gaffer.store.schema.TypeDefinition) GraphConfig(uk.gov.gchq.gaffer.graph.GraphConfig) Graph(uk.gov.gchq.gaffer.graph.Graph) IsTrue(uk.gov.gchq.koryphe.impl.predicate.IsTrue) SchemaEdgeDefinition(uk.gov.gchq.gaffer.store.schema.SchemaEdgeDefinition) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties)

Aggregations

IsTrue (uk.gov.gchq.koryphe.impl.predicate.IsTrue)7 Schema (uk.gov.gchq.gaffer.store.schema.Schema)5 TypeDefinition (uk.gov.gchq.gaffer.store.schema.TypeDefinition)5 Graph (uk.gov.gchq.gaffer.graph.Graph)4 AccumuloProperties (uk.gov.gchq.gaffer.accumulostore.AccumuloProperties)3 Element (uk.gov.gchq.gaffer.data.element.Element)3 SchemaEdgeDefinition (uk.gov.gchq.gaffer.store.schema.SchemaEdgeDefinition)3 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)2 GraphConfig (uk.gov.gchq.gaffer.graph.GraphConfig)2 OperationChain (uk.gov.gchq.gaffer.operation.OperationChain)2 ExportToOtherGraph (uk.gov.gchq.gaffer.operation.export.graph.ExportToOtherGraph)2 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)2 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)2 FileGraphLibrary (uk.gov.gchq.gaffer.store.library.FileGraphLibrary)2 GraphLibrary (uk.gov.gchq.gaffer.store.library.GraphLibrary)2 IsMoreThan (uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)2 ArrayList (java.util.ArrayList)1 RoadUseElementGenerator (uk.gov.gchq.gaffer.doc.user.generator.RoadUseElementGenerator)1 FederatedStore (uk.gov.gchq.gaffer.federatedstore.FederatedStore)1 PredefinedFederatedStore (uk.gov.gchq.gaffer.federatedstore.PredefinedFederatedStore)1