Search in sources :

Example 1 with IRIFactory

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

the class MoreTests method testNotIDN.

public void testNotIDN() {
    @SuppressWarnings("deprecation") IRIFactory f = IRIFactory.jenaImplementation();
    IRI base = f.create("http://example.org/");
    IRI frag = base.resolve("outbind://4-00000000C45F478BF9F2A048A7A59DE" + "3AE35F7230700D3E3AEE226D20A49A390BCD779EC5D4700" + "00003DB3650000D3E3AEE226D20A49A390BCD779EC5D470" + "00001182DB0000/www.uconnectevent.org");
    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 2 with IRIFactory

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

the class MoreTests method testRelativizeFrag1.

public void testRelativizeFrag1() {
    @SuppressWarnings("deprecation") IRIFactory f = IRIFactory.jenaImplementation();
    IRI base = f.create("http://example.org/somefolder/mybase.rdf");
    IRI frag = f.create("http://example.org#foo");
    IRI rel = base.relativize(frag);
    assertEquals(frag, rel);
    //		System.err.println(rel.toString());
    IRI back = base.resolve(rel);
    assertEquals(frag, back);
}
Also used : IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory)

Example 3 with IRIFactory

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

the class MoreTests method testRelativizeFrag2.

public void testRelativizeFrag2() {
    @SuppressWarnings("deprecation") IRIFactory f = IRIFactory.jenaImplementation();
    IRI base = f.create("http://example.org/somefolder/mybase.rdf");
    IRI frag = f.create("http://example.org/#foo");
    IRI rel = base.relativize(frag);
    assertEquals("/#foo", rel.toString());
    IRI back = base.resolve(rel);
    assertEquals(frag, back);
}
Also used : IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory)

Example 4 with IRIFactory

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

the class Additional method relDotSlash2.

@Test
public void relDotSlash2() throws MalformedURLException {
    IRIFactory f = IRIFactory.iriImplementation();
    IRI iri = f.construct("http://a/b/c/dddd;pppp?qqqqq");
    IRI iri2 = iri.resolve("./foo");
    test(iri2, "http://a/b/c/foo");
}
Also used : IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory) Test(org.junit.Test)

Example 5 with IRIFactory

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

the class Additional method relDotSlash1.

@Test
public void relDotSlash1() throws MalformedURLException {
    IRIFactory f = IRIFactory.iriImplementation();
    IRI iri = f.construct("http://a/b/c/dddd;pppp?qqqqq");
    IRI iri2 = iri.resolve("./");
    test(iri2, "http://a/b/c/");
}
Also used : IRI(org.apache.jena.iri.IRI) IRIFactory(org.apache.jena.iri.IRIFactory) Test(org.junit.Test)

Aggregations

IRIFactory (org.apache.jena.iri.IRIFactory)15 IRI (org.apache.jena.iri.IRI)10 Violation (org.apache.jena.iri.Violation)4 Test (org.junit.Test)3 Model (org.apache.jena.rdf.model.Model)2 Graph (org.apache.jena.graph.Graph)1 SetupJenaIRI (org.apache.jena.irix.SetupJenaIRI)1 Property (org.apache.jena.rdf.model.Property)1 RDFReaderI (org.apache.jena.rdf.model.RDFReaderI)1 Resource (org.apache.jena.rdf.model.Resource)1 Statement (org.apache.jena.rdf.model.Statement)1 UnknownPropertyException (org.apache.jena.shared.UnknownPropertyException)1