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

DNG : OSLC query to get views in a module

 Where can I find a sample OSLC query to get the views (shared and/or personnal) existing in a DNG module ?


My goal is :
  • Mini : get the view name, URI, status (shared or personnal)
  • Maxi : get the view name, URI, status  and attributes list

Thank you for your help.

Regards.

0 votes


Accepted answer

Permanent link

 Hi


If you follow the discovery sequence for your project/component/configuration you'll get a configuration-specific services.xml which includes query capabilities, and one of these is for views http://jazz.net/ns/rm/dng/view#View. NOTE this query capability doesn't pay attention to oslc.where or oslc.select - you get the detail for all views - for 7.0.2 this includes the scope and if module-scope the module ID, and whether it is shared. I assume it won't show you other user's private views..


I think that was for 6.0.6.1 but whichever version it was for didn't then include the query capability for views.

This example services.xml (which does include the view query capability) below is from a component in 7.0.2, marked by <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/view#View"/>. The services.xml for this component is at URL https://jazz.ibm.com:9443/rm/oslc_rm/-_28tkB6Eeuh3Iiax2L3Ow/services.xml - apologies I think jazz.net has abbreviated that URL. Your URL may well be different but will still end with services.xml.
:
NOTE 1. of course you must include the configuration when you make the query.
NOTE 2: the View query doesn't appear to use the oslc.select and oslc.where query parameters.


To find this, do a GET on the component services.xml with headers:
  • OSLC-=Core-Version: 2.0
  • Accept: application/rdf+xml
  • Configuration.Context: the configuration URL


<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc_config="http://open-services.net/ns/config#"
    xmlns:jazzDisc="http://jazz.net/ns/discovery#"
  <oslc:ServiceProvider rdf:about="https://jazz.ibm.com:9443/rm/oslc_rm/-28tkB6Eeuh3Iiax2L3Ow/services.xml">
    <jp10:supportLinkDiscoveryViaLinkIndexProvider rdf:datatype=
    <dcterms:publisher rdf:resource="https://jazz.ibm.com:9443/rm/application-about"/>
    <jp10:globalConfigurationAware rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >no</jp10:globalConfigurationAware>
    <oslc:service>
      <oslc:Service>
        <oslc:creationDialog>
          <oslc:Dialog>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:hintHeight>530px</oslc:hintHeight>
            <oslc:hintWidth>600px</oslc:hintWidth>
            <oslc:label>Collection</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Collection Creation</dcterms:title>
          </oslc:Dialog>
        </oslc:creationDialog>
        <oslc:selectionDialog>
          <oslc:Dialog>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:hintHeight>550px</oslc:hintHeight>
            <oslc:hintWidth>800px</oslc:hintWidth>
            <oslc:label>Requirement</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Generic Requirement Selection</dcterms:title>
          </oslc:Dialog>
        </oslc:selectionDialog>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TGkB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TKUB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7THkB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TIUB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TJUB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TJ0B6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TF0B6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TKkB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TIEB6Eeuh3Iiax2L3Ow"/>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TGUB6Eeuh3Iiax2L3Ow"/>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Collection Creation Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <calm:filter>
          <calm:Filter>
            <calm:filterBase rdf:resource="https://jazz.ibm.com:9443/rm/calmFilter/-_28tkB6Eeuh3Iiax2L3Ow/requirementsChangedSince"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:usage rdf:resource="http://jazz.net/xmlns/prod/jazz/calm/1.0/requirementsChangedSince"/>
            <dcterms:title>Requirements Changed Since Filter</dcterms:title>
          </calm:Filter>
        </calm:filter>
        <oslc:queryCapability>
          <oslc:QueryCapability>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Query Capability</dcterms:title>
          </oslc:QueryCapability>
        </oslc:queryCapability>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Requirement Creation Factory</dcterms:title>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OT_v7FZkHOiEeytoJ46yP5LHA"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TH0B6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TGEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TIkB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TKEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7THEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TK0B6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TJkB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TJEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7THUB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TG0B6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/OTx7TI0B6Eeuh3Iiax2L3Ow"/>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:creationDialog>
          <oslc:Dialog>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:hintHeight>530px</oslc:hintHeight>
            <oslc:hintWidth>600px</oslc:hintWidth>
            <oslc:label>Requirement</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Generic Requirement Creation</dcterms:title>
          </oslc:Dialog>
        </oslc:creationDialog>
        <oslc:queryCapability>
          <oslc:QueryCapability>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/navigation#folder"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Folder Query Capability</dcterms:title>
          </oslc:QueryCapability>
        </oslc:queryCapability>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://www.ibm.com/xmlns/rdm/types/TypeImportSession"/>
            <oslc:creation rdf:resource="https://jazz.ibm.com:9443/rm/type-import-sessions"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Type System Copy Session Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:selectionDialog>
          <oslc:Dialog>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:hintHeight>550px</oslc:hintHeight>
            <oslc:hintWidth>800px</oslc:hintWidth>
            <oslc:label>Requirement</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Requirement Selection</dcterms:title>
          </oslc:Dialog>
        </oslc:selectionDialog>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/config#DeliverySession"/>
            <oslc:creation rdf:resource="https://jazz.ibm.com:9443/rm/delivery-sessions"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Delivery Session Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:selectionDialog>
          <oslc:Dialog>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>
            <oslc:hintHeight>550px</oslc:hintHeight>
            <oslc:hintWidth>800px</oslc:hintWidth>
            <oslc:label>Collection</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Collection Selection</dcterms:title>
          </oslc:Dialog>
        </oslc:selectionDialog>
        <oslc:domain rdf:resource="http://open-services.net/ns/rm#"/>
        <oslc:creationDialog>
          <oslc:Dialog>
            <oslc:usage rdf:resource="http://open-services.net/ns/core#default"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/>
            <oslc:hintHeight>530px</oslc:hintHeight>
            <oslc:hintWidth>600px</oslc:hintWidth>
            <oslc:label>Requirement</oslc:label>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Requirement Creation</dcterms:title>
          </oslc:Dialog>
        </oslc:creationDialog>
      </oslc:Service>
    </oslc:service>
    <oslc:service>
      <oslc:Service>
        <oslc:queryCapability>
          <oslc:QueryCapability>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/view#View"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >View Definition Query Capability</dcterms:title>
          </oslc:QueryCapability>
        </oslc:queryCapability>
        <oslc:queryCapability>
          <oslc:QueryCapability>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/reqif#ReqIFDefinition"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ReqIF Definition Query Capability</dcterms:title>
          </oslc:QueryCapability>
        </oslc:queryCapability>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/reqif#ReqIFExport"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ReqIF Export Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/reqif#ReqIFDefinition"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ReqIF Definition Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/reqif#ReqIFPackage"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ReqIF Package Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:creationFactory>
          <oslc:CreationFactory>
            <oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/J_JEEB6Eeuh3Iiax2L3Ow"/>
            <oslc:resourceType rdf:resource="http://jazz.net/ns/rm/dng/reqif#ReqIFImport"/>
            <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ReqIF Import Factory</dcterms:title>
          </oslc:CreationFactory>
        </oslc:creationFactory>
        <oslc:domain rdf:resource="http://jazz.net/ns/rm/dng/reqif#"/>
      </oslc:Service>
    </oslc:service>
    <dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Service Descriptor for Project: rm_optout_p1</dcterms:description>
    <jp10:supportLinkDiscoveryViaOSLCQueries rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
    >true</jp10:supportLinkDiscoveryViaOSLCQueries>
    <jp10:supportContributionsToLinkIndexProvider rdf:datatype=
    <oslc:details rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/-_28tkB6Eeuh3Iiax2L3Ow"/>
    <jp10:supportOSLCSimpleQuery rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
    >true</jp10:supportOSLCSimpleQuery>
    <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >rm_optout_p1</dcterms:title>
  </oslc:ServiceProvider>
</rdf:RDF>





Jean-François CHAPELLE selected this answer as the correct answer

0 votes

Comments

Returns views from other components also. I have 2 Module Types, with 2 shared views each (zero personal views for the logged user). I am expecting only 4 <rdfs:member> node; but 34 nodes are present in my response.

How to find the Module Type to which the View is associated.

I am using 702.

That looks like the OSLC Query capability URL for views - it returns instances of shared views - I guess you've got 17 modules each with two views.

Also you should be providing a configuration with this URL either through a query parameter oslc_config.context or a header Configuration-Context - otherwise you'll get results from the default configuration.


One other answer

Permanent link

@ianbarnard,



Headers:
  • OSLC-Core-Version: 2.0
  • Accept: application/rdf+xml
  • Configuration-Context: the configuration URL
returns

    <rdfs:member>
      <dng_view:ViewDefinition rdf:about="https://localhost:9443/rm/views/VW_GchyuvctEe6WWrIwsxuKgg">
        <dcterms:title>Requirements Capture</dcterms:title>
        <dcterms:description> </dcterms:description>
        <dng_view:shared rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_view:shared>
        <dng_view:scopedArtifact rdf:resource="https://localhost:9443/rm/resources/MD_CIu4RFKSEeynovSJOwlrnw" />
        <dng_view:applicability rdf:resource="http://jazz.net/ns/rm/dng/view/scope#module" />
        <acp:accessControl rdf:resource="https://localhost:9443/rm/accessControl/_UCzOUOfFEeyt2rcBAVlGUA" />
        <oslc:serviceProvider rdf:resource="https://localhost:9443/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml" />
      </dng_view:ViewDefinition>
    </rdfs:member>
    <rdfs:member>
      <dng_view:ViewDefinition rdf:about="https://localhost:9443/rm/views/VW_GchypPctEe6WWrIwsxuKgg">
        <dcterms:title>V&amp;V Planning [Public]</dcterms:title>
        <dcterms:description> </dcterms:description>
        <dng_view:shared rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_view:shared>
        <dng_view:scopedArtifact rdf:resource="https://localhost:9443/rm/resources/MD_CIu4Q1KSEeynovSJOwlrnw" />
        <dng_view:applicability rdf:resource="http://jazz.net/ns/rm/dng/view/scope#module" />
        <acp:accessControl rdf:resource="https://localhost:9443/rm/accessControl/_UCzOUOfFEeyt2rcBAVlGUA" />
        <oslc:serviceProvider rdf:resource="https://localhost:9443/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml" />
      </dng_view:ViewDefinition>
    </rdfs:member>
    <rdfs:member>
      <dng_view:ViewDefinition rdf:about="https://localhost:9443/rm/views/VW_GchyrvctEe6WWrIwsxuKgg">
        <dcterms:title>SOR Classic VnV Table</dcterms:title>
        <dcterms:description>exporting classical VnV table acc. to legacy BHI Template</dcterms:description>
        <dng_view:shared rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_view:shared>
        <dng_view:applicability rdf:resource="http://jazz.net/ns/rm/dng/view/scope#module" />
        <acp:accessControl rdf:resource="https://localhost:9443/rm/accessControl/_UCzOUOfFEeyt2rcBAVlGUA" />
        <oslc:serviceProvider rdf:resource="https://localhost:9443/rm/oslc_rm/_UCzOUOfFEeyt2rcBAVlGUA/services.xml" />
      </dng_view:ViewDefinition>
    </rdfs:member>
  </rdf:Description>
  <oslc:ResponseInfo rdf:about="https://localhost:9443/rm/views_oslc/query">
    <dcterms:title>Query Results : 3</dcterms:title>
  </oslc:ResponseInfo>
</rdf:RDF>

This does not have any resourceShape nodes. Schema of the xml response that you have reported & the one I got are different. Am I missing something on the Headers.

0 votes

Comments

You're comparing apples with oranges. The example in my post is for the services.xml which includes the QueryCapability for views and yes it includes resourceShape references. With the URL you're using you're getting the results of the query for views in a component - that will be different and won't include resourceShape references. 

Your results have two views which are module-specific (the module is in the dng_view:scopedArtifact tag) and one view which isn't for a specific module.


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
× 12,019
× 516
× 479
× 201
× 60

Question asked: Jan 19 '22, 1:16 a.m.

Question was seen: 2,295 times

Last updated: Oct 29, 10:43 a.m.

Confirmation Cancel Confirm