SPARQL queries

102 views
Skip to first unread message

Jennifer B Young

unread,
Sep 26, 2018, 5:23:17 PM9/26/18
to openr...@googlegroups.com

Hi,

 

I’m trying to reconciliation against the Getty vocabularies. I did this a while ago and used SPARQL queries to do so. They’re not working the way they did before and while looking for possible resolutions I saw this note:

 

https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation

NOTE: OpenRefine Reconciliation does NOT work against a SPARQL endpoint at this time, but instead only a Reconciliation Service API.

 

Is this a permanent change?

 

Thank you!

Jennifer

 

Jennifer B. Young (she/her/hers)

Metadata Coordinator

Northwestern University Libraries

Northwestern University

www.library.northwestern.edu

j-yo...@northwestern.edu

847.491.8978

 

Owen Stephens

unread,
Sep 27, 2018, 4:18:06 AM9/27/18
to OpenRefine
Hi Jennifer,

The only way I'm aware of doing reconciliation against a SPARQL endpoint is by using the RDF extension. There is a new version of this extension available at https://github.com/stkenny/grefine-rdf-extension/releases/tag/v1.0.0-rc2

How did you previously reconcile using SPARQL queries?

Thanks

Owen

Timothy R. Mendenhall

unread,
Sep 27, 2018, 9:18:13 AM9/27/18
to openr...@googlegroups.com
Hi Jennifer!

Sometime in the last 2-3 years Getty reconfigured its vocabulary endpoint, and I think that may be the cause of your problem.  When I need to work with the Getty vocabularies, I usually use an Add column by fetching URLs task to drop the column value into a SPARQL query embedded in a URL.  JSON is returned.  This works best for known item searching, and I'll add a caveat that any parenthetical qualifiers (e.g. "(visual works)") need to be filtered out of your query string first.  In theory, you could use the parenthetical qualifiers to limit the scope of your primary query, but this would take some extra work. 

A sample query for AAT entered into the expression box of an Add column by fetching URLs task:
'http://vocab.getty.edu/sparql.json?query=select+?x+?label{?x+skos:inScheme+aat:;(xl:prefLabel|xl:altLabel)/gvp:term"' + escape(value, 'url') + '"@en;skos:prefLabel+?label+filter(lang(?label)="en").}'  

Getty does maintain a very helpful reference page with lots of samples of functioning SPARQL queries that may be helpful in formulating or tweaking your OpenRefine query: http://vocab.getty.edu/queries
Hope that helps!  I would also be thrilled if a viable reconciliation service for Getty could be (re)created. . .

Best,

Ryan Mendenhall
Metadata Librarian
Columbia University Libraries
Original and Special Materials Cataloging
102 Butler Library
535 West 114th Street
New York, NY 10027


--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Jennifer B Young

unread,
Sep 27, 2018, 5:25:28 PM9/27/18
to openr...@googlegroups.com

Thanks Ryan,

 

I should have been clearer – I am using the Add column by fetching URLs task.

 

I need to reconcile against both ULAN and AAT. I would very much love a reconciliation service in OR!

 

I am very new to SPARQL – these are the queries I run in the Add column by fetching URLs task -

 

For AAT

'http://vocab.getty.edu/sparql.json?query=select+distinct*{?x+skos:inScheme+aat:;(xl:prefLabel|xl:altLabel)/gvp:term"' + escape(value, 'url') + '"@en}'

 

For ULAN

'http://vocab.getty.edu/sparql.json?query=select+distinct*{?x+skos:inScheme+ulan:;(xl:prefLabel|xl:altLabel)/gvp:term+"' + escape(value, 'url') + '"}

 

I keep getting this as the results – the “x” should be the URI.

 

{

  "head" : {

    "vars" : [ "x" ]

  },

  "results" : {

    "bindings" : [ ]

  }

}

 

Thank you for any help!

Jennifer

Olivier van D'Huynslager

unread,
Sep 28, 2018, 6:06:36 AM9/28/18
to openr...@googlegroups.com
Hi Jennifer,

I used the service last week and everything worked fine. Could you give an example on what you’re trying to fetch the URL’s? 

Kind regards, 
Olivier 

Ettore Rizza

unread,
Sep 30, 2018, 9:54:29 AM9/30/18
to OpenRefine
I need to reconcile against both ULAN and AAT. I would very much love a reconciliation service in OR!

Hi Jennifer,

Could you try this new service? It's an alpha version and it works only with AAT for the moment, but ULAN and TGN can be added afterwards.

BR,

Ettore


Reply all
Reply to author
Forward
0 new messages