|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Schema
The Schema
class provides access to the graph schema of a
pool. It is used to create, modify, and query the schema.
Method Summary | |
---|---|
void |
clear()
Removes every class declaration from this schema. |
EdgeClass |
declareDirectedEdgeClass(java.lang.String name,
boolean abstractClass,
GraphEntityClass source,
Cardinality srcCard,
GraphEntityClass target,
Cardinality trgCard)
Declare a new edge class for directed edges and returns it. |
GraphClass |
declareGraphClass(java.lang.String name,
boolean abstractClass)
Declare a new graph class and returns it. |
GraphEntityClass |
declareGraphEntityClass(java.lang.String name)
Declare a new abstract graph entity class and returns it. |
NodeClass |
declareNodeClass(java.lang.String name,
boolean abstractClass)
Declare a new node class and returns it. |
RelationClass |
declareRelationClass(java.lang.String name,
boolean abstractClass)
Declare a new relations class and returns it. |
EdgeClass |
declareUndirectedEdgeClass(java.lang.String name,
boolean abstractClass,
GraphEntityClass entityClass,
Cardinality cardinality)
Declare a new edge class for undirected edges and returns it. |
boolean |
existsEdgeClass(EdgeClass id)
Returns true if the edge class is declared in this
schema and false otherwise. |
boolean |
existsEdgeClass(java.lang.String name)
Returns true if the edge class is declared in this
schema and false otherwise. |
boolean |
existsGraphClass(GraphClass id)
Returns true if the graph class is declared in this
schema and false otherwise. |
boolean |
existsGraphClass(java.lang.String name)
Returns true if the graph class is declared in this
schema and false otherwise. |
boolean |
existsGraphEntityClass(GraphEntityClass id)
Returns true if the schema entity is declared in this
schema and false otherwise. |
boolean |
existsGraphEntityClass(java.lang.String name)
Returns true if the schema entity is declared in this
schema and false otherwise. |
boolean |
existsNodeClass(NodeClass id)
Returns true if the node class is declared in this
schema and false otherwise. |
boolean |
existsNodeClass(java.lang.String name)
Returns true if the node class is declared in this
schema and false otherwise. |
boolean |
existsRelationClass(RelationClass id)
Returns true if the relation class is declared in this
schema and false otherwise. |
boolean |
existsRelationClass(java.lang.String name)
Returns true if the relation class is declared in this
schema and false otherwise. |
boolean |
existsRelationEndClass(RelationEndClass id)
Returns true if the relation end class is declared in this
schema and false otherwise. |
boolean |
existsRelationEndClass(java.lang.String name)
Returns true if the relation end class is declared in this
schema and false otherwise. |
java.util.Collection<? extends EdgeClass> |
getAllEdgeClasses()
Returns a collection containing all edge classes defined in the schema. |
java.util.Collection<? extends GraphClass> |
getAllGraphClasses()
Returns a collection containing all graph classes defined in the schema. |
java.util.Collection<? extends GraphEntityClass> |
getAllGraphEntityClasses()
Returns a collection containing all graph entity classes defined in the schema. |
java.util.Collection<? extends NodeClass> |
getAllNodeClasses()
Returns a collection containing all node classes defined in the schema. |
java.util.Collection<? extends RelationClass> |
getAllRelationClasses()
Returns a collection containing all relation classes defined in the schema. |
EdgeClass |
getEdgeClassByName(java.lang.String name)
Returns the edge class specified by the given name. |
GraphClass |
getGraphClassByName(java.lang.String name)
Returns the graph class specified by the given name. |
GraphEntityClass |
getGraphEntityClassByInternalIdentifier(java.io.Serializable identifier)
Retrieves a graph entity class by its internal identifier. |
GraphEntityClass |
getGraphEntityClassByName(java.lang.String name)
Returns the graph entity class specified by the given name. |
NodeClass |
getNodeClassByName(java.lang.String name)
Returns the node class specified by the given name. |
RelationClass |
getRelationClassByName(java.lang.String name)
Returns the relation class specified by the given name. |
RelationEndClass |
getRelationEndClassByName(java.lang.String name)
Returns the relation end class specified by the given name. |
DefaultSchemaChecker |
getSchemaChecker()
Returns the SchemaChecker used by the Schema, which will always be an instance of DefaultSchemaChecker. |
void |
undeclareGraphEntityClass(GraphEntityClass g)
Undeclares a graph entity class. |
Method Detail |
---|
GraphClass declareGraphClass(java.lang.String name, boolean abstractClass) throws EntityAlreadyExistsException, DragosException
name
- The graph classes name.abstractClass
- Is the class abstract or not.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.GraphEntityClass declareGraphEntityClass(java.lang.String name) throws EntityAlreadyExistsException, DragosException
name
- The graph entity classes name.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.NodeClass declareNodeClass(java.lang.String name, boolean abstractClass) throws EntityAlreadyExistsException, DragosException
name
- The node classes name.abstractClass
- Is the class abstract or not.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.EdgeClass declareDirectedEdgeClass(java.lang.String name, boolean abstractClass, GraphEntityClass source, Cardinality srcCard, GraphEntityClass target, Cardinality trgCard) throws EntityAlreadyExistsException, EntityNotFoundException, DragosException
name
- The edge classes name.abstractClass
- Is the class abstract or not.source
- The graph entity class allowed as a source.srcCard
- The source cardinality.target
- The graph entity class allowed as a target.trgCard
- The target cardinality.
EntityNotFoundException
- if the source or target graph class
do not exist.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.EdgeClass declareUndirectedEdgeClass(java.lang.String name, boolean abstractClass, GraphEntityClass entityClass, Cardinality cardinality) throws EntityAlreadyExistsException, EntityNotFoundException, DragosException
name
- The edge classes name.abstractClass
- Is the class abstract or not.entityClass
- The graph entity class allowed as source and target.cardinality
- The cardinality of the edge.
EntityNotFoundException
- if the source or target graph class
do not exist.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.RelationClass declareRelationClass(java.lang.String name, boolean abstractClass) throws EntityAlreadyExistsException, DragosException
name
- The relation classes name.abstractClass
- Is the class abstract or not.
EntityAlreadyExistsException
- if a schema entity with the same
name has already been declared
DragosException
- if something went wrong.void undeclareGraphEntityClass(GraphEntityClass g) throws EntityNotFoundException, DragosException
Deletion is cascading, meaning any dependent graph entity classes and attributes will be undeclared as well. You should also be aware that this method only ensures a consistent schema at core GM level (e.g. by simply removing the class from the class hierachy), which in most cases is not sufficient to ensure meaningful semantics at application level. Usually the application GM will perform additional checks and operations.
This method proceeds in the following order:
GraphEntityClass.removeSubClass(GraphEntityClass)
.GraphEntityClass.undeclareAllAttributes()
.GraphPool.removeAllInstances(GraphEntityClass)
to remove all instances of the class from the GraphPool.
g
- The graph entity class to undeclare.
EntityNotFoundException
- if the class does not exist.
DragosException
- if something else went wrong.void clear() throws DragosException
undeclareGraphEntityClass(GraphEntityClass)
was called on each graph entity class separately
(skipping classes already removed by cascading
deletion, of course).
DragosException
- if something went wrong.boolean existsGraphEntityClass(GraphEntityClass id) throws DragosException
true
if the schema entity is declared in this
schema and false
otherwise.
id
- The schema entity.
true
if the schema entity is declared.
DragosException
- if something went wrong.boolean existsGraphEntityClass(java.lang.String name) throws DragosException
true
if the schema entity is declared in this
schema and false
otherwise.
name
- The name of the schema entity.
true
if the schema entity is declared.
DragosException
- if something went wrong.boolean existsGraphClass(GraphClass id) throws DragosException
true
if the graph class is declared in this
schema and false
otherwise.
id
- The graph class.
true
if the graph class is declared.
DragosException
- if something went wrong.boolean existsGraphClass(java.lang.String name) throws DragosException
true
if the graph class is declared in this
schema and false
otherwise.
name
- The name of the graph class.
true
if the graph class is declared.
DragosException
- if something went wrong.boolean existsNodeClass(NodeClass id) throws DragosException
true
if the node class is declared in this
schema and false
otherwise.
id
- The node class.
true
if the node class is declared.
DragosException
- if something went wrong.boolean existsNodeClass(java.lang.String name) throws DragosException
true
if the node class is declared in this
schema and false
otherwise.
name
- The name of the graph class.
true
if the node class is declared.
DragosException
- if something went wrong.boolean existsEdgeClass(EdgeClass id) throws DragosException
true
if the edge class is declared in this
schema and false
otherwise.
id
- The edge class.
true
if the edge class is declared.
DragosException
- if something went wrong.boolean existsEdgeClass(java.lang.String name) throws DragosException
true
if the edge class is declared in this
schema and false
otherwise.
name
- The name of the edge class.
true
if the edge class is declared.
DragosException
- if something went wrong.boolean existsRelationClass(RelationClass id) throws DragosException
true
if the relation class is declared in this
schema and false
otherwise.
id
- The relation class.
true
if the relation class is declared.
DragosException
- if something went wrong.boolean existsRelationClass(java.lang.String name) throws DragosException
true
if the relation class is declared in this
schema and false
otherwise.
name
- The name of the relation class.
true
if the relation class is declared.
DragosException
- if something went wrong.boolean existsRelationEndClass(RelationEndClass id) throws DragosException
true
if the relation end class is declared in this
schema and false
otherwise.
id
- The relation end class.
true
if the relation end class is declared.
DragosException
- if something went wrong.boolean existsRelationEndClass(java.lang.String name) throws DragosException
true
if the relation end class is declared in this
schema and false
otherwise.
name
- The name of the relation end class.
true
if the relation end class is declared.
DragosException
- if something went wrong.GraphEntityClass getGraphEntityClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.GraphClass getGraphClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.NodeClass getNodeClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.EdgeClass getEdgeClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.RelationClass getRelationClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.RelationEndClass getRelationEndClassByName(java.lang.String name) throws EntityNotFoundException, DragosException
name
- The name of the class (which must not be null
).
EntityNotFoundException
- if no class with this name could be found.
DragosException
- if something else went wrong.GraphEntityClass getGraphEntityClassByInternalIdentifier(java.io.Serializable identifier) throws EntityNotFoundException, DragosException
identifier
- The internal identifier.
EntityNotFoundException
- if the graph entity does not exist.
DragosException
- if something else went wrong.java.util.Collection<? extends EdgeClass> getAllEdgeClasses() throws DragosException
Edge
.
DragosException
- if queries are not allowed, or something else went wrong.java.util.Collection<? extends GraphClass> getAllGraphClasses() throws DragosException
Graph
.
DragosException
- if queries are not allowed, or something else went wrong.java.util.Collection<? extends NodeClass> getAllNodeClasses() throws DragosException
Node
.
DragosException
- if queries are not allowed, or something else went wrong.java.util.Collection<? extends RelationClass> getAllRelationClasses() throws DragosException
Relation
.
DragosException
- if queries are not allowed, or something else went wrong.java.util.Collection<? extends GraphEntityClass> getAllGraphEntityClasses() throws DragosException
GraphEntity
.
DragosException
- if something went wrong.DefaultSchemaChecker getSchemaChecker()
GraphPool.getGraphPoolChecker()
.
This method must work even when the associated GraphPool is closed.
null
).SchemaChecker
,
DefaultSchemaChecker
,
GraphPool.getGraphPoolChecker()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |