It's all about the answers!

Ask a question

Why can't I see oslc links added to a requirement through the api on a view?


Matthew Bradshaw (51315) | asked Jul 20 '15, 11:41 a.m.
I have written some Java code to add links to requirements artifacts that already exist in the project.  The links are created internally which I understand didn't work before but looks to have been added as an enhancement for version 5.  I am on 502

The code works successfully to add a "Elaborates/Elaborated By Link"  between requirement types x & y.

The code updates the xml for req x.

I can see this in the tool when I open up req x, I see a "Elaborates" link to req y.  I open req y and can see req x linked using "Elaborated By".   So the directional link is working.

I set up a view to show req x with a column for "elaborates" and req y is shown with the id and title of the requirement so all appears well.  When I set up a view for req y with a "Elaborated By" column, nothing appears in the column.

It's strange as it appears when req y is opened.

The other odd thing I can now see is that there are two link types for "Elaborates/Elaborated By".  i.e. I have two choices for "Elaborates" if trying to apply a filter to requirements.   I can also see this in the "Link Types" page in the project properties.

Is this even possible?  Do I need to add the reverse link to get it to work?



3 answers



permanent link
Jean-Luc Johnson (8125) | answered Jul 21 '15, 3:15 a.m.
Hi Matthew,
The behaviour you described here looks normal. RDNG does not create bidirectional links. However, when you navigate to either x or y requirement URL you see the relationship to each other. This is possible because RDNG queries on the fly all the service providers associated a given project in order to fetch and show all the links in the links widgets.
For exemple,  you could try with Design Manager. Make few links to a requirement. Then fetch the RDF representation of this requirement using a REST plugin (I use POSTER with Firefox or Chrome). You will NOT see the link to the Model element in RDM despite this link is displayed in an Internet browser.
I hope it helps.

Best regards,
JLJ


Comments
Matthew Bradshaw commented Jul 29 '15, 5:00 a.m.

I need this to link between specific requirement artifacts e.g. Business requirement and a funcitonal requirement. 

I tried adding the bidirectional link and the same issue persisted so I can't see the reverse link in the view.


permanent link
Gabriel Ruelas (1.1k13) | answered Jul 20 '15, 11:46 a.m.
Hi,   You do not have to add the reverse link for RDNG ( RM) defined links ( that is only needed for cross app links like ValidatedBy ).
Having two link types with same ( or similar names is odd ) try by adding both link types in the grid and verify that your link appears.

Best Regards.

Comments
Matthew Bradshaw commented Jul 29 '15, 4:39 a.m.

Even though I am just adding the elaborates link from x to y, I can see elaborated by (the opposite link) from y to x if I open the artifact.  I cannot see this however on the view I have set up?  Is this what you would expect to happen?

http://open-services.net/bin/view/Main/RmSpecificationV2

Which link types from the list on the link above are best for adding programmatically to internal rm artifacts.  I can work with any just need to be consistent?


permanent link
Donald Nong (14.5k614) | answered Jul 21 '15, 2:13 a.m.
I can see the same behavior and I believe this is due to the choice of link type. The "Elaborates / Elaborated By" is a standard OSLC one, and should be used in integration between RDNG and Focal Point only. OSLC links are considered "external" if I'm not mistaken, and should be recorded in the affected RNDG artifacts regardless the link direction. By saying that, it appears that you need to put the link of the opposite direction in "req y". But...RNDG should normally have one direction of OSLC links only. For example, if an RDNG requirement has an "Elaborates" link to a Focal Point artifact, the "Elaborated By" link is in Focal Point, not RDNG. I don't know whether there are any ill effects if you put both direction of the OSLC links in RDNG.
For "internal" links (for example those in the namespace http://www.ibm.com/xmlns/rdm/types/), only one direction is recorded in the artifacts.
My advice would be avoid using the links this way.

Comments
Matthew Bradshaw commented Jul 22 '15, 8:48 a.m.

Even though I am just adding the elaborates link from x to y, I can see elaborated by (the opposite link) from y to x if I open the artifact.  I cannot see this however on the view I have set up?  Is this what you would expect to happen?

http://open-services.net/bin/view/Main/RmSpecificationV2

Which link types from the list on the link above are best for adding programmatically to internal rm artifacts.  I can work with any just need to be consistent?


Donald Nong commented Aug 02 '15, 8:46 p.m.

On second thought, I believe the behavior is by design and probably for performance consideration, regardless what link type you choose. When you add a bidirectional link to an artifact, a property with the link type is added to the "subject/source" artifact, and a separate link relationship "subject-predicate-object" is also recorded. When you open the "object/target" artifact, the link relationship is queried, and all links, whether the current artifact is the subject or the object, are shown. In a view, I believe the link relationship is not queried, as it can be done only in a one-by-one way, and will be very slow. I believe only the "property" part is read and displayed.
If you think the behavior should be changed, an RFE is probably the best way.

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.