getRDF
Description
returns the locally stored RDF/XML data for the resource specified by
rdfContent
= getRDF(resource
)resource
. For more information, see RDF classes and properties in OSLC on the Open Services for Lifecycle
Collaboration (OSLC) website.
Examples
Get and Set RDF Content for Requirement Resource
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 client myClient
as described
in Create 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 = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?><rdf:RDF 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#"> <oslc_rm:Requirement> <dcterms:title>My New Requirement</dcterms:title><oslc:instanceShape rdf:resource="https://example.com/shapes/oslc-requirement-version1"/> </oslc_rm:Requirement> </rdf:RDF>'
Copy and paste the rdfContent
text into a new variable newRDF
. Edit the text contents for the dcterms:title
property to My New Requirement (Edited)
.
newRDF = ['<?xml version="1.0" encoding="UTF-8" ' ... 'standalone="no" ?><rdf:RDF ' ... '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#">' ... '<oslc_rm:Requirement><dcterms:title>' ... 'My New Requirement (Edited)</dcterms:title>' ... '<oslc:instanceShape rdf:resource=' ... '"https://example.com/shapes/oslc-requirement-version1"/>' ... '</oslc_rm:Requirement></rdf:RDF>']
Set the RDF content of the requirement to the variable newRDF
. 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
resource
— OSLC resource
oslc.rm.Requirement
object | oslc.rm.RequirementCollection
object | oslc.cm.ChangeRequest
object | ...
OSLC resource, specified as one of these objects:
Output Arguments
rdfContent
— RDF resource data
character vector
RDF data for the OSLC resource, returned as a character vector.
Version History
Introduced in R2021a
See Also
oslc.Client
| oslc.rm.Requirement
| oslc.rm.RequirementCollection
| oslc.cm.ChangeRequest
| oslc.qm.TestCase
| oslc.qm.TestExecutionRecord
| oslc.qm.TestPlan
| oslc.qm.TestResult
| oslc.qm.TestScript
| setRDF
External Websites
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)