Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Done
-
Jena 3.1.1, Jena 3.2.0, Jena 3.3.0, Jena 3.4.0
-
None
Description
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):
if ( ch == ':' ) return true ;
Proposed Test add to TestFmtUtils:
@Test public void stringForURI_colonInLocalname_shouldCompact() { String uri = aUri + "local:name"; final String result = FmtUtils.stringForURI(uri, getPrefixMapping()); assertEquals("zz:local:name", result); }
Attachments
Attachments
Issue Links
- links to