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

How to set an attribute while creating artifact using rest api

I am trying to create artifact having different attributes using rest api. Inorder to create the post message for artifact creation I need to know the RDF data of the allowed values of the attribute.


But however when I do a get on the url for a property definition of particular artifact type I get the following:

    <oslc:property>
      <oslc:Property>
        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>
        <oslc:propertyDefinition rdf:resource="https://localhost/rm/types/_BxEvkKQZEeGhApRcb1sFqA"/>
        <oslc:range rdf:resource="https://localhost/rm/types/_9VwXzUNVEeGavIlLsxV1tA"/>
        <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one"/>
        <dc:description rdf:parseType="Literal"></dc:description>
        <oslc:name>Pre-Build Assurance Required</oslc:name>
      </oslc:Property>
    </oslc:property>

and when I do the get on the property definition https://localhost/rm/types/_BxEvkKQZEeGhApRcb1sFqA I get the allowed values in

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dc="http://purl.org/dc/terms/"
    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_rm="http://open-services.net/ns/rm#">
  <oslc:Property>
    <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#int"/>
    <oslc:allowedValues>
      <oslc:AllowedValues>
        <oslc:allowedValue rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
        >0</oslc:allowedValue>
        <oslc:allowedValue rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
        >1</oslc:allowedValue>
      </oslc:AllowedValues>
    </oslc:allowedValues>
    <oslc:propertyDefinition rdf:resource="https://localhost/rm/types/_BxEvkKQZEeGhApRcb1sFqA"/>
    <oslc:range rdf:resource="https://localhost/rm/types/_9VwXzUNVEeGavIlLsxV1tA"/>
    <oslc:occurs rdf:resource="http://open-service.net/ns/core#Zero-or-one"/>
    <dc:description rdf:parseType="Literal"></dc:description>
    <oslc:name>Pre-Build Assurance Required</oslc:name>
  </oslc:Property>
</rdf:RDF>

However I am not getting the actual rdf data for the value 0 or 1. I tried doing get on the instance shape url but that gives only a list of attributes and urls for the allowed range. When doing a get on the allowed range what I get is

<rdf:RDF
    xmlns:dc="http://purl.org/dc/terms/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_rm="http://open-services.net/ns/rm#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/">
</rdf:RDF>


0 votes

Comments

Appreciate help form expert developers as I am currently held on to this , and unable to make any progress. I believe I have seen similar questions been answered saying doing a get on the instance shape will expose the allowed values for an attribute, however doing a get to instance shape in my  case is only revelaing the actual allowed values like 0,1,12 etc and not the rdf values. Appreciate help on this.



One answer

Permanent link
Found out that this is because of the version, RRC version 4.1 has unique RDF data for the properties havking enumerated values . However the earlier version does not expose these values .

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,936
× 233
× 137
× 40

Question asked: Dec 07 '12, 11:20 a.m.

Question was seen: 6,652 times

Last updated: Feb 26 '13, 11:40 a.m.

Confirmation Cancel Confirm