Skip to content

Commit bc87a23

Browse files
committed
Modify I18nSort document modifier to work around Jena literal comparison bug
1 parent e759fad commit bc87a23

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

home/src/main/resources/rdf/display/everytime/documentModifierI18nSort.n3

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
:hasTargetSuffix "_label_sort" ;
1010
:hasSelectQuery """
1111
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
12-
SELECT ( LCASE(MIN(?label)) AS ?singleLabel ) WHERE {
13-
?uri rdfs:label ?label .
14-
BIND (LANG(?label) as ?lang )
12+
# Re-add language tag after comparing plain strings in MIN() aggregation to work around Jena bug.
13+
# This can be changed back to SELECT (LCASE(MIN(?label)) AS ?singleLabel) when Jena is upgraded.
14+
SELECT (LCASE(IF(?lang = "", MIN(STR(?label)), STRLANG(MIN(STR(?label)), ?lang))) AS ?singleLabel)
15+
WHERE {
16+
?uri rdfs:label ?label .
17+
BIND (LANG(?label) as ?lang)
1518
} GROUP BY ?lang ORDER BY ?lang
1619
""" .

0 commit comments

Comments
 (0)