|
Variables documentationclass Browsable a Things that are addressed by URI and browsed as a tree of named children. Both
Resource and fromUri :: Browsable a => String -> <ReadGraph> a (Simantics/DB) Returns the value at the given absolute URI. Fails if there is nothing at that URI. uriOf :: Browsable a => a -> <ReadGraph> String (Simantics/DB) Returns the URI of the given value. possibleUriOf :: Browsable a => a -> <ReadGraph> Maybe String (Simantics/DB) Returns the URI of the given value if it exists or Nothing. nameOf :: Browsable a => a -> <ReadGraph> String (Simantics/DB) Reads the name of the value. possibleNameOf :: Browsable a => a -> <ReadGraph> Maybe String (Simantics/DB) Reads the name of the value or Nothing if it has no name. valueOf :: Browsable a => Serializable b => a -> <ReadGraph> b (Simantics/DB) Reads the value the given entity holds, deserialized with the binding of the expected type. Fails if the entity holds no value. genericRelatedValue :: Browsable a => a -> Resource -> <ReadGraph> b (Simantics/DB) Reads the value related to the given entity with the given relation. For a resource this is the value of the object of that relation, for a variable the value of the property named after the relation. Fails if there is no such value. genericPossibleRelatedValue :: Browsable a => a -> Resource -> <ReadGraph> Maybe b (Simantics/DB) As genericRelatedValue but returns variantValueOf :: Browsable a => a -> <ReadGraph> Variant (Simantics/DB) Reads the value the given entity holds as a children :: Browsable a => a -> <ReadGraph> [a] (Simantics/DB) Returns the children of the given entity. For a resource these are the resources it consists of. parent :: Browsable a => a -> <ReadGraph> a (Simantics/DB) Returns the parent of the given entity. Fails if there is no unique parent. possibleParent :: Browsable a => a -> <ReadGraph> Maybe a (Simantics/DB) As parent but returns child :: Browsable a => a -> String -> <ReadGraph> a (Simantics/DB)
possibleChild :: Browsable a => a -> String -> <ReadGraph> Maybe a (Simantics/DB) As child but returns ResourceX :: Resource -> VariableOrResource VariableX :: Variable -> VariableOrResource browse :: Variable -> String -> <ReadGraph> Variable Returns the variable reached from the given variable by the given relative
path. The path may mix child steps and property steps, for example
browsePossible :: Variable -> String -> <ReadGraph> Maybe Variable Like children_ :: Variable -> <ReadGraph> Collection Variable Returns all children of the given variable as a Java collection. createValueAccessor :: (Variable -> <ReadGraph> a) -> (Variable -> Binding b -> <ReadGraph> b) -> (Variable -> c -> <WriteGraph> ()) -> (Variable -> d -> Binding d -> <WriteGraph> ()) -> (Variable -> <ReadGraph> Datatype) -> ValueAccessor Creates a value accessor from the five functions that implement reading and writing the value of a variable: reading with the default binding, reading with an explicit binding, writing with the default binding, writing with an explicit binding, and resolving the datatype of the value. createVariableMap :: [Resource] -> VariableMap Creates a variable map whose children are the given resources, each becoming a
child variable named by its datatype :: Variable -> <ReadGraph> Datatype Returns the datatype of the value of the given variable. getIndexRoot :: Variable -> <ReadGraph> Resource Returns the index root, typically the model or the ontology, that the given variable belongs to. getPossiblePredicateResource :: Variable -> <ReadGraph> Maybe Resource Like getPossibleType :: Variable -> <ReadGraph> Maybe Resource Like getPossibleTypeWithBaseType :: Variable -> Resource -> <ReadGraph> Maybe Resource Returns the type of the given variable that inherits from the given base type, or getPredicateResource :: Variable -> <ReadGraph> Resource Returns the resource of the relation through which the given property variable was reached. Fails if the variable is not a property or has no predicate resource. getType :: Variable -> <ReadGraph> Resource Function getType returns the type of the input variable as resource Example:
instanceIndexRoot :: Variable -> <ReadGraph> Resource Returns the index root, typically the model or the ontology, that the given variable belongs to. instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource Creates a new instance of the given type under the given container and returns
it. By default the instance is attached to the container with modelOfVariable :: Variable -> <ReadGraph> Resource Function modelOfVariable returns the model, in which the given input variable is located, as Resource Example:
modelResourceOfVariable :: Variable -> <ReadGraph> Resource Returns the model that contains the given variable. Same as modelVariableOfVariable :: Variable -> <ReadGraph> Variable Function modelVariableOfVariable returns the model, in which the given input Variable is located, as Variable Example:
name :: Variable -> <ReadGraph> String Function name return the name of the input variable as string Example:
possibleActiveVariable :: Variable -> <ReadGraph> Maybe Variable Returns the counterpart of the given configuration variable in the currently
active experiment run of its model. Returns possibleConfigurationContext :: Resource -> <ReadGraph> Variable Returns the configuration variable of the model that the given resource belongs
to. The resource may be the model itself or any resource under it. Fails if no
model or no configuration is found; despite the name it has no possibleProperty :: Variable -> String -> <ReadGraph> Maybe Variable Like possiblePropertyValue :: Serializable a => Typeable a => Variable -> String -> <ReadGraph> Maybe a Like possiblePropertyValue_ :: Variable -> String -> Binding a -> <ReadGraph> Maybe a Returns the value of the named property decoded with the given binding, or possibleRepresents :: Variable -> <ReadGraph> Maybe Resource Like possibleResourceVariable :: Resource -> <ReadGraph> Maybe Variable Returns the variable that corresponds to the given resource, or possibleVariable :: String -> <ReadGraph> Maybe Variable Returns the variable at the given variable URI, or possibleVariableValue :: Serializable a => Typeable a => Variable -> <ReadGraph> Maybe a Like possibleVariableValue_ :: Variable -> Binding a -> <ReadGraph> Maybe a Returns the value of the given variable decoded with the given binding, or properties :: Variable -> <ReadGraph> [Variable] Function properties returns a list, which contains of the properties of the input variable as Variable Example 1: print out all the properties of certain point as they are shown in Variable Debugger.
Example 2: print out only the properties of a point, which name starts as "PO11". Else do nothing.
propertiesClassified :: Variable -> Resource -> <ReadGraph> [Variable] Returns those properties of the given variable that carry the given classification resource. propertiesClassified_ :: Variable -> Resource -> <ReadGraph> Collection Variable Returns those properties of the given variable that carry the given classification resource, as a Java collection. properties_ :: Variable -> <ReadGraph> Collection Variable Returns all properties of the given variable as a Java collection. property :: Variable -> String -> <ReadGraph> Variable Function property return the wanted property as Variable Input 1: Module which property we want to obtain as Variable Input 2: Name of the property as String Output: wanted property as Variable Example
propertyInfoOf :: Resource -> <ReadGraph> PropertyInfo Returns the cached propertyValue :: Serializable a => Typeable a => Variable -> String -> <ReadGraph> a Function propertyValue finds the value of given property. Example: Find out the value of point PO01 attribute PO11_PRESSURE
propertyValue_ :: Variable -> String -> Binding a -> <ReadGraph> a Returns the value of the named property of the given variable, decoded with the given binding. represents :: Variable -> <ReadGraph> Resource Function represents returns the resource of the given input variable Input 1: Variable which resource is wanted to be obtainend Output: Resource of the given input variable. Example: Find out the resource of given variable
resolvePossible :: RVI -> Variable -> <ReadGraph> Maybe Variable Follows the given RVI from the given variable and returns the variable it leads to, or resourceVariable :: Resource -> <ReadGraph> Variable Function resourceVariable converts a resource to a corresponding variable. Example:
rviBinding :: <ReadGraph> Binding a Returns the Binding needed to read RVI type properties. rviIsEmpty :: RVI -> Boolean Returns True if the given RVI is empty in which case
rviOf :: Variable -> <ReadGraph> RVI Returns the RVI of the given variable, relative to the nearest enclosing context. sclVariableMap :: (Variable -> <ReadGraph,Proc> [Variable]) -> VariableMap Creates a variable map whose children of a variable are the variables produced by the given function. sclVariableMapWithBasis :: VariableMap -> (Variable -> <ReadGraph,Proc> [Variable]) -> VariableMap Like setPropertyValue :: Serializable a => Variable -> String -> a -> <WriteGraph> () Function setPropertyValue sets wanted to value to given Variable property. Input 1: Wanted module as Variable Input 2: Wanted property name as String Output: No output, given value is inserted to property Example:
setPropertyValue_ :: Variable -> String -> a -> Binding a -> <WriteGraph> () Writes the value of the named property of the given variable, encoding it with the given binding. Requires a write transaction and fails if the property is not writable. setRVIProperty :: Variable -> RVI -> <WriteGraph> () Writes the given RVI as the value of the given RVI-valued property variable. The old literal is removed and a new one claimed on the parent resource. Requires a write transaction. setValue :: Variable -> a -> <WriteGraph> () Writes the value of the given variable, using the default binding for the class of the value. Requires a write transaction and fails if the variable is not writable. standardChildDomainProperties :: VariableMap The variable map that resolves the properties of a variable that represents an
entity. It is the default value of the standardGetDatatype :: Variable -> <ReadGraph> Datatype The default implementation for resolving the datatype of the value of a variable. standardGetValue1 :: Variable -> <ReadGraph> a The default implementation for reading the value of a standard graph property variable, using the default binding of the property. standardGetValue2 :: Variable -> Binding a -> <ReadGraph> a The default implementation for reading the value of a standard graph property variable with the given binding. standardGraphPropertyVariable :: Variable -> Maybe VariableNode -> Resource -> PropertyInfo -> Resource -> <ReadGraph> Variable Creates a standard graph property variable for the property described by the
given standardGraphPropertyVariableParentPredicate :: Variable -> Resource -> <ReadGraph> Variable Creates a standard graph property variable for the property reached from the given parent variable through the given predicate resource. standardPropertyDomainProperties :: VariableMap The variable map that resolves the properties of a variable that is itself a
property, such as the standardSetValue2 :: Variable -> a -> <WriteGraph> () The default implementation for writing the value of a standard graph property variable, using the default binding for the class of the value. Requires a write transaction. standardSetValue3 :: Variable -> a -> Binding a -> <WriteGraph> () The default implementation for writing the value of a standard graph property variable with the given binding. Requires a write transaction. switchPossibleContext :: Variable -> Resource -> <ReadGraph> Maybe Variable Returns the variable at the same relative path as the given variable but under
the given context resource, for example the same property in another experiment
run. Returns uniqueChild :: Resource -> Resource -> String -> <ReadGraph> Variable Searches the index of the given model for an instance of the given type with the given name and returns it as a variable. Fails if the index has no match; if it has several, the first one is returned. untypedPossiblePropertyValue :: Variable -> String -> <ReadGraph> Maybe a Like untypedPossibleVariableValue :: Variable -> <ReadGraph> Maybe a Like untypedPropertyValue :: Variable -> String -> <ReadGraph> a Returns the value of the named property without checking that it has the expected SCL type. untypedValue :: Variable -> <ReadGraph> a Returns the value of the given variable using the binding of its datatype, without checking that the value has the expected SCL type. uri :: Variable -> <ReadGraph> String Function uri return the uri of given variable. The uri is fetched from the active Experiment Input 1: wanted variable which uri is needed as Variable Output: uri of the variable as String Example:
value :: Serializable a => Typeable a => Variable -> <ReadGraph> a Returns the value of the given variable, decoded with the default binding of the expected SCL type. value_ :: Variable -> Binding a -> <ReadGraph> a Returns the value of the given variable, decoded with the given binding. variable :: String -> <ReadGraph> Variable Function variable converts a variable URI to a variable. Example:
variableParent :: Variable -> <ReadGraph> Variable Function variableParent returns the name of the parent variable as Variable Example:
|