hydra.langs.tinkerpop.dsl.Graphs Maven / Gradle / Ivy
package hydra.langs.tinkerpop.dsl;
import hydra.langs.tinkerpop.propertyGraph.EdgeLabel;
import hydra.langs.tinkerpop.propertyGraph.EdgeType;
import hydra.langs.tinkerpop.propertyGraph.VertexLabel;
import hydra.langs.tinkerpop.propertyGraph.VertexType;
/**
* DSL for constructing property graph types (vertex and edge types, property types)
* and values (vertices, edges, and properties).
*/
public interface Graphs {
static EdgeBuilder edge(EdgeType type, V id, V outId, V inId) {
return new EdgeBuilder(type.label, id, outId, inId);
}
static EdgeBuilder edge(String label, V id, V outId, V inId) {
return new EdgeBuilder(new EdgeLabel(label), id, outId, inId);
}
static EdgeTypeBuilder edgeType(String label, T idType, String outLabel, String inLabel) {
return new EdgeTypeBuilder(
new EdgeLabel(label), idType, new VertexLabel(outLabel), new VertexLabel(inLabel));
}
static VertexBuilder vertex(VertexType type, V id) {
return new VertexBuilder(type.label, id);
}
static VertexBuilder vertex(String label, V id) {
return new VertexBuilder(new VertexLabel(label), id);
}
static VertexTypeBuilder vertexType(String label, T idType) {
return new VertexTypeBuilder(new VertexLabel(label), idType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy