ajtucker commented on issue #2585: URL: https://github.com/apache/jena/issues/2585#issuecomment-2233467191
It looks as though [`checkValidLocalname()`](https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/sparql/util/FmtUtils.java#L474) doesn't quite match the production for [PN_LOCAL](https://www.w3.org/TR/sparql11-query/#rPN_LOCAL), in that the first character of the local name is restricted to: > [PN_CHARS_U](https://www.w3.org/TR/sparql11-query/#rPN_CHARS_U) | ':' | [0-9] | [PLX](https://www.w3.org/TR/sparql11-query/#rPLX) while the rest are allowed to be: > [PN_CHARS](https://www.w3.org/TR/sparql11-query/#rPN_CHARS) | '.' | ':' | [PLX](https://www.w3.org/TR/sparql11-query/#rPLX))* ([PN_CHARS](https://www.w3.org/TR/sparql11-query/#rPN_CHARS) | ':' | [PLX](https://www.w3.org/TR/sparql11-query/#rPLX) Adding the following test fails: ```diff diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/syntax/TestSerialization.java b/jena-arq/src/test/java/org/apache/jena/sparql/syntax/TestSerialization.java index 08c3fd708f..6efb1eaef4 100644 --- a/jena-arq/src/test/java/org/apache/jena/sparql/syntax/TestSerialization.java +++ b/jena-arq/src/test/java/org/apache/jena/sparql/syntax/TestSerialization.java @@ -118,6 +118,9 @@ public class TestSerialization @Test public void test_PName_Bad_7() { fmtURI_Prefix("http://example/x.", "<http://example/x.>", pmap1) ; } + @Test public void test_PName_Bad_8() + { fmtURI_Prefix("http://default/-x", "<http://default/-x>", pmap1) ; } + // Dots @Test public void test_Dots_1() // Internal DOT { fmtURI_Prefix("http://example/x#a.b", "ex:a.b", pmap1) ; } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
