new CurrentGraph()
Methods
-
<static> findRecursive(graphDB, startTag, relationTag, relationDirection, predicate)
-
Find the first instance matching the provided predicate when following the given relation recursively. Return null if not found.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB startTagolympe.dc.InstanceTag Tag of the starting instance
relationTagstring Tag of the followed relation
relationDirectionolympe.dc.RelationDirection Direction in which to follow the recursive relation.
predicatefunction Anonymous predicate function
Returns:
- Type
- string
-
<static> findRelated(graphDB, startTag, relations, predicate)
-
Find the first instance matching the provided predicate when following all the given relations.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB startTagolympe.dc.InstanceTag Tag of the starting instance
relationsArray.<olympe.dc.registry.Relation> The relations to follow
predicatefunction Anonymous predicate function
Returns:
- Type
- string
-
<static> getExtendedModels(graphDB, modelTag [, endTag])
-
Get all the models extended by this model (including self). Optionally define an end tag to get a subset of extended models. Will throw an error if the expected end model is not found.
Parameters:
Name Type Argument Default Description graphDBolympe.dc.GraphDB modelTagolympe.dc.InstanceTag Tag of the starting model instance
endTagolympe.dc.InstanceTag <optional>
olympe.dc.Sync.entry Optional end instance tag after which to stop following the extend relations.
Returns:
- Type
- Array.<string>
-
<static> getInstanceName(graphDB, tag)
-
Get the current name of an instance, or null if the instance is unnamed.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB tagolympe.dc.InstanceTag Instance
Returns:
- Type
- string
-
<static> getInstances(graphDB, modelTag)
-
Get the current instances of a model.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB modelTagolympe.dc.InstanceTag Tag of the model instance
Returns:
- Type
- Array.<string>
-
<static> getParentModel(graphDB, instance)
-
Returns the tag of the parent model of the instance given as parameter, if the instance exists and it it has a model. Returns null instead.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB instanceolympe.dc.InstanceTag The instance, represented by any of the option offered by InstanceTag
Returns:
- Type
- string
-
<static> getRecursiveInstances(graphDB, startTag, relationTag, relationDirection [, endTag])
-
Get all the instance following the given relation recursively.
Parameters:
Name Type Argument Description graphDBolympe.dc.GraphDB startTagolympe.dc.InstanceTag Tag of the starting instance
relationTagstring Tag of the followed relation
relationDirectionolympe.dc.RelationDirection Direction in which to follow the recursive relation.
endTagolympe.dc.InstanceTag <optional>
Optional end instance tag after which to stop following the relation.
Returns:
- Type
- Array.<string>
-
<static> getRelated(graphDB, tag, relation)
-
Gets the currently related instances.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB tagolympe.dc.InstanceTag Instance
relationolympe.dc.registry.Relation Relation to follow
Returns:
The resulting array of tags.
- Type
- Array.<string>
-
<static> getUniqueRelated(graphDB, tag, relation)
-
Gets the currently unique related instance.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB tagolympe.dc.InstanceTag Instance
relationolympe.dc.registry.Relation Relation to follow
Returns:
The tag or
nullif there is no match.- Type
- string
-
<static> isExtending(graphDB, modelTag, extendedTag)
-
Assess whether the model
modelTagis extending the modelextendedTagParameters:
Name Type Description graphDBolympe.dc.GraphDB modelTagolympe.dc.InstanceTag Tag of the starting model instance
extendedTagolympe.dc.InstanceTag Tag of the extended model instance
Returns:
- Type
- boolean
-
<static> isInstanceof(graphDB, instanceTag, modelTag)
-
Assess whether the instance
instanceTagis instanceof the modelmodelTag. Note: if A is instance of B, and B extends C, A is an instance of both B and C.Parameters:
Name Type Description graphDBolympe.dc.GraphDB instanceTagolympe.dc.InstanceTag Tag of the starting model instance
modelTagolympe.dc.InstanceTag Tag of the extended model instance
Returns:
- Type
- boolean
-
<static> isModel(graphDB, tag)
-
Determines if the instance is a model.
Parameters:
Name Type Description graphDBolympe.dc.GraphDB tagolympe.dc.InstanceTag Instance
Returns:
- Type
- boolean
Olympe SDK