预订演示
前页 后页

Query Capability

Clients can query a model and retrieve the Resources that match a specific criteria. In Enterprise Architect, the base URI for accessing the Query Capability is:

     <protocol>://<server>/<model_name>/oslc/am/qc/

A query string expressing the specific criteria should be added to the base URI and addressed to the model using an HTTP GET request. If the URI becomes too long (say, it exceeds 1000 characters), it is recommended to use an HTTP POST request, with the query string in the POST body. The response for this request will be in RDF/XML format. Currently, Enterprise Architect supports querying on Package, element and diagram properties only (and not on features such as attributes, operations and scenarios).

Enterprise Architect supports these Query Capability parameters for specifying the criteria:

  • oslc.where - specifies the conditions that the Resources must satisfy and is similar to the WHERE clause of a SQL statement
  • oslc.select - specifies the Resource properties to be retrieved and is similar to the SELECT clause of a SQL statement

These parameters can be used separately or in combination to specify the criteria for retrieving the Resources.

Elements of the Response XML

Element

Description

See also

oslc_am:Resource

Represents an OSLC Architecture Management 2.0 Resource and its properties (as defined in the Resource Shape). The attribute 'rdf:about' on this element specifies the URL for accessing the Resource. The format for this URL is:

<protocol>://<server>/<model_name>/oslc/am/resource/<Resource GUID With Prefix>/

Elements with namespace prefix 'dcterms'

The standard properties from the Dublin Core Metadata Element Set.

Elements with namespace prefix 'foaf'

The standard properties from the Friend of a Friend (FOAF) Vocabulary.

Elements with namespace prefix 'ss'

The custom Enterprise Architect properties.

Example

Retrieve all Resources of type Actor in the model:

  • URL : http://localhost:480/firebird_model/oslc/am/qc/?oslc.where=dcterms:type="Actor" & useridentifier={72825AF9-E116-48f1-9DF8-77815E66B1A7}

The response is as shown.

<rdf:RDF>

     <rdf:Description rdf:about="http://mybuildvm:2480/firebird_model/oslc/am/qc/">

          <rdfs:member>

               <oslc_am:Resource rdf:about="http://localhost:480/firebird_model/oslc/am/resource/el_{9EAD1087-BC1A-4b04-804F-748713D10E42}/">

                    <rdf:type rdf:resource="http://open-services.net/ns/am#Resource"/>

                    <!--Name of the Resource-->

                    <dcterms:title>A1</dcterms:title>

                    <!--Enterprise Architect Type for the Resource-->

                    <dcterms:type>Actor</dcterms:type>

                   <!--GUID of the Resource-->

                    <dcterms:identifier>el_{9EAD1087-BC1A-4b04-804F-748713D10E42}</dcterms:identifier>

                    <!--Author of the Resource-->

                    <dcterms:creator>

                         <foaf:Person>

                              <foaf:name>Sparx</foaf:name>

                         </foaf:Person>

                    </dcterms:creator>

                    <!--Created Date of the Resource-->

                    <dcterms:created>2020-06-21 09:40:58</dcterms:created>

                    <!--Modified Date of the Resource-->

                    <dcterms:modified>2020-07-12 15:43:28</dcterms:modified>

                    <!--Status of the Resource-->

                    <ss:status>Proposed</ss:status>

                    <!--Complexity of the Resource-->

                    <ss:complexity>Easy</ss:complexity>

                    <!--Phase of the Resource-->

                    <ss:phase>1.0</ss:phase>

                    <!--Version of the Resource-->

                    <ss:version>1.0</ss:version>

                    <!--Type of the Resource-->

                    <ss:resourcetype>Element</ss:resourcetype>

                    <!--GUID of the Package that contains this Actor-->

                    <ss:parentresourceidentifier>pk_{56DF19B4-7035-40d2-9030-21D3383562A6}</ss:parentresourceidentifier>

                    <!--Use this link to retrieve the Features of this Actor-->

                    <ss:features rdf:resource="http://localhost:480/firebird_model/oslc/am/features/el_{9EAD1087-BC1A-4b04-804F-748713D10E42}/"/>

                    <!--Use this link to retrieve the Connectors of this Actor-->

                    <ss:nestedresources rdf:resource="http://localhost:480/firebird_model/oslc/am/nestedresources/el_{9EAD1087-BC1A-4b04-804F-748713D10E42}/"/>

               </oslc_am:Resource>

          </rdfs:member>

     </rdf:Description>

</rdf:RDF>

Notes

  • This facility is available through the Pro Cloud Server, with a valid license
  • GET request to retrieve the Resource/Resource Feature will not be processed by the Pro Cloud Server unless the User Authentication Token is passed in with the request (via the 'useridentifier' query string in the URL)

Learn more