It's all about the answers!

Ask a question

How can I get only part of artifact data

Oded Mozesh (52518) | asked Apr 04 '18, 3:06 p.m.


I need to get all DNG project artifacts.
I use the query:

But as my project include hundreds of modules and hundreds of thousands of artifacts the result is to big.

I would like to get all the artifacts links.

How can I get from each artifact only the <rrm:about> & <rrm:identifier> fields and its links?
I tried to add &linksonly=true but still got huge result.
(I need, at least, the GUID of all of the artifacts in the projects in as short as possible result).

The data I get is as below (This is only ONE artifact...)
I would like to filter (see inline in bold):
<ds:artifact attribute:itemId="_093d6388940f4b0cafc0a5dd7225efb3">
<rrm:title attribute:itemId="_KGfOcTZSEeiFD6SH9VyEqA">The use case begins when the JKE website is accessed.</rrm:title>
<rrm:description attribute:itemId="_KHes8TZSEeiFD6SH9VyEqA"/>
<rrm:identifier attribute:itemId="_KGUPUTZSEeiFD6SH9VyEqA">125</rrm:identifier>
<rrm:format attribute:itemId="_KHIHoTZSEeiFD6SH9VyEqA">Text</rrm:format>
<rrm:creator attribute:itemId="_KGnxUTZSEeiFD6SH9VyEqA">
<rrm:created attribute:itemId="_KHsIUTZSEeiFD6SH9VyEqA">2018-04-02T08:45:53.173+0000</rrm:created>
<rrm:modified attribute:itemId="_KGICETZSEeiFD6SH9VyEqA">2018-04-02T08:45:53.173+0000</rrm:modified>
<attribute:objectType attribute:itemId="_MJjSYTZSEeiFD6SH9VyEqA" attribute:name="Use Case Requirement" attribute:projectAreaItemId="_J5qTYDZSEeiFD6SH9VyEqA" attribute:projectAreaName="JKE Banking (Requirements Management)">
<attribute:customAttribute attribute:datatype="" attribute:isEnumeration="true" attribute:isMultiValued="false" attribute:itemId="_L6bRQTZSEeiFD6SH9VyEqA" attribute:literalId="_LttD4TZSEeiFD6SH9VyEqA#dd84ed1c-9786-469b-85a2-517388d6a09b" attribute:literalName="Approved" attribute:name="Status" attribute:value="2"/>
<attribute:customAttribute attribute:datatype="" attribute:isMultiValued="false" attribute:itemId="_KGUPUTZSEeiFD6SH9VyEqA" attribute:name="Identifier" attribute:value="125" attribute:valueTS=""/>
<attribute:customAttribute attribute:datatype="" attribute:isEnumeration="true" attribute:isMultiValued="false" attribute:itemId="_L4_G1jZSEeiFD6SH9VyEqA" attribute:literalId="_LunC0TZSEeiFD6SH9VyEqA#ac6775bd-d6c7-4ed5-8358-4dd199a6f9d1" attribute:literalName="Basic Flow" attribute:name="Use Case Property" attribute:value="2"/>
<rrm:title>JKE Banking (Requirements Management)</rrm:title>
<rrm:description>The purpose of this project is to specify and manage the requirements of the JKE Business Recovery Matters project.</rrm:description>
<rrm:title>The use case begins when the JKE website is accessed.</rrm:title>
<rrm:moduleDisplayName>2: Open an account (Module Example)</rrm:moduleDisplayName>
<ds:Link type="Link">
<rrm:title>A registered user will provide their secure profile content to access account information including the login and password.</rrm:title>
<ds:artifactFormat>Use Case Requirement</ds:artifactFormat>


One answer

permanent link
Donald Nong (14.5k414) | answered Apr 05 '18, 12:12 a.m.

It appears that you are using DNG reportable REST API but "publish" is missing in your sample URL. If it is indeed the case, I am afraid you cannot do field selection (limit the attributes in the output). You'd better use pagination to ease the load on both the client and the server.

BTW, getting all the artifacts is never a good idea.

Oded Mozesh commented Apr 08 '18, 5:12 a.m. | edited Apr 09 '18, 3:00 a.m.
Is it possible to use paging in query of the format:

I also need to get all the base artifacts (i.e. all the artifacts with <nav:parent rdf:resource=....>;)
but if I add to the ",dcterms:identifier" the selection of "nav:parent", it fails...

Donald Nong commented Apr 09 '18, 3:06 a.m.

You need to be very careful with what API you are using because you can do different things with different APIs. If you want to get artifacts by folders, you need to use the folder query feature. As far as I know, you need to start from the root folder (you can find its URL in the services document). I have never tried pagination or field selection with the folder query though.

Your answer

Register or to post your answer.