Skip to content

Commit

Permalink
Use fallbacks for concept labels with en-US, en, and without language…
Browse files Browse the repository at this point in the history
… tag in visualization caches
  • Loading branch information
litvinovg committed Jan 13, 2023
1 parent 984354f commit 4362061
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,23 @@ protected ConceptLabelMap callWithService(RDFService rdfService) throws Exceptio
" ?person a foaf:Person .\n" +
" ?person core:hasResearchArea ?concept .\n" +
" ?concept a skos:Concept .\n" +
" ?concept rdfs:label ?label .\n" +
" FILTER (lang(?label) = '" + langCtx+"' ) \n" +
" OPTIONAL { " +
" ?concept rdfs:label ?labelPrimary . \n" +
" FILTER (LANG(?labelPrimary) = '" + langCtx + "') \n" +
" } \n" +
" OPTIONAL { " +
" ?concept rdfs:label ?labelFallback1 . \n" +
" FILTER (LANG(?labelFallback1) = 'en-US') \n" +
" } \n" +
" OPTIONAL { " +
" ?concept rdfs:label ?labelFallback2 . \n" +
" FILTER (LANG(?labelFallback2) = 'en') \n" +
" } \n" +
" OPTIONAL { " +
" ?concept rdfs:label ?labelFallback3 . \n" +
" FILTER (LANG(?labelFallback3) = '') \n" +
" } \n" +
"BIND(COALESCE(?labelPrimary, ?labelFallback1, ?labelFallback2, ?labelFallback3) AS ?label) \n" +
"}\n";

// final Map<String, String> map = new HashMap<>();
Expand Down

0 comments on commit 4362061

Please sign in to comment.