Sparql Endpoint change and Mandatory Prefixes

73 views
Skip to first unread message

andre.w...@gmail.com

unread,
Sep 16, 2022, 4:00:13 AM9/16/22
to Getty Vocabularies as Linked Open Data
Hi, 
my name is André, I am working for zetcom on the MuseumPlus product. We do have an integration of Getty vocabularies in MuseumPlus. Everything worked fine for quite a while but recently the sparql endpoint http://vocab.getty.edu/sparql returns an InternalServerError on our standard search query. 

I checked the documentation on http://vocab.getty.edu/ and found another endpoint https://data.getty.edu/vocab/sparql. I did a test with the new Endpoint and it did not return an InternalServerError, but the sparql query that used to work with the other endpoint is not valid anymore, because of missing prefix declarations. They seem to be  mandatary now. Even the examples available on the website do not work with the new endpoint. I also checked the new sparql ui with our own query and some example queries, adding the missing prefixes. But nothing worked for me. 

The following is an example of a query that used to work. 

select ?VocNode ?VocNodeID ?VocNodePath ?VocTerm ?VocTermID ?VocTermLabel ?VocNodeScopeNote ?VocNodeProviderView {
  ?VocNode a skos:Concept; luc:term 'aquarelle'.
  ?VocNode skos:inScheme aat: .
  ?VocNode dc:identifier ?VocNodeID.
  ?VocNode gvp:prefLabelGVP ?VocTerm .
  ?VocTerm xl:literalForm ?VocTermLabel .
  ?VocNode gvp:parentString ?VocNodePath .
  ?VocNode rdfs:seeAlso ?VocNodeProviderView .
  optional { ?VocNode skos:scopeNote [dct:language gvp_lang:en; rdf:value ?VocNodeScopeNote] }
  ?VocTerm dc:identifier ?VocTermID .
} order by asc(lcase(str(?VocTerm))) LIMIT 100

I would like to know what we have to change to get our Getty integration back to work. 
And is there any place where we can find information about changes beforehand. I did not find any information about changes on vocab.getty.edu

Any help is appreciated :) 

andre.w...@gmail.com

unread,
Sep 16, 2022, 5:44:51 AM9/16/22
to Getty Vocabularies as Linked Open Data
Hi again,
I finally saw the announcement from this june and some things are clearer for me now. But nevertheless the request does not work anymore where it did in the past. I post the raw request below including the headers to show what exactly is not working

GET /sparql?queryLn=SPARQL&query=select%20?VocNode%20?VocNodeID%20?VocNodePath%20?VocTerm%20?VocTermID%20?VocTermLabel%20?VocNodeScopeNote%20?VocNodeProviderView%20%7B%0A%C2%A0%20?VocNode%20a%20skos%3AConcept%3B%20luc%3Aterm%20%27aquarelle%27.%0A%C2%A0%20?VocNode%20skos%3AinScheme%20aat%3A%20.%0A%C2%A0%20?VocNode%20dc%3Aidentifier%20?VocNodeID.%0A%C2%A0%20?VocNode%20gvp%3AprefLabelGVP%20?VocTerm%20.%0A%C2%A0%20?VocTerm%20xl%3AliteralForm%20?VocTermLabel%20.%0A%C2%A0%20?VocNode%20gvp%3AparentString%20?VocNodePath%20.%0A%C2%A0%20?VocNode%20rdfs%3AseeAlso%20?VocNodeProviderView%20.%0A%C2%A0%20optional%20%7B%20?VocNode%20skos%3AscopeNote%20%5Bdct%3Alanguage%20gvp_lang%3Aen%3B%20rdf%3Avalue%20?VocNodeScopeNote%5D%20%7D%0A%C2%A0%20?VocTerm%20dc%3Aidentifier%20?VocTermID%20.%0A%7D%20order%20by%20asc(lcase(str(?VocTerm)))%20LIMIT%20100 HTTP/1.1
Accept: application/xml
Accept: application/sparql-results+xml
Host: vocab.getty.edu

Thanks a lot.

Getty Vocabularies LOD

unread,
Sep 16, 2022, 10:43:19 AM9/16/22
to Getty Vocabularies as Linked Open Data
Hi, André.

You're request and query has highlighted a number of issues we will look into, but for now, you can get the results of this query if  you remove the "queryLn" parameter, URL encode the "(lcase(str(?VocTerm)))" part of your query and use the XML SPARQL endpoint:

curl http://vocab.getty.edu/sparql.xml?query=select%20?VocNode%20?VocNodeID%20?VocNodePath%20?VocTerm%20?VocTermID%20?VocTermLabel%20?VocNodeScopeNote%20?VocNodeProviderView%20%7B%0A%C2%A0%20?VocNode%20a%20skos%3AConcept%3B%20luc%3Aterm%20%27aquarelle%27.%0A%C2%A0%20?VocNode%20skos%3AinScheme%20aat%3A%20.%0A%C2%A0%20?VocNode%20dc%3Aidentifier%20?VocNodeID.%0A%C2%A0%20?VocNode%20gvp%3AprefLabelGVP%20?VocTerm%20.%0A%C2%A0%20?VocTerm%20xl%3AliteralForm%20?VocTermLabel%20.%0A%C2%A0%20?VocNode%20gvp%3AparentString%20?VocNodePath%20.%0A%C2%A0%20?VocNode%20rdfs%3AseeAlso%20?VocNodeProviderView%20.%0A%C2%A0%20optional%20%7B%20?VocNode%20skos%3AscopeNote%20%5Bdct%3Alanguage%20gvp_lang%3Aen%3B%20rdf%3Avalue%20?VocNodeScopeNote%5D%20%7D%0A%C2%A0%20?VocTerm%20dc%3Aidentifier%20?VocTermID%20.%0A%7D%20order%20by%20asc%28lcase%28str%28%3FVocTerm%29%29%29%20LIMIT%20100

The raw query you posted works in the SPARQL UI without having to define the prefixes:

https://vocab.getty.edu/sparql?query=select+%3FVocNode+%3FVocNodeID+%3FVocNodePath+%3FVocTerm+%3FVocTermID+%3FVocTermLabel+%3FVocNodeScopeNote+%3FVocNodeProviderView+%7B%0D%0A++%3FVocNode+a+skos%3AConcept%3B+luc%3Aterm+%27aquarelle%27.%0D%0A++%3FVocNode+skos%3AinScheme+aat%3A+.%0D%0A++%3FVocNode+dc%3Aidentifier+%3FVocNodeID.%0D%0A++%3FVocNode+gvp%3AprefLabelGVP+%3FVocTerm+.%0D%0A++%3FVocTerm+xl%3AliteralForm+%3FVocTermLabel+.%0D%0A++%3FVocNode+gvp%3AparentString+%3FVocNodePath+.%0D%0A++%3FVocNode+rdfs%3AseeAlso+%3FVocNodeProviderView+.%0D%0A++optional+%7B+%3FVocNode+skos%3AscopeNote+%5Bdct%3Alanguage+gvp_lang%3Aen%3B+rdf%3Avalue+%3FVocNodeScopeNote%5D+%7D%0D%0A++%3FVocTerm+dc%3Aidentifier+%3FVocTermID+.%0D%0A%7D+order+by+asc%28lcase%28str%28%3FVocTerm%29%29%29+LIMIT+100&_implicit=false&implicit=true&_equivalent=false&_form=%2Fsparql

Gregg Garcia
Software Architect
Getty Digital / J. Paul Getty Trust

Martin GERSBACH

unread,
Sep 16, 2022, 8:01:44 PM9/16/22
to Getty Vocabularies as Linked Open Data
hum...
your query works fine for me

ScreenShot 2022-09-16 a las 21.00.34.jpg

André W.

unread,
Sep 19, 2022, 4:53:53 AM9/19/22
to Getty Vocabularies as Linked Open Data
Hi Gregg,

thanks for your support and for looking into this. 

Switching to the sparql.xml endpoint works for us. Is it safe to permanently switch to the xml endpoint or is this more a short-term workaround?

Concerning the queryln url parameter. We are using a rather old version of the openrdf sesame library where I am not able to omit the parameter. But it seems to also work with the parameter applied as long as the sparql xml endpoint is used. Do you see any problem with this?

Best
André

Getty Vocabularies LOD

unread,
Sep 19, 2022, 2:47:12 PM9/19/22
to Getty Vocabularies as Linked Open Data
Hi, André.

I'm very happy to hear that the sparql.xml endpoint works for you. You should be able to switch permanently to it.

If the query works with the additional queryln parameter using the openrdf sesame library, then yes, you should be ok including it although it has no purpose.

Gregg Garcia
Software Architect
Getty Digital / J. Paul Getty Trust

Reply all
Reply to author
Forward
0 new messages