Angulillos<?>
Angulillos is a Java 8 library for working with strongly typed graph data in a generic way.
You write graph schemas using the Java type system, with graph traversals being statically checked over graph schemas. The same schemas and traversals can then be used with any graph technology implementing the Angulillos API.
See also the bio4j/angulillos-titan repo with the implementation of Angulillos API for the Titan graph database.
This library was developed for the Bio4j bioinformatics graph data platform. But it can be used for working with any kind of graph structured data.
If you are going to read the code and probably use it, you may find these notes useful.
- Edge source and target vertices don't have to be from the same graph (note the wildcards in the API). This allows you to have a graph with edges that connect vertices of two other independent graphs.
- But all vertices and edges that interact through this API have to have the same raw types (
RV,RE
).
Most frequently used things:
V
stands for VertexE
stands for Edge. Plus in the context of an edgeS
stands for its Source vertexT
stands for its Target vertex
*T
suffix stands for Type for any of the above (e.g.VT
is Vertex Type)G
stands for GraphR*
prefix means Raw. These are shared among all other types in the API:RV
stands for Raw Vertex typeRE
stands for Raw Edge type
Now less frequently used things have not so nice, but unambiguous names:
F
for Element, becauseE
is used for Edge and F is just the closes letterX
for the property value type, becauseV
is used for Vertex and X looks like an arbitrary type variable
-
All graph element types (i.e. vertices and edges) come in pairs: typed element and its type. For example:
-
Vertex and its type:
< V extends TypedVertex<V,VT, G,RV,RE>, VT extends TypedVertex.Type<V,VT, G,RV,RE> >
-
Edge and its type:
< E extends TypedEdge<S,ST, E,ET, T,TT, G,RV,RE>, ET extends TypedEdge.Type<S,ST, E,ET, T,TT, G,RV,RE> >
-
-
The order of edge primary parameters is source, then edge itself, then target. And in general, when you mention edge and its source or target, you put source-related things before the edge and target-related things after it.
-
Almost all types have graph
G
, raw vertexRV
and raw edgeRE
types and they are placed in the end of the list (see examples above). To improve readability, it's recommended to put a space between the paired type variables and these three.