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

import de.uni_stuttgart.vis.vowl.owl2vowl.model.data.VowlData;

import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.util.OWLObjectVisitorAdapter;

import java.util.Set;

public class OwlClassAxiomVisitor extends OWLObjectVisitorAdapter {

	private VowlData vowlData;
	private OWLClass owlClass;

	public OwlClassAxiomVisitor(VowlData vowlData, OWLClass owlClass) {
		this.vowlData = vowlData;
		this.owlClass = owlClass;
	}

	@Override
	protected void handleDefault(OWLObject axiom) {
		System.out.println(owlClass);
		System.out.println("\t" + axiom);
	}

	@Override
	public void visit(OWLEquivalentClassesAxiom axiom) {
		// TODO NamedClasses size != 1 means either
		if (axiom.getNamedClasses().size() != 1) {
			createEquivalentClass(axiom);
		}

		OWLClass referencedClass = axiom.getNamedClasses().iterator().next();

		Set<OWLClassExpression> expressionsWithoutRefClass = axiom.getClassExpressionsMinus(referencedClass);
		for (OWLClassExpression anonymExpressions : expressionsWithoutRefClass) {
			anonymExpressions.accept(new VowlClassVisitor(vowlData, referencedClass));
		}
	}

	protected void createEquivalentClass(OWLEquivalentClassesAxiom axiom) {

	}

	@Override
	public void visit(OWLSubClassOfAxiom axiom) {

	}
}

@@ -114,16 +114,177 @@
 lData;%0A%0A
+import de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.classes.AbstractClass;%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0A
 import o
@@ -314,16 +314,16 @@
 odel.*;%0A
-
 import o
@@ -522,16 +522,91 @@
 wlClass;
+%0A%09private Logger logger = LogManager.getLogger(OwlClassAxiomVisitor.class);
 %0A%0A%09publi
@@ -1525,18 +1525,699 @@
 om axiom) %7B%0A
+%09%09if (axiom.isGCI()) %7B%0A%09%09%09// TODO anonym subclass behaviour%0A%09%09%09logger.info(%22Anonym subclass: %22 + axiom);%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09OWLClass subClass = axiom.getSubClass().asOWLClass();%0A%09%09AbstractClass vowlSubclass = vowlData.getClassForIri(subClass.getIRI());%0A%0A%09%09if (axiom.getSuperClass().isAnonymous()) %7B%0A%09%09%09// TODO anonym superclass like cardinality or hasValue%0A%09%09%09logger.info(%22Anonym superclass: %22 + axiom);%0A%09%09%09return;%0A%09%09%7D else %7B%0A%09%09%09OWLClass superClass = axiom.getSuperClass().asOWLClass();%0A%09%09%09AbstractClass vowlSuperClass = vowlData.getClassForIri(superClass.getIRI());%0A%09%09%09vowlSubclass.addSuperEntity(vowlSuperClass.getIri());%0A%09%09%09vowlSuperClass.addSubEntity(vowlSubclass.getIri());%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

Add subclass/superclass axiom implementation