Query gives an error

61 views
Skip to first unread message

Josephine Kamp

unread,
Apr 11, 2019, 6:01:28 AM4/11/19
to Getty Vocabularies as Linked Open Data
Hi,

If I do a query at the sparql endpoint i get following error 'The connection was reset', see picture below.
I use this query.

select?x?id?gvpLabel ?prefNl (group_concat(?alt; separator="; ")as?altNl)?noteNl{
 
?x gvp:broaderExtended aat:300209261;
     dc
:identifier ?id;
     gvp
:prefLabelGVP [xl:literalForm ?gvpLabel].
optional
{?x xl:pfreflabel [dct:language gvp_lang:nl;xl:literalForm ?prefNI]}
optional
{?x xl:altlabel [dct:language gvp_lang:nl; xl:literalForm ?alt]}
optional
{?x xl:skos:scopeNote [dct:language gvp_lang:nl; rdf:value ?noteNI]}
} group by ?x ?id ?gvpLabel ?prefNI ?noteNI


Example queries from the site: some work, others don't and picture the same error. Any clues?
Thanks in advance for your time and help. 


Josephine

SparqlERROR.JPG

Getty Vocabularies LOD

unread,
Apr 11, 2019, 5:25:41 PM4/11/19
to Getty Vocabularies as Linked Open Data
This problem has been there since the Getty web site moved to AWS hosting. The security provided by the service thinks there is some kind of SQL injection happening with a few of the queries and blocks them. It is only tripped when functions such as group_concat() are used.

There are workarounds, if you are interested, although we realize that many people use the sample queries to begin learning SPARQL and the Vocabularies Linked Data implementation. First of all, you can run the queries using an HTTP POST method rather than the GET method the query form uses:

curl -X POST --data-binary 'query=select ?x ?id ?gvpLabel ?prefNl (group_concat(?alt; separator="| ")as?altNl) ?noteNl{ ?x gvp:broaderExtended aat:300209261; dc:identifier ?id; gvp:prefLabelGVP [xl:literalForm ?gvpLabel]. optional{?x xl:pfreflabel [dct:language gvp_lang:nl;xl:literalForm ?prefNl]} optional{?x xl:altlabel [dct:language gvp_lang:nl; xl:literalForm ?alt]} optional{?x xl:skos:scopeNote [dct:language gvp_lang:nl; rdf:value ?noteNI]} } group by ?x ?id ?gvpLabel ?prefNl ?noteNl' http://vocab.getty.edu/sparql.json

Or, you could simplify the query by taking out the group_concat() function that is making the blocking happen:

select ?x ?id ?gvpLabel ?prefNl ?noteNl{

  ?x gvp:broaderExtended aat:300209261;
     dc:identifier ?id;
     gvp:prefLabelGVP [xl:literalForm ?gvpLabel].
optional{?x xl:pfreflabel [dct:language gvp_lang:nl;xl:literalForm ?prefNI]}
optional{?x xl:skos:scopeNote [dct:language gvp_lang:nl; rdf:value ?noteNI]}
} group by ?x ?id ?gvpLabel ?prefNl ?noteNl

Hopefully we can solve the blocking issue soon. We are sorry for the inconvenience.

Gregg Garcia
Getty Digital

Josephine Kamp

unread,
Jul 16, 2019, 10:13:13 AM7/16/19
to Getty Vocabularies as Linked Open Data

Vladimir Alexiev

unread,
Jul 19, 2019, 12:58:31 PM7/19/19
to Getty Vocabularies as Linked Open Data
I inspected a page of results and it seems those concepts have only 1 altLabel@nl, so you are better off without group_concat.
I checked http://vocab.getty.edu/doc/queries/ and only 1 query has group_concat. Josephine, which queries give "Connection reset" to you?

PS: it's a pity AWS thinks that group_concat has something to do with SQL injection... On the other hand, a SQL injection is claimed to have lead to a leak of personal data of about 90% of Bulgarians, so that's serious stuff: https://twitter.com/hashtag/НАПЛийкс
Reply all
Reply to author
Forward
0 new messages