Publisher and Web Interface > Web Interface > Web Interface REST service > Requesting resources through the REST service > Requesting the items that are linked to the model or an item (Web Interface REST service)
  
Requesting the items that are linked to the model or an item (Web Interface REST service)
Modeler uses named association types (named roles) to link items in a model. For example, when a Stereotype is applied Class, the Class is linked to that Attribute through the Stereotype association type.
The RoleDescriptors request returns resource URIs for the association types of the model or an item. You can then use a returned URI for an association type to return the resource URIs of the items that are linked through that association type.
* 
The Help topics for the Modeler Automated Interface provide information about what association types are available for the model and each item type
Request
The syntax of the URI for a RoleDescriptors request is as follows. This request returns resource URIs for the association types (named roles) that are available for the model or an item.
For the model:
<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/RoleDescriptors
For an item:<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/Item/<item id>/RoleDescriptors
The syntax of a resource URI for an association type (named role) is as follows. The request returns URIs for the items that are linked through an association type.
For the model: <Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<versionRole/<association type>/
For an item:<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/Item/<item id>/Role/<association type>
Where:
<Web Interface website> - is the URI for the Web Interface website.
<server name> - is the name of the server.
If the server name contains reserved characters, those characters must be percent encoded in the URI. Use the Servers operation request to return the URI safe version of the server name.
<repository name> - is the name of the database.
If the database name contains reserved characters, those characters must be percent encoded in the URI. Use the Repositories operation request to return the URI safe version of the database name.
<model name> - is the name of the model.
If the model name contains reserved characters, those characters must be percent encoded in the URI. Use the Models operation request to return the URI safe version of the model name.
Note that the REST service cannot work with Models that have the percentage character (%) in their names.
<version> - is the version number of the model, as it appears in Model Explorer.
<item id> - is the id of the Modeler item, against which the RoleDescriptors or Role operation is being run.
You can find out the ids of items through operation requests such as ChildItems operation request.
<association type> is the name of the association type for which linked items are being returned.
If the association type name contains spaces, those spaces must be percent encoded in the URI (%20 for a space). Use the RoleDescriptors operation request to return the URI safe versions of the association type names.
Returned XML
The RoleDescriptors request returns a URI for each association type (named role) of the model or an item.
The syntax of a returned URI is as follows.
For the model:<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/Role/<association type>
For an item:<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/Item/<item id>Role/<association type>
When you use the preceding URI for an association type, the REST service returns a resource URI for each item that is linked to the <item id> item through the association type link.
The syntax of a returned URI is as follows.
<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>/ModelVersions/<version/Item/<item id>
Example
In this example, Class1 (e475d03c-9ed2-45b8-b943-e08d3892651b) is Stereotyped by Stereotype1.
The following RoleDescriptors request returns a URI for each association type (named roles) that is available for Class1.
https://localhost:57850/ModelerService/Servers/Server101/Repository/Example1/Models/Model1/ModelVersions/0/Item/e475d03c-9ed2-45b8-b943-e08d3892651b/RoleDescriptors
The returned XML is as follows (not all the returned code is shown). You can see that there is a URI for the Applied Stereotypes association type. The WebInterfaceLink opens the item in the Web Interface Website.
<?xml version="1.0"?
ArrayOfRoleDescriptor xmlns:i="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://schemas.datacontract.org/2004/07/StudioRESTService.ModelerRESTService">
...
<RoleDescriptor>

<RequestResult>Complete</RequestResult
<RequestResultType>Resource</RequestResultType>
<ID/<
<Name>Applied Stereotypes</Name<
<ResourceType>Role Descriptor</ResourceType
</URIs>
<URI>
<href>https://localhost:57850/ModelerService/Servers/Server101/Repositories/Examples/Models/Model1/ModelVersions/0/Item/e475d03c-9ed2-45b8-b943-e08d3892651b/Role/Applied%20Stereotypes</href
</URI
</URIs
</RoleDescriptor>
...
</ArrayOfRoleDescriptor>
The resource URI from the preceding XML returns a URI for each Stereotype item that is applied to Class1 (e475d03c-9ed2-45b8-b943-e08d3892651b).https://localhost:57850/ModelerService/Servers/Server101/Repositories/Examples/Models/Model1/ModelVersions/0/Item/e475d03c-9ed2-45b8-b943-e08d3892651b/Role/Applied%20Stereotypes
The returned XML is as follows. You can see that there is only one Stereotype applied to Class1, that is, Stereotype1 (a2b9efc2-3cee-46a8-ad31-c38c44043c4c).
http://www.w3.org/2001/XMLSchema-instance<ArrayOfModelItem xmlns:i=" xmlns="http://schemas.datacontract.org/2004/07/StudioRESTService.ModelerRESTService".<ModelItem
<RequestResult>Complete</RequestResult
<RequestResultType>/Resource</RequestResultType
<ID>a2b9efc2-3cee-46a8-ad31-c38c44043c4c</ID
<Name>Stereotype1</Name
<ResourceType>Stereotype</ResourceType
<URIs
<URI
<href>https://localhost:57850/ModelerService/Servers/Server101/Repositories/Examples/Models/Model1/ModelVersions/0/Item/a2b9efc2-3cee-46a8-ad31-c38c44043c4c</href>
</URI>
</URIs>
<Ip/>
<StyleIcon>false</StyleIcon
<Tg/>
<Ty/>
<WebInterfaceLink/>
</ModelItem>
</ArrayOfModelItem>