Prev | Next |
Combine oslc.where and oslc.select parameters
The 'oslc.where' and 'oslc.select' Query parameters can be combined in the base URI of the Query Capability to retrieve the required properties of all those Resources that satisfy the specified condition. This is similar to using WHERE and SELECT clauses together in a SQL statement.
<protocol>://<server>/<model_name>/oslc/am/qc/?oslc.select=<CSV of Resource Properties> & oslc.where=<conditions>
Examples
These example queries act on a model called 'firebird_model' connected through the Pro Cloud Server.
No. |
Query |
---|---|
1 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=* & oslc.where=dcterms:title="Class1" Selects all properties of Resources that have the name 'Class1'. |
2 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=dcterms:title & oslc.where=dcterms:title="Class1" and dcterms:type="Class" Selects the name of every Enterprise Architect Class Type Resource with the name 'Class1'. |
3 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=dcterms:title,dcterms:type,dcterms:identifier & oslc.where=ss:resourcetype in ["Package","Diagram"] Selects the name, type and GUID of every Enterprise Architect Package and diagram in the model. |
4 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=dcterms:title,dcterms:identifier,ss:resourcetype & oslc.where=ss:stereotype{ss:fqname in ["BPMN2.0::BusinessProcess", "BPMN2.0::BPELProcess"] and ss:parentresourceidentifier="pk_{2DFF8796-9D6F-4381-B2DC-4C7FFEB881E2}" Selects the name, GUID and Resource Type of every Resource in a Package with the GUID {2DFF8796-9D6F-4381-B2DC-4C7FFEB881E2}, that are either BPMN 2.0 Business Process or BPMN 2.0 BPEL Process elements. |
5 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=dcterms:title,dcterms:creator{foaf:name},ss:version & oslc.where=ss:linkedresources{*=<http://localhost:480/firebird_model/oslc/am/resource/el_{B55E995C-D8EA-4fa9-9006-7932294961A9}>} Selects the name, author and version of every Resource in the model that links to 'Class1' (which has the Enterprise Architect GUID {B55E995C-D8EA-4fa9-9006-7932294961A9}). |
6 |
http://localhost:480/firebird_model/oslc/am/qc/?oslc.select=dcterms:title & oslc.where=dcterms:created<"01-05-2020" Returns an error response, as the value of the Resource property 'created' is not in a valid format. |
Notes
- This facility is available through the Pro Cloud Server, with a valid license
- Dates must be specified in the format YYYY-MM-DD
- In a security-enabled model, you need to provide the User Authentication Token (via the 'useridentifier' query string in the URL) in the GET request to retrieve the Resource/Resource Feature XML
Learn more
- OSLC Query Syntax (Online Resource)
- oslc.where (Online Resource)
- oslc.select (Online Resource)
- User Authentication Token