I am trying to use LYO (org.eclipse.lyo.clients:oslc-java-client:2.4.0) to read requirements from DOORS via OSLC and parse them to ReqIF. I successfully manage to read out a Requirement object using this request:
String requirementURL = http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-O-2-00000100;
ClientResponse requirementResponse = oslcOauthClient.getResource(requirementURL, OslcMediaType.APPLICATION_RDF_XML);
Requirement requirement = requirementResponse.getEntity(Requirement.class);
While doing that, I ran into an issue while trying to parse the Attribute Values. From a DOORS perspective, these are located in requirement.extendedProperties[x].value. However, there is a problem. The ReqIF standard defines 7 Attribute Value types that msut be adhered to, such as ATTRIBUTE-VALUE-INTEGER, ATTRIBUTE-VALUE-DATE etc... Now, for the most part, the objects contained in requirement.extendedProperties[x].value are of a clearly mappable type such as int or date. However, in some cases, they are instead URI. Here's some samples or URIs that emerge at this point:
http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1
http://localhost:8080/dwa/rm/acp/urn:rational::1-5efc6f9a4ff877cf-F-00000000/gFgcK1req0%252BQ5gE6yE5YsEZZcDI%253D%250A
http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-10#1
Now I understand that these URIs point to DOORS resources. The first and third are Enumeration value references, and I don't know what the second one is. However, as far as I understand it, I should be able to access the corresponding DOORS resources using these URIs, and then be able to have a look at them to determine what they are, and consequently how to parse them.
However, this is when everything fails, because when I try to make this request:
String uriValue = http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1;
ClientResponse response = oslcOauthClient.getResource(uriValue , OslcMediaType.APPLICATION_RDF_XML);
...instead of a response containing a usable entity, response.entity is of the object type EofSensorInputStream, whereas I would have expected something like EnumValue, or something.
So, here's the question: Based on that URI that is contained within requirement.extendedProperties[x].value, how can I retrieve the resource it points to in order to determine the attribute type that I have to use? Apparently, oslcOauthClient.getResource is the wrong thing to use, or I am using it the wrong way. Maybe the second parameter is wrong in this case (even though it works for retrieving the Requirement), but then I have no idea what would be the correct parameter or how to figure it out.
Or to make it even shorter:
So, I figured out that the value of this attribute is the URI http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1 .
...now what?