It's all about the answers!

Ask a question

How to set an attribute while creating artifact using rest api


Meera Varma (911012) | asked Dec 07 '12, 11:20 a.m.
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>



Comments
Meera Varma commented Dec 10 '12, 5:59 a.m.

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
Meera Varma (911012) | answered Feb 26 '13, 11:40 a.m.
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 .

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.