[RM] Creation of Baseline in Non-GC RM Project using OSLC
Hello,
7 answers
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.
So the sequence would be:
- GET the stream
- Extract the URI of the baselines LDPC.
-
Take the RDF from the GET, replace the title and description, remove any
rdf:type
ofoslc_config:Stream
, add rdf:type ofoslc_config:Baseline
. You may also need to addprov: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.
- POST that RDF to the baselines LDPC URI from step 2.
-
For a 202 response, look at the
Location
header to get the URI of aoslc_config:Activity
. -
Poll that activity with GETs until it is completed. Then look at the information in the completed activity.
Comments
URI : https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines
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.
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.
URI : https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines
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
I tried to doing a get on content location for an activity.
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
Did the get and performed the POST Operation. Its stating method not allowed 405
</rdf:RDF>
@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
But until you provide the above details, it's unlikely anyone is going to help you further.
POST
Comments
Most likely the POST request body contains incorrect data.
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.
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.