Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to read the details of all the Atribute Types in any Project Area ?

Hi all,

Is it possible to read the details of all the Attribute Types in any Project Area ?

My Requirement is to match the Attribute Type URI with the Instance Shape returned by the Requirement Object.

Please let me know.

Thanks
Vaibhav

0 votes



2 answers

Permanent link

Not quite sure why you need all the attribute types in "any" project area. Getting the type definition should be very straightforward.

When you GET the details of a requirement, you will get <oslc:instanceShape>, which I believe you have already known that. Follow the instance shape URI, you should then have some <rm:hasSystemAttribute> and <rm:hasAttribute> attributes. And finally follow the URI in these attributes, you can get the details of each individual attribute, with <dcterms:title> being the attribute name.

Do I misunderstand what you are trying to do?

0 votes

Comments

Hi Donald Nong,

Thanks for the response.

I will elaborate a bit. I am developing a utility which takes "ArtifactType" name as input and returns Ids of all the Artifacts of that Artifact Type as output.

For the same I need to match the Attribute Type/ Instance Shape of any requirement object with all the available Attribute Types in the given Project Area.

So far I am able to read the Instance shape for any Requirement object but not able to retrieve Attribute Type Name from that URI.

On passing the instanceShape URI i dont get any "rm" related tags (<rm:hasSystemAttribute>,<rm:hasAttribute> as mentioned by you).

<dcterms:title> is do visible but it has many instances of it available.

Please let me know what did I miss.

Thanks
Vaibhav


Permanent link

Hi,

I found the code that will do the job:

ClientResponse clientResponseAttribute = client.getResource(requirement.getInstanceShape().toString(), OSLCConstants.CT_RDF);
                 
 ResourceShape resourceShape = clientResponseAttribute.getEntity(ResourceShape.class);
                
 artifactType = resourceShape.getTitle();


Thanks
Vaibhav

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jan 22 '18, 6:23 a.m.

Question was seen: 2,518 times

Last updated: Jan 23 '18, 11:43 p.m.

Confirmation Cancel Confirm