Skip to content

Commit

Permalink
Get correct namespace for lcsh URI
Browse files Browse the repository at this point in the history
  • Loading branch information
kwahlin authored and olovy committed Nov 25, 2021
1 parent 5343f9b commit cd16448
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions whelk-core/src/main/groovy/whelk/external/Wikidata.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,16 @@ class WikidataEntity {

List<RDFNode> getLcsh() {
String queryString = """
SELECT ?fullId {
wd:${shortId} wdtn:${LC_AUTH} ?fullId ;
wdt:${LC_AUTH} ?shortId .
SELECT ?id {
wd:${shortId} wdt:${LC_AUTH} ?shortId .
bind(iri(concat("http://id.loc.gov/authorities/subjects/", ?shortId)) as ?id)
FILTER(strstarts(?shortId, "sh"))
}
"""

ResultSet rs = QueryRunner.localSelectResult(queryString, graph)

return rs.collect { it.get("fullId") }
return rs.collect { it.get("id") }
}

List<RDFNode> getFast() {
Expand Down

0 comments on commit cd16448

Please sign in to comment.