It's all about the answers!

Ask a question

How to fetch the type of the artifact or module in DNG


G C (4911) | asked Nov 05 '23, 11:42 p.m.

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Nov 06 '23, 5:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

When you GET the artifact in a configuration (with headers OSLC-Core-Version: 2.0 and Accept: application/rdf+xml), its 'type' is in the RDF in the oslc:instanceShape tag, e.g.


<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:acp="http://jazz.net/ns/acp#" xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:jazz_rm="http://jazz.net/ns/rm#" xmlns:acc="http://open-services.net/ns/core/acc#" xmlns:process="http://jazz.net/ns/process#" xmlns:rm_property="https://jazz.ibm.com:9443/rm/types/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oslc="http://open-services.net/ns/core#" xmlns:nav="http://jazz.net/ns/rm/navigation#" xmlns:oslc_config="http://open-services.net/ns/config#" xmlns:oslc_rm="http://open-services.net/ns/rm#" xmlns:dng_task="http://jazz.net/ns/rm/dng/task#" xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" xmlns:oslc_auto="http://open-services.net/ns/auto#"> 
    <dcterms:description rdf:parseType="Literal"/>
    <dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
    <jazz_rm:primaryText rdf:parseType="Literal"><div xmlns="http://www.w3.org/1999/xhtml">
<p id="_1389358019520"> Interface identification and diagrams</p>
</div></jazz_rm:primaryText>
    <dcterms:contributor rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
    <rdf:type rdf:resource="http://jazz.net/ns/rm#Text"/>
    <rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
    <dcterms:title rdf:parseType="Literal">Interface identification and diagrams</dcterms:title>
    <oslc:instanceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OT_tx4kl1EhEe2d5dG-54qhbg"/>
  </rdf:Description>
</rdf:RDF>

To get the name of the type (shape) you GET its URL and use its top-level dcterms:title, for example.

    ....
    <dcterms:title rdf:parseType="Literal">Heading</dcterms:title>
    ....
  </oslc:ResourceShape>
</rdf:RDF>

G C selected this answer as the correct answer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.