Search in sources :

Example 1 with IRIxResolver

use of org.apache.jena.irix.IRIxResolver in project jena by apache.

the class TestIRIxRIOT method irix_ttl_resolver_4.

@Test
public void irix_ttl_resolver_4() {
    // Resolver:: no base, allow relative IRIs, no resolving -> warning.
    IRIxResolver resolver = IRIxResolver.create().noBase().resolve(false).allowRelative(true).build();
    testTTL("<relative>", resolver, 0, 1);
}
Also used : IRIxResolver(org.apache.jena.irix.IRIxResolver) Test(org.junit.Test)

Example 2 with IRIxResolver

use of org.apache.jena.irix.IRIxResolver in project jena by apache.

the class TestIRIxRIOT method irix_ttl_resolver_5.

@Test
public void irix_ttl_resolver_5() {
    // Resolver:: no base, allow relative IRIs, no resolving -> warning.
    IRIxResolver resolver = IRIxResolver.create().noBase().resolve(false).allowRelative(true).build();
    testTTL("<relative>", resolver, 0, 1);
}
Also used : IRIxResolver(org.apache.jena.irix.IRIxResolver) Test(org.junit.Test)

Example 3 with IRIxResolver

use of org.apache.jena.irix.IRIxResolver in project jena by apache.

the class RiotLib method profile.

/**
 * Create a parser profile for the given setup
 */
private static ParserProfile profile(String baseIRI, boolean resolveIRIs, boolean checking, ErrorHandler handler) {
    LabelToNode labelToNode = SyntaxLabels.createLabelToNode();
    IRIx base = resolveIRIs ? IRIs.resolveIRI(baseIRI) : IRIx.create(baseIRI);
    IRIxResolver resolver = IRIxResolver.create(base).resolve(resolveIRIs).allowRelative(false).build();
    return RiotLib.createParserProfile(factoryRDF(labelToNode), handler, resolver, checking);
}
Also used : LabelToNode(org.apache.jena.riot.lang.LabelToNode) IRIx(org.apache.jena.irix.IRIx) IRIxResolver(org.apache.jena.irix.IRIxResolver)

Example 4 with IRIxResolver

use of org.apache.jena.irix.IRIxResolver in project jena by apache.

the class TestIRIxRIOT method irix_ttl_resolver_1.

@Test
public void irix_ttl_resolver_1() {
    // Resolver:: no base, no relative IRIs -> error.
    IRIxResolver resolver = IRIxResolver.create().noBase().allowRelative(false).build();
    testTTL("<relative>", resolver, 1, 0);
}
Also used : IRIxResolver(org.apache.jena.irix.IRIxResolver) Test(org.junit.Test)

Example 5 with IRIxResolver

use of org.apache.jena.irix.IRIxResolver in project jena by apache.

the class TestIRIxRIOT method irix_ttl_resolver_3.

@Test
public void irix_ttl_resolver_3() {
    // Resolver:: no base, allow relative IRIs -> warning.
    IRIxResolver resolver = IRIxResolver.create().noBase().resolve(true).allowRelative(true).build();
    testTTL("<relative>", resolver, 0, 1);
}
Also used : IRIxResolver(org.apache.jena.irix.IRIxResolver) Test(org.junit.Test)

Aggregations

IRIxResolver (org.apache.jena.irix.IRIxResolver)9 Test (org.junit.Test)7 Triple (org.apache.jena.graph.Triple)1 IRIx (org.apache.jena.irix.IRIx)1 LabelToNode (org.apache.jena.riot.lang.LabelToNode)1 Tokenizer (org.apache.jena.riot.tokens.Tokenizer)1