Different responses for DNG REST baseline query
One answer
David Honey (1.8k●1●7)
| answered Jan 24 '23, 5:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I think you are interpreting the returned RDF/XML too literally.
In the first example, expressed in Turtle I see:
@prefix acc: <http://open-services.net/ns/core/acc#> . @prefix rmTypes: <http://www.ibm.com/xmlns/rdm/types/> . @prefix process: <http://jazz.net/ns/process#> . @prefix h: <http://www.w3.org/TR/REC-html40> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix oslc_config: <http://open-services.net/ns/config#> . @prefix oslc: <http://open-services.net/ns/core#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix jfs: <http://jazz.net/xmlns/foundation/1.0/> . @prefix rmWorkflow: <http://www.ibm.com/xmlns/rdm/workflow/> . @prefix ldp: <http://www.w3.org/ns/ldp#> . @prefix dcterms: <http://purl.org/dc/terms/> . @prefix xs: <http://schema.w3.org/xs/> . @prefix rm: <http://www.ibm.com/xmlns/rdm/rdf/> . @prefix prov: <http://www.w3.org/ns/prov#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . <https://xyz.com/rm/cm/baseline/_8COGABO9Ee2wReB1R5agyg> a oslc_config:Baseline , oslc_config:Configuration ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_2VNLABMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_8COGABO9Ee2wReB1R5agyg> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_8COGABO9Ee2wReB1R5agyg/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-08-04T06:23:21.698Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_8COGABO9Ee2wReB1R5agyg" ; dcterms:title "PL48 General 1.0"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> . <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg/baselines> a ldp:DirectContainer ; rdfs:member <https://xyz.com/rm/cm/baseline/_fUQ5kBzNEe2f29eLu6PFCQ> , <https://xyz.com/rm/cm/baseline/_8COGABO9Ee2wReB1R5agyg> . <https://xyz.com/rm/cm/baseline/_fUQ5kBzNEe2f29eLu6PFCQ> a oslc_config:Configuration , oslc_config:Baseline ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_2VNLABMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> ; oslc_config:previousBaseline <https://xyz.com/rm/cm/baseline/_8COGABO9Ee2wReB1R5agyg> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_fUQ5kBzNEe2f29eLu6PFCQ> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_fUQ5kBzNEe2f29eLu6PFCQ/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-08-15T19:07:21.392Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_fUQ5kBzNEe2f29eLu6PFCQ" ; dcterms:title "PL48 General 2.0"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_2VPnRhMcEe2wReB1R5agyg> .
For the 2nd example, the Turtle is:
@prefix acc: <http://open-services.net/ns/core/acc#> . @prefix rmTypes: <http://www.ibm.com/xmlns/rdm/types/> . @prefix process: <http://jazz.net/ns/process#> . @prefix h: <http://www.w3.org/TR/REC-html40> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix oslc_config: <http://open-services.net/ns/config#> . @prefix oslc: <http://open-services.net/ns/core#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix jfs: <http://jazz.net/xmlns/foundation/1.0/> . @prefix rmWorkflow: <http://www.ibm.com/xmlns/rdm/workflow/> . @prefix ldp: <http://www.w3.org/ns/ldp#> . @prefix dcterms: <http://purl.org/dc/terms/> . @prefix xs: <http://schema.w3.org/xs/> . @prefix rm: <http://www.ibm.com/xmlns/rdm/rdf/> . @prefix prov: <http://www.w3.org/ns/prov#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . <https://xyz.com/rm/cm/baseline/_1JLnEBO8Ee2wReB1R5agyg> a oslc_config:Configuration , oslc_config:Baseline ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_wYJWsBMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_1JLnEBO8Ee2wReB1R5agyg> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_1JLnEBO8Ee2wReB1R5agyg/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-08-04T06:15:25.954Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_1JLnEBO8Ee2wReB1R5agyg" ; dcterms:title "PL48 Diagnostics 11.0"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> . <https://xyz.com/rm/cm/baseline/_4vUtMDS_Ee2fmp1dlZYEUg> a oslc_config:Configuration , oslc_config:Baseline ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_wYJWsBMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:previousBaseline <https://xyz.com/rm/cm/baseline/_p4xIoDS_Ee2fmp1dlZYEUg> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_4vUtMDS_Ee2fmp1dlZYEUg> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_4vUtMDS_Ee2fmp1dlZYEUg/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-09-15T06:30:26.949Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_4vUtMDS_Ee2fmp1dlZYEUg" ; dcterms:title "PL48 Diagnostics 4.0"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> . <https://xyz.com/rm/cm/baseline/_2DMF8B04Ee2f29eLu6PFCQ> a oslc_config:Baseline , oslc_config:Configuration ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_wYJWsBMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:previousBaseline <https://xyz.com/rm/cm/baseline/_1JLnEBO8Ee2wReB1R5agyg> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_2DMF8B04Ee2f29eLu6PFCQ> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_2DMF8B04Ee2f29eLu6PFCQ/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-08-16T07:55:50.109Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_2DMF8B04Ee2f29eLu6PFCQ" ; dcterms:title "PL48 Diagnostics XAPR5 x5.0"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> . <https://xyz.com/rm/cm/baseline/_p4xIoDS_Ee2fmp1dlZYEUg> a oslc_config:Configuration , oslc_config:Baseline ; process:projectArea <https://xyz.com/rm/process/project-areas/_UCzOUOfFEeyt2rcBAVlGUA> ; oslc_config:acceptedBy oslc_config:Configuration ; oslc_config:baselineOfStream <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:component <https://xyz.com/rm/cm/component/_wYJWsBMcEe2wReB1R5agyg> ; oslc_config:overrides <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> ; oslc_config:previousBaseline <https://xyz.com/rm/cm/baseline/_2DMF8B04Ee2f29eLu6PFCQ> ; oslc_config:selections <https://xyz.com/rm/configSelections/baseline/_p4xIoDS_Ee2fmp1dlZYEUg> ; oslc_config:streams <https://xyz.com/rm/cm/baseline/_p4xIoDS_Ee2fmp1dlZYEUg/streams> ; oslc:serviceProvider <https://xyz.com/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml> ; acc:accessContext <https://xyz.com/rm/acclist#_UCzOUOfFEeyt2rcBAVlGUA> ; dcterms:created "2022-09-15T06:28:47.277Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; dcterms:creator <https://xyz.com/jts/users/lakschi> ; dcterms:description "" ; dcterms:identifier "_p4xIoDS_Ee2fmp1dlZYEUg" ; dcterms:title "PL48 Diagnostics 3.1"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg> . <https://xyz.com/rm/cm/stream/_wYLy9hMcEe2wReB1R5agyg/baselines> a ldp:DirectContainer ; rdfs:member <https://xyz.com/rm/cm/baseline/_4vUtMDS_Ee2fmp1dlZYEUg> , <https://xyz.com/rm/cm/baseline/_p4xIoDS_Ee2fmp1dlZYEUg> , <https://xyz.com/rm/cm/baseline/_2DMF8B04Ee2f29eLu6PFCQ> , <https://xyz.com/rm/cm/baseline/_1JLnEBO8Ee2wReB1R5agyg> .
Notice that each configuration can have multiple RDF types. Also note that in RDF, the order of triples in an RDF model is undefined. When serializing the RDF as RDF/XML, the node that represents a resource will be one of the RDF types. When there are multiple RDF types, it will be one of those types, chosen at random. This is just the way that RDF/XML gets serialized. You can read the W3C specification for RDF/XML.
If you have code that is reliant on the RDF type chosen for the resource node, then that code is wrong. You should process the HTTP response body as RDF rather than be reliant on your own XML parsing of RDF/XML. Many applications use Apache Jena to deal with RDF serialization and deserialzation as it supports multiple RDF media types, and then you can use the Model class to extract data that you want in a serialization independent manner.
Comments
Chidambaram L
commented Jan 24 '23, 9:32 a.m.
My end usage of this REST Query is RPE. How to deal with RDF in RPE. You mentioned you defined the schema for RPE. That schema needs to allow for any node type, not just
@davidhoney, Have handled this in RPE to read both nodes. Is there a way to identify all the rdf/xml schemas returned for this query. Is is a general question to for all ELM queries returning rdf/xml. To rephrase your question: What are the possible RDF types of confiugurations?
A more robust solution would be to define the schema so that it can accept any RDF type. The OSLC Configuration Management 1.0 specification defines the following RDF types:
However, remember that in linked lifecycle data, resources can have multiple RDF types. Consider what might happen if, in a future release, the application (DN in this case) added some other RDF types. If the schema was defined to accept any RDF type, then it would continue to work. If the schema was defined harding the above set of RDF types, it might cease to work in some cases.
|
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.
Comments
Your post does not contain any question - only statements.
Also, if you want to ask question(s) about REST APIs, please include the full details of the HTTP requests including URIs, parameters, and headers, and the full details of the corresponding HTTP responses, including header and response body.
@davidhoney, Revised the question now.
You still have not shown the complete details of the HttpResponse including headers and the full response body. What does "stream1 returns" mean?
For each HTTP request, please provide details of the request URI, parameters, headers, and the details of the corresponding HTTP response, including the full response body and the headers.
@davidhoney, Revised the question now.