Set up a matrix report to display the relationships between
two sets of results, for example, between a set of test cases and
a set of work items.
About this task
Define a matrix report by selecting one or two queries.
Artifacts that are found by these queries populate the column and
row headers. Define one or more relationships between those artifacts
to populate the cells.
Procedure
- In the main menu, click , select one or two queries, and then click the Generate
Matrix icon on the upper right.
- In the first Generate Matrix dialog
box, set the query to populate Row and another
to populate Column. Depending on how many queries
you chose, you might set Row and Column to
the same query or different queries.
- Select the artifacts to be shown for the rows and columns
in the matrix by using the Label list boxes.
For example, in step 2 if you specified the query Work
Items tested by Test Cases, you can choose the row label
of Work Items and the column label of Test
Cases.
The matrix report populates the rows
and columns with indexed artifacts from the query results. You cannot
choose query results that include literals or non-indexed artifacts
to be rows or columns.
You can use the format syntax in the
SPARQL query to change the labels that display in the Label list
boxes. Several of the queries in the Shared Queries Sample folder
use format syntax. For example, Work Items tested by Test
Cases includes the following format syntax:
#!Label Work Item
#!Label Status
#!Label Test Cases
#!Format ?{cm_uri:link:?cm_shortTitle ?cm_title}
#!Format ?{status}
#!Format ?{qm_uri:link:?qm_title}
In the example, Label shows
the human readable name that displays in the matrix report. Label maps
to the Name field in the Add Relationship table. Format shows
the SPARQL variable name.
- In the second Generate Matrix dialog,
define the relationships between the row and column that you want
to display. Click Add Relationship and choose
a relationship in the Select Relationship table.
If an appropriate relationship does not display, click the Add icon
to open the Add Relationship table. You can
use the Append Predefined Link Type table to
add a link type, such as oslc_cm:implementedByTestCase.
For Work Items tested by Test Cases,
you could select a relationship of oslc_cm:relatedChangeRequest and oslc_cm:testedByTestCase to
build a valid matrix report.
- You can show multiple relationships in the same report.
If you do, you can set individual symbols to show that a relationship
exists. You might leave one symbol as the default X, while you change
the other to an asterisk *. Any multiple relationships show both symbols
in the same cell.
- After you set the relationships, your report might look
like this example.

The
Xs in the report show where a relationship exists between artifacts.
Note: Because
many links have specific directional meanings, you can use a matrix
report to show that a relationship in an expected direction is missing
or present. Therefore, rows and columns are not always interchangeable.
The matrix report shows the presence of the given path from the row
to the column.
In the example report above, the matrix was set
up to show <workitem> oslc_cm:implementedByTestCase <testcase>,
where <workitem> was the row and <testcase> was
the column. If the rows and columns were switched, the matrix report
would probably show that no relationships were found and would display
without any Xs. If the matrix report returned Xs, then you would have
found a problem.
If you wanted the report to show a bidirectional
relationship, you could set it up in the Add Relationship table
as follows: oslc_cm:implementedByTestCase|ˆoslc_cm:implementedByTestCase.
The bar indicates "or" and the caret indicates "search backwards."
- To view the matrix report, click OK in
the Opening matrix.csv window. If you want to
save the file, click Save File and then click OK.