PTC Annotations
The OData protocol supports specifying elements in EDM with custom annotations that provide additional information to the clients. The following annotations are available in Windchill REST Services:
Core.Description
PTC.Operations
PTC.MultiOperations
PTC.ReadOnly
PTC.SecurityLabel
PTC.UpdateableViaAction
Org.OData.Capabilities.V1.SortRestrictions
PTC.NonSortable
PTC.Capability
PTC.ClassificationNameSpace
Core.Description
This annotation is available on all entity types. It describes the entity.
<Annotation Term="Core.Description">
<String>Some description</String>
</Annotation>
PTC.Operations
This annotation specifies the list of supported CRUD operations for entities. In the example below, the annotation is applied to the Part entity in the PTC Product Management domain:
<EntityType Name=”Part>
<Key>
<PropertyRef Name=”ID”/>
</Key>
<Property Name=”ID” Type=”EDM.String”>

<Annotation Term="PTC.Operations">
<String>READ, CREATE, UPDATE, DELETE</String>
</Annotation>
</EntityType>
The annotation indicates that the framework supports reading, creating, updating, and deleting parts.
PTC.MultiOperations
This annotation is available on an entity type. It specifies the list of CRUD operations for which actions are available for multiple objects. For example, if CREATE operation is listed in the annotation for a Part entity type, then a bound action CreateParts is available for the Part entity.
<Annotation Term="PTC.MultiOperations">
<String>CREATE,UPDATE,DELETE</String>
</Annotation>
PTC.ReadOnly
This annotation indicates entity properties that are read-only. In the example below, an annotation from the EDM of the PTC Product Management domain is shown:
<EntityType Name=”Part”>
<Key>
<PropertyRef Name=”ID”/>
</Key>
<Property Name=”ID” Type=”EDM.String”>

<Property Name=”State” Type=”PTC.EnumType”>
<Annotation Term="PTC.ReadOnly"/>
</Property>

</EntityType>
The annotation indicates that the property State on the Part entity is read-only.
PTC.SecurityLabel
This annotation indicates security labels. In the example below, an annotation from the EDM of the PTC Product Management domain is shown:
<EntityType Name=”Part”>
<Property Name="<Internal_name_for_Security_label>" Type="Edm.String">
<Annotation Term="PTC.ReadOnly"/>
<Annotation Term="PTC.SecurityLabel"/>
</Property> …

</EntityType>
PTC.UpdateableViaAction
This annotation indicates that you cannot update the property using a PATCH request. You can modify the property using the UpdateCommonProperties action. In the example below, an annotation from the EDM of the PTC Product Management domain is shown:
<EntityType Name=”Part”>
<Property Name="EndItem" Type="Edm.Boolean" Nullable="false">
<Annotation Term="PTC.UpdateableViaAction">
<String>Property is updateable via UpdateCommonProperties action</String>
</Annotation>
</Property>
<NavigationProperty Name="Organization" Type="PTC.PrincipalMgmt.Organization">
<Annotation Term="PTC.UpdateableViaAction">
<String>Property is updateable via UpdateCommonProperties action</String>
</Annotation>
</NavigationProperty>

</EntityType>
Org.OData.Capabilities.V1.SortRestrictions
This annotation is available on an entity set. It specifies the properties of an entity set that you cannot use for sorting the entity set.
<Annotation Term="Org.OData.Capabilities.V1.SortRestrictions">
<Record>
<PropertyValue Property="NonSortableProperties">
<Collection>
<String>Property Name 1</String>
<String>Property Name 2</String>

</Collection>
</ PropertyValue>
</Record>
</Annotation>
PTC.NonSortable
This annotation is deprecated. Use the annotation Org.OData.Capabilities.V1.SortRestrictions instead. The properties marked as nonsortable are shown in the Org.OData.Capabilities.V1.SortRestrictions annotation.
PTC.Capability
This annotation is available on an entity type. It designates an entity type that implements a specific capability. In the following example, the annotation shows the Notifiable capability, which indicates that you can subscribe to the entity type and the instances of the entity type using webhooks.
<Annotation Term="PTC.Capability">
<String>Notifiable</String>
</Annotation>
PTC.ClassificationNameSpace
This annotation is available on a property of type PTC.ClassificationInfo. Clients can use the value from the annotation to specify the clfStructureNameSpace property while classifying a part.
<Annotation Term="PTC.ClassificationNameSpace">
<String>com.ptc.csm.default_clf_namespace</String>
</Annotation>