Main Content

setRDF

Set RDF content for local OSLC resource object

    Description

    example

    setRDF(resource,rdfContent)sets the XML/RDF data to the content specified byrdfContentfor the resource specified byresource. Use the有限公司mmitfunction to apply the change to the service provider. For more information, seeRDF classes and properties in OSLCon the Open Services for Lifecycle Collaboration (OSLC) website.

    Examples

    有限公司llapse all

    This example shows how to get and set the RDF content of an OSLC requirement resource with a configured OSLC client.

    After you have created and configured the OSLC clientmyClientas described inCreate and Configure an OSLC Client for the Requirements Management Domain, create a query capability for the requirement resource type.

    myQueryCapability = getQueryService(myClient);

    Submit a query request to the service provider for the available requirement resources.

    reqs = queryRequirements(myQueryCapability)
    reqs = 1×30 Requirement array with properties: ResourceUrl Dirty IsFetched Title Identifier

    Fetch the full resource properties for a single requirement resource. Inspect the title of the requirement.

    myReq = reqs(1); status = fetch(myReq,myClient)
    status = StatusCode enumeration OK
    title = myReq.Title
    title = 'My New Requirement'

    Get the locally stored RDF content of the requirement resource.

    rdfContent = getRDF (myReq)
    rdfContent = '  My New Requirement  '

    Copy and paste therdfContenttext into a new variablenewRDF. Edit the text contents for thedcterms:titleproperty toMy New Requirement (Edited).

    newRDF= ['...'standalone="no" ?>...'xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" '...'xmlns:dcterms="http://purl.org/dc/terms/" '...'xmlns:oslc="http://open-services.net/ns/core#" '...'xmlns:oslc_rm="http://open-services.net/ns/rm#">'...''...'My New Requirement (Edited)'...''...'']

    Set the RDF content of the requirement to the variablenewRDF. Inspect the requirement title.

    setRDF(myReq,newRDF); title = myReq.Title
    title = 'My New Requirement (Edited)'

    Commit the changes to the service provider.

    status = commit(newReq,myClient)
    status = StatusCode enumeration OK

    Input Arguments

    有限公司llapse all

    RDF data for OSLC resource, specified as a character vector.

    Version History

    Introduced in R2021a