Package com.hp.hpl.jena.iri

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


        LineNumberReader in = new LineNumberReader(new InputStreamReader(
                System.in));
        IRIImpl last = null;
        DEBUG = true;

        IRIFactory factory = IRIFactory.iriImplementation();
        while (true) {
            String s = in.readLine().trim();
            if (s.equals("quit"))
                return;
            IRIImpl iri = (IRIImpl) factory.create(s);
            show(iri);

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


        else
            runTestSpec();
    }

    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: "+
            ((Violation)(iri.violations(false).next())).codeName()
           
            );
View Full Code Here

    }

 

    private void runTestErrorCode() {
        IRIFactory f = new IRIFactory();
        f.setIsError(violation.getCode(), true);

        runTest(f,
                true,
                false,
                "Just this error");
View Full Code Here

    super(s);
  }

 
  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

    IRI back = base.resolve(rel);
    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

        LineNumberReader in = new LineNumberReader(new InputStreamReader(
                System.in));
        IRIImpl last = null;
        DEBUG = true;

        IRIFactory factory = IRIFactory.iriImplementation();
        while (true) {
            String s = in.readLine().trim();
            if (s.equals("quit"))
                return;
            IRIImpl iri = (IRIImpl) factory.create(s);
            show(iri);

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

public class iri
{

    public static void main(String[] args)
    {
        IRIFactory iriFactory = IRIFactory.iriImplementation() ;
        iriFactory = IRIResolver.iriFactory ;
       
        boolean first = true ;
        for ( String iriStr : args )
        {
            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) ;
View Full Code Here

        LineNumberReader in = new LineNumberReader(new InputStreamReader(
                System.in));
        IRIImpl last = null;
        DEBUG = true;

        IRIFactory factory = IRIFactory.iriImplementation();
        while (true) {
            String s = in.readLine().trim();
            if (s.equals("quit"))
                return;
            IRIImpl iri = (IRIImpl) factory.create(s);
            show(iri);

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

            }
        }
       
        if ( str.equals("IRI-RULES") )
        {
            IRIFactory old = options.getIRIFactory() ;
            if ( v.equals("STRICT") )   { options.setIRIFactory(IRIFactory.semanticWebImplementation()) ; }
            else if ( v.equals("IRI") ) { options.setIRIFactory(IRIFactory.iriImplementation()) ; }
            else if ( v.equals("LAX") ) { options.setIRIFactory(IRIFactory.jenaImplementation()) ; }
            else
                eh.error(new IllegalArgumentException(
View Full Code Here

            ErrorHandler errorHandler) {
        this.sizeLimit = sizeLimit;
        this.requestsLeft = maxRequests;
        this.laxContentType = laxContentType;
        this.errorHandler = errorHandler;
        this.iriFactory = new IRIFactory();
        this.iriFactory.useSpecificationXMLSystemID(true);
        this.iriFactory.useSchemeSpecificRules("http", true);
        this.iriFactory.useSchemeSpecificRules("https", true);
        this.contentTypeParser = new ContentTypeParser(errorHandler,
                laxContentType, this.allowRnc, this.allowHtml, this.allowXhtml,
View Full Code Here

TOP

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

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.