# DOORS Lyo incompatibility

**URL:** <https://forum.open-services.net/t/doors-lyo-incompatibility/631>\
**Category:** OSLC implementations\
**Created:** [June 16, 2022, 9:50am UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631 "2022-06-16T09:50:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael.C](https://forum.open-services.net/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michael.C](https://forum.open-services.net/u/Michael.C)\
**Post date:** [June 16, 2022, 9:50am UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/1 "2022-06-16T09:50:03Z")

</div>

Hello,

When I return a Resource with Lyo it’s formated like this

```xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:j.0="http://open-services.net/ns/am#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <j.0:Resource rdf:about="https://domain:8443/server-am/services/resource/c306ab60-b3f1-4a0b-97e4-bd82e820a138/46e1cf32-a19a-4c6b-8567-92e4ccffcdab">
    <dcterms:title rdf:parseType="Literal">Storekeeper</dcterms:title>
    <dcterms:identifier>46e1cf32-a19a-4c6b-8567-92e4ccffcdab</dcterms:identifier>
    <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
    >2020-09-23T09:13:10Z</dcterms:modified>
    <oslc:shortTitle rdf:parseType="Literal">Storekeeper</oslc:shortTitle>
  </j.0:Resource>
</rdf:RDF>

```

I tried to return a String like this

```xml
<rdf:RDF
	xmlns:dcterms="http://purl.org/dc/terms/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:oslc="http://open-services.net/ns/core#"
	xmlns:j.0="http://open-services.net/ns/am#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <rdf:Description rdf:about="https://domain:8443/server-am/services/resource/c306ab60-b3f1-4a0b-97e4-bd82e820a138/46e1cf32-a19a-4c6b-8567-92e4ccffcdab">
	<dcterms:title rdf:parseType="Literal">Storekeeper</dcterms:title>
	<dcterms:identifier>46e1cf32-a19a-4c6b-8567-92e4ccffcdab</dcterms:identifier>
	<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
	>2020-09-23T09:13:10Z</dcterms:modified>
	<oslc:shortTitle rdf:parseType="Literal">Storekeeper</oslc:shortTitle>
	<rdf:type rdf:resource="http://open-services.net/ns/am#Resource"/>
  </rdf:Description>
</rdf:RDF>

```

So the first one does not work with DOORS next because I’m not getting a PUT request after the GET when trying to make a link from DOORS.  
It was working with Polarion.  
I read the documents about the valid OSLC format here ([OSLC Architecture Management Specification Version 2.0 | Architecture Management - Open Services for Lifecycle Collaboration](https://archive.open-services.net/wiki/architecture-management/OSLC-Architecture-Management-Specification-Version-2.0/)) and I was under the impression that both are valid.

Is this an issue with DOORS or Lyo ?  
Is there a setting to have the second format in Lyo ?

Thanks you

---

<div class="post-metadata">

**Author:** ![Frej](https://forum.open-services.net/user_avatar/forum.open-services.net/frej/32/210_2.png) [@Frej](https://forum.open-services.net/u/Frej)\
**Post date:** [June 16, 2022, 11:02am UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/2 "2022-06-16T11:02:38Z")

</div>

Hi Michael,

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?

-Frej.

---

<div class="post-metadata">

**Author:** ![Michael.C](https://forum.open-services.net/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michael.C](https://forum.open-services.net/u/Michael.C)\
**Post date:** [June 16, 2022, 11:52am UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/3 "2022-06-16T11:52:37Z")

</div>

Hello Frej,

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.

```auto
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF 0="http://open-services.net/ns/am#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc="http://open-services.net/ns/core#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" rdf:about="https://PCTBOR2241:8443/server-am/services/resource/c306ab60-b3f1-4a0b-97e4-bd82e820a138/2f2b70cd-f771-4d18-a51f-a49e2e7d9fd2" rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
    2f2b70cd-f771-4d18-a51f-a49e2e7d9fd2
</rdf:RDF>

```

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.

---

<div class="post-metadata">

**Author:** ![jad](https://forum.open-services.net/user_avatar/forum.open-services.net/jad/32/42_2.png) [@jad](https://forum.open-services.net/u/jad)\
**Post date:** [June 16, 2022, 9:42pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/4 "2022-06-16T21:42:26Z")

</div>

Hi!  
Both formats do seem to be valid rdf+xml.

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?

---

<div class="post-metadata">

**Author:** ![jad](https://forum.open-services.net/user_avatar/forum.open-services.net/jad/32/42_2.png) [@jad](https://forum.open-services.net/u/jad)\
**Post date:** [June 16, 2022, 10:02pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/5 "2022-06-16T22:02:30Z")

</div>

I recall now some special hacks in Lyo Writers to handle DNG that might help.

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java#L104>

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())

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java#L252>

Finally, one difference I noticed above is a missing xmlDeclaration.  
Could this be related to this line in the code?

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java#L147>

Just observations from old obscure logic from Lyo that I never really understood myself. But they somehow seem related to what you are facing.

---

<div class="post-metadata">

**Author:** ![andrew](https://forum.open-services.net/user_avatar/forum.open-services.net/andrew/32/28_2.png) [@andrew](https://forum.open-services.net/u/andrew)\
**Post date:** [June 16, 2022, 10:21pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/6 "2022-06-16T22:21:37Z")

</div>

> [@Michael.C](#):
>
> Is there a setting to have the second format in Lyo ?

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?

---

<div class="post-metadata">

**Author:** ![Michael.C](https://forum.open-services.net/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michael.C](https://forum.open-services.net/u/Michael.C)\
**Post date:** [June 20, 2022, 12:59pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/7 "2022-06-20T12:59:25Z")

</div>

Hello, thanks for the advices.

I’m using open jdk 16 with Lyo 5.0.0.alpha2 and DOORS NEXT 7.0.2.  
I based my producer on RefImpl AM server.

So when DOORS is performing a GET with the 2st example it works and DOORS is performing a PUT after.

```auto
<rdf:Description rdf:about="https://domain:8443/server-am/services/resource/c306ab60-b3f1-4a0b-97e4-bd82e820a138/46e1cf32-a19a-4c6b-8567-92e4ccffcdab">

```

But with this, it’s not performing a PUT after the GET

```auto
<j.0:Resource rdf:about="https://domain:8443/server-am/services/resource/c306ab60-b3f1-4a0b-97e4-bd82e820a138/46e1cf32-a19a-4c6b-8567-92e4ccffcdab">

```

> [@andrew](#):
>
> 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…

This is even more confusing then.

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.

```auto
OSLC4JConstants.OSL4J_PROPERTY_SINGLETON.put(OSLC4JConstants.OSLC4J_ALWAYS_XML_ABBREV, true);

```

---

<div class="post-metadata">

**Author:** ![Michael.C](https://forum.open-services.net/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michael.C](https://forum.open-services.net/u/Michael.C)\
**Post date:** [June 23, 2022, 12:40pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/8 "2022-06-23T12:40:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![andrew](https://forum.open-services.net/user_avatar/forum.open-services.net/andrew/32/28_2.png) [@andrew](https://forum.open-services.net/u/andrew)\
**Post date:** [June 25, 2022, 8:44pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/9 "2022-06-25T20:44:46Z")

</div>

I guess we will need input from @DavidJHoney or @jamsden here.

> [@Michael.C](#):
>
> But with this, it’s not performing a PUT after the GET

I am assuming you are trying to create a link from DNG to your AM and expecting a GET request to be followed by a PUT request?

Does DNG write some errors in the log?

> [@Michael.C](#):
>
> It seems that Lyo or Jena is not taking into account the OSLC4JConstants.OSLC4J\_ALWAYS\_XML\_ABBREV propertie

The code that should do the work is under

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java#L263-L271>

The value you want for this property is `false`.

I created a quick PR [feat: Control the RDF output format manually by berezovskyi · Pull Request #277 · eclipse/lyo · GitHub](https://github.com/eclipse/lyo/pull/277) that shows how we can require Jena to use the exact output format we want, instead of letting Jena choose depending on the language. I suspect that over time, Jena switched `RDFXML` to [produce abbreviated output](https://jena.apache.org/documentation/io/rdf-output.html#rdfxml) by default and it may have broken something.

We should also update the logic around forced/custom RDF/XML-ABBREV given that it seems that Jazz tools no longer like/require it.

---

<div class="post-metadata">

**Author:** ![jad](https://forum.open-services.net/user_avatar/forum.open-services.net/jad/32/42_2.png) [@jad](https://forum.open-services.net/u/jad)\
**Post date:** [June 28, 2022, 10:08pm UTC](https://forum.open-services.net/t/doors-lyo-incompatibility/631/10 "2022-06-28T22:08:55Z")

</div>

> [@Michael.C](#):
>
> I tried to put this line in the constructor of Application.java but with true or false, it’s not changing the output.
> 
> ```auto
> OSLC4JConstants.OSL4J_PROPERTY_SINGLETON.put(OSLC4JConstants.OSLC4J_ALWAYS_XML_ABBREV, true);
> 
> ```

This doesn’t seem to me to be how this constant should be set. As you can see below, the code is looking for a system property.

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java#L104>

See also

> <https://github.com/eclipse/lyo/blob/db2e96960e0a37739a2d75e986c754b683e66516/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtils.java#L90>
