It's all about the answers!

Ask a question

DNG v7.0.2: Unclear ID when adding a term link with OSLC API


Dmitry A. Lesin (23623481) | asked Oct 27 '21, 8:48 a.m.
edited Oct 27 '21, 8:50 a.m.

Hello everybody,
I'm trying to programmatically with OSLC add a link to some existing term in DNG module. I have sent GET request, modified the body of a resource, and finally trying to send PUT request as prescribed.
Partially, the content to PUT is like next:

...
  <rdf:Description rdf:nodeID="A2">
    <rdf:subject rdf:resource="https://win-olemig:9443/rm/resources/TX_Nh95cC_4EeyE757DKrVYXA" />
    <rdf:predicate rdf:resource="http://www.ibm.com/xmlns/rdm/types/Link" />
    <rdf:object rdf:resource="https://win-olemig:9443/rm/resources/TX_UfEzwCqNEeyX9sJ60m8STg" />
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" />
    <dcterms:title>85</dcterms:title>
  </rdf:Description>
...
    <jazz_rm:primaryText rdf:parseType="Literal">      <div xmlns="http://www.w3.org/1999/xhtml">        <p dir="ltr" id="_1634550900066">          If we want to make a term then          <a href="https://win-olemig:9443/rm/resources/TX_UfRoECqNEeyX9sJ60m8STg" id="_1634553234800">Business Recovery Matters</a>            can be most appropriate candidate. Term          <span title="Business Recovery Matters">            <a href="https://win-olemig:9443/rm/resources/TX_UfRoECqNEeyX9sJ60m8STg" id="_1634553246847">Business Recovery Matters</a>          </span>            can be met secondly, and much more times in the text as needed.        </p>        <p dir="ltr" id="_1634558606926">          And one more          <a href="https://win-olemig:9443/rm/resources/TX_UfRoECqNEeyX9sJ60m8STg" id="">Business Recovery Matters</a>          for testing!        </p>      </div>
    </jazz_rm:primaryText>
...
  <rdf:Description rdf:nodeID="A3">
    <rdf:subject rdf:resource="https://win-olemig:9443/rm/resources/TX_Nh95cC_4EeyE757DKrVYXA" />
    <rdf:predicate rdf:resource="http://www.ibm.com/xmlns/rdm/types/ArtifactTermReferenceLink" />
    <rdf:object rdf:resource="https://win-olemig:9443/rm/resources/TX_UfRoECqNEeyX9sJ60m8STg" />
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" />
    <dcterms:title>https://win-olemig:9443/rm/resources/TX_UfRoECqNEeyX9sJ60m8STg</dcterms:title>
  </rdf:Description>
Section rdf:nodeID="A3 was added by my solution. Now I'm getting an error that id is not defined in primary text for "Business Recovery Matters" where a link is to be created. The error is next:
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/">
  <rdf:Description>
    <err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >cvc-attribute.3: The value '' of attribute 'id' on element 'a' is not valid with respect to its type, 'ID'.,cvc-datatype-valid.1.2.1: '' is not a valid value for 'NCName'.</err:detailedMessage>
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Bad Request</err:errorMessage>
    <err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
    >400</err:errorStatus>
  </rdf:Description>
</rdf:RDF>
But honestly I don't have any understanding how to define that ID referring to my custom A3 section.
Could anybody provide any link or simple explanation where it can be found.
Thank you very much in advance!

One answer



permanent link
Jim Amsden (22837) | answered Oct 27 '21, 9:58 a.m.
edited Oct 27 '21, 9:59 a.m.

 When adding a relationship between artifacts, you only add the assertion for the relationship, you don't add the reified statements describing that assertion. So for example, say you did a GET for work item with URL https://host:port/project/id and you want to add a resolved by link to another work item. You would add the following triple:



The do the PUT to update the resource. When you do another GET on https://host:port/project/id, you will see the relationship you added, and the reified statements that describe it.


Comments
Dmitry A. Lesin commented Oct 29 '21, 4:40 a.m. | edited Oct 29 '21, 4:45 a.m.

Hi Jim,
Thank you for your answer. But my confusion is a bit another one. Sorry that I was not clear enough to explain my problem.|
I'm following in the way like you mentioned - making GET and sending the following PUT to update a resource.

But for me it's not clear one case. When I add term reference manually in primary text, I see that related link is displayed in Links section. When I remove this link in primary text, it will disappear in Links section.

But when I add it with OSLC, those links aren't bind. I must to remove it first in primary text and second in Links section.

Obviously, they are bind somehow in case of manual creation. Or no?

Bind links creating a term reference
I was thinking that ID in primary text's link is responsible for that binding. That's why I asked the question which I asked. But it seems that I was wrong, that ID is an own identifier only for a tag in primary text.
So if not ID then what is responsible for that behavior? Or ID is?

Your answer


Register or to post your answer.