Query Barn-Raising

0 views
Skip to first unread message

Zach Beauvais

unread,
Oct 28, 2011, 4:20:53 AM10/28/11
to kasab...@googlegroups.com
Good morning everyone,

Today, we're  having our first virtual barn-raising event. The goal is to add value to datasets, and today's task is to contribute useful or interesting queries to as many datasets as possible. 

There is a new timeline visualisation up on the site, which follows newly-created queries as they're added. The name of the query-creator appears, and you can see a summary of the query with links to the datasets too.

The main meeting point is IRC at #kasabi or irc.freenode.net and you can also send messages to the developer list (reply here, or send to kasab...@googlegroups.com).

I will launch Google Hangouts during the day, and announce the uri via twitter (@teamkasabi) and IRC.

A few tips:

* Try not to duplicate queries
* Try to add queries to datasets with no existing examples
* Use clear titles for your queries
* Make sure to include a description of what to expect from your query when it's run.

Each dataset displays its sample queries—if any exist—on its homepage by default, just under the "Default APIs" and SPARQL section. From there, you can simply click "Create a sample query" to get started. It is helpful to give your sample query a title telling what it does, and a description explaining expected results from running the query. The vocabularies and classes used in each dataset can be found either by clicking the link on the set's page, or by appending /schema to the uri. I also find it useful to have a look at existing queries on other datasets for ideas.

This is also an opportunity to practice your SPARQL, or ask questions and polish up your query skills, so feel free to ask for help or share ideas on IRC.


Cheers!

-Z


---
Zach Beauvais | @zbeauvais
Community Manager, Kasabi

Talis Systems Limited
43 Temple Row
Birmingham, B2 5LS

email: z...@talis.com
skype: zbeauvais
phone: 07775 870 362

Michael Lenahan

unread,
Oct 28, 2011, 7:42:10 AM10/28/11
to kasab...@googlegroups.com
Hello barn-stormers!

I had set today aside to work with you on Kasabi, but some urgent work
has landed on my desk which needs attention *right now*. Always the
way, isn't it, so I'm confining my kasabi to my lunch break.

What I had intended to do today was look at the NHS performance data set.
http://kasabi.com/dataset/nhs-performance-data/apis/36z

What I want to achieve are maps of gps, dentists, etc by local authority.

e.g. Dentists in the London Borough of Lambeth.

This works:

PREFIX nhs: <http://data.kasabi.com/dataset/nhs-organization/def/>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX os: <http://data.ordnancesurvey.co.uk/ontology/postcode/>

SELECT
?org
?postcode
?siteAddress
WHERE {
#?org a nhs:GeneralPractice;
?org a nhs:DentalPractice;
org:hasSite ?site. #;
#org:siteAddress ?siteAddress.

?site os:postcode ?postcode.

# London Borough of Lambeth
?postcode os:district <http://data.ordnancesurvey.co.uk/id/7000000000011144>
}
LIMIT 100

... but it doesn't work any more if I uncomment siteAddress - I can't
seem to get to the vCard information for the dental surgery.

I need this for the name of the surgery.

I hope this makes some sense.

Any tips?

Michael

Michael Lenahan

unread,
Oct 28, 2011, 8:49:03 AM10/28/11
to kasab...@googlegroups.com
An update: sorted, thanks to Zach and Leigh on irc. (nice poetry there)

Google Map:
http://maps.google.com/maps?q=http:%2F%2Fapi.kasabi.com%2Fdataset%2Fnhs-performance-data%2Fapis%2F4bv%3Fapikey%3Da36e7a3bcdd9fcebe0b32b0cef1a146912df1266%26output%3Dkml

Sparql Query:
http://kasabi.com/dataset/nhs-performance-data/apis/4bv/config

PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX rdf-schema: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>

SELECT
?org
?postcode
?adr
?name
?lat
?long


WHERE {
#?org a nhs:GeneralPractice;
?org a nhs:DentalPractice;
org:hasSite ?site.

?site os:postcode ?postcode;
org:siteAddress ?siteAddress.

?siteAddress vcard:adr ?adr.

?adr rdf-schema:label ?name.

?postcode geo:lat ?lat;
geo:long ?long;


# London Borough of Lambeth

os:district <http://data.ordnancesurvey.co.uk/id/7000000000011144>.
}
LIMIT 100

Reply all
Reply to author
Forward
0 new messages