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
)
(raw view)
---+ Architecture Management Simple Query %TOC% ---++ Introduction The OSLC AM service specification leverages the OSLC Core specification and [[OSLCCoreSpecQueryDRAFT][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 [[OSLCCoreSpecQueryDRAFT][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: * rdf - <a target="_top" href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF XML</a> namespace - <a target="_top" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a> * dcterms - The <a target="_top" href="http://dublincore.org/documents/dcmi-terms/">Dublin Core Metadata Terms</a> namespace - <a target="_top" href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a> * foaf - <a target="_top" href="http://xmlns.com/foaf/spec/">Friend of a Friend</a> namespace - <a target="_top" href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a> 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. ---++++ HTTP POST Queries 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=). ---++ Examples 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. <blockquote> =.../query?oslc.where=dcterms:created>"2008-04-01T12:00:00"^^xsd:dateTime= </blockquote> ---+++ With a name and type The client wants all the resources with the name ICustomer that are a UML interface. <blockquote> =.../query?oslc.where=dcterms:title>"ICustomer" and rdf:type="http://www.eclipse.org/uml2/3.0.0/UML/Interface"= </blockquote> ---+++ 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. <blockquote> =.../query?oslc.prefix=acme="http://acme.com/ns/" and acme:status="red"= </blockquote> ---+++ 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. <blockquote> =.../query?oslc.where=*=<http://acme.req.com/requirements/req123>= </blockquote>
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r13
<
r12
<
r11
<
r10
<
r9
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r13 - 14 Jul 2010 - 12:49:01 -
JimConallen
Main
Main Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Main
Sandbox
TWiki
Български
Cesky
Dansk
Deutsch
English
Español
Français
Italiano
日本語
Nederlands
Polski
Português
Русский
Svenska
简体中文
簡體中文
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