neontribe / Linked_Development

Linked Development
1 stars 1 forks source link

/count/Documents/Country no countrycode #30

Closed tobybatch closed 11 years ago

tobybatch commented 11 years ago

This sparql

prefix DCTERMS: http://purl.org/dc/terms/ select distinct ?countrycode ?countrylabel count(distinct ?article) where { ?a http://purl.org/dc/terms/coverage ?country . ?publisher a http://dbpedia.org/ontology/Organisation . ?article DCTERMS:publisher ?publisher . ?article a http://purl.org/ontology/bibo/Article . ?article http://purl.org/dc/terms/coverage ?country . ?country http://www.w3.org/2000/01/rdf-schema#label ?countrylabel . }

Errors with:

37000 Error SP031: SPARQL compiler: Variable 'countrycode' is used in the query result set but not assigned

tobybatch commented 11 years ago

I have no object id for the country:

"prefix DCTERMS: http://purl.org/dc/terms/ select distinct ?countrycode ?countrylabel count(distinct ?article) where { ?country http://www.fao.org/countryprofiles/geoinfo/geopolitical/resource/codeISO2 ?countrycode . ?publisher a http://dbpedia.org/ontology/Organisation . ?article DCTERMS:publisher ?publisher . ?article a http://purl.org/ontology/bibo/Article . ?article http://purl.org/dc/terms/coverage ?country . ?country http://www.w3.org/2000/01/rdf-schema#label ?countrylabel . }"

Does not give me the A1100 value,

http://api.ids.ac.uk/openapi/eldis/count/documents/country

practicalparticipation commented 11 years ago

The two step model introduced for the API makes this possible and example queries are now in the YAML.

We could potentially do this all in one query using UNION if we wanted to avoid the multi-query approach in place now...