[oslc-core] Example of a self-subject query capability representation?

Arthur Ryman ryman at ca.ibm.com
Wed Apr 28 10:00:14 EDT 2010


Dave,

1. * Why would you use a multi-subject query vs. a single-subject query?
I would like to spell this out in the section that defines the two
types.

The conceptual model behind the simple query syntax is that you start with 
some base URL which normally would be a plain old resource, i.e. you could 
GET the base URL and see a natural looking XML document. This document 
would be RDF/XML compliant and start with a document root element that 
represents a resource node in the RDF graph. The base URL is therefore the 
subject of a set of RDF triples that give the properties of the resource. 
Hence "self-subject" since the base URL is itself the subject.

The simple query syntax builds on this concept of resources by allowing 
you to control the amount of information you get back in the HTTP 
response. The oslc.properties query parameter lets use control which 
properties you get, and whether you want to inline any nested properties. 
The response for the query looks similar to the response for the bare base 
URL. They both begin with the base URL as the document element subject 
node in the XML (via rdf:about).

The other query parameters extend this model by letting you manage 
multi-valued properties that are typically used to model membership in a 
container. You can select a subset of those via oslc.where, and can 
control the amount and order of information coming back in the response.

In summary, the self-subject query is a natural extension of doing a GET 
on the base URL. 

Now suppose you want to do a search that can't be modelled as a 
self-subject query since there is no single resource in the RDF model that 
acts as the starting point. Full text search is a good example. Suppose 
your service manages bugs, requirements, and test cases, and you have 3 
top-level resources that contain these, e.g.

http://example.com/bugs
http://example.com/requirements
http://example.com/testcases

The solution is to define a new query capability base URL, that represents 
the above three resources, e.g.

http://example.com/all

Suppose you want to search for the top ten hits on resources that deal 
with Sarbanes-Oxley. The following query does this:

http://example.com/all?oslc.searchTerms=
"Sarbanes-Oxley","SOX"&oslc.limit=10

Now the result in general involves three different subject resources so 
the RDF/XML represent must start with <rdf:RDF>, e.g.

<rdf:RDF>

<ex:BugList rdf:about="http://example.com/bugs">
        <ex:memberBug>
                <ex:Bug rdf:about="http://example.com/bugs/42009">
                        <oslc:score>0.99</oslc:score>
                </ex:Bug>
        </ex:memberBug>
</ex:BugList>

<ex:RequirementsList rdf:about="http://example.com/requirements">
        <ex:memberRequirement>
                <ex:Requirement rdf:about="
http://example.com/requirement/77387">
                        <oslc:score>0.95</oslc:score>
                </ex:Requirement >
        </ex:memberRequirement>
</ex:RequirementsList >

<ex:BugList rdf:about="http://example.com/bugs">
        <ex:memberBug>
                <ex:Bug rdf:about="http://example.com/bugs/38918">
                        <oslc:score>0.90</oslc:score>
                </ex:Bug>
        </ex:memberBug>
</ex:BugList>

<!-- another 7 resources go here -->

</rdf:RDF>

Regards, 
___________________________________________________________________________ 

Arthur Ryman, PhD, DE


Chief Architect, Project and Portfolio Management

IBM Software, Rational

Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063
Twitter | Facebook | YouTube







From:
Dave <snoopdave at gmail.com>
To:
oslc-core <oslc-core at open-services.net>
Date:
04/26/2010 04:51 PM
Subject:
Re: [oslc-core] Example of a self-subject query capability representation?
Sent by:
oslc-core-bounces at open-services.net



Thanks Arthur. I'm going to have to think on this some more. We've got
a ways to go before this is dumbed down to my level ;-) I have a
couple more questions, if you please:

* Why would you use a multi-subject query vs. a single-subject query?
I would like to spell this out in the section that defines the two
types.

* Are there different parameters that apply with single vs. multi? I
could not see any, but perhaps I did not read closely enough.

* If you define a single-subject query must you also define the
"shape" of the resulting response And specifically, how did we know,
in Tack's example, that the root element would be <ems:ProjectList>?

Thanks,
- Dave


On Mon, Apr 26, 2010 at 3:44 PM, Arthur Ryman <ryman at ca.ibm.com> wrote:
> The most frequent case would be a self-subject query since any resource
> can be its base URL. The Query Capabilities then simply identify a few
> root resources to start off the discovery process. That is what 
Reporting
> is supporting.
>
> The multi-subject case allows some additional use cases (e.g. full text
> search across all resources, search across multiple lists of the same
> type, e.g. different project areas) but perhaps these are not worth
> specifying in the core.  If no one has a compelling need for this, I am 
OK
> with dropping it.  Perhaps the more powerful types of query should be
> handled by an RDF index running full SPARQL.
>
> Regards,
> 
___________________________________________________________________________
>
> Arthur Ryman, PhD, DE
>
>
> Chief Architect, Project and Portfolio Management
>
> IBM Software, Rational
>
> Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063
> Twitter | Facebook | YouTube
>
>
>
>
>
>
>
> From:
> Dave <snoopdave at gmail.com>
> To:
> Arthur Ryman/Toronto/IBM at IBMCA
> Cc:
> oslc-core <oslc-core at open-services.net>,
> oslc-core-bounces at open-services.net
> Date:
> 04/26/2010 03:09 PM
> Subject:
> Re: [oslc-core] Example of a self-subject query capability 
representation?
>
>
>
> I think the differences in format are pretty different. In one case
> you have a response that contains a sequence of resource
> representations, each with properties, and in the other case you get
> one resource with a multi-valued property that has resource
> values-types.
>
> Conceptually, this may make sense but I think it is pretty hard to
> explain to consumer and provider implementations. Can't we just have
> one format of query response?
>
> - Dave
>
>
>
> On Mon, Apr 26, 2010 at 2:58 PM, Arthur Ryman <ryman at ca.ibm.com> wrote:
>> Dave,
>>
>> It is very easy to convert the format of a single-subject response into
> a
>> multi-subject reponse that just has one subject. You merely put the
>> single-subject response inside <rdf:RDF> ... </rdf:RDF>. I don't think
>> this is a big burden for parsers (i.e. to logically supply rdf:RDF if 
it
>> is missing).
>>
>> The single-subject response is similar to the representation you get
> from
>> an HTTP GET on a resource URL without any query parameters, and that 
one
>> has no rdf:RDF. On the other hand, a multi-subject response MUST in
>> general start with rdf:RDF.  So I think we need both (unless we are
> happy
>> requiring ALL RDF/XML representations to start with rdf:RDF).
>>
>>
>> Regards,
>>
> 
___________________________________________________________________________
>>
>> Arthur Ryman, PhD, DE
>>
>>
>> Chief Architect, Project and Portfolio Management
>>
>> IBM Software, Rational
>>
>> Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063
>> Twitter | Facebook | YouTube
>>
>>
>>
>>
>>
>>
>>
>> From:
>> Dave <snoopdave at gmail.com>
>> To:
>> oslc-core <oslc-core at open-services.net>
>> Date:
>> 04/26/2010 02:38 PM
>> Subject:
>> Re: [oslc-core] Example of a self-subject query capability
> representation?
>> Sent by:
>> oslc-core-bounces at open-services.net
>>
>>
>>
>> Thanks Arthur,
>>
>> That is very helpful and I think I understand how single-subject query
>> responses are formed.
>>
>> My next question is this: is it possible for us to continue to have
>> two different conceptual types of queries (single and multi-subject)
>> but to use the very exact same response representation for both? This
>> would be very helpful to clients, who would not have to maintain two
>> separate code paths for parsing OSLC query results.
>>
>> - Dave
>>
>>
>>
>> On Mon, Apr 26, 2010 at 2:27 PM, Arthur Ryman <ryman at ca.ibm.com> wrote:
>>> Dave,
>>>
>>> The example query response in the core spec is a mult-subject response
>>> since it begins with <rdf:RDF>.
>>>
>>> A "container" resource or a "collection" resource is a plain old
>> resource
>>> that has some multi-valued property that we regard as a membership
>>> property. The values of this property are the members of the
>>> container/collection/list/... We can filter, sort, etc. this set of
>>> members using "member list pattern" queries.
>>>
>>> The core spec links to examples of self-subject query responses [1].
> For
>>> example, the resource  http://braintwistors.example.com/ems10/Project
> is
>> a
>>> container resource that contains the list of all project resources. It
>> has
>>> a multi-valued property ems:memberProject that refers to the member
>>> projects.
>>>
>>> <ems:ProjectList xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#
> "
>>>   xmlns:dc="http://purl.org/dc/terms/" xmlns:ems="
>>> http://open-services.net/software-metrics/"
>>>   rdf:about="http://braintwistors.example.com/ems10/Project">
>>>   <dc:title>BrainTwistors Corp. Project List</dc:title>
>>>   <dc:description>
>>>      This is the list of all Project resources contained in
>>>      BrainTwistors Corp. MetricServer web application.
>>>      </dc:description>
>>>   <ems:service rdf:resource="http://braintwistors.example.com/ems10" 
/>
>>>
>>>   <ems:memberProject rdf:resource="
>>> http://braintwistors.example.com/ems10/Project/2009" />
>>>   <ems:memberProject rdf:resource="
>>> http://braintwistors.example.com/ems10/Project/3707" />
>>>   <ems:memberProject rdf:resource="
>>> http://braintwistors.example.com/ems10/Project/3998" />
>>>   <!--
>>>      Other members of this ProjectList resource have been omitted for
>>>      brevity.
>>>   -->
>>> </ems:ProjectList>
>>>
>>> The following query filters the project list:
>>>
>>>
> http://braintwistors.example.com/ems10/Project?oslc.where=dc:identifier=
>>> "2009"
>>>
>>> The query response is:
>>>
>>> <ems:ProjectList xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#
> "
>>>   xmlns:dc="http://purl.org/dc/terms/" xmlns:ems="
>>> http://open-services.net/software-metrics/"
>>>   rdf:about="http://braintwistors.example.com/ems10/Project">
>>>   <ems:memberProject rdf:resource="
>>> http://braintwistors.example.com/ems10/Project/2009" />
>>> </ems:ProjectList>
>>>
>>> [1]
>>>
>>
> 
http://open-services.net/bin/view/Main/OslcSimpleQuerySemanticsV1#Examples
>>> Regards,
>>>
>>
> 
___________________________________________________________________________
>>>
>>> Arthur Ryman, PhD, DE
>>>
>>>
>>> Chief Architect, Project and Portfolio Management
>>>
>>> IBM Software, Rational
>>>
>>> Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063
>>> Twitter | Facebook | YouTube
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> From:
>>> Dave <snoopdave at gmail.com>
>>> To:
>>> oslc-core <oslc-core at open-services.net>
>>> Date:
>>> 04/26/2010 12:45 PM
>>> Subject:
>>> [oslc-core] Example of a self-subject query capability 
 representation?
>>> Sent by:
>>> oslc-core-bounces at open-services.net
>>>
>>>
>>>
>>> I need a little help understanding the most recent changes in the
>>> Query Capabilities section of the spec. We now have two types of query
>>> capabilities, multi-subject and self-subject but we only illustrate
>>> multi-subject queries in our examples. I'm trying to understand what a
>>> self-subject query response would look like. Here's how it is
>>> described in the Core spec:
>>>
>>> "The RDF/XML representation of the query result begins with a node
>>> element whose rdf:about attribute value is equal to the base URI.
>>> Typically, the base URI is a container resource that may have a long
>>> list of members, e.g. the list of all defects in a bug tracking
>>> system. Since the list may contains hundreds of thousands of members,
>>> queries are used to filter the list for members that satisfy certain
>>> conditions, e.g. the bugs that have high priority and were created
>>> this week."
>>>
>>> I don't know what "the base URI is a container resource that may have
>>> a long list of members" means. Are we using a multi-valued property
>>> here to hold the resources that match the query? Tack or Arthur, would
>>> one of you please provide a simple example of a self-subject query
>>> response?
>>>
>>> Thanks,
>>> - Dave
>>>
>>> _______________________________________________
>>> Oslc-Core mailing list
>>> Oslc-Core at open-services.net
>>> http://open-services.net/mailman/listinfo/oslc-core_open-services.net
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Oslc-Core mailing list
>> Oslc-Core at open-services.net
>> http://open-services.net/mailman/listinfo/oslc-core_open-services.net
>>
>>
>>
>>
>
>
>
>

_______________________________________________
Oslc-Core mailing list
Oslc-Core at open-services.net
http://open-services.net/mailman/listinfo/oslc-core_open-services.net







More information about the Oslc-Core mailing list