DNG OSLC : How to get module information in a project area
Accepted answer
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
One other answer
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:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:jfs="http://jazz.net/xmlns/foundation/1.0/"
xmlns:h="http://www.w3.org/TR/REC-html40"
xmlns:xs="http://schema.w3.org/xs/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:rmTypes="http://www.ibm.com/xmlns/rdm/types/">
...
<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:
https://<server.com>/rm/views?oslc.query=true&projectURL=https://<server.com>/rm/process/project-areas/_rc9vAObpEeaBBtWBB0lE&oslc.prefix=rmTypes=<http://www.ibm.com/xmlns/rdm/types/>&oslc.prefix=shape=<http://open-services.net/ns/core#>&oslc.where=rmTypes:ArtifactFormat=<http://jazz.net/ns/rm#Module>&oslc.where=shape:instanceShape=<https://<server.com>/rm/types/_C6utc1tEeisjbv2RYhTrQ>&oslc_config.context=https://<server.com>/rm/cm/stream/_rloi0ObpEeaBBt3WBB0lE
Response: Result: I got only resource URIs...
<rdf:RDF xmlns:jazz_rm="http://jazz.net/ns/rm#"
xmlns:nav="http://jazz.net/ns/rm/navigation#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>
<oslc:ResponseInfo rdf:about="https://<server.com>/rm/views?oslc.query=true&projectURL=https%3A%2F%2F<server.com>%2Frm%2Fprocess%2Fproject-areas%2F_rc9vAObpEeaBBt3WBB0lEw&oslc.prefix=rmTypes%3D%3Chttp%3A%2F%2Fwww.ibm.com%2Fxmlns%2Frdm%2Ftypes%2F%3E&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&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?