Documentation ¶
Overview ¶
Package multiplicity contains the object to control property sets for an edge.
See:
Titan: http://titan.thinkaurelius.com/javadoc/1.0.0/com/thinkaurelius/titan/core/Multiplicity.html Wikipedia: http://en.wikipedia.org/wiki/Class_diagram#Multiplicity Object-oriented Systems Modeling Laboratory (OSM): http://osm7.cs.byu.edu/OSA/participConst.html
Multiplicity acts as a property set for an edge. This includes the number of arrows and vertices of association there are.
A note about Multiplicity:
This object implements the Parameter interfaces used by graph traversals.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Multiplicity ¶
type Multiplicity string
Multiplicity acts as a property set for an edge. This includes the arrow being associated with the direction of the edge. This is essentially the cardinality and participation.
const ( // Many2One shows that many vertices // connect to a single vertex. Similar // to One2Many but in the opposite direction. // Example: // person <-- --> birth place // left | right // 1..* or + | 1 Many2One Multiplicity = "MANY2ONE" // Many2Many shows that many vertices // connect to many other vertices. Similar // to Many2One, but instead of just one vertex // it's all just a cluster of vertices. // Example: // person <-- --> book // left | right // 0..* or * | 0..* or * Many2Many Multiplicity = "MANY2MANY" // One2Many describes an edge that // comes from multiple vertices and // point towards one vertex. // order <-- --> line item // left | right // 1 | 1..* or + One2Many Multiplicity = "ONE2MANY" // One2One explains that the vertex // being associated connects to one // going in a single direction. // person <-- --> birth certificate // left | right // 1 | 1 One2One Multiplicity = "ONE2ONE" // Simple does not have an associated // direction belonging to it. This // results in an edge with no arrows. Simple Multiplicity = "SIMPLE" // Multi is an arbitrary multiplicity // explaining that this edge will have // multiple arrows associated with it. // Wikipedia: // http://en.wikipedia.org/wiki/Multigraph Multi Multiplicity = "MULTI" )
func Convert ¶
func Convert(c cardinality.Cardinality) Multiplicity
Convert will take a cardinality and return a matching Multiplicity.
func (Multiplicity) Cardinality ¶
func (m Multiplicity) Cardinality() cardinality.Cardinality
Cardinality will convert the Multiplicity to a cardinality.
func (Multiplicity) IsConstrained ¶
func (m Multiplicity) IsConstrained() bool
IsConstrained returns whether this multiplicity imposes any constraint on the number of edges there may exist between a pair of vertices.
func (Multiplicity) IsConstrainedDirection ¶
func (m Multiplicity) IsConstrainedDirection(d direction.Direction) bool
IsConstrainedDirection returns whether this multiplicity imposes any constraint on the number of edges there may exist between a pair of vertices.
func (Multiplicity) IsUnique ¶
func (m Multiplicity) IsUnique(d direction.Direction) bool
IsUnique returns true if this multiplicity implies edge uniqueness in the given direction for any given vertex.
func (Multiplicity) String ¶
func (m Multiplicity) String() string
String will convert the Multiplicity into a string.