Package com.clarkparsia.pellet.owlapiv3

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter


   
    if( !"OWLAPIv3".equals( loaderName ) ) {
      logger.log( Level.WARNING, "Ignoring -l " + loaderName + " option. When using --persist the only allowed loader is OWLAPIv3" );
    }
   
    OWLAPILoader loader = (OWLAPILoader) getLoader( "OWLAPIv3" );
   
    loader.parse( getInputFiles() );
    OWLOntology ontology = loader.getOntology();
   
    IncrementalClassifier incrementalClassifier = createIncrementalClassifier( ontology );
   
    if ( !incrementalClassifier.isClassified() ) {
      startTask( "consistency check" );
View Full Code Here


  }

  public void run() {
    propertyName = options.getOption( "property" ).getValueAsString();

    OWLAPILoader loader = new OWLAPILoader();
    KnowledgeBase kb = loader.createKB( getInputFiles() );

    OWLEntity entity = OntologyUtils.findEntity( propertyName, loader.getAllOntologies() );

    if( entity == null )
      throw new PelletCmdException( "Property not found: " + propertyName );

    if( !(entity instanceof OWLObjectProperty) )
      throw new PelletCmdException( "Not an object property: " + propertyName );

    if( !((OWLObjectProperty) entity).isTransitive( loader.getAllOntologies() ) )
      throw new PelletCmdException( "Not a transitive property: " + propertyName );

    ATermAppl p = ATermUtils.makeTermAppl( entity.getIRI().toString() );

    ATermAppl c = null;
    boolean filter = false;

    if(options.getOption( "filter" ).exists())
    {
      String filterName = options.getOption( "filter" ).getValueAsString();     
      OWLEntity filterClass = OntologyUtils.findEntity( filterName, loader.getAllOntologies() );
      if(filterClass == null)
        throw new PelletCmdException( "Filter class not found: " + filterName );     
      if(!(filterClass instanceof OWLClass))
        throw new PelletCmdException( "Not a class: " + filterName );
View Full Code Here

  }

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

  protected KBLoader getLoader(String loaderName) {
    if( loaderName.equalsIgnoreCase( "Jena" ) )
      loader = new JenaLoader();
    else if( loaderName.equalsIgnoreCase( "OWLAPIv3" ) )
      loader = new OWLAPILoader();
    else if( loaderName.equalsIgnoreCase( "OWLAPI" ) )
      loader = new org.mindswap.pellet.owlapi.OWLAPILoader();
    else if( loaderName.equalsIgnoreCase( "KRSS" ) )
      loader = new KRSSLoader();
    else
View Full Code Here

  public void testDiscoveryOntology() {
    testProperty( "test/data/trans-tree-tests/discovery.owl", "http://purl.org/vocab/relationship/ancestorOf" );
  }
   
  private void testProperty( String ontologyURI, String propertyURI ) {
    OWLAPILoader loader = new OWLAPILoader();
    KnowledgeBase kb = loader.createKB( new String[] { ontologyURI } );
   
    OWLEntity entity = OntologyUtils.findEntity( propertyURI, loader.getAllOntologies() );

    if( entity == null )
      throw new IllegalArgumentException( "Property not found: " + propertyURI );

    if( !(entity instanceof OWLObjectProperty) )
      throw new IllegalArgumentException( "Not an object property: " + propertyURI );

    if( !((OWLObjectProperty) entity).isTransitive( loader.getAllOntologies() ) )
      throw new IllegalArgumentException( "Not a transitive property: " + propertyURI );
   
    ATermAppl p = ATermUtils.makeTermAppl( entity.getIRI().toString() );

    POTaxonomyBuilder builder = null;
View Full Code Here

         all( inv( r ), some( inv( f ), D ) ) ) ) );
  }
 
  @Test
  public void complexInconsistent() {
    kb = new OWLAPILoader().createKB( MiscTests.base + "one+one-inconsistent.owl" );
   
    assertFalse( kb.isConsistent() );
  }
View Full Code Here

    assertFalse( kb.isConsistent() );
  }
 
  @Test
  public void complexAllUnsat() {
    kb = new OWLAPILoader().createKB( MiscTests.base + "one+one-consistent-but-all-unsat.owl" );
   
    assertTrue( kb.isConsistent() );
   
    assertEquals( kb.getClasses(), kb.getUnsatisfiableClasses() );
  }
View Full Code Here

    assertEquals( kb.getClasses(), kb.getUnsatisfiableClasses() );
  }
 
  @Test
  public void complexAllInfSat() {
    kb = new OWLAPILoader().createKB( MiscTests.base + "one+one-consistent-and-all-inf-sat.owl" );
   
    assertTrue( kb.isConsistent() );
   
    assertTrue( kb.getUnsatisfiableClasses().isEmpty() );
  }
View Full Code Here

    assertEquals( expected, actual );
  }

  @Test
  public void testOWLAPILoader() throws OWLOntologyCreationException {
    KnowledgeBase kb = new OWLAPILoader().createKB( DATA1_RDF );

    ATermAppl i = ATermUtils.makeTermAppl( "http://example.org#i" );
    ATermAppl label = ATermUtils.makeTermAppl( RDFS.label.getURI() );
    ATermAppl o1 = ATermUtils.makePlainLiteral( "o1" );
View Full Code Here

  @Override
    public void run() {
    entailmentFile = options.getOption( "entailment-file" ).getValueAsString();
    findAll = options.getOption( "all" ).getValueAsBoolean();
   
    OWLAPILoader loader = (OWLAPILoader) getLoader( "OWLAPIv3" );
   
    getKB();
   
    PelletReasoner reasoner = loader.getReasoner();
   
    OWLOntology entailmentOntology = null;
    try {
      verbose( "Loading entailment file: " );
      verbose( entailmentFile );
      IRI entailmentFileURI = IRI.create( FileUtils.toURI( entailmentFile ) );
      entailmentOntology = loader.getManager().loadOntology( entailmentFileURI );
    } catch( Exception e ) {
      throw new PelletCmdException( e );
    }
   
    EntailmentChecker checker = new EntailmentChecker(reasoner);   
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.owlapiv3.AxiomConverter

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.