commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
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

    [ https://issues.apache.org/jira/browse/COMMONSRDF-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15821169#comment-15821169
] 

ASF GitHub Bot commented on COMMONSRDF-51:
------------------------------------------

GitHub user stain opened a pull request:

    https://github.com/apache/commons-rdf/pull/30

    COMMONSRDF-51 language tags compared lower case

    This fixes [COMMONSRDF-51](https://issues.apache.org/jira/browse/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)](http://stain.github.io/commons-rdf/COMMONSRDF-51/org/apache/commons/rdf/api/Literal.html#equals-java.lang.Object-)
    * [Literal.hashCode()](http://stain.github.io/commons-rdf/COMMONSRDF-51/org/apache/commons/rdf/api/Literal.html#hashCode--)
    * [Literal.getLanguageTag()](http://stain.github.io/commons-rdf/COMMONSRDF-51/org/apache/commons/rdf/api/Literal.html#getLanguageTag--)
    
    For code improvements of this PR, feel free to push to the `COMMONSRDF-51-langtag-lcase`
branch at https://git-wip-us.apache.org/repos/asf/commons-rdf.git or use the "Start review"
mechanism in GitHub.
    


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

    $ git pull https://github.com/apache/commons-rdf COMMONSRDF-51-langtag-lcase

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

    https://github.com/apache/commons-rdf/pull/30.patch

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 <stain@apache.org>
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: https://issues.apache.org/jira/browse/COMMONSRDF-51
>             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|https://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal],
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
(v6.3.4#6332)

Mime
View raw message