- From: Eric Prud'hommeaux <eric@w3.org>
- Date: Wed, 2 Feb 2005 03:01:03 -0500
- To: Yoshio FUKUSHIGE <fuku@w3.org>
- Cc: public-rdf-dawg@w3.org
- Message-ID: <20050202080103.GO14150@w3.org>
On Wed, Feb 02, 2005 at 03:59:37PM +0900, Yoshio FUKUSHIGE wrote: > Eric, what is spat as the query result? > > With "CONSTRUCT *", I don't think the list information will be lost... > My misunderstanding? http://www.w3.org/2001/sw/DataAccess/rq23/#construct [[ The form CONSTRUCT * returns an RDF that is equivalent to the subgraph of the data graph that has all the triples that matched the query. It will give all the same bindings if the query is executed on the returned graph. ]] So it comes down to the definition of the magic predicate owl:member. If it's outside the spec, and in some service policy, then another query engine with a different policy could fail to match owl:member on a graph that looks like: Eric sharesOfficeWith _:list1. _:list1 rdf:first Philippe. _:list1 rdf:next _:list2. _:list1 rdf:first David. _:list1 rdf:next rdf:nil. So if the server understands predicates that an intermediate might not understand, it needs to break the data down to a universally understood form: Eric sharesOfficeWith _:list1. _:list1 owl:member Philippe. _:list1 owl:member David. (which loses the closed aspect to the list). If the WG does specify owl:member, then every agent that consumes CONSTRUCT'd graphs that imply DAWG-defined triples must also understand how to get at those triples. Apart from this, the client code could potentially be as simple as an HTTP client plus an API that matches a single triples: require LWP::UserAgent; require CGI; my $ua = LWP::UserAgent->new; my $response = $ua->get('http://service.example/?q='. CGI::escape('CONSTRUCT *'). CGI::escape('WHERE { (Eric sharesOfficeWith ?list)'). CGI::escape(' (?list owl:member ?who) }')); use RDF::Redland; my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'"); my $model=new RDF::Redland::Model($storage, $response->content()); my (@who)=$model->targets(undef, owl:member); If we are shipping the actual list down to this client, the person writing the query with owl:member in it must also (know to) write a more complex traversal of the results: my @who; for (my $list = $model->targets(Eric, sharesOfficeWith)[0]; $list != rdf:nil; $list = $model->targets($list, rdf:next)[0]) { push (2who, $model->targets($list, rdf:first); } Clearly not the end of the world, but it does place more burden on the client to extract what he wants from the results. If we use a syntactic accessor: WHERE { (Eric sharesOfficeWith ?list) (?list %MEMBER ?who) } we still have to make the above decision. (The only advantage of the special syntax is that we are confident it matches only elements in a list rather than repeated properties with a magic property.) > >> Client1 asks Server1: > >> CONSTRUCT * > >> WHERE { (Eric sharesOfficeWith ?list) (?list owl:member ?who) } > >> > >> Client1 learns: > >> Joe hasAssets ?list. ?list owl:member (Philippe, David, Michiko, > >> Yoshio, ...) > > > >oops, screwed up. Those parens aren't there. > > > > Joe hasAssets ?list. ?list owl:member Philippe, David, Michiko, > > Yoshio, ... > >Not using the shorhand ',' syntax: > > > > Joe hasAssets ?list. > > ?list owl:member Philippe. > > ?list owl:member David. > > ?list owl:member Michiko. > > ?list owl:member Yoshio. > > ... > > Cheers, > -- > Yoshio Fukushige > W3C fellow at Keio > 5322 Endo Fujisawa Kanagawa 252-8520 > Tel. +81-466-49-1170 > Fax. +81-466-49-1171 > fuku@w3.org > -- -eric office: +81.466.49.1170 W3C, Keio Research Institute at SFC, Shonan Fujisawa Campus, Keio University, 5322 Endo, Fujisawa, Kanagawa 252-8520 JAPAN +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA cell: +81.90.6533.3882 (eric@w3.org) Feel free to forward this message to any list for any purpose other than email address distribution.
Received on Wednesday, 2 February 2005 08:01:04 UTC