Package dev.roanh.gmark.core.graph
Class Schema
java.lang.Object
dev.roanh.gmark.core.graph.Schema
Represents the schema configuration of a graph.
This includes the set of predicates (edge labels),
node types (node labels) and the configuration
for how often edges with certain predicates are
present between nodes of a certain type.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasGraph()
Gets this schema in graph format where all types are nodes and all edge configurations edges between these type nodes.int
Gets the total number of edge configurations in this schema.getEdges()
Gets all edge configuration objects for this schema.getPredicate
(int id) Gets a predicate from this graph schema by its ID.getPredicate
(String alias) Gets a predicate from this graph schema by its textual alias name.int
Gets the total number of distinct predicates for this schema.Gets all predicates for this schema.getType
(int id) Gets a type from this graph schema by its ID.Gets a type from this graph schema by its textual alias name.int
Gets the total number of distinct node types for this schema.getTypes()
Gets all node types for this schema.
-
Field Details
-
edges
List of schema edge configurations. -
predicates
List of all valid edge predicates. -
types
List of all valid node types.
-
-
Constructor Details
-
Schema
Constructs a new schema with the given set of edges, node types and predicates.- Parameters:
edges
- The list of schema edges.types
- The list of node types.predicates
- The list of edge predicates.
-
-
Method Details
-
getPredicates
Gets all predicates for this schema.- Returns:
- All predicates (edge labels).
-
getTypes
Gets all node types for this schema.- Returns:
- All node types.
-
getEdges
Gets all edge configuration objects for this schema.- Returns:
- All edge configuration objects.
-
getTypeCount
public int getTypeCount()Gets the total number of distinct node types for this schema.- Returns:
- The total number of node types.
- See Also:
-
getPredicateCount
public int getPredicateCount()Gets the total number of distinct predicates for this schema. Note: this does not include inverse predicates.- Returns:
- The total number of predicates.
- See Also:
-
getEdgeCount
public int getEdgeCount()Gets the total number of edge configurations in this schema.- Returns:
- The total number of edge configurations.
- See Also:
-
asGraph
Gets this schema in graph format where all types are nodes and all edge configurations edges between these type nodes.- Returns:
- This schema in graph format.
-
getType
Gets a type from this graph schema by its ID.- Parameters:
id
- The ID of the type to get.- Returns:
- The type with the given ID.
-
getType
Gets a type from this graph schema by its textual alias name.- Parameters:
alias
- The type alias.- Returns:
- The type with the given alias.
-
getPredicate
Gets a predicate from this graph schema by its ID.- Parameters:
id
- The ID of the predicate to get.- Returns:
- The predicate with the given ID.
-
getPredicate
Gets a predicate from this graph schema by its textual alias name.- Parameters:
alias
- The predicate alias.- Returns:
- The predicate with the given alias.
-