Package com.clarkparsia.owlwg.testrun

Examples of com.clarkparsia.owlwg.testrun.ReasoningRun


      throwable = null;
    }

    public TestRunResult getErrorResult(Throwable th) {
      th.printStackTrace();
      return new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this, th
          .getMessage(), th );
    }
View Full Code Here


      return result;
    }

    public TestRunResult getTimeoutResult() {
      return new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this, String
          .format( "Timeout: %s ms", timeout ) );
    }
View Full Code Here

          fmt = f;
          break;
        }
      }
      if( fmt == null ) {
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "No acceptable serialization formats found for premise ontology." );
        return;
      }

      OWLOntology o;
      try {
        long parseStart = System.currentTimeMillis();
        o = testcase.parsePremiseOntology( fmt );
        long parseEnd = System.currentTimeMillis();
        System.err.println(testcase.getIdentifier() + " parse time " + ((parseEnd - parseStart)/1000));
      } catch( OntologyParseException e ) {
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "Exception parsing premise ontology: " + e.getLocalizedMessage(), e );
        return;
      }

      try {
        final boolean consistent = isConsistent( o );
        if( consistent )
          result = new ReasoningRun( testcase, CONSISTENCY.equals( type )
            ? PASSING
            : FAILING, type, OwlApi3AbstractRunner.this );
        else
          result = new ReasoningRun( testcase, INCONSISTENCY.equals( type )
            ? PASSING
            : FAILING, type, OwlApi3AbstractRunner.this );
      } catch( Throwable th ) {
        th.printStackTrace();
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "Caught throwable: " + th.getLocalizedMessage(), th );
      }
    }
View Full Code Here

          pFmt = f;
          break;
        }
      }
      if( pFmt == null ) {
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "No acceptable serialization formats found for premise ontology." );
        return;
      }
      for( SerializationFormat f : formatList ) {
        if( testcase.getConclusionFormats().contains( f ) ) {
          cFmt = f;
          break;
        }
      }
      if( cFmt == null ) {
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "No acceptable serialization formats found for conclusion ontology." );
        return;
      }

      OWLOntology premise, conclusion;
      try {
        long parseStart = System.currentTimeMillis();
        premise = testcase.parsePremiseOntology( pFmt );
        conclusion = testcase.parseConclusionOntology( cFmt );
        long parseEnd = System.currentTimeMillis();
        System.err.println(testcase.getIdentifier() + " parse time " + ((parseEnd - parseStart)/1000));
      } catch( OntologyParseException e ) {
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "Exception parsing input ontology: " + e.getLocalizedMessage(), e );
        return;
      }

      try {
        boolean entailed = isEntailed(premise, conclusion );
        if( entailed )
          result = new ReasoningRun( testcase, POSITIVE_ENTAILMENT.equals( type )
            ? PASSING
            : FAILING, type, OwlApi3AbstractRunner.this );
        else
          result = new ReasoningRun( testcase, NEGATIVE_ENTAILMENT.equals( type )
            ? PASSING
            : FAILING, type, OwlApi3AbstractRunner.this );
      } catch( Throwable th ) {
        System.gc();
        th.printStackTrace();
        result = new ReasoningRun( testcase, INCOMPLETE, type, OwlApi3AbstractRunner.this,
            "Caught throwable: " + th.getLocalizedMessage(), th );
      }
    }
View Full Code Here

TOP

Related Classes of com.clarkparsia.owlwg.testrun.ReasoningRun

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.