Package org.mindswap.pellet.taxonomy

Examples of org.mindswap.pellet.taxonomy.POTaxonomyBuilder


      c = ATermUtils.makeTermAppl( filterClass.getIRI().toString() );

      filter = true;
    }

    POTaxonomyBuilder builder = null;

    // Test first the individuals parameter, as per default the --classes
    // option is true
    if( options.getOption( "individuals" ).getValueAsBoolean() ) {
      // Parts for individuals
      builder = new POTaxonomyBuilder( kb, new PartIndividualsComparator( kb, p ) );
     
      Set<ATermAppl> individuals;     
      if(filter)
        individuals = kb.getInstances(c);
      else
        individuals = kb.getIndividuals()// Note: this is not an optimal solution 
     
      for( ATermAppl individual :  individuals)
        if (!ATermUtils.isBnode( individual ))
          builder.classify( individual );
    }
    else {
      builder = new POTaxonomyBuilder( kb, new PartClassesComparator( kb, p ) );
     
      if(filter)
      {
        for(ATermAppl cl: getDistinctSubclasses(kb, c))
          builder.classify(cl);
      }
      else
        builder.classify();
    }

    Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();

    ClassTreePrinter printer = new ClassTreePrinter();
    printer.print( taxonomy );
   
    publicTaxonomy = taxonomy;
View Full Code Here


   
    return true;
  }

  private void buildTaxonomyWithPO() {
    POTaxonomyBuilder builder = new POTaxonomyBuilder(kb, subsumptionComparator);
    taxonomy = builder.getTaxonomy();
   
    for( ConceptInfo ci : concepts.values() ) {
      classify( ci );
    }
  }
View Full Code Here

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

    POTaxonomyBuilder builder = null;

    // Parts for individuals
    //builder = new POTaxonomyBuilder( kb, new PartIndividualsComparator( kb, p ) );

    // Note: this is not an optimal solution
    //for( ATermAppl individual : kb.getIndividuals() )
    //  if (!ATermUtils.isBnode( individual ))
    //    builder.classify( individual );
     
    //Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();
    //ClassTreePrinter printer = new ClassTreePrinter();
    //printer.print( taxonomy );
   
    builder = new POTaxonomyBuilder( kb, new PartClassesComparator( kb, p ) );
    builder.classify();
   
    Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();
    ClassTreePrinter printer = new ClassTreePrinter();
    printer.print( taxonomy );
  }
View Full Code Here

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

    POTaxonomyBuilder builder = null;

    // Parts for individuals
    //builder = new POTaxonomyBuilder( kb, new PartIndividualsComparator( kb, p ) );

    // Note: this is not an optimal solution
    //for( ATermAppl individual : kb.getIndividuals() )
    //  if (!ATermUtils.isBnode( individual ))
    //    builder.classify( individual );
     
    //Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();
    //ClassTreePrinter printer = new ClassTreePrinter();
    //printer.print( taxonomy );
   
    builder = new POTaxonomyBuilder( kb, new PartClassesComparator( kb, p ) );
    builder.classify();
   
    Taxonomy<ATermAppl> taxonomy = builder.getTaxonomy();
    ClassTreePrinter printer = new ClassTreePrinter();
    printer.print( taxonomy );
  }
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.taxonomy.POTaxonomyBuilder

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.