Examples of OWLOntology


Examples of edu.stanford.smi.protegex.owl.model.OWLOntology

 
  public IOntology[] getImportedOntologies() {
    if(imported == null){
      checkModel();
      imported = new ArrayList<IOntology>();
      OWLOntology defaultont = (OWLOntology) resource;
      Collection list = defaultont.getImportResources();
      for(Object o: list){
        if(o instanceof RDFResource){
          //TODO: maybe there is some tripplestore trick that I can use
          // and avoid loading imported ontology again
          RDFResource on = (RDFResource) o;
View Full Code Here

Examples of org.semanticweb.owl.model.OWLOntology

      return false;
    }
  }
 
  public boolean computeMetrics(URI uri, String ontName) throws OWLReasonerException{
    OWLOntology ontology = loadOntology(uri);
    if (ontology != null){
      rowCnt++;
      int colCnt = -1;
     
      VocabularyManager vManager = new VocabularyManager(ontology);
      Set<OWLClass> concepts = vManager.getConceptSet();
      Set<OWLProperty<?,?>> properties = vManager.getPropertySet();
     
      Set<OWLIndividual> allIndividuals = ontology.getReferencedIndividuals();
   
      String link = "<a href=\"viewmetrics.php?o="+ontName+"\">C</a>&nbsp;<a href=\"viewmetrics-i.php?o="+ontName+"\">I</a>";
      this.writeToFile(this.output, ontName + " ");
      String htmlRow = "<tr>\n\t<td bgcolor=\"#FFFFFF\" align=\"left\"><a href=\"viewmetrics.php?o="+ontName+"\">"+ontName+"</a></td>\n";
      String dataCell = "data.setCell("+rowCnt+", "+(++colCnt)+", '"+ontName+"&nbsp"+link+"');\n";
     
      this.logger.info("Ontology " + ontology.getURI() + " loaded");
     
      this.logger.info("\tClasses: " + concepts.size());
      this.writeToFile(this.output, concepts.size() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+concepts.size()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+concepts.size()+", '"+concepts.size()+"');\n";
     
      this.logger.info("\tProperties: " + properties.size());
      this.writeToFile(this.output, properties.size() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+properties.size()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+properties.size()+", '"+properties.size()+"');\n";
     
      this.logger.info("\tIndividual count: " + allIndividuals.size());
      this.writeToFile(this.output, allIndividuals.size() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+allIndividuals.size()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+allIndividuals.size()+", '"+allIndividuals.size()+"');\n";     
     
      this.logger.info("\tAxioms: " + ontology.getAxioms().size());
      this.writeToFile(this.output, ontology.getAxioms().size() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+ontology.getAxioms().size()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+ontology.getAxioms().size()+", '"+ontology.getAxioms().size()+"');\n";
     
      this.logger.info("\tSubClass Axioms: " + ontology.getAxiomCount(AxiomType.SUBCLASS));
      this.writeToFile(this.output, ontology.getAxiomCount(AxiomType.SUBCLASS) + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+ontology.getAxiomCount(AxiomType.SUBCLASS)+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+ontology.getAxiomCount(AxiomType.SUBCLASS)+", '"+ontology.getAxiomCount(AxiomType.SUBCLASS)+"');\n";
     
      this.logger.info("\tLogical Axioms: " + ontology.getLogicalAxiomCount());
      this.writeToFile(this.output, ontology.getLogicalAxiomCount() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+ontology.getLogicalAxiomCount()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+ontology.getLogicalAxiomCount()+", '"+ontology.getLogicalAxiomCount()+"');\n";
     
      this.logger.info("\tAnnotation Axioms: " + ontology.getAnnotationAxioms().size());
      this.writeToFile(this.output, ontology.getAnnotationAxioms().size() + " ");
     
      this.logger.info("\tClass Axioms: " + ontology.getClassAxioms().size());
      this.writeToFile(this.output, ontology.getClassAxioms().size() + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+ontology.getClassAxioms().size()+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+ontology.getClassAxioms().size()+", '"+ontology.getClassAxioms().size()+"');\n";
     
      OWLOntologyWalker walker = new OWLOntologyWalker(Collections.singleton(ontology));
      ExistentialAxiomVisitor<OWLObject> myVisitor = new ExistentialAxiomVisitor<OWLObject>();
     
      walker.walkStructure(myVisitor);
     
      this.logger.info("\tsubClass = " + myVisitor.subClassCnt);
      this.logger.info("\tclassAssertAxiom = " + myVisitor.classAssertAxiomCnt);
      this.logger.info("\tentityAnnAxiom = " + myVisitor.entityAnnAxiomCnt);
     
      this.logger.info("\tdataSomeRestriction = " + myVisitor.dataSomeRestrictionCnt);
      this.logger.info("\tobjectSomeRestriction = " + myVisitor.objectSomeRestrictionCnt);
      int someCnt = myVisitor.dataSomeRestrictionCnt + myVisitor.objectSomeRestrictionCnt;
      this.writeToFile(this.output, someCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+someCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+someCnt+", '"+someCnt+"');\n";
     
      this.logger.info("\tdataAllRestriction = " + myVisitor.dataAllRestrictionCnt);
      this.logger.info("\tobjectAllRestriction = " + myVisitor.objectAllRestrictionCnt);
      int allCnt = myVisitor.dataAllRestrictionCnt + myVisitor.objectAllRestrictionCnt;
      this.writeToFile(this.output, allCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+allCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+allCnt+", '"+allCnt+"');\n";
     
      this.logger.info("\tobjectIntersectionOf = " + myVisitor.objectIntersectionOfCnt);
      this.writeToFile(this.output, myVisitor.objectIntersectionOfCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.objectIntersectionOfCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.objectIntersectionOfCnt+", '"+myVisitor.objectIntersectionOfCnt+"');\n";
     
      this.logger.info("\tobjectUnionOf = " + myVisitor.objectUnionOfCnt);
      this.writeToFile(this.output, myVisitor.objectUnionOfCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.objectUnionOfCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.objectUnionOfCnt+", '"+myVisitor.objectUnionOfCnt+"');\n";
     
      this.logger.info("\tobjectComplementOf = " + myVisitor.objectComplementOfCnt);
      this.writeToFile(this.output, myVisitor.objectComplementOfCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.objectComplementOfCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.objectComplementOfCnt+", '"+myVisitor.objectComplementOfCnt+"');\n";
     
      this.logger.info("\tEquivalent Class Axioms = " + myVisitor.equivClassesCnt);
      this.writeToFile(this.output, myVisitor.equivClassesCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.equivClassesCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.equivClassesCnt+", '"+myVisitor.equivClassesCnt+"');\n";
     
      this.logger.info("\tDisjoint Class Axioms = " + myVisitor.disjClassesCnt);
      this.writeToFile(this.output, myVisitor.disjClassesCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.disjClassesCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.disjClassesCnt+", '"+myVisitor.disjClassesCnt+"');\n";
     
      this.logger.info("\tSame Individual Axioms = " + myVisitor.sameIndividualAxiomCnt);
      this.writeToFile(this.output, myVisitor.sameIndividualAxiomCnt + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+myVisitor.sameIndividualAxiomCnt+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+myVisitor.sameIndividualAxiomCnt+", '"+myVisitor.sameIndividualAxiomCnt+"');\n";
     
      //int value = ontology.getAxiomCount(AxiomType.OBJECT_PROPERTY_ASSERTION);
      int value = ontology.getObjectPropertyAxioms().size();
      this.logger.info("\tObject Property Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.OBJECT_PROPERTY_DOMAIN);
      this.logger.info("\tObject Property Domain Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";

      value = ontology.getAxiomCount(AxiomType.OBJECT_PROPERTY_RANGE);
      this.logger.info("\tObject Property Range Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.SUB_OBJECT_PROPERTY);
      this.logger.info("\tSub Object Property Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.TRANSITIVE_OBJECT_PROPERTY);
      this.logger.info("\tTransitive Object Property Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.DATA_PROPERTY_ASSERTION);
      this.logger.info("\tData Property Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.DATA_PROPERTY_DOMAIN);
      this.logger.info("\tData Property Domain Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";

      value = ontology.getAxiomCount(AxiomType.DATA_PROPERTY_RANGE);
      this.logger.info("\tData Property Range Axioms: " + value);
      this.writeToFile(this.output, value + " ");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
      value = ontology.getAxiomCount(AxiomType.SUB_DATA_PROPERTY);
      this.logger.info("\tSub Data Property Axioms: " + value);
      this.writeToFile(this.output, value + "\n");
      htmlRow += "\t<td bgcolor=\"#FFFFFF\" align=\"right\">"+value+"</td>\n</tr>\n";
      dataCell += "data.setCell("+rowCnt+", "+(++colCnt)+", "+value+", '"+value+"');\n";
     
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

            @Nonnull OWLOntologyManager manager) throws IOException,
            OWLOntologyCreationException, OWLOntologyStorageException {
        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(manager);
        OBOFormatParser p = new OBOFormatParser();
        OBODoc obodoc = p.parse(new URL(iri));
        OWLOntology ontology = bridge.convert(obodoc);
        IRI outputStream = IRI.create(outFile);
        OWLDocumentFormat format = new RDFXMLDocumentFormat();
        LOG.info("saving to {} fmt={}", outputStream, format);
        manager.saveOntology(ontology, format, outputStream);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

            OWLOntologyStorageException {
        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(manager);
        OBOFormatParser p = new OBOFormatParser();
        OBODoc obodoc = p.parse(new URL(iri));
        obodoc.addDefaultOntologyHeader(defaultOnt);
        OWLOntology ontology = bridge.convert(obodoc);
        IRI outputStream = IRI.create(outFile);
        OWLDocumentFormat format = new RDFXMLDocumentFormat();
        LOG.info("saving to {} fmt={}", outputStream, format);
        manager.saveOntology(ontology, format, outputStream);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

            throws OwlStringException {
        if (axioms == null || axioms.isEmpty()) {
            return null;
        }
        try {
            OWLOntology ontology = translationManager.createOntology();
            translationManager.addAxioms(ontology, axioms);
            OWLFunctionalSyntaxRenderer r = new OWLFunctionalSyntaxRenderer();
            Writer writer = new StringWriter();
            r.render(ontology, writer);
            return writer.toString();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

        }
        try {
            OWLFunctionalSyntaxOWLParser p = new OWLFunctionalSyntaxOWLParser();
            OWLOntologyDocumentSource documentSource = new StringDocumentSource(
                    axioms);
            OWLOntology ontology = translationManager.createOntology();
            p.parse(documentSource, ontology,
                    translationManager.getOntologyLoaderConfiguration());
            return ontology.getAxioms();
        } catch (UnloadableImportException e) {
            throw new OwlStringException(e);
        } catch (OWLOntologyCreationException e) {
            throw new OwlStringException(e);
        } catch (OWLParserException e) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

     */
    public void writeOntology() throws OWLRendererException {
        if (ontologies.size() != 1) {
            throw new OWLRuntimeException("Can only render one ontology");
        }
        OWLOntology ontology = ontologies.iterator().next();
        assert ontology != null;
        writePrefixMap();
        writeNewLine();
        writeOntologyHeader(ontology);
        for (OWLAnnotationProperty prop : ontology
                .getAnnotationPropertiesInSignature(EXCLUDED)) {
            assert prop != null;
            write(prop);
        }
        for (OWLDatatype datatype : ontology.getDatatypesInSignature()) {
            assert datatype != null;
            write(datatype);
        }
        for (OWLObjectProperty prop : ontology.getObjectPropertiesInSignature()) {
            assert prop != null;
            write(prop);
            OWLObjectPropertyExpression invProp = prop.getInverseProperty();
            if (!ontology.getAxioms(invProp, EXCLUDED).isEmpty()) {
                write(invProp);
            }
        }
        for (OWLDataProperty prop : ontology.getDataPropertiesInSignature()) {
            assert prop != null;
            write(prop);
        }
        for (OWLClass cls : ontology.getClassesInSignature()) {
            assert cls != null;
            write(cls);
        }
        for (OWLNamedIndividual ind : ontology.getIndividualsInSignature()) {
            assert ind != null;
            write(ind);
        }
        for (OWLAnonymousIndividual ind : ontology
                .getReferencedAnonymousIndividuals(EXCLUDED)) {
            assert ind != null;
            write(ind);
        }
        // Nary disjoint classes axioms
        event = new RendererEvent(this, ontology);
        for (OWLDisjointClassesAxiom ax : ontology
                .getAxioms(AxiomType.DISJOINT_CLASSES)) {
            if (ax.getClassExpressions().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getClassExpressions(), ax);
                writeSection(DISJOINT_CLASSES, map, ",", false, ontology);
            }
        }
        // Nary equivalent classes axioms
        for (OWLEquivalentClassesAxiom ax : ontology
                .getAxioms(AxiomType.EQUIVALENT_CLASSES)) {
            if (ax.getClassExpressions().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getClassExpressions(), ax);
                writeSection(EQUIVALENT_CLASSES, map, ",", false, ontology);
            }
        }
        // Nary disjoint properties
        for (OWLDisjointObjectPropertiesAxiom ax : ontology
                .getAxioms(AxiomType.DISJOINT_OBJECT_PROPERTIES)) {
            if (ax.getProperties().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getProperties(), ax);
                writeSection(DISJOINT_PROPERTIES, map, ",", false, ontology);
            }
        }
        // Nary equivalent properties
        for (OWLEquivalentObjectPropertiesAxiom ax : ontology
                .getAxioms(AxiomType.EQUIVALENT_OBJECT_PROPERTIES)) {
            if (ax.getProperties().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getProperties(), ax);
                writeSection(EQUIVALENT_PROPERTIES, map, ",", false, ontology);
            }
        }
        // Nary disjoint properties
        for (OWLDisjointDataPropertiesAxiom ax : ontology
                .getAxioms(AxiomType.DISJOINT_DATA_PROPERTIES)) {
            if (ax.getProperties().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getProperties(), ax);
                writeSection(DISJOINT_PROPERTIES, map, ",", false, ontology);
            }
        }
        // Nary equivalent properties
        for (OWLEquivalentDataPropertiesAxiom ax : ontology
                .getAxioms(AxiomType.EQUIVALENT_DATA_PROPERTIES)) {
            if (ax.getProperties().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getProperties(), ax);
                writeSection(EQUIVALENT_PROPERTIES, map, ",", false, ontology);
            }
        }
        // Nary different individuals
        for (OWLDifferentIndividualsAxiom ax : ontology
                .getAxioms(AxiomType.DIFFERENT_INDIVIDUALS)) {
            if (ax.getIndividuals().size() > 2) {
                SectionMap<Object, OWLAxiom> map = new SectionMap<>();
                map.put(ax.getIndividuals(), ax);
                writeSection(DIFFERENT_INDIVIDUALS, map, ",", false, ontology);
            }
        }
        for (SWRLRule rule : ontology.getAxioms(AxiomType.SWRL_RULE)) {
            @SuppressWarnings("null")
            @Nonnull
            Set<SWRLRule> singleton = Collections.singleton(rule);
            writeSection(RULE, singleton, ", ", false);
        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

        String sep = COMMA.keyword();
        Set<OWLOntology> onts = new HashSet<>();
        while (COMMA.matches(sep)) {
            String tok = consumeToken();
            if (isOntologyName(tok)) {
                OWLOntology ont = getOntology(tok);
                if (ont != null) {
                    onts.add(ont);
                }
            } else {
                throw new ExceptionBuilder().withOnto().build();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

                        .getImportsDeclarations()) {
                    assert decl != null;
                    imports.add(new AddImport(ont, decl));
                    ont.getOWLOntologyManager().makeLoadImportRequest(decl,
                            getOntologyLoaderConfiguration());
                    OWLOntology imported = ont.getOWLOntologyManager()
                            .getOntology(decl.getIRI());
                    assert imported != null;
                    for (OWLDeclarationAxiom declaration : imported
                            .getAxioms(AxiomType.DECLARATION)) {
                        processDeclaredEntities(declaration);
                    }
                }
                for (OWLAnnotation anno : header.getAnnotations()) {
                    assert anno != null;
                    ontologyAnnotations
                            .add(new AddOntologyAnnotation(ont, anno));
                }
                ontologyID = header.getOntologyID();
            } else if (DISJOINT_CLASSES.matches(section)) {
                axioms.addAll(parseDisjointClasses());
            } else if (EQUIVALENT_CLASSES.matches(section)) {
                axioms.addAll(parseNaryEquivalentClasses());
            } else if (EQUIVALENT_PROPERTIES.matches(section)) {
                axioms.addAll(parseNaryEquivalentProperties());
            } else if (DISJOINT_PROPERTIES.matches(section)) {
                axioms.addAll(parseDisjointProperties());
            } else if (DIFFERENT_INDIVIDUALS.matches(section)) {
                axioms.addAll(parseDifferentIndividuals());
            } else if (SAME_INDIVIDUAL.matches(section)) {
                axioms.addAll(parseSameIndividual());
            } else if (CLASS.matches(section)) {
                axioms.addAll(parseClassFrame());
            } else if (OBJECT_PROPERTY.matches(section)) {
                axioms.addAll(parseObjectPropertyFrame());
            } else if (DATA_PROPERTY.matches(section)) {
                axioms.addAll(parseDataPropertyFrame());
            } else if (INDIVIDUAL.matches(section)) {
                axioms.addAll(parseIndividualFrame());
            } else if (DATATYPE.matches(section)) {
                axioms.addAll(parseDatatypeFrame());
            } else if (ANNOTATION_PROPERTY.matches(section)) {
                axioms.addAll(parseAnnotationPropertyFrame());
            } else if (VALUE_PARTITION.matches(section)) {
                axioms.addAll(parseValuePartitionFrame());
            } else if (IMPORT.matches(section)) {
                OWLImportsDeclaration decl = parseImportsDeclaration();
                ont.getOWLOntologyManager().makeLoadImportRequest(decl,
                        getOntologyLoaderConfiguration());
                imports.add(new AddImport(ont, decl));
                OWLOntology imported = ont.getOWLOntologyManager().getOntology(
                        decl.getIRI());
                assert imported != null;
                for (OWLDeclarationAxiom declaration : imported
                        .getAxioms(AxiomType.DECLARATION)) {
                    processDeclaredEntities(declaration);
                }
            } else if (PREFIX.matches(section)) {
                Map<String, IRI> nsMap = parsePrefixDeclaration();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

                Optional<IRI> importedIRI = Optional.absent();
                if (tok.startsWith("<")) {
                    importedIRI = Optional.of(parseIRI());
                } else if (isOntologyName(tok)) {
                    consumeToken();
                    OWLOntology ont = getOntology(tok);
                    if (ont != null) {
                        importedIRI = ont.getOntologyID().getOntologyIRI();
                    }
                } else {
                    consumeToken();
                    throw new ExceptionBuilder().withOnto()
                            .withKeyword("<$ONTOLOGYYURI$>").build();
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.