W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > October 2011

Re: Some questions on sparql/client

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Thu, 20 Oct 2011 16:42:23 -0400
To: Jim Amsden <jamsden@us.ibm.com>
CC: "public-rdf-ruby@w3.org" <public-rdf-ruby@w3.org>, Ben Levender <blavender@gmail.com>
Message-ID: <0BC4757E-848B-44FC-8731-9B130270D6D1@kellogg-assoc.com>
I confess that I haven't really used SPARQL::Client much, even though I released the latest version; Ben can probably answer better.

Gregg Kellogg
Sent from my iPhone

On Oct 20, 2011, at 1:30 PM, "Jim Amsden" <jamsden@us.ibm.com<mailto:jamsden@us.ibm.com>> wrote:

I'm doing some experimenting with RDF.rb and sparql-client. I ran into a couple of problems, possibly because I'm just not understanding how to use the APIs.

1. Distinct not working:

query = sparql.select.where([:thing, RDF.type, :type]).order_by(:type).distinct

The query has duplicates whether distinct is called or not. The query look right (has the distinct keyword) and executing:

query = 'SELECT DISTINCT ?type WHERE { ?thing a ?type . } ORDER BY ?type'

works properly.

2. Construct not working?

query2 = sparql.construct([:s, :s, :o]).where([:s, :p, :o]).limit(10)

doesn't return any statements. Nor does

query2 = sparql.query("construct {?s ?p o} where {?s ?p ?o} limit 10")

But if I execute the construct through RestClient.post endpoint :query => "construct {?s ?p o} where {?s ?p ?o} limit 10"

does return RDF/XML that I can parse into an RDF:Graph


Jim Amsden, Senior Technical Staff Member
Unleash the Labs Solution Architect for Rational EA and ADC Tools
Make a new ULL Request<https://sma-cqwebvm01.ratl.swg.usma.ibm.com/CRT/>
919-461-3689
<ATT00001.gif>
Received on Thursday, 20 October 2011 20:43:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 20 October 2011 20:43:15 GMT