It's all about the answers!

Ask a question

OSLC: Is it possible to access all attributes and their types for particular work item type?


Timur Markunin (6495165145) | asked Jul 03 '13, 10:46 a.m.
 Hello,

I'm trying to access work item type info:
- attributes
- attributes types
- enumerations

Is it possible via OSLC?

Accepted answer


permanent link
Dinesh Kumar B (4.1k413) | answered Jul 03 '13, 2:07 p.m.
JAZZ DEVELOPER
Resource Shape is what I believe you are looking for which is reached following the discovery mechanism starting with rootservices of ccm.

let me explain from the Services URL obtained through the discovery mechanism:

GET on
    https://localhost:9443/ccm/oslc/contexts/_87qOEKvrEeKxU5AQolS52w/workitems/services.xml

with following headers
    OSLC-Core-Version: 2.0
    Accept: application/xml

and from the response locate the creation factory for the work item type you want to understand and you will see the resourceShape URL

<oslc:creationFactory>
    <oslc:CreationFactory>
        <dcterms:title rdf:parseType="Literal">Location for creation of Defect change requests </dcterms:title>
        <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
        <oslc:usage rdf:resource="http://open-services.net/ns/cm#defect"/>
        <oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
        <oslc:resourceType rdf:resource="https://localhost:9443/ccm/oslc/types/_87qOEKvrEeKxU5AQolS52w/defect"/>
        <oslc:resourceShape rdf:resource="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect"/>
        <oslc:creation rdf:resource="https://localhost:9443/ccm/oslc/contexts/_87qOEKvrEeKxU5AQolS52w/workitems/defect"/>
    </oslc:CreationFactory>
</oslc:creationFactory>

perform a GET on the rdf:resource for oslc:resourceShape and you will see all the attributes of the work item type and the attriubtes data type and more (readonly, mandatory... )

here is a sample for Resolution Date of Defect Work Item Type:
<oslc:property>
    <oslc:Property rdf:about="https://localhost:9443/ccm/oslc/context/_87qOEKvrEeKxU5AQolS52w/shapes/workitems/defect/property/resolutionDate">
        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>       
        <oslc:readOnly rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:readOnly>
        <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/cm#closeDate"/>       
        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>       
        <oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">closeDate</oslc:name>       
        <dcterms:title rdf:parseType="Literal">Resolution Date</dcterms:title>
    </oslc:Property>
</oslc:property>

hope this helps...
Timur Markunin selected this answer as the correct answer

Comments
Bas Bekker commented Jul 29 '13, 10:44 a.m.
JAZZ DEVELOPER

For a workshop on how to use the OSLC API, see this article Open Services for Lifecycle Collaboration Workshop


1
Geoff Alexander commented Sep 15 '15, 3:59 p.m.

I realized that this answer is fairly old.  But hopefully someone will answer my question. A GET on the rdf:resource for oslc:resourceShape does appear to return properties for all of the attributes.  But it also seems to return properties for other items such as link types.  So how do I determine which properties refer to attributes?

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.