Search in sources :

Example 36 with IRI

use of org.apache.jena.iri.IRI in project jena by apache.

the class TestMERelativize method computeIRI.

@Override
IRI computeIRI() {
    IRI base = ((TestMoreExamples) parent.testAt(0)).getIRI();
    IRI rel = ((TestMoreExamples) parent.testAt(2)).getIRI();
    return base.relativize(rel, TestCreator.RelativizeFlags);
}
Also used : IRI(org.apache.jena.iri.IRI)

Example 37 with IRI

use of org.apache.jena.iri.IRI in project jena by apache.

the class TestMEResult method computeIRI.

@Override
IRI computeIRI() {
    IRI base = ((TestMoreExamples) parent.testAt(0)).getIRI();
    IRI rel = ((TestMoreExamples) parent.testAt(1)).getIRI();
    return base.create(rel);
}
Also used : IRI(org.apache.jena.iri.IRI)

Example 38 with IRI

use of org.apache.jena.iri.IRI 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());
//		}
}
Also used : Violation(org.apache.jena.iri.Violation) IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory)

Example 39 with IRI

use of org.apache.jena.iri.IRI in project jena by apache.

the class TestErrorMessages method runTest.

@Override
public void runTest() {
    IRI iri = f.create(uri);
    Iterator<Violation> it = iri.violations(true);
    while (it.hasNext()) {
        Violation v = it.next();
        printErrorMessages(v);
    }
}
Also used : Violation(org.apache.jena.iri.Violation) IRI(org.apache.jena.iri.IRI)

Example 40 with IRI

use of org.apache.jena.iri.IRI 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.");
    }
}
Also used : IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory)

Aggregations

IRI (org.apache.jena.iri.IRI)51 Violation (org.apache.jena.iri.Violation)12 IRIFactory (org.apache.jena.iri.IRIFactory)9 IOException (java.io.IOException)3 Node (org.apache.jena.graph.Node)3 Test (org.junit.Test)3 PrintStream (java.io.PrintStream)2 MalformedURLException (java.net.MalformedURLException)2 ServletOutputStream (javax.servlet.ServletOutputStream)2 Lang (org.apache.jena.riot.Lang)2 RiotException (org.apache.jena.riot.RiotException)2 CheckerIRI (org.apache.jena.riot.checker.CheckerIRI)2 IRI (org.apache.jena.riot.tokens.TokenType.IRI)2 InputStream (java.io.InputStream)1 BigDecimal (java.math.BigDecimal)1 URI (java.net.URI)1 URL (java.net.URL)1 Date (java.sql.Date)1 SQLException (java.sql.SQLException)1 Time (java.sql.Time)1