It's all about the answers!

Ask a question

[RM] Creation of Baseline in Non-GC RM Project using OSLC


Chandan M B (1133370) | asked Jul 20 '22, 7:54 a.m.

 Hello,

 
 I am looking for some examples to create baseline for non-GC projects of DNG PA.

Tried for Baseline : Response is 202 Accepted.
But Baseline was not created. Any leads here ?

7 answers



permanent link
David Honey (1.8k17) | answered Jul 20 '22, 10:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

POST to what URI? You cannot POST to the stream.
You can only create a baseline by POSTing to the baseline's LDPC of the stream.

See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/config-resources.html#shape-stream.

So the sequence would be:
  1. GET the stream
  2. Extract the URI of the baselines LDPC.
  3. Take the RDF from the GET, replace the title and description, remove any rdf:type of oslc_config:Stream , add rdf:type of oslc_config:Baseline . You may also need to add prov:wasDerivedFrom to reference the stream URI. The important point here is that you have to POST RDF content that is a valid baseline, including any mandatory properties.POSTing just a title and description may be insufficient.
  4. POST that RDF to the baselines LDPC URI from step 2.
  5. For a 202 response, look at the Location header to get the URI of a oslc_config:Activity .
  6. Poll that activity with GETs until it is completed. Then look at the information in the completed activity.



Comments
Chandan M B commented Jul 21 '22, 6:03 a.m. | edited Jul 21 '22, 6:05 a.m.

 URI https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines

          
Body
         
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>

Even though Response is 202 and GET on location header
Response os Not found on activity.


David Honey commented Jul 21 '22, 6:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What headers are you including in the POST?
The body shown doesn't look like valid RDF/XML
You can use the RDF validator at http://rdfvalidator.mybluemix.net/ to check that your POST body is valid RDF.

If you want people to help you with REST APIs, as Ralph commented, show the full details of the request (URI, headers and body), and of the response (headers and body).

The GCM application uses POST requests to stream's baselines LDPC for both DOORS Next and ETM, and this works fine.


permanent link
Ralph Schoon (62.9k33645) | answered Jul 20 '22, 8:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 If you have API questions, provide the details of what you have done. Request, URI, headers. Do not expect the forum users to assume stuff from references to other posts. If you are not willing to spend the time creating a useful question, do not hope for a useful answer.


Comments
Chandan M B commented Jul 20 '22, 8:47 a.m.

Sorry Ralph. Please find the details below 


permanent link
Chandan M B (1133370) | answered Jul 20 '22, 8:46 a.m.

 URI : https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines


Headers : 
 Accept : application/rdf+xml
 OSLC-Core-Version : 2.0
 Content-Type : application/rdf+xml
  X-Jazz-CSRF-Prevent : JSessionID

Body

  <oslc_config:Baseline>
   <dcterms:title rdf:parseType="Literal">Create Via OSLC</dcterms:title>
        <dcterms:description rdf:parseType="Literal">Test description</dcterms:description>
  </oslc_config:Baseline>
</rdf:RDF>


permanent link
David Honey (1.8k17) | answered Jul 20 '22, 9:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

202 Accepted is the expected response since it is a long running operation.
See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/config-resources.html#longoperations for further information.


Comments
Chandan M B commented Jul 20 '22, 9:24 a.m. | edited Jul 20 '22, 10:13 a.m.

I tried to doing a get on content location for an activity.  

Exception is 
    <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Create Child Configuration Task</dcterms:title>
    <dcterms:references>
      <oslc:Error>
        <oslc:statusCode>0</oslc:statusCode>
        <oslc:message>Unexpected exception while executing task</oslc:message>
      </oslc:Error>
    </dcterms:references>
  </oslc_config:Activity>


permanent link
David Honey (1.8k17) | answered Jul 20 '22, 9:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your POST body is very sparse. Try doing a GET on the stream you want to create a baseline from, and using the RDF from that with changes to the RDF types, title, description and POST that modified content.


Comments
Chandan M B commented Jul 20 '22, 10:19 a.m. | edited Jul 20 '22, 10:20 a.m.

Did the get and performed the POST Operation. Its stating method not allowed 405


       <dcterms:description>Description</dcterms:description>
      <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>
</rdf:RDF> 


Chandan M B commented Jul 21 '22, 6:49 a.m. | edited Jul 21 '22, 6:51 a.m.
Still not successful


Body
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>

</rdf:RDF> 


Performing GET on location header leads to "Not Found"


permanent link
David Honey (1.8k17) | answered Jul 21 '22, 6:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 21 '22, 7:02 a.m.

@Chandan I'm not going to respond to any more posts on this topic until you include the following information:

  • The request URI
  • The request headers
  • The request body
  • The response headers
  • The response body
As per my previous comment, your POST body isn't valid RDF.
But until you provide the above details, it's unlikely anyone is going to help you further.


permanent link
Chandan M B (1133370) | answered Jul 21 '22, 7:36 a.m.

POST 

URI https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines

Headers : Accept : application/rdf+xml
                OSLC-Core-Version : 2.0
                Content-Type : application/rdf+xml
                 X-Jazz-CSRF-Prevent : JSessionID

Body
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
    <prov:wasDerivedFrom rdf:resource="https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w" />
  </oslc_config:Baseline>
</rdf:RDF>

Response :
Status Code : 202 Accepted

GET 
Headers : Accept : application/rdf+xml
                OSLC-Core-Version : 2.0

Response
  <rdf:Description>
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Not found</err:errorMessage>
  </rdf:Description>
</rdf:RDF>


Comments
Ralph Schoon commented Jul 21 '22, 9:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Most likely the POST request body contains incorrect data.   


Ralph Schoon commented Jul 21 '22, 9:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that some objects need to have a about URI that is NOT NULL. E.g. about="https://nowhere.net/". It might not matter what the URI is, it just has to be a URI and can not be empty. 


David Honey commented Jul 21 '22, 10:20 a.m. | edited Jul 21 '22, 10:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In Turtle, the POST request is:

@prefix acc:   <http://open-services.net/ns/core/acc#> .
@prefix process: <http://jazz.net/ns/process#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ldp:   <http://www.w3.org/ns/ldp#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix oslc_config: <http://open-services.net/ns/config#> .
@prefix prov:  <http://www.w3.org/ns/prov#> .
@prefix oslc:  <http://open-services.net/ns/core#> .

[ a oslc_config:Baseline ; dcterms:description "Description" ; dcterms:title "Power BI - example Initial Stream"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w> ] .

In essence, the subject is a blank node. As Ralph suggests, try a proper URI for the suibject.

Your answer


Register or to post your answer.