Examples of ModelExtractor


Examples of org.mindswap.pellet.jena.ModelExtractor

  private void extractInferences() {
    if( selector.size() == 0 )
      throw new PelletCmdException( "Selector is empty, provide types to extract" );

    ModelExtractor extractor = new ModelExtractor( getKB() );
    extractor.setSelector( selector );

    Model extracted = ModelFactory.createDefaultModel();
   
    if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_CLASS_STATEMENTS ) ) {
      startTask( "Extracting class statements" );
      extractor.extractClassModel( extracted );
      finishTask( "Extracting class statements" );
    }

    if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_PROPERTY_STATEMENTS ) ) {
      startTask( "Extracting property statements" );
      extractor.extractPropertyModel( extracted );
      finishTask( "Extracting property statements" );
    }

    if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_INDIVIDUAL_STATEMENTS ) ) {
      startTask( "Extracting individual statements" );
      extractor.extractIndividualModel( extracted );
      finishTask( "Extracting individual statements" );
    }

    output( extracted );
  }
View Full Code Here

Examples of org.mindswap.pellet.jena.ModelExtractor

          return true;
        }
       
        @Override
        public ExtendedIterator<Triple> find(KnowledgeBase kb, PelletInfGraph pellet, Node s, Node p, Node o) {
          ModelExtractor me = new ModelExtractor( kb );
          me.setSelector( StatementType.ALL_STATEMENTS );
          Graph graph = me.extractModel().getGraph();
          return graph.find( Triple.ANY );
        }
      }
    );       
   
View Full Code Here

Examples of org.mindswap.pellet.jena.ModelExtractor

    rawModel.add(a, RDF.type, C);
    rawModel.add(C, RDFS.subClassOf, D);
   
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, rawModel );

    ModelExtractor extractor = new ModelExtractor(model);
    Model inferences = extractor.extractModel();
   
    assertTrue(inferences.contains(a, RDF.type, D));
  }
View Full Code Here

Examples of org.mindswap.pellet.jena.ModelExtractor

          return true;
        }
       
        @Override
        public ExtendedIterator<Triple> find(KnowledgeBase kb, GraphLoader loader, Node s, Node p, Node o) {
          ModelExtractor me = new ModelExtractor( kb );
          me.setSelector( StatementType.ALL_STATEMENTS );
          Graph graph = me.extractModel().getGraph();
          return graph.find( Triple.ANY );
        }
      }
    );       
   
View Full Code Here

Examples of org.mindswap.pellet.jena.ModelExtractor

    rawModel.add(a, RDF.type, C);
    rawModel.add(C, RDFS.subClassOf, D);
   
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, rawModel );

    ModelExtractor extractor = new ModelExtractor(model);
    Model inferences = extractor.extractModel();
   
    assertTrue(inferences.contains(a, RDF.type, D));
  }
View Full Code Here

Examples of pymontecarlo.fileformat.options.ModelExtractor

            EPQException {
        Element modelsRoot = root.getChild("models");

        Strategy strategy = new Strategy();

        ModelExtractor extractor;
        for (Element modelElement : modelsRoot.getChildren()) {
            extractor =
                    (ModelExtractor) ExtractorManager.getExtractor(modelElement
                            .getName());
            strategy.addAll(extractor.extract(modelElement));
        }

        return strategy;
    }
View Full Code Here

Examples of pymontecarlo.fileformat.options.ModelExtractor

            EPQException {
        Element modelsRoot = root.getChild("models");

        Strategy strategy = new Strategy();

        ModelExtractor extractor;
        for (Element modelElement : modelsRoot.getChildren()) {
            extractor =
                    (ModelExtractor) ExtractorManager.getExtractor(modelElement
                            .getName());
            strategy.addAll(extractor.extract(modelElement));
        }

        return strategy;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.