Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLOntology


  private ArrayList<OWLClass> getStartingPoint(URI tboxPhysicalURI,
      URI aboxPhysicalURI, int method, String ontology)
  {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology tboxOntology = null, aboxOntology = null;
    try
    {
      // load the Tbox and Abox
      tboxOntology = manager.loadOntology(tboxPhysicalURI);
      aboxOntology = manager.loadOntologyFromPhysicalURI(aboxPhysicalURI);
View Full Code Here


    String iParameter = "";
    String approximationConfig = "";
    for (int i = 0; i < noRestarts; i++)
    {
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
      OWLOntology tboxOntology = null, aboxOntology = null;

      URI aboxLogicalURI = null;
      try
      {
        aboxOntology = manager
            .loadOntologyFromPhysicalURI(aboxPhysicalURI);
        aboxLogicalURI = aboxOntology.getURI();
      } catch (OWLOntologyCreationException e)
      {
        e.printStackTrace();
        System.exit(0);
      }

      URI tboxLogicalURI = null;
      try
      {
        tboxOntology = manager.loadOntology(tboxPhysicalURI);
        tboxLogicalURI = tboxOntology.getURI();
      } catch (OWLOntologyCreationException e)
      {
        e.printStackTrace();
        System.exit(0);
      }
View Full Code Here

    String iParameter = "";
    String approximationConfig = "";
    for (int i = 0; i < noRestarts; i++)
    {
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
      OWLOntology tboxOntology = null, aboxOntology = null;

      URI aboxLogicalURI = null;
      try
      {
        aboxOntology = manager
            .loadOntologyFromPhysicalURI(aboxPhysicalURI);
        aboxLogicalURI = aboxOntology.getURI();
      } catch (OWLOntologyCreationException e)
      {
        e.printStackTrace();
        System.exit(0);
      }

      URI tboxLogicalURI = null;
      try
      {
        tboxOntology = manager.loadOntology(tboxPhysicalURI);
        tboxLogicalURI = tboxOntology.getURI();
      } catch (OWLOntologyCreationException e)
      {
        e.printStackTrace();
        System.exit(0);
      }
View Full Code Here

  {
    Map<OWLClass, Set<OWLIndividual>> approximateClassInstances = new HashMap<OWLClass, Set<OWLIndividual>>();
    RunResult runResult;

    URI originalAboxPhysicalURI = aboxPhysicalURI;
    OWLOntology modifiedAboxOntology = null;

    int runCounter = 1;
    while (true)
    {
      System.out.println("Running Approximation No. " + runCounter);
      OWLReasonerFactory reasonerFactory = new PelletReasonerFactory();
      // OWLReasonerFactory reasonerFactory = new
      // FaCTPlusPlusReasonerFactory();
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
      OWLReasoner reasoner = null;

      OWLOntology aboxOntology = null;
      ApproximationResult approximationResult = null;
      OWLOntology approximatedTboxOntology = null;

      HashMap<OWLClass, Integer> allIndividualsCounts = new HashMap<OWLClass, Integer>();
      HashMap<OWLClass, Integer> directIndividualsCounts = new HashMap<OWLClass, Integer>();
      HashMap<OWLClass, Integer> indirectIndividualsCounts = new HashMap<OWLClass, Integer>();
View Full Code Here

    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLReasonerFactory reasonerFactory = new PelletReasonerFactory();
    // OWLReasonerFactory reasonerFactory = new
    // FaCTPlusPlusReasonerFactory();
    OWLReasoner reasoner = null;
    OWLOntology tboxOntology = null, aboxOntology = null;

    fullCassIndividuals = new HashMap<OWLClass, Set<OWLIndividual>>();
    Set<OWLIndividual> allIndividuals;
    Set<OWLIndividual> directIndividuals;

    HashMap<OWLClass, Integer> allIndividualsCounts = new HashMap<OWLClass, Integer>();
    HashMap<OWLClass, Integer> directIndividualsCounts = new HashMap<OWLClass, Integer>();
    HashMap<OWLClass, Integer> indirectIndividualsCounts = new HashMap<OWLClass, Integer>();

    int cumulativeIndividualsCount = 0;
    int cumulativeDirectindividualsCount = 0;
    int cumulativeIndirectIndividualsCount = 0;

    Timers timers = new Timers();
    double time = 0;
    double classificationTime = 0;
    double instanceRetrievalTime = 0;

    try
    {
      tboxOntology = manager.loadOntology(tboxURI);
      aboxOntology = manager.loadOntology(aboxURI);

    } catch (OWLOntologyCreationException e)
    {
      e.printStackTrace();
      System.exit(0);
    }

    // System.out.println("--->classifying...");
    reasoner = reasonerFactory.createReasoner(manager);
    reasoner.loadOntologies(Collections.singleton(tboxOntology));
    reasoner.loadOntologies(Collections.singleton(aboxOntology));
    timers.createTimer("classification");

    if (!reasoner.isClassified())
    {
      Timer timerClassify = timers.startTimer("classification");
      reasoner.classify();
      timerClassify.stop();
      classificationTime += timerClassify.getTotal();
    }
    // System.out.println("--->retrieving instances...");
    for (OWLClass cc : classes)
    {
      allIndividuals = new HashSet<OWLIndividual>();
      directIndividuals = new HashSet<OWLIndividual>();
      timers.createTimer("retrieval");
      Timer timerRetrieval = timers.startTimer("retrieval");
      allIndividuals = reasoner.getIndividuals(cc, false);
      timerRetrieval.stop();
      instanceRetrievalTime += timerRetrieval.getTotal();

      fullCassIndividuals.put(cc, allIndividuals);

      directIndividuals = reasoner.getIndividuals(cc, true);

      allIndividualsCounts.put(cc, new Integer(allIndividuals.size()));
      directIndividualsCounts.put(cc, new Integer(directIndividuals
          .size()));
      indirectIndividualsCounts.put(cc, new Integer(allIndividuals.size()
          - directIndividuals.size()));

      cumulativeIndividualsCount += allIndividuals.size();
      cumulativeDirectindividualsCount += directIndividuals.size();
      cumulativeIndirectIndividualsCount += (allIndividuals.size() - directIndividuals
          .size());

    }
    reasoner.clearOntologies();
    reasoner.dispose();
    manager.removeOntology(tboxOntology.getURI());
    manager.removeOntology(aboxOntology.getURI());

    time = classificationTime + instanceRetrievalTime;
    RunResult result = new RunResult(allIndividualsCounts, time, classes
        .size(), properties.size());
View Full Code Here

    }


    public OWLOntology createOWLOntology(URI ontologyURI, URI physicalURI,
                                         OWLOntologyCreationHandler handler) throws OWLOntologyCreationException {
        OWLOntology ont = super.createOWLOntology(ontologyURI, physicalURI, handler);
        handler.setOntologyFormat(ont, new DefaultOntologyFormat());
        return ont;
    }
View Full Code Here

    public Map<OWLOntology, Set<O>> getObjects() {
        List<OWLOntology> imports = manager.getSortedImportsClosure(ontology);
        Map<OWLOntology, Set<O>> ontology2EntityMap = new HashMap<OWLOntology, Set<O>>();
        Set<O> processed = new HashSet<O>();
        for(int i = imports.size() - 1; i > -1; i--) {
            OWLOntology currentOnt = imports.get(i);
            Set<O> objects = new HashSet<O>();
            for(O obj : objectSelector.getObjects(currentOnt)) {
                if(!processed.contains(obj)) {
                    processed.add(obj);
                    objects.add(obj);
View Full Code Here

      auxiliarySelection.clear();

    } else
    {
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
      OWLOntology tbox = null, abox = null;
      try
      {
        tbox = manager.loadOntology(tboxURI);
        abox = manager.loadOntology(aboxURI);
      } catch (OWLOntologyCreationException e)
View Full Code Here

    super(v, p, s);
   
    // Compute the ordered list of classes
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
   
    OWLOntology tbox = null, abox = null;
    try {
     
      tbox = manager.loadOntology(tboxURI);
      abox = manager.loadOntology(aboxURI);
     
View Full Code Here

    // // compute matrix S = H + A

    // Compute the ordered list of classes
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

    OWLOntology tbox = null;
    try {
      tbox = manager.loadOntology(tboxURI);

      // Compute the number of direct subclasses of each class
      for (OWLClass owlClass : v) {
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLOntology

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.