Package org.apache.jena.iri

Examples of org.apache.jena.iri.IRIFactory


            }
        }
       
        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


    public static void main(String[] args) throws Exception {
        /// turn off the "No BGP optimizer warning"
        TDB.setOptimizerWarningFlag(false);

        final IRIFactory iriFactory = IRIFactory.semanticWebImplementation();

        final String DATASET_DIR_NAME = "data0";
        final Dataset data0 = TDBFactory.createDataset( DATASET_DIR_NAME );

        // show the currently registered names
        for (Iterator<String> it = data0.listNames(); it.hasNext(); ) {
            out.println("NAME="+it.next());
        }

        out.println("getting named model...");
        /// this is the OWL portion
        final Model model = data0.getNamedModel( MY_NS );
        out.println("Model := "+model);

        out.println("getting graph...");
        /// this is the DATA in that MODEL
        final Graph graph = model.getGraph();
        out.println("Graph := "+graph);

        if (graph.isEmpty()) {
            final Resource product1 = model.createResource(
                    iriFactory.construct( MY_NS +"product/1" )
                        .toString() );

            final Property hasName = model.createProperty( MY_NS, "#hasName");
            final Statement stmt = model.createStatement(
                    product1, hasName, model.createLiteral("Beach Ball","en") );
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

  }
 
  public void testIRIRules_2()
  {
        Model model = ModelFactory.createDefaultModel() ;
      IRIFactory f = ARPOptions.getIRIFactoryGlobal() ;
      try {
          ARPOptions.setIRIFactoryGlobal(IRIFactory.iriImplementation()) ;
          RDFReader r =  model.getReader("RDF/XML") ;
            expected = new int[] { WARN_MALFORMED_URI , WARN_MALFORMED_URI };
          r.setErrorHandler(this);
View Full Code Here

  }
 
  public void testIRIRules_2()
  {
        Model model = ModelFactory.createDefaultModel() ;
      IRIFactory f = ARPOptions.getIRIFactoryGlobal() ;
      try {
          ARPOptions.setIRIFactoryGlobal(IRIFactory.iriImplementation()) ;
          RDFReader r =  model.getReader("RDF/XML") ;
            expected = new int[] { WARN_MALFORMED_URI , WARN_MALFORMED_URI };
          r.setErrorHandler(this);
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

        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: "+
            ((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

        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: "+
            ((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

TOP

Related Classes of org.apache.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.