Package org.mindswap.pellet

Examples of org.mindswap.pellet.KBLoader


    return ProfileUtils.mb( mem );
  }

  public Collection<Result<Task>> profile(String... files) {
    KBLoader loader = (loaderType == LoaderType.JENA)
      ? new JenaLoader()
      : new OWLAPILoader();
   
    loader.setIgnoreImports(!imports);
   
    KnowledgeBase kb = loader.getKB();

    List<Result<Task>> results = new ArrayList<Result<Task>>();

    for( int i = 0; i <= task.ordinal(); i++ ) {
      Task task = Task.values()[i];

      long start = System.currentTimeMillis();

      switch ( task ) {
      case Parse:
        loader.parse( FileUtils.getFileURIsFromRegex( files ).toArray( new String[0] ) );
        break;

      case Load:
        loader.load();
        ProfileUtils.printCounts( kb );
        break;

      case Consistency:
        kb.isConsistent();
        ProfileUtils.printCounts( kb.getABox() );
        break;

      case Classify:
        kb.classify();
        break;

      case Realize:
        kb.realize();
        break;

      default:
        throw new AssertionError( "This task does not exist: " + task );
      }

      double time = (System.currentTimeMillis() - start) / 1000.0;
      double mem = task.requiresInstances() && kb.getABox().isEmpty()
      ? results.get( results.size() - 1 ).getAvgMemory()
          : printProfile( kb, loader, "After " + task );
      results.add( new Result<Task>( task, mem, time ) );
    }
    kb.timers.print();
    try{
      //System.in.read();
    } catch(Exception e){

    }

    loader.clear();

    return results;
  }
View Full Code Here


  public void testTicket424() {
    classes(A, B, C, D, E, F, G);
    objectProperties(p, q, r, s);


    KBLoader loader = new JenaLoader();
   
    KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );
   
    Taxonomy<ATermAppl> toldTaxonomy = kb.getToldTaxonomy();
       
    try {
View Full Code Here

    boolean savedValue = PelletOptions.DISABLE_EL_CLASSIFIER ;

    try {
      PelletOptions.DISABLE_EL_CLASSIFIER = false;

      KBLoader loader = new JenaLoader();

      KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );

      assertEquals( SimplifiedELClassifier.class, kb.getTaxonomyBuilder().getClass() );
    }
    finally {
      PelletOptions.DISABLE_EL_CLASSIFIER = savedValue;
View Full Code Here

    boolean savedValue = PelletOptions.DISABLE_EL_CLASSIFIER ;

    try {
      PelletOptions.DISABLE_EL_CLASSIFIER = true;

      KBLoader loader = new JenaLoader();

      KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );

      assertFalse( SimplifiedELClassifier.class.equals( kb.getTaxonomyBuilder().getClass() ) );
    }
    finally {
      PelletOptions.DISABLE_EL_CLASSIFIER = savedValue;
View Full Code Here

  public void testTicket424() {
    classes(A, B, C, D, E, F, G);
    objectProperties(p, q, r, s);


    KBLoader loader = new JenaLoader();
   
    KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );
   
    Taxonomy<ATermAppl> toldTaxonomy = kb.getToldTaxonomy();
       
    try {
View Full Code Here

    boolean savedValue = PelletOptions.DISABLE_EL_CLASSIFIER ;

    try {
      PelletOptions.DISABLE_EL_CLASSIFIER = false;

      KBLoader loader = new JenaLoader();

      KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );

      assertEquals( SimplifiedELClassifier.class, kb.getTaxonomyBuilder().getClass() );
    }
    finally {
      PelletOptions.DISABLE_EL_CLASSIFIER = savedValue;
View Full Code Here

    boolean savedValue = PelletOptions.DISABLE_EL_CLASSIFIER ;

    try {
      PelletOptions.DISABLE_EL_CLASSIFIER = true;

      KBLoader loader = new JenaLoader();

      KnowledgeBase kb = loader.createKB( new String[] { "file:" + PelletTestSuite.base + "misc/ticket-424-test-case.owl" } );

      assertFalse( SimplifiedELClassifier.class.equals( kb.getTaxonomyBuilder().getClass() ) );
    }
    finally {
      PelletOptions.DISABLE_EL_CLASSIFIER = savedValue;
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.KBLoader

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.