Hello again,
I'm trying to match a list of place names (~10k) I have with TGN records - an automated reconciliation. For each place name I also have a type and containing country. If I send the following query via the web SPARQL interface I get a single record that I would expect. A related mystery is that when I send the
identical query to
http://vocab.getty.edu/sparql in Python
using SPARQLWrapper, I don't get the single record I get via the web
form - rather I get a set 3 of bindings, identical except for the typePref;
one record (binding) each for 'inhabited places', 'deserted settlements', and
'ruined settlements'. The place in question has four assigned placetypes according to the TGN search interface: inhabited
places (preferred), deserted settlement, etc. as seen here:
http://www.getty.edu/vow/TGNFullDisplay?find=abydos&place=&nation=&english=Y&subjectid=6000030SELECT distinct ?tgnid ?pLab ?typePref ?parents ?note ?lat ?long
{
?p skos:inScheme tgn:;
luc:term "Abydos";
gvp:prefLabelGVP [xl:literalForm ?pLab].
?t1 skos:inScheme aat:;
luc:term "inhabited places";
gvp:prefLabelGVP [xl:literalForm ?typePref].
?p dc:identifier ?tgnid .
?p gvp:placeTypePreferred ?ptp .
?p gvp:placeType|(gvp:placeType/gvp:broaderGenericExtended) ?t1 .
?p gvp:parentString ?parents .
?p skos:scopeNote [rdf:value ?note] .
?p foaf:focus [wgs:lat ?lat] .
?p foaf:focus [wgs:long ?long] .
FILTER regex(?parents, "Türkiye", "i")
}
Instead of ?prefType I'd like to group the placetypes (AAT id, label) for each TGN id, and I've tried group_concat(), using the endpoint via the web and in a Python script using the SPARQLWrapper library.
Can anyone lend a hand?
thanks