afs commented on issue #2975: URL: https://github.com/apache/jena/issues/2975#issuecomment-2612157015
Online validator for IRIs https://www.sparql.org/iri-validator.html (running Jena 5.3.0 / jena-iri3986) Code [IRIValidatorHTML](https://github.com/apache/jena/blob/main/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/validation/html/IRIValidatorHTML.java#L65). The `IRI` class is `IRIx`. This abstracts the provider. Two providers old/legacy jena-iri (your code uses that) and jena-irir3986 (will replace jena-iri soon). Even when using jena-iri, the correct route is via IRIx because the violation checking is different and reflects RDF better. jena-iri3986 is up-to-date with all the RFCs that define the various URIs scheme of interest, as well as RFC 3986/7, the syntax of IRIs. > "Are these really valid IRIs?" They are valid as IRIs but they are both not suitable for RDF which requires resolved IRIs which are not relative references. (Oddly, I was updating the "RDF Concepts" in the RDF Working Group in this area last week.) Jena calls them " RDF references" - there isn't an exact term for this in the RFC3986 spec. ("Absolute" does not mean what people intuitively think it means!) This is an area that has tightened up over the years, both spec-wise and in Jena. Jena2 is RDF 1.0. RDF 1.0 that spec has "RDF URI references" - this all predates IRI3986/7. ```java public static boolean checkIriBad(final String iriStr) { final IRIx iri = IRIx.create(iriStr); System.out.println(iri); System.out.println("hasViolations: "+iri.hasViolations()); System.out.println("Reference: "+iri.isReference()); return iri.hasViolations(); } ``` `isReference` is false for both jena-iri and jena-iri3986 implementations. Weclome to the black hole of IRI details! -- 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]
