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

Andy Seaborne commented on JENA-1713:
-------------------------------------

Yes - the warning is incorrect. Thank you for the detailed report.

{{NON_INITIAL_DOT_SEGMENT}} seems to be a condition for certain IRIs that might 
affect use in RDF/XML, specifically use of {{IRI.relativize}}. There, when used 
in the absolute part, some cases of "/./" and "/../" may lead to problems. That 
isn't happening here.

This does not apply to parsing.

The PR#570 switches off the warning status for the global IRI resolver.

(I also suspect the code detecting the condition is signalling it unnecessarily 
in some situations but that needs more investigation, or ideally, an output 
based test case.)


> Riot emits a WARN on valid IRI data
> -----------------------------------
>
>                 Key: JENA-1713
>                 URL: https://issues.apache.org/jira/browse/JENA-1713
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: IRI
>    Affects Versions: Jena 3.10.0
>            Reporter: Gregory Williams
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
>  
> riot 3.10.0 emits a NON_INITIAL_DOT_SEGMENT warning on data that I believe if 
> valid:
>  
> {code:java}
> $ cat test.ttl
> @base <http://example.org/foo/bar/> .
> <./../../../useless/../../../still-root> <> "not ok" .
> $ riot -q test.ttl
> 10:56:50 WARN riot :: [line: 2, col: 1 ] Bad IRI: 
> <http://example.org/still-root> Code: 8/NON_INITIAL_DOT_SEGMENT in PATH: The 
> path contains a segment /../ not at the beginning of a relative reference, or 
> it contains a /./ These should be removed.
> <http://example.org/still-root> <http://example.org/foo/bar/> "not ok" .
> {code}
>  
> The resulting IRI is what I expect, but the warning seems spurious. The cited 
> ref text in the [definition of that 
> warning|https://github.com/apache/jena/blob/69571e7ebc3bfde6ec3bc4e96d136428d7f7378e/jena-iri/src/main/xml/org/apache/jena/iri/impl/violations.xml#L705]
>  suggests that it should only be warning if the dot segments are used outside 
> of a relative IRI:
> {quote}The complete path segments "." and ".." are intended <em>only</em> for 
> use within relative references
> {quote}
> In this example, however, they *are* being used in a relative IRI, and seem 
> to be successfully removed during resolution against the base IRI to produce 
> the expected output.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to