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> <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+" "+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";