It's all about the answers!

Ask a question

Doors Web (not DNG) OSLC API - How do I get the text of custom fields


Arne Matthes (261) | asked Nov 09 '23, 4:41 a.m.

 Hello everyone,


we still use the old Doors Web (and also Doors Desktop 9.x) and I need to fetch all requirements via the OSLC API and convert them to JSON.

I already managed to query the requirements I need, but I just cant find a way to identify which XML attributes correspond to which custom field.

My response looks like this

<?xml version="1.0"?>
<rdf:RDF
        xmlns:rm_property="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/">
    <oslc_rm:Requirement
            rdf:about="<about url>">
        <rm_property:attrDef-1049 rdf:parseType="Literal">
            <div>---</div>
        </rm_property:attrDef-1049>
        <rm_property:attrDef-1053 rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"></rm_property:attrDef-1053>
        <rm_property:attrDef-1069
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1069#2"/>
        <rm_property:attrDef-1067 rdf:parseType="Literal">
            <div></div>
        </rm_property:attrDef-1067>
        <rm_property:attrDef-1006
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1006#9"/>
        <rm_property:attrDef-1078
                rdf:resource="<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1078#1"/>
        <rm_property:attrDef-1035 rdf:parseType="Literal">
            <div></div>
        </rm_property:attrDef-1035>
    </oslc_rm:Requirement>
</rdf:RDF>

How would I find what's the corresponding attribute in doors web and the value of that attribute.

When I query the URLs of the rm_property:attrDef-xxxx attributes, I just get a list of my requirements.

Any help is greatly appreciated.


Comments
Ralph Schoon commented Nov 10 '23, 2:18 a.m. | edited Nov 10 '23, 4:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Have you looked into how OSLC works? Here is the core specification: https://docs.oasis-open-projects.org/oslc-op/core/v3.0/oslc-core.html


Provided you pass the correct headers - this is critical, you are supposed to get a result back, where the properties of the OSLC resource are in the result body. Attributes/properties of simple types like string should be in the result. Otherwise the value would be a link to a resource that contains the detail. 

Headers are:
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml


Ralph Schoon commented Nov 10 '23, 4:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Your XML does not look like RDF+XML.


Arne Matthes commented Nov 22 '23, 9:39 a.m.

@rschoon Why does this not look like RDF+XML? What's missing there? That's the (slightly shortened) Data I get from Doors.


Ralph Schoon commented Nov 22 '23, 10:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I was wrong, pasted XML in this forum is usually hard to read. I was missing the prefixes, but there is a prefix. A better way might be using text/turtle.

the attributes are e,g, rm_property:attrDef-1049 and you could get more details using the rdf:resource url. 



Arne Matthes commented Nov 23 '23, 3:05 a.m. | edited Nov 23 '23, 3:06 a.m.

  That's the strange part.
When I grab the URL from lets say rm_property:attrDef-1069 (<company_url>/dwa/rm/urn:rational::1-48beda447cfb0c27-M-0000f900/types/attrDef-1069#2) and query it using the application/rdf+xml headers I just get a long list of URLs back, which looks suspiciously like the list of all requirements instead of the enum values.


The response looke like this (but with over 1000 entries)

And if I try to access an OSLC URL with "Accept: text/turtle" header, doors refuses to answer and returns an error code.


Ralph Schoon commented Nov 23 '23, 3:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1.  Yes, it looks like you get the uses back.
  2. You have to always provide all headers e.g. OSLC-Core-Version
Maybe Doors does not support turtle. I have no Doors instance. 


Kevin Murphy commented Nov 27 '23, 6:09 p.m.

With your pastebin response, I think it's working as intended. I think you need to query each one of those responses to get your DOORS objects.  

showing 5 of 7 show 2 more comments

Accepted answer


permanent link
Arne Matthes (261) | answered Nov 29 '23, 3:14 a.m.

 Thanks for all the help I got.


In the end I found out that you can add "useEnumLabel=true" to the query and get enum labels back instead of links

Ralph Schoon selected this answer as the correct answer

Your answer


Register or to post 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.