commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (COMMONSRDF-51) RDF-1.1 specifies that language tags need to be compared using lower-case
Date Thu, 12 Jan 2017 14:53:52 GMT


ASF GitHub Bot commented on COMMONSRDF-51:

GitHub user stain opened a pull request:

    COMMONSRDF-51 language tags compared lower case

    This fixes [COMMONSRDF-51]( - at least
from `Literal.equals()` and `Literal.hashCode()`
    Further test might be needed to verify consistent behaviour in `Graph` and `Dataset` if
underlying framework does not correctly do langtag comparison in lower case (e.g. Turkish
locale problem).
    Please comment on the fixes and the suggested updated javadoc:
    * [Literal.equals(Object)](
    * [Literal.hashCode()](
    * [Literal.getLanguageTag()](
    For code improvements of this PR, feel free to push to the `COMMONSRDF-51-langtag-lcase`
branch at or use the "Start review"
mechanism in GitHub.

You can merge this pull request into a Git repository by running:

    $ git pull COMMONSRDF-51-langtag-lcase

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #30
commit 3064d219606cbe42c0150d81dbf6cdbc74bf7491
Author: Stian Soiland-Reyes <>
Date:   2017-01-12T14:51:26Z

    COMMONSRDF-51: compare language tags in lower case


> RDF-1.1 specifies that language tags need to be compared using lower-case
> -------------------------------------------------------------------------
>                 Key: COMMONSRDF-51
>                 URL:
>             Project: Apache Commons RDF
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 0.3.0
>            Reporter: Peter Ansell
>            Assignee: Stian Soiland-Reyes
> The [RDF-1.1 specification states that the [value space of Literal language tags is lowercase|],
which does not conflict with the case-insensitive specification in BCP47. The Literal.equals
and Literal.hashCode API contracts should specify that language tags must be compared using
lowercase, even if they are otherwise stored and returned as upper-case by getLanguageTag.
The API currently has incorrect language by saying "character-by-character" for language tag
comparisons, as that implies case-sensitive comparisons are used.
> The lowercasing must also be done using a locale that is consistent (known example where
lowercase and uppercase do not roundtrip as expected for US-ASCII characters is Turkish [1]),
so I would recommend actually stating that .toLowerCase(Locale.ENGLISH) is used.

This message was sent by Atlassian JIRA

View raw message