Re: SPARQL server for LIBRIS

From: Lovins, Daniel <daniel.lovins_at_nyob>
Date: Thu, 7 May 2009 17:13:17 -0400
To: NGC4LIB_at_LISTSERV.ND.EDU
The confusion's all mine. :-) 

Thanks very much Martin. I'll play around with this a bit and see what happens.

Daniel

-----Original Message-----
From: Next generation catalogs for libraries [mailto:NGC4LIB_at_LISTSERV.ND.EDU] On Behalf Of Martin Malmsten
Sent: Thursday, May 07, 2009 3:28 PM
To: NGC4LIB_at_LISTSERV.ND.EDU
Subject: Re: SPARQL server for LIBRIS

Ah,

sorry about the confusion. You are right they are terminal commands.  
Here are some example queries (without all the prefix definitions):

Find a(n identifier for) resources that are persons and has the name  
"August Strindberg"
---
select * where {
    ?uri foaf:name "August Strindberg" .
    ?uri rdf:type foaf:Person .
}
---

Find books by this person
--
select * where {
    ?book dc:creator <http://libris.kb.se/resource/auth/94541> .
}
---

Find August Strindberg's authority record in LIBRIS given his DBPedia  
URI
---
select * where {
    ?s owl:sameAs <http://dbpedia.org/resource/August_Strindberg> .
}
---

Describe the resource http://libris.kb.se/resource/auth/94541
---
describe <http://libris.kb.se/resource/auth/94541>
---

*All* books by people who has written about people named August  
Strindberg
---
select ?otherbooks ?title where {
   ?august foaf:name "August Strindberg" ; rdf:type foaf:Person .
   ?books dc:subject ?august ; dc:creator ?someone .
   ?someone rdf:type foaf:Person .
   ?otherbooks dc:creator ?someone ; dc:title ?title .
}
---

One thing I like about SPARQL (or rather RDF) is the fact that there  
is no record type. There are just resources and statements. Some of  
those statements are about type, but they are just like any other  
statement.

/martin

On 7 maj 2009, at 15.22, Lovins, Daniel wrote:

> Hi Martin.
>
> Could you say a bit more specifically (for those of us ill-versed in  
> SPARQL queries) what kind of strings can be entered into the LIBRIS  
> query box? The examples you give below look like terminal command.
>
> Thanks!
>
> Daniel
>
> -----Original Message-----
> From: Next generation catalogs for libraries [mailto:NGC4LIB_at_LISTSERV.ND.EDU 
> ] On Behalf Of Martin Malmsten
> Sent: Thursday, May 07, 2009 5:31 AM
> To: NGC4LIB_at_LISTSERV.ND.EDU
> Subject: SPARQL server for LIBRIS
>
> Hello,
>
> just wanted to share this with you. I've put up a SPARQL server for
> the LIBRIS data. It is still very experimental. You can find it  
> here: http://lab3.libris.kb.se/sparql
>
> There is some HTTP content negotiation going on in the background, so
> you can do stuff like:
>
> curl --header accept:application/sparql-results+xml "http://lab3.libris.kb.se/sparqlquery=select+%3Fs+where+%7B+%3Fs+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23prefLabel%3E+%22Historia%22%40sv+.+%7D%0D%0A
> "
>
> and:
>
> curl --header accept:text/rdf+n3 "http://lab3.libris.kb.se/sparql?query=describe+%3Chttp%3A%2F%2Flibris.kb.se%2Fresource%2Fauth%2F94541%3E
> "
>
> /martin
>
> --------------------------------------------
> Martin Malmsten
> Systemutvecklare / Senior Developer
> Avdelningen för Nationell samverkan/LIBRIS
>
> Kungl. biblioteket/National Library of Sweden
> E-post: martin.malmsten_at_kb.se
> libris.kb.se
Received on Thu May 07 2009 - 17:14:39 EDT