This is probably an implementation thing, but I cannot get the POST method to work either from curl nor from Java.
PREFIX tgn: <
http://vocab.getty.edu/tgn/>
PREFIX dc: <
http://purl.org/dc/elements/1.1/>
PREFIX foaf: <
http://xmlns.com/foaf/0.1/>
PREFIX wgs: <
http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX gvp: <
http://vocab.getty.edu/ontology#>
PREFIX rdf: <
http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <
http://schema.org/>
PREFIX skos: <
http://www.w3.org/2004/02/skos/core#>
PREFIX skosxl: <
http://www.w3.org/2008/05/skos-xl#>
PREFIX term_flag: <
http://vocab.getty.edu/term/flag/>
CONSTRUCT {
?s ?p1 ?o1. # subject
?sn ?p2 ?o2. # note
?n ?p3 ?o3. # names
?pl ?p4 ?o4. # place
?st ?p5 ?o5. # place types
}
WHERE {
BIND (tgn:7011179 as ?s)
{?s ?p1 ?o1 FILTER(!isBlank(?o1)
&& (?p1 in (dc:identifier, gvp:prefLabelGVP, skosxl:prefLabel, skosxl:altLabel, skos:scopeNote,
gvp:broaderPreferred, gvp:placeTypeNonPreferred, gvp:placeTypePreferred))
&& ?s!=?o1) }
UNION {?s skos:scopeNote ?sn. ?sn ?p2 ?o2
FILTER(?p2 in (dc:identifier, rdf:value)) }
UNION {?s gvp:prefLabelGVP ?n. ?n ?p3 ?o3
FILTER(?p3 in (dc:identifier, gvp:term, skosxl:literalForm, gvp:historicFlag, gvp:termFlag, term_flag:Vernacular)) }
UNION {?s skosxl:prefLabel ?n. ?n ?p3 ?o3
FILTER(?p3 in (dc:identifier, gvp:term, skosxl:literalForm, gvp:historicFlag, gvp:termFlag, term_flag:Vernacular)) }
UNION {?s skosxl:altLabel ?n. ?n ?p3 ?o3
FILTER(?p3 in (dc:identifier, gvp:term, skosxl:literalForm, gvp:historicFlag, gvp:termFlag, term_flag:Vernacular)) }
UNION {?s foaf:focus ?pl. ?pl ?p4 ?o4
FILTER(?p4 in (wgs:lat, wgs:long)) }
UNION {?st rdf:subject ?s ;
rdf:predicate gvp:placeTypeNonPreferred.
?st ?p5 ?o5 FILTER(?p5 in (rdf:object, rdf:predicate, gvp:historicFlag)) }
UNION {?st rdf:subject ?s ;
rdf:predicate gvp:placeTypePreferred.
?st ?p5 ?o5 FILTER(?p5 in (rdf:object, rdf:predicate, gvp:historicFlag)) }
}
(Attached as a file for convenience).
If I urlencode this and place on the URL using "?query=" and use GET everything works great (allowing for the charset in the response issue I have raised as another conversation).
However, I cannot get this same query to work with POST.
Testing with curl:
curl -v -H "Content-Type: application/sparql-query" -H "Accept: application/ld+json;charset=UTF-8" -d @sparql
http://vocab.getty.edu/sparql.jsonldResults in a 500 internal server error. However the body is in UTF-8, and the SPARQL spec suggests this should be uuenocded.