use of org.apache.jena.iri.IRIFactory in project jena by apache.
the class MoreTests method testXPointer.
public void testXPointer() {
@SuppressWarnings("deprecation") IRIFactory f = IRIFactory.jenaImplementation();
IRI base = f.create("http://example.org/");
IRI frag = base.resolve("http://eg.com/test.txt#xpointer(/unit[5])");
Iterator<Violation> it = frag.violations(false);
assertTrue(it.hasNext());
// while (it.hasNext()) {
// System.err.println(it.next().getLongMessage());
// }
}
use of org.apache.jena.iri.IRIFactory in project jena by apache.
the class TestExample method runTestJustSpec.
private void runTestJustSpec() {
IRIFactory f = specs[specID].isSchemeSpec() ? IRIFactory.iriImplementation() : all[specID][Force.MUST];
IRI iri = f.create(uri);
if (iri.hasViolation(false)) {
if (good)
fail("Unexpected violation found: " + ((iri.violations(false).next())).codeName());
} else {
if (!good)
fail("Expected a violation, none found.");
}
}
use of org.apache.jena.iri.IRIFactory in project jena by apache.
the class TestExample method runTestErrorCode.
private void runTestErrorCode() {
IRIFactory f = new IRIFactory();
f.setIsError(violation.getCode(), true);
runTest(f, true, false, "Just this error");
}
use of org.apache.jena.iri.IRIFactory in project jena by apache.
the class iri method main.
public static void main(String[] args) {
//IRIFactory iriFactory = IRIFactory.iriImplementation() ;
IRIFactory iriFactory = IRIResolver.iriFactory;
boolean first = true;
for (String iriStr : args) {
if (iriStr.startsWith("<") && iriStr.endsWith(">"))
iriStr = iriStr.substring(1, iriStr.length() - 1);
if (!first)
System.out.println();
first = false;
IRI iri = iriFactory.create(iriStr);
System.out.println(iriStr + " ==> " + iri);
if (iri.isRelative())
System.out.println("Relative: " + iri.isRelative());
Iterator<Violation> vIter = iri.violations(true);
for (; vIter.hasNext(); ) {
System.out.println(vIter.next().getShortMessage());
}
}
}
use of org.apache.jena.iri.IRIFactory in project jena by apache.
the class iri method main.
public static void main(String... args) {
IRIFactory iriFactory = SetupJenaIRI.iriCheckerFactory();
boolean first = true;
for (String iriStr : args) {
if (iriStr.startsWith("<") && iriStr.endsWith(">"))
iriStr = iriStr.substring(1, iriStr.length() - 1);
if (!first)
System.out.println();
first = false;
IRI iri = iriFactory.create(iriStr);
System.out.println(iriStr + " ==> " + iri);
if (iri.isRelative())
System.out.println("Relative: " + iri.isRelative());
Iterator<Violation> vIter = iri.violations(true);
for (; vIter.hasNext(); ) {
System.out.println(vIter.next().getShortMessage());
}
}
}
Aggregations