Package com.hp.hpl.jena.iri

Examples of com.hp.hpl.jena.iri.IRI


                return;
            IRIImpl iri = (IRIImpl) factory.create(s);
            show(iri);

            if (last != null) {
                IRI r = last.create(iri);
                System.out.println("Resolved: " + r.toString());
                show(r);
            }
            last = iri;
        }
    }
View Full Code Here


        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: "+
            ((Violation)(iri.violations(false).next())).codeName()
           
            );
        } else {
            if (!good) fail("Expected a violation, none found.");
        }
View Full Code Here

    }

    private void runTest(IRIFactory f, boolean expectError,
            boolean expectWarning, String desc) {
        IRI iri = f.create(uri);
        boolean implemented = violation.isImplemented();
        expectError = expectError && implemented;
        expectWarning = expectWarning && (!expectError) && implemented;
        if (good) {
            expectError = expectWarning = false;
        }
        boolean hasError = false;
        boolean hasWarning = false;
        Iterator it = iri.violations(true);
        while (it.hasNext()) {
            Violation v = (Violation) it.next();
            if (v.getViolationCode() == violation.getCode()) {
                if (v.isError()) {
                    if (!expectError)
View Full Code Here

        }

    }

    private void check(String string) {
        IRI iri = factory.create(string);
        if (iri.hasViolation(true)) {
            System.out.println("n: " + string);
            Iterator it = iri.violations(true);
            while (it.hasNext()) {
                Violation v = (Violation) it.next();
                System.out.println(v.getLongMessage());
            }
        } else {
View Full Code Here

       
        doIt(absolute);
       
        if (base!=null) {
            out.println("<Resolve>");
            IRI b = doIt(base);
            IRI r = doIt(relative);
            out.println("<Result>");
            IRI result = b.create(r);
            doIt(result);
            out.println("</Result>");
            IRI rAgain =  b.relativize(
                    result,
                  RelativizeFlags 
                    );
            if (r.equals(rAgain)) {
                out.println("<Relativize same='true'/>");
View Full Code Here

    }

    private IRI doIt(String iri) {
        if (iri==null)
            return null;
        IRI rslt =
            factory.create(iri);
//            empty.create(iri);
        out.println("<IRI iri='"+substituteStandardEntities(iri)+"'>");
        doIt(rslt);
        out.println("</IRI>");
View Full Code Here

  }

 
  public void testRelativizeFrag1() {
    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);
  }
View Full Code Here

    assertEquals(frag,back);
  }

  public void testRelativizeFrag2() {
    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);
  }
View Full Code Here

    public TestMERelativize(Attributes att, TestSuite suite) {
        super("relativize"+ (++count),att,suite);
    }

    IRI computeIRI() {
        IRI base = ((TestMoreExamples)parent.testAt(0)).getIRI();
        IRI rel = ((TestMoreExamples)parent.testAt(2)).getIRI();
        return base.relativize(rel, TestCreator.RelativizeFlags);
    }
View Full Code Here

    public TestMEResult(Attributes att, TestSuite suite) {
        super("result"+ (++count),att, suite);
    }

    IRI computeIRI() {
        IRI base = ((TestMoreExamples)parent.testAt(0)).getIRI();
        IRI rel = ((TestMoreExamples)parent.testAt(1)).getIRI();
        return base.create(rel);
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.iri.IRI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.