This wiki is locked. Future workgroup activity and specification development must take place at our new wiki. For more information, see this blog post about the new governance model and this post about changes to the website.
TWiki> Main Web>AMQuerySyntaxV1? >AmQuerySpecV1 (14 Jul 2010, JimConallen)

Architecture Management Simple Query


The OSLC AM service specification leverages the OSLC Core specification and syntax for simple query. The query URI is specified in the services document. Clients use this URI to GET (or POST) simple queries, and receive an ATOM formatted response with OSLC AM Resource (RDF/XML) in each entry's <content>.

The OSLC AM specification does not require the use of OSLC Core Resource Shapes. This specification only requires service providers to support the Member List Pattern defined in the query syntax.

To perform a query an OSLC client first creates a URI by starting with a Query Capability's base URI as a base and adding a URI Query String to express the query criteria. The OSLC client then uses HTTP GET to request a Query Resource representation of the query results. The Query Resource representation will contain property values about the query and a collection of resources that match the query criteria.

Predefined Prefixes

For simplicity, this specification pre-defines some prefixes that can are used in the query string:

When a property name does not use one of these prefixes, then the oslc.prefix parameter can be used to explicitly specify it (or override one of these existing definitions). This parameter is useful when referencing custom properties (those defined outside of this specification).

HTTP GET Queries

To perform an HTTP GET query, an OSLC client starts with the base URI as defined by the oslc:queryBase property of a Query Capability, and appends to it query parameters in a syntax supported by the service. The resulting URI is the query URI. The OSLC client sends an HTTP GET request to the query URI, optionally specifying the preferred content media type for the query response in the HTTP Accept header. OSLC services MUST support query responses in RDF/XML format (media type application/rdf+xml) and MAY support other formats. OSLC services SHOULD support the Query Syntax defined in this specification, but MAY support other syntaxes.


Alternatively, the client MAY encode the query parameters in the HTTP request body as media type application/x-www-form-urlencoded, and send an HTTP POST request to the base URI. An OSLC service MAY support other query languages using other media types in the request body, e.g. SPARQL (media type application/sparql-query).


The following are examples of queries for OSLC AM resources using the OSLC common simple query syntax. Each of these examples is NOT URL encoded for clarity.

Modifed past a given date

The client wants all the resources that have been modified since April 1, 2010.


With a name and type

The client wants all the resources with the name ICustomer that are a UML interface.

.../query?oslc.where=dcterms:title>"ICustomer" and rdf:type=""

With a custom property

The client wants all the resources with that have the custom property "status" equal to "red". The namespace of this property must be specified with the oslc.prefix parameter.

.../query?oslc.prefix=acme="" and acme:status="red"

Query for all resources that have a link (property) of any type to a given resource URI

The client wants all the resources with that have the custom property "status" equal to "red". The namespace of this property must be specified with the oslc.prefix parameter.


Topic revision: r13 - 14 Jul 2010 - 12:49:01 - JimConallen
This site is powered by the TWiki collaboration platform Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding this site? Send feedback