Skip to content

Commit cd16448

Browse files
kwahlinolovy
authored andcommitted
Get correct namespace for lcsh URI
1 parent 5343f9b commit cd16448

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

whelk-core/src/main/groovy/whelk/external/Wikidata.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,16 @@ class WikidataEntity {
282282

283283
List<RDFNode> getLcsh() {
284284
String queryString = """
285-
SELECT ?fullId {
286-
wd:${shortId} wdtn:${LC_AUTH} ?fullId ;
287-
wdt:${LC_AUTH} ?shortId .
285+
SELECT ?id {
286+
wd:${shortId} wdt:${LC_AUTH} ?shortId .
287+
bind(iri(concat("http://id.loc.gov/authorities/subjects/", ?shortId)) as ?id)
288288
FILTER(strstarts(?shortId, "sh"))
289289
}
290290
"""
291291

292292
ResultSet rs = QueryRunner.localSelectResult(queryString, graph)
293293

294-
return rs.collect { it.get("fullId") }
294+
return rs.collect { it.get("id") }
295295
}
296296

297297
List<RDFNode> getFast() {

0 commit comments

Comments
 (0)