クエリ

<< 目次を表示 >>

ページ位置:  プロジェクトの作成と管理 > Proクラウドサーバ > 有料ライセンスで利用できる機能 > OSLCの利用 > OSLC Architecture Management 2.0 >

クエリ

クライアントはモデルに対してクエリ(問い合わせ)を行い、特定の条件に合致するリソースを取得できます。Enterprise Architectでは、クエリ機能にアクセスするための基本URIは以下の通りです。

 

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

 

特定の条件を表すクエリ文字列をベース URI に追加し、HTTP GET リクエストを使用してモデル宛に送信する必要があります。URIが長くなりすぎる場合(例えば1000文字を超える場合)、HTTP POSTリクエストを使用し、POSTの本体にクエリ文字列を記述することが推奨されます。このリクエストに対する応答は、RDF/XML形式になります。現在、Enterprise Architectでは、パッケージ・要素・ダイアグラムのプロパティのみ問い合わせることができます。属性・操作・シナリオなどの機能については問い合わせることができません。

 

Enterprise Architectでは、条件を指定するために、以下のQuery Capabilityパラメータをサポートしています。

 

 

これらのパラメータを個別に、または組み合わせて使用することで、リソースを取得するための条件を指定することができます。

 

応答のXMLの構成要素

項目

説明

oslc_am:Resource

OSLC Architecture Management 2.0 Resourceとそのプロパティ(Resource Shapeで定義されているもの)を表します。この要素の 'rdf:about' 属性は、リソースにアクセスするための URL を指定します。このURLのフォーマットは以下の通りです。

 

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

Elements with namespace prefix 'dcterms'

Dublin Core Metadata Element Set の標準プロパティです。

Elements with namespace prefix 'foaf'

Friend of a Friend (FOAF) Vocabulary の標準プロパティです。

Elements with namespace prefix 'ss'

Enterprise Architectのカスタムプロパティです。

 

 

種類がアクターのすべての要素を取得します。

 

応答の例は以下の通りです。

 

<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>

 

 

注意:

  • OSLCの機能は有料ライセンスが適用されたProクラウドサーバのみで利用できます。
  • リソースやリソースフィーチャーの取得は、ユーザー認証トークンを渡すことが必要です。渡されない場合には処理は行いません。

 

 

参照: