Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Error [... is not a literal node]: Modyfing artifact properties when artifact has "link to"

Hello Community, I have following Issue:


Problem description
I am able to modify the the attributes of an artifact without any issues as long as the attribute hasn't any link to a requirement. When the attribute has a link to an requirement following error occurs:

I linked the Evidence --> a requirement.
Used Programming language: C# VS
API: OSLC-Core-Version=2.0

Code

//Request: Get Artifact

                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(milestones.EvidenceResource);
                    request = createRequest(request, context);
                    IWebProxy proxy = WebRequest.DefaultWebProxy;
                    // Uri proxyUri = proxy.GetProxy(request.RequestUri);
                    bool isBypassed = proxy.IsBypassed(request.RequestUri);
                    if (!isBypassed)
                        proxy.Credentials = context.ProxyCredential;
                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                    var reader = new StreamReader(response.GetResponseStream());
                    var etag = response.Headers.Get("ETag");
                    var Replace = reader.ReadToEnd();

**Response I get [WHEN Artefact has a link to a requirement:]
[Received Body --> and I send the same body PUT without any modification]

<rdf:RDF

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

    xmlns:acp="http://jazz.net/ns/acp#"

    xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/"

    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"

    xmlns:jazz_rm="http://jazz.net/ns/rm#"

    xmlns:rm_property="https://jazz.XXX.com/rm/types/"

    xmlns:acc="http://open-services.net/ns/core/acc#"

    xmlns:process="http://jazz.net/ns/process#"

    xmlns:dcterms="http://purl.org/dc/terms/"

    xmlns:dc="http://purl.org/dc/elements/1.1/"

    xmlns:oslc="http://open-services.net/ns/core#"

    xmlns:nav="http://jazz.net/ns/rm/navigation#"

    xmlns:oslc_config="http://open-services.net/ns/config#"

    xmlns:oslc_rm="http://open-services.net/ns/rm#"

    xmlns:dng_task="http://jazz.net/ns/rm/dng/task#"

    xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"

    xmlns:oslc_auto="http://open-services.net/ns/auto#" > 

  <rdf:Description rdf:nodeID="A0">

    <rdf:subject rdf:resource="https://jazz.XXX.com/rm/resources/MD_lqu3QY14EeucUNeS-GXy8w"/>

    <rdf:predicate rdf:resource="https://jazz.XXX.com/rm/types/LT_4_CfI_XnEeumDc79C12NdA"/>

    <rdf:object rdf:resource="https://jazz.XXX.com/rm/resources/TX_CVfu-lDmEeuWbbdnw2HZow"/>

    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>

    <dcterms:title>1228377</dcterms:title>

  </rdf:Description>

  <rdf:Description rdf:about="https://jazz.XXX.com/rm/resources/MD_lqu3QY14EeucUNeS-GXy8w">

    <oslc_config:component rdf:resource="https://jazz.XXX.com/rm/cm/component/V1TCoPQ4Eequ_bWtpv6_DQ"/>

    <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-03-25T14:44:22.836Z</dcterms:created>

    <rm_property:AD_cWfn1m-UEeuSlb86Gyd1dg rdf:resource="https://jazz.XXX.com/rm/types/AT_XItUWW-UEeuSlb86Gyd1dg#_dvQgOb1pGAq2_cUQUlcMmg"/>

    <dcterms:contributor rdf:resource="https://jazz.XXX.com/jts/users/thophi"/>

    <process:projectArea rdf:resource="https://jazz.XXX.com/rm/process/project-areas/_VmiN4PQ4Eequ_bWtpv6_DQ"/>

    <rm_property:AD_vUgxAG-UEeuSlb86Gyd1dg rdf:datatype="http://www.w3.org/2001/XMLSchema#string">XX_4235676</rm_property:AD_vUgxAG-UEeuSlb86Gyd1dg>

    <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1283914</dcterms:identifier>

    <rm_property:AD_ffc7oJ3dEeuPP9F2fpUvLw rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Antenne Position</rm_property:AD_ffc7oJ3dEeuPP9F2fpUvLw>

    <oslc:instanceShape rdf:resource="https://jazz.XXX.com/rm/types/OT_kXZjO2-UEeuSlb86Gyd1dg"/>

    <rdf:type rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>

    <acp:accessControl rdf:resource="https://jazz.XXX.com/rm/accessControl/_VmiN4PQ4Eequ_bWtpv6_DQ"/>

    <rm_property:AD_IR_i041QEeucUNeS-GXy8w rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2021-02-26</rm_property:AD_IR_i041QEeucUNeS-GXy8w>

    <dcterms:description rdf:parseType="Literal"></dcterms:description>

    <nav:parent rdf:resource="https://jazz.XXX.com/rm/folders/FR_7b-SEm-UEeuSlb86Gyd1dg"/>

    <dcterms:title rdf:parseType="Literal">Req4</dcterms:title>

    <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-08-06T10:26:42.826Z</dcterms:modified>

    <rdf:type rdf:resource="http://jazz.net/ns/rm#Module"/>

    <dcterms:creator rdf:resource="https://jazz.XXX.com/jts/users/thophi"/>

    <oslc:serviceProvider rdf:resource="https://jazz.XXX.com/rm/oslc_rm/_VmiN4PQ4Eequ_bWtpv6_DQ/services.xml"/>

    <rm_property:AD_I12-IIM6EeuSlb86Gyd1dg rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Freigegeben</rm_property:AD_I12-IIM6EeuSlb86Gyd1dg>

    <rm_property:LT_4_CfI_XnEeumDc79C12NdA rdf:resource="https://jazz.XXX.com/rm/resources/TX_CVfu-lDmEeuWbbdnw2HZow"/>

    <rm_property:AD_3SNIoIi0EeucUNeS-GXy8w rdf:datatype="http://www.w3.org/2001/XMLSchema#string"></rm_property:AD_3SNIoIi0EeucUNeS-GXy8w>

  </rdf:Description>

</rdf:RDF>

 

  
//Request PUT Arrtifact   [In between I usually do some Meta data manipulation, for debugging reasons I left this part complet out. and send exactly the same body back as i receive:  ]


request = (HttpWebRequest)WebRequest.Create(milestones.EvidenceResource);
                    request.Headers.Add("If-Match", etag);
                    request = createRequest(request, context);
                    request.Method = "PUT";
                    using (var requestStream = request.GetRequestStream())
                    {
                        using (var streamWriter = new StreamWriter(requestStream))
                        { streamWriter.Write(Replace); }
                    }

                    var response_ = request.GetResponse();
                    var responseStream = response_.GetResponseStream();
                    var streamReader = new StreamReader(responseStream);
                    var data = streamReader.ReadToEnd();


Error Message:

<rdf:RDF
  <rdf:Description>
    <err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Falsche Anforderung</err:errorMessage>
    <err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
    >400</err:errorStatus>
  </rdf:Description>
</rdf:RDF>

--> System.Net.WebException: 'The remote server has returned an error: (400) Invalid request.'

Many thanks for any input/suggestion/hint
//Philipp

0 votes


Accepted answer

Permanent link
Update and answer to this question:

The problem could be narrowed down to when an artifact is linked with a custom link (without predefined URI) to a requirement. (Standard Links defined by DOORS worked fine)

Solution: Each custom link needs to have a URI (Link types setting) defined when updates via OSLC are done.

Headers PUT and GET request [Source: IBM Ian]

GET https://jazz.ibm.com:9443/rm/resources/MD_CEpgWNd8EeqV5_5cfWW9rw?oslc_config.context=https%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Fcm%2Fstream%2F_B5n79td8EeqV5_5cfWW9rw HTTP/1.1
Host: jazz.ibm.com:9443
Accept-Encoding: gzip, deflate, br
Accept: application/rdf+xml
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: https://jazz.ibm.com:9443/rm/web
OSLC-Core-Version: 2.0
Configuration-Context: https://jazz.ibm.com:9443/rm/cm/stream/_B5n79td8EeqV5_5cfWW9rw
vvc.configuration: https://jazz.ibm.com:9443/rm/cm/stream/_B5n79td8EeqV5_5cfWW9rw
Cache-Control: no-store, max-age=0
Cookie: JAZZ_AUTH_TOKEN=""; jfs-oauth-access_token-secret0=""; JSESSIONID=""; LtpaToken2=""

PUT
PUT https://jazz.ibm.com:9443/rm/resources/MD_CEpgWNd8EeqV5_5cfWW9rw?oslc_config.context=https%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Fcm%2Fstream%2F_B5n79td8EeqV5_5cfWW9rw HTTP/1.1
Host: jazz.ibm.com:9443
Accept-Encoding: gzip, deflate, br
Accept: application/xml
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: https://jazz.ibm.com:9443/rm/web
OSLC-Core-Version: 2.0
Configuration-Context: https://jazz.ibm.com:9443/rm/cm/stream/_B5n79td8EeqV5_5cfWW9rw
Content-Type: application/rdf+xml
vvc.configuration: https://jazz.ibm.com:9443/rm/cm/stream/_B5n79td8EeqV5_5cfWW9rw
If-Match: "%220%22&_XKN8YI9LEeyEDflBVqwSHg"
Cookie: JAZZ_AUTH_TOKEN=""; jfs-oauth-access_token-secret0=""; JSESSIONID=""; LtpaToken2=""

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Thanks for sharing Philip. 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 516

Question asked: Aug 09 '21, 10:42 a.m.

Question was seen: 1,201 times

Last updated: Feb 23 '22, 3:27 a.m.

Confirmation Cancel Confirm