Annotation2 module documentation

AnnotationType

AnnotationType represents AnnotationType instance in Simantics ontology (http://www.simantics.org/Annotation-1.0/AnnotationType)

newAnnotationType :: Resource -> <WriteGraph> Resource

Creates new AnnotationType under the given Library instance and returns it without PropertyRelation

newAnnotationType1 :: Resource -> <WriteGraph> (Resource, Resource)

Creates new AnnotationType under the given Library instance. Returns a Tuple2 consisting the AnnotationPropertyRelation and AnnotationType instances.

attachAnnotationType :: Resource -> Resource -> <WriteGraph> Resource

Attaches the given AnnotationType to the given Resource which can be for example a Diagram or a Symbol.

AnnotationValue

AnnotationValue represents AnnotationType instance in Simantics ontology (http://www.simantics.org/Annotation-1.0/AnnotationType)

newAnnotationValue :: Resource -> Resource -> <WriteGraph> Resource

Creates new AnnotationValue under the given Library instance with the AnnotationType reference. Returns the created AnnotationValue.

Didn't find the value 'attachAnnotationValue'.

AnnotationProperty

newAnnotationProperty :: Resource -> <WriteGraph> Resource

Creates new AnnotationProperty under the given AnnotatoinType instance. Returns the created AnnotationProperty.

advancedAnnotationProperty :: Resource -> String -> String -> String -> String -> String -> String -> <WriteGraph> Resource

Creates new AnnotationProperty under the given AnnotationType instance with advanced options for user to define non-default parameters for the following values

  • name
  • type
  • unit
  • range
  • label
  • description
removeAnnotationProperty :: Resource -> <WriteGraph> ()

Removes the given AnnotationProperty instance.

Undocumented entities

copyAnnotationData :: Resource -> Resource -> <WriteGraph> ()

copyAnnotationData source target moves the property values of one annotation onto another annotation of the same type: for every property the two share by name, the value of source is detached and attached to target, and a property that source only inherits from its type is reset to the inherited value in target as well. The source is left with the inherited values.

exportAnnotationType :: File -> Resource -> <Proc> ()

Writes the given AnnotationType into the given file in the format read back by importAnnotation.

getAnnotationNameFromType :: Resource -> <ReadGraph> String

The name of the annotation property relation that has the given AnnotationType as its range. This is the name under which annotations of that type appear on the resources they are attached to. Fails if the type does not have exactly one such relation.

getPossibleAnnotationType :: Resource -> String -> <ReadGraph> Maybe Resource

getPossibleAnnotationType model name searches the index root model for the AnnotationType whose annotation name, as given by getAnnotationNameFromType, is name. Returns Nothing if no type matches or if several do.

importAnnotation :: File -> Resource -> <Proc> ()

Imports the annotation types stored in the given file into the given library. Must be called outside a database transaction, since it writes on its own.

newAnnotationValueWithName :: Resource -> String -> Resource -> <WriteGraph> Resource

newAnnotationValueWithName library name annotationType is as newAnnotationValue but names the created AnnotationValue. If the library already has a child with that name, that child is returned and nothing is created.

saveAnnotation :: Resource -> Resource -> String -> <WriteGraph> Resource

saveAnnotation annotation library name moves an annotation that was attached to a resource into the given library under the given name, so that it becomes a reusable AnnotationValue. Returns the annotation.

setAnnotationPropertyValue :: Resource -> Resource -> String -> String -> <WriteGraph> ()

setAnnotationPropertyValue relation resource property newValue writes the display value of one property of the annotation that is attached to resource through relation. The property is named as it is written in the annotation type, and the value is given in the display form the user would type.

setPropertyDescription :: Resource -> String -> <WriteGraph> ()

Sets the description of the given AnnotationProperty.

setPropertyLabel :: Resource -> String -> <WriteGraph> ()

Sets the label shown for the given AnnotationProperty in the user interface.

setPropertyRange :: Resource -> String -> <WriteGraph> ()

Sets the allowed value range of the given AnnotationProperty into the datatype it requires. The range is written in databoard range notation.

setPropertyType :: Resource -> String -> <WriteGraph> ()

Sets the required value type of the given AnnotationProperty. The type is given as an SCL type, written the way it would appear in a type signature, for example Double, String or Vector Double. It is stored as the property's L0.RequiresValueType.

Note that this is not a databoard datatype, unlike the range given to setPropertyRange, which is written in databoard range notation.

The default value of the property is converted to the new type.

setPropertyUnit :: Resource -> String -> <WriteGraph> ()

Sets the unit of the given AnnotationProperty, both in the datatype it requires and in the unit shown for it. The stored value is not converted.