It's all about the answers!

Ask a question

Counting the Number of Folders present in a project area in RRC


Yash Doshi (11512) | asked Jun 11 '14, 12:23 a.m.

Hi,

I just wanted to check if there is any easier way to count the number of folders present in a project area in RRC rather than manual counting.

We are doing a performance benchmarking for a patch recently received from IBM support where only 100 folders are visible in the Project Area. If there are more than 100 folders, the folders disappear. Post applying this patch, we are not seeing the problem. However, we want to give out a number (of folders) for project areas in production environments.


Comments
long TRUONG commented Jun 13 '14, 6:00 p.m.

 Hi Yash,


Just submitted a question asking for this very patch. Would you mind give us enough infos to get the patch, you mentioned applying to cure the over 100 folders disappearance, from IBM.

Thanks in advance Yash.


long TRUONG commented Jun 13 '14, 9:33 p.m.

 Don Yang gave me the infos: Hotfix request 274074: Missing subfolders defect 71478 for v4.0.3 RRC


Will be submitting a PMR foor it. Thx regardless.


Yash Doshi commented Jun 18 '14, 7:15 a.m.

Yes. PMR will be the way to go. Support should be able to find this patch in their system and provide it to you.

2 answers



permanent link
Benjamin Silverman (4.1k610) | answered Jun 11 '14, 1:47 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can also use the SPARQL query below to count the number of folders in a given RM project area.  The steps for accessing the SPARQL Query editor vary between 4.x and 5.0.

4.x:  Go to http{s}://<server>:<port>/rm/rmadin -> Advanced Properties -> set com.ibm.rdm.fronting.server.debug.enabled to "true" and click "Update Property" to set the value

Then go back to rm/rmadmin -> SPARQL Query

5.0:  Go to http{s}://<server>:<port>/rm/admin -> Debug -> SPARQL Query

Enter the query below, making sure to change the server URL to match your server URL.

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rm: <http://www.ibm.com/xmlns/rdm/rdf/>
PREFIX nav: <http://com.ibm.rdm/navigation#>
PREFIX jfs: <http://jazz.net/xmlns/foundation/1.0/>
SELECT ?Folder
WHERE {
    ?Folder dc:isPartOf <https://<server>:<port>/rm/folders> .
}
LIMIT 1

Just select the "pre-count" option and select your project from the dropdown, and run the query.  Your result will be the count of folders in the project you selected.

In the screenshot below, I've run the query against a project with 5 folders (well really 6, because of the root folder), so the result returned from the query is 6.  Hope it helps,



Comments
Benjamin Silverman commented Jun 11 '14, 1:49 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

My query was formatted poorly by the forum, so please refer to the screenshot attached for the appropriate query to run.


Yash Doshi commented Jun 18 '14, 7:13 a.m.

Thanks Benjamin...let me try this and get back to you with my results.


Yash Doshi commented Jun 19 '14, 4:22 a.m.

Benjamin,

I tried to run the below query on my server. However, the query is not returning any results. I am not sure why.

QUERY:
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rm: <http://www.ibm.com/xmlns/rdm/rdf/>
PREFIX nav: <http://com.ibm.rdm/navigation#>
PREFIX jfs: <http://jazz.net/xmlns/foundation/1.0/>

SELECT ?Folder
WHERE {
    ?Folder dc:isPartOf <https://wegsfes19803ptclm2.accenture.com:443/rm/folders> .
}


Benjamin Silverman commented Jun 19 '14, 9:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The query looks right.  Did you add the LIMIT 1 and check the pre-count option to return the total?  Or did you get an error?


Yash Doshi commented Jun 20 '14, 12:12 a.m.

Hi Benjamin,

Yes I did and did check the precount option to return the total. When I run the query, it runs into a page not found.


Mike Jaworski commented Jun 20 '14, 10:14 a.m.
JAZZ DEVELOPER

Is the server you're running the query against server-renamed? if so, you may need to include the pre-rename URL as the [host] in the dc:isPartOf statement of the query.


Yash Doshi commented Jun 23 '14, 4:08 a.m.

Hi Michael,

No the server is not server-renamed.

showing 5 of 7 show 2 more comments

permanent link
Brian Fleming (1.6k11928) | answered Jun 11 '14, 10:31 a.m.
Hi Yash

I think writing a utility to query the folder structure via OSLC, and count the number of folders, will be the fastest way.  Follow the samples from https://jazz.net/library/article/1197 (search for Exploring the project folder structure by using the folder query capability). 

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.