Package hydra.pg
Class Merging
java.lang.Object
hydra.pg.Merging
Utilities for combining multiple vertex or edge types into a single "merged" vertex or edge type,
and correspondingly encoding and decoding vertices and edges of these types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA helper object which defines merged vertex and edge id types, and a value coder for each vertex and edge label. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic EdgeLabelstatic VertexLabelstatic final Merging.IdAdapters<LiteralType,Literal> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEdgeAdapter(List<EdgeType<T>> types, Merging.IdAdapters<T, V> idAdapters, boolean unifyIdenticalTypes) Create an edge adapter based on a list of edge types and given id adapters.static <T,V> Flow<Unit, StatelessAdapter<List<VertexType<T>>, VertexType<T>, Vertex<V>, Vertex<V>>> createVertexAdapter(List<VertexType<T>> types, Merging.IdAdapters<T, V> idAdapters, boolean unifyIdenticalTypes) Create a vertex adapter based on a list of vertex types and given id adapters.static <T,V> Merging.IdAdapters<T, V> stringIdAdapters(T stringType, Function<V, Flow<Unit, String>> fromLiteral, Function<String, V> toLiteral) Create string-based id adapters for merging vertex and edge types.
-
Field Details
-
DEFAULT_VERTEX_LABEL
-
DEFAULT_EDGE_LABEL
-
STRING_ID_ADAPTERS
-
-
Constructor Details
-
Merging
public Merging()
-
-
Method Details
-
createVertexAdapter
public static <T,V> Flow<Unit,StatelessAdapter<List<VertexType<T>>, createVertexAdapterVertexType<T>, Vertex<V>, Vertex<V>>> (List<VertexType<T>> types, Merging.IdAdapters<T, V> idAdapters, boolean unifyIdenticalTypes) Create a vertex adapter based on a list of vertex types and given id adapters.- Type Parameters:
T- the type parameter for vertex typesV- the value type for vertex properties- Parameters:
types- the list of vertex types to mergeidAdapters- the id adapters for encoding/decoding vertex and edge idsunifyIdenticalTypes- whether to unify identical property types across vertex types- Returns:
- a flow producing a stateless adapter for the merged vertex type
-
createEdgeAdapter
public static <T,V> Flow<Unit,StatelessAdapter<List<EdgeType<T>>, createEdgeAdapterEdgeType<T>, Edge<V>, Edge<V>>> (List<EdgeType<T>> types, Merging.IdAdapters<T, V> idAdapters, boolean unifyIdenticalTypes) Create an edge adapter based on a list of edge types and given id adapters.- Type Parameters:
T- the type parameter for edge typesV- the value type for edge properties- Parameters:
types- the list of edge types to mergeidAdapters- the id adapters for encoding/decoding vertex and edge idsunifyIdenticalTypes- whether to unify identical property types across edge types- Returns:
- a flow producing a stateless adapter for the merged edge type
-
stringIdAdapters
public static <T,V> Merging.IdAdapters<T,V> stringIdAdapters(T stringType, Function<V, Flow<Unit, String>> fromLiteral, Function<String, V> toLiteral) Create string-based id adapters for merging vertex and edge types.- Type Parameters:
T- the type parameter for id typesV- the value type for ids- Parameters:
stringType- the string type to use for merged idsfromLiteral- function to extract a string from a literal valuetoLiteral- function to create a literal value from a string- Returns:
- id adapters configured for string-based ids
-