Main Content

digitalthread.uri.requirements.fromObject

R2026b

Get digital thread URI from Requirements Toolbox object

Since R2026b

    Description

    uri = digitalthread.uri.requirements.fromObject(storageMap,reqObj) returns the digital thread URI for the Requirements Toolbox™ object specified by reqObj.

    A digital thread URI is a stable identifier for an artifact, such as a requirement set file, or an artifact within that file, such as an individual requirement. The digital thread uses these URIs as a consistent way to refer to artifacts across tools and inside metric results.

    Use this function to find the digital thread URI for a specific Requirements Toolbox object. You can then use that URI as an identifier in your code to match and filter metric results for that specific object.

    If you need to convert from a digital thread URI to a Requirements Toolbox object, use the function digitalthread.uri.requirements.toObject.

    example

    Examples

    collapse all

    Suppose you want to analyze metric results for a specific Requirements Toolbox object, such as a requirement set.

    Create a storage map for the current project.

    storageMap = digitalthread.StorageMap.forProject();

    Get the Requirements Toolbox object of interest by using the Requirements Toolbox APIs. For example, this code gets a requirement set object.

    myReqObj = slreq.load("myReqs.slreqx")
    myReqObj = 
    
      ReqSet with properties:
    
                 Description: ''
                        Name: 'myReqs'
                    Filename: 'C:\MATLAB\myProject\myReqs.slreqx'
                        ...

    Find the digital thread URI for that Requirements Toolbox object.

    myURI = digitalthread.uri.requirements.fromObject(storageMap,myReqObj)
    myURI = 
    
        "mwdigitalthread://myProject/myReqs.slreqx"

    You can use this digital thread URI in your code to find metric results that apply to this specific Requirements Toolbox object.

    Input Arguments

    collapse all

    Storage map, specified as a digitalthread.StorageMap object.

    A storage map defines how digital thread URIs map to the actual artifact locations. The storage map determines which artifacts the digital thread can reference, trace, and associate with metric results.

    To create a storage map, use digitalthread.StorageMap.forProject.

    Example: digitalthread.StorageMap.forProject()

    Requirements Toolbox object, specified as either a:

    Output Arguments

    collapse all

    Digital thread URI that identifies the Requirements Toolbox object, returned as a string scalar.

    Use the URI as an identifier in your code to match and filter metric results for the specific requirements object.

    Note

    Do not manually parse or construct digital thread URIs. Use the digitalthread.uri APIs to work with digital thread URIs.

    The digital thread URI format is subject to change without notice.

    Example: "mwdigitalthread://myProject/myReqs.slreqx#addr=123-abc"

    Version History

    Introduced in R2026b