hoijui commented on issue #2975:
URL: https://github.com/apache/jena/issues/2975#issuecomment-2612330938
aHA!
`isReference` means exactly the opposite of what I though it means.. doh! :D
thanks again!
So I'll use:
```java
public static boolean checkValidIriForRDF(final String iriStr) {
final IRIx iri = IRIx.create(iriStr);
return !iri.hasViolations() && iri.isReference();
}
@Test
public void testBadIri1() {
assertFalse(checkValidIriForRDF("#:bar"));
}
@Test
public void testBadIri2() {
assertFalse(checkValidIriForRDF("domain.com/directory"));
}
@Test
public void testGoodIri1() {
assertTrue(checkValidIriForRDF("xsd:string"));
}
@Test
public void testGoodIri2() {
assertTrue(checkValidIriForRDF("http://domain.com/directory#good"));
}
```
These all pass!
--
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]