The difference seems to be that one is application/xml content and the other is application/rdf+xml content.
If you specify an “Accept: xxx” header on your request, you should be able to switch from format 1 to format 2.
As for the PUT/GET, I am unsure… is your DOORSNext project configuration enabled?
Thanks for your advice. I logged the request from DOORS in my OSLC provider.
So DOORS is using a header with Accept application/rdf+xml, so I can’t change it.
The result of application/rdf+xml is the first request in my previous post.
If I use Postman and try with application/xml I get something again different.
I’m not using gc. I’m linking from DOORS, after selecting my ‘am’ object in the selection ui. DOORS is performing a GET but it’s only performing a PUT for adding the link in my producer with the second representation.
I think the 2 output I showed in my first post are valid application/rdf+xml but I need the second one. For the second one I returned a String from my oslc provider since I don’t know how to get it with Lyo.
I am a bit confused though about what you are trying to do.
For example, you say “I’m not getting a PUT request after the GET when …” Why would you expect a PUT request after a GET?
And, you also seem to be working with Jazz, Lyo and Polarion?
It would be good to understand, because I am wondering if your problem is somewhere else than the format?
I recall now some special hacks in Lyo Writers to handle DNG that might help.
This particular piece of code is most likely not relevant, but there seems to be 2 formats for rdf/xml. Normal and abbreviated. Could it be that your 2 formats above corrspond to these 2 formats?
Could you possibly put a breakpoint in the getSerializationLanguage() method to work out what you are working with? Can you make it choose one or the other to see what happens? (See the method OSLC4JUtils.alwaysAbbrevXML())
Finally, one difference I noticed above is a missing xmlDeclaration.
Could this be related to this line in the code?
Just observations from old obscure logic from Lyo that I never really understood myself. But they somehow seem related to what you are facing.
The second format will be returned if you are asking for application/rdf+xml (unless you set OSLC4JConstants.OSLC4J_ALWAYS_XML_ABBREV to true). If you only ask for application/xml, you will always get the first (abbreviated) format.
The abbreviated output (first in your example) is only used for Jazz. So, it’s a bit unusual that you want to generate a non-abbreviated output for the only system that needs abbreviated format support…
I guess we need a bit more info to reproduce:
what are your steps (on all the components involved)
what are the versions of software (jazz, lyo, java, etc.) you are running. I guess you are using OSLC RefImpl AM server?
I added Oslc_amDomainConstants.ARCHITECTURE_MANAGEMENT_DOMAIN in the list of types of the resource and I’m able to get the 2st form now.
But after adding some links, Lyo return sometimes the first form again.
I tried to put this line in the constructor of Application.java but with true or false, it’s not changing the output.
So after more testing. It seems that Lyo or Jena is not taking into account the OSLC4JConstants.OSLC4J_ALWAYS_XML_ABBREV propertie. I’m not able to get
<rdf:Description … every time unless I add a custom types URI.
Also, I did not find a setting in DOORS to allow abreviated output, it’s working only if I have the plain version.