It's all about the answers!

Ask a question

DNG OSLC : How to get module information in a project area


Param S (2711) | asked Feb 09 '20, 9:20 a.m.

Q. Is there a way to get module name and URI for all modules of a given project area in DNG in a single OSLC / REST request? Or is a combination of two more requests required? 


I have been trying but I have not found a concise way for this. Please help if it is known how to do so.

Accepted answer


permanent link
Davyd Norris (2.9k217) | answered Feb 09 '20, 5:43 p.m.
You would almost be better off using the RM Reportable REST API, which is what tools like Publishing Engine use.

You could in theory do it in one OSLC query, but that would assume you have already queried the OSLC Root Services document, found the project's services.xml and then located the core Query Capability URL for the project.

Once you have that, you could use something like:
https://<<YOUR SERVER>>/rm/views?oslc.query=true&projectURL=https%3A%2F%2F<<YOUR SERVER>>%2Frm%2Fprocess%2Fproject-areas%2F_n7uBUA6zEeeRveGgsFyhmA&oslc.prefix=rm=<http://www.ibm.com/xmlns/rdm/rdf/>&oslc.select=*&oslc.where=rm:ofType in [<https://<<YOUR SERVER>>/rm/types/_SAwm2t5jEeGb6IIbvOh9Dw>,<https://<<YOUR SERVER>>/rm/types/_0zVeYIV4EeiC2dwB1IQqlw>]

where the first part of the URL is the queryCapability root as identified in your services document for the project, and the last part is the list of module artefact types in your project.

With the Reportable REST API, it's just:
https://<<YOUR SERVER>>/rm/publish/modules?projectName=Your%20Project%20Name

Param S selected this answer as the correct answer

Comments
Param S commented Feb 11 '20, 1:11 a.m.

Thank you Davyd. I was able to get the concise information on the modules using this OSLC query.  

One other answer



permanent link
Param S (2711) | answered Feb 10 '20, 8:34 a.m.

Well I tried to do the following with the headers as

OSLC-Core-Version: 2.0
Accept: application/rdf+xml

Step 1. GET Request: Queried on all types of artifacts

https://<server.com>/rm/types?private=true&accept=*&resourceContext=_rc9vAObpEeaBBt3B0lEw&&oslc_config.context=https://<server.com>/rm/cm/stream/_rloi0ObpEeaBBt3W0lEw

Response:
<rdf:RDF
    xmlns:rmWorkflow="http://www.ibm.com/xmlns/rdm/workflow/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:xs="http://schema.w3.org/xs/"
...
<rm:ObjectType rdf:about="https://<server.com>/rm/types/_C6ut0c1tEeisjbv2RYhTrQ">
    <rm:hasSystemAttribute rdf:resource="https://<server.com>/rm/types/_r1CQwebpEeaBBt3WBB0lEw"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_r2bX4ebpEeaBBt3WBB0lEw"/>
    <dcterms:description></dcterms:description>
    <rm:hasSystemAttribute rdf:resource="https://<server.com>/rm/types/_r2LgQebpEeaBBt3WBB0lEw"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_sBGW0ebpEeaBBt3WBB0lEw"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_QW1J4Jj9Eem3j-DfUE3PzQ"/>
    <owl:sameAs rdf:resource="http://www.fca.com/dng/types/Module"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_ssuGsebpEeaBBt3WBB0lEw"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_r1mRcebpEeaBBt3WBB0lEw"/>
    <dcterms:created>2018-10-11T15:48:06.587Z</dcterms:created>
    <dcterms:modified>2019-06-28T12:43:58.339Z</dcterms:modified>
    <rm:hasSystemAttribute rdf:resource="https://<server.com>/rm/types/_r1TWgebpEeaBBt3WBB0lEw"/>
    <rm:attributeOrdering>https://<server.com>/rm/types/_ssuGsebpEeaBBt3WBB0lEw,https://<server.com>/rm/types/_QW1J4Jj9Eem3j-DfUE3PzQ</rm:attributeOrdering>
    <rm:defaultFormat rdf:resource="https://<server.com>/rm/types/_rwfvAebpEeaBBt3WBB0lEw#Module"/>
    <rm:hasAttribute rdf:resource="https://<server.com>/rm/types/_r0W7UebpEeaBBt3WBB0lEw"/>
    <rm:hasSystemAttribute rdf:resource="https://<server.com>/rm/types/_r15MYebpEeaBBt3WBB0lEw"/>
    <dcterms:title>Module</dcterms:title>
    <rm:preferredModuleContent rdf:parseType="Resource">
      <rm:preferredArtifactTypes>
        <rdf:Seq>
          <rdf:li rdf:resource="https://<server.com>/rm/types/_tIZWEebpEeaBBt3WBB0lEw"/>
          <rdf:li rdf:resource="https://<server.com>/rm/types/_tKlHYebpEeaBBt3WBB0lEw"/>
        </rdf:Seq>
      </rm:preferredArtifactTypes>
    </rm:preferredModuleContent>
    <rm:inCreationMenu>true</rm:inCreationMenu>
    <rm:actionId>1085706482-_rlOTIObpEeaBBt3WBB0lEw</rm:actionId>
    <rm:hasSystemAttribute rdf:resource="https://<server.com>/rm/types/_r0zAMebpEeaBBt3WBB0lEw"/>
  </rm:ObjectType>
  ...
  </rdf:RDF>

Result: Used rdf:about URI for rm:ObjectType where dcterms:title is Module

Step 2. GETRequest Tried to get title and identifier of all artifacts of type Module for a oslc configuration for a project URL:


Response: Result: I got only resource URIs...
<rdf:RDF xmlns:jazz_rm="http://jazz.net/ns/rm#"
    xmlns:oslc_rm="http://open-services.net/ns/rm#"
    xmlns:dcterms="http://purl.org/dc/terms/"
>
    <oslc:ResponseInfo rdf:about="https://<server.com>/rm/views?oslc.query=true&amp;projectURL=https%3A%2F%2F<server.com>%2Frm%2Fprocess%2Fproject-areas%2F_rc9vAObpEeaBBt3WBB0lEw&amp;oslc.prefix=rmTypes%3D%3Chttp%3A%2F%2Fwww.ibm.com%2Fxmlns%2Frdm%2Ftypes%2F%3E&amp;oslc.prefix=shape%3D%3Chttp%3A%2F%2Fopen-services.net%2Fns%2Fcore">
        <dcterms:title>Query Results: 22843</dcterms:title>
    </oslc:ResponseInfo>
    <rdf:Description rdf:about="https://<server.com>/rm/views?oslc.query=true&amp;projectURL=https%3A%2F%2F<server.com>%2Frm%2Fprocess%2Fproject-areas%2F_rc9vAObpEeaBBt3WBB0lEw">
        <rdfs:member>
            <oslc_rm:Requirement rdf:about="https://<server.com>/rm/resources/_b252c179f6494ec6a0acd42ccdaafa">
            </oslc_rm:Requirement>
        </rdfs:member>
        <rdfs:member>
            <oslc_rm:RequirementCollection rdf:about="https://<server.com>/rm/resources/_VzJjkecNeaBBt3WBB0lEw">
            </oslc_rm:RequirementCollection>
        </rdfs:member>
        <rdfs:member>
...
</rdfs:member>
    </rdf:Description>
</rdf:RDF>

Problem that exists: I expected module artifact details but I got links to URIs. Is there another way to get the module artifact details?

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.