Full featured Function Oriented Database, Key/Value Deep Store with transaction checkpointing and recovery, embedded and server modes!
Building relationships is as easy as saying:
Relatrix.store([fromObject],[mapObject],[toObject]); // This stores a functional relationship
and a query for that set is as simple as:
Stream stream = (Stream) Relatrix.findStream("?", "?", "?");
stream.forEach(e -> Stream.of(e).forEach(g -> System.out.println("Element A:"+g)));
Or using the old Iterator model:
Iterator iterator = Relatrix.findSet("?",[mapObject],"?"); // This retrieves all domain objects and range objects mapped through [mapObject]
To compose two relationships to an association:
Relatrix.store([fromObject1],[mapObject1],Relatrix.store([fromObject2],[mapObject2].[toObject2])); // This composes relationships
Stream stream = (Stream) Relatrix.findStream([fromObject1],"*","?", true); // This returns all range objects mapped to [fromObject1] through ANY map object in parallel, including the relationship stored above
Stream stream = (Stream) Relatrix.findStream(("*","*","*"); // This makes ready for consumption by stream all relationships as identity objects
public class VisualCortex {
public static void main(String[] args) throws Exception {
Relatrix.setTablespaceDirectory(args[0]);
Stream<Result> stream = (Stream<Result>) Relatrix.findStream("?", "?", "?", true);
Map<Object, Map<Object, Map<Object, Long>>> nameCount = stream.collect(Collectors.groupingBy(b -> b[0].toString(),
Collectors.groupingBy(d -> d[1].toString(),
Collectors.groupingBy(e -> e[2].toString(), Collectors.counting()))));
nameCount.forEach((name, count) -> {
System.out.println(name + ":" + count);
});
}
}