You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/02 13:27:00 UTC
[jira] [Commented] (JENA-1393) FmtUtils.stringForURI does not
compact URIs with ":" in localname
[ https://issues.apache.org/jira/browse/JENA-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188001#comment-16188001 ]
ASF GitHub Bot commented on JENA-1393:
--------------------------------------
GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/282
JENA-1393: Format prefix names
This PR includes the patch on [JENA-1393](https://issues.apache.org/jira/browse/JENA-1393) and also applies the same to Turtle writing.
":" in prefix local names is used on output which is spec-legal.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena format-prefix-names
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/282.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 #282
----
commit 0228f12c5afd0b4d2cb83d0c4b62732e32b0dbb2
Author: Andy Seaborne <an...@apache.org>
Date: 2017-09-24T12:56:57Z
JENA-1393: Allow ':' in SPARQL prefix names.
commit bc5c7e79de4b88bd7b7b4c73b7d76a9f09f8029a
Author: Andy Seaborne <an...@apache.org>
Date: 2017-10-02T13:20:53Z
JENA-1393: Allow ':' in Turtle prefix names.
----
> FmtUtils.stringForURI does not compact URIs with ":" in localname
> -----------------------------------------------------------------
>
> Key: JENA-1393
> URL: https://issues.apache.org/jira/browse/JENA-1393
> Project: Apache Jena
> Issue Type: Improvement
> Components: ARQ, Jena
> Affects Versions: Jena 3.1.1, Jena 3.2.0, Jena 3.3.0, Jena 3.4.0
> Reporter: Michał Woźniak
> Assignee: Andy Seaborne
> Priority: Minor
> Attachments: fix_stringForURI.patch
>
>
> *Issue*: {{FmtUtils.stringForURI}} does not compact URI with ":" in localname as the compacted
> prefixed form gets rejected by {{FmtUtils.validPNameChar(ch)}} function. However,
> according to the SPARQL specification ";" is allowed in prefixed form, see:
> https://www.w3.org/TR/sparql11-query/#rPN_LOCAL
> *Note* it ":" was not allowed in localname in older versions of the document (before 2013):
> https://www.w3.org/TR/2012/WD-sparql11-query-20120105/#rPN_LOCAL
> *Proposed Fix*: add the following line to FmtUtils.validPNameChar(ch):
> {noformat}
> if ( ch == ':' ) return true ;
> {noformat}
> *Proposed Test* add to TestFmtUtils:
> {noformat}
> @Test
> public void stringForURI_colonInLocalname_shouldCompact() {
> String uri = aUri + "local:name";
> final String result = FmtUtils.stringForURI(uri, getPrefixMapping());
> assertEquals("zz:local:name", result);
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)