DNG v7.0.2: Unclear ID when adding a term link with OSLC API
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"><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>
<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: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!
Could anybody provide any link or simple explanation where it can be found.
Thank you very much in advance!
One answer
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:
(https://host:port/project/id, http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/com.ibm.team.workitem.linktype.resolvesworkitem.resolvedBy, https://host:port/project/id2)
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.