/*
 * ClassParser.java
 *
 */

package de.uni_stuttgart.vis.vowl.owl2vowl.parser;

import de.uni_stuttgart.vis.vowl.owl2vowl.constants.Standard_Iris;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.Vowl_Prop_Attr;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.classes.BaseClass;
import de.uni_stuttgart.vis.vowl.owl2vowl.parser.container.MapData;
import de.uni_stuttgart.vis.vowl.owl2vowl.parser.container.OntologyInformation;
import de.uni_stuttgart.vis.vowl.owl2vowl.pipes.FormatText;
import org.semanticweb.owlapi.model.*;

import java.util.Map;
import java.util.Set;

/**
 *
 */
public class ClassParser extends GeneralNodeParser {
	private Set<OWLClass> classes;

	public ClassParser(OntologyInformation ontologyInformation, MapData mapData, Set<OWLClass> classes) {
		super(ontologyInformation, mapData);
		this.classes = classes;
	}

	protected void execute() {
		Map<String, BaseClass> classMap = mapData.getClassMap();
		Map<String, OWLClass> owlClasses = mapData.getOwlClasses();

		for (OWLClass currentClass : classes) {
			isDeprecated = false;
			rdfsIsDefinedBy = "";
			owlVersionInfo = "";
			iri = currentClass.getIRI().toString();

			// If thing is found skip it! It only gets created where necessary.
			if (iri.equals(Standard_Iris.OWL_THING_CLASS_URI)) {
				continue;
			}

			logger.info("Class: " + currentClass);
			for (OWLAxiom currentAxiom : currentClass.getReferencingAxioms(ontology)) {
				logger.info("\tAxiom: " + currentAxiom);

				for (OWLClassExpression nestExpr : currentAxiom.getNestedClassExpressions()) {
					logger.info("\t\tNested: " + nestExpr);
				}
			}

			TypeFinder finder = new TypeFinder(ontologyInformation);
			BaseClass theClass = finder.findVowlClass(currentClass);

			parseAnnotations(currentClass);

			// Setting data in VOWLClass
			theClass.setLabels(languageToLabel);
			theClass.setComments(comments);
			theClass.setName(languageToLabel.get("default"));
			theClass.setIri(iri);
			theClass.setDefinedBy(FormatText.cutQuote(rdfsIsDefinedBy));
			theClass.setOwlVersion(FormatText.cutQuote(owlVersionInfo));

			if (isDeprecated) {
				theClass.getAttributes().add(Vowl_Prop_Attr.PROP_ATTR_DEPR);
			}

			owlClasses.put(currentClass.getIRI().toString(), currentClass);
			classMap.put(theClass.getIri(), theClass);
		}
	}
}

@@ -842,16 +842,74 @@
 es;%0A%09%7D%0A%0A
+%09@Override%0A%09protected void reset() %7B%0A%09%09super.reset();%0A%09%7D%0A%0A
 %09protect
@@ -1099,77 +1099,15 @@
 %0A%09%09%09
-isDeprecated = false;%0A%09%09%09rdfsIsDefinedBy = %22%22;%0A%09%09%09owlVersionInfo = %22%22
+reset()
 ;%0A%09%09
@@ -1226,16 +1226,45 @@
 %0A%09%09%09if (
+currentClass.isOWLThing() %7C%7C 
 iri.equa
@@ -1328,315 +1328,8 @@
 %09%7D%0A%0A
-%09%09%09logger.info(%22Class: %22 + currentClass);%0A%09%09%09for (OWLAxiom currentAxiom : currentClass.getReferencingAxioms(ontology)) %7B%0A%09%09%09%09logger.info(%22%5CtAxiom: %22 + currentAxiom);%0A%0A%09%09%09%09for (OWLClassExpression nestExpr : currentAxiom.getNestedClassExpressions()) %7B%0A%09%09%09%09%09logger.info(%22%5Ct%5CtNested: %22 + nestExpr);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A
 %09%09%09T
@@ -2001,16 +2001,45 @@
 eClass);
+%0A%0A%09%09%09logAxioms(currentClass);
 %0A%09%09%7D%0A%09%7D%0A

Add missing reset.