/*
 * Test.java
 *
 */

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

import de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonExporter;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.Constants;
import de.uni_stuttgart.vis.vowl.owl2vowl.parser.container.MapData;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.*;

import java.io.File;
import java.io.IOException;
import java.util.Set;

/**
 * @author Eduard Marbach
 */
public class Main {
	private static final boolean DEBUG_EXPORT = true;
	private static MapData mapData;
	private static GeneralParser parser;

	private static OWLOntologyManager manager;
	private static OWLOntology ontology;
	private static OWLDataFactory factory;

	public static void main(String[] args) {
		File ont = new File(Constants.MUTO);
		manager = OWLManager.createOWLOntologyManager();
		factory = manager.getOWLDataFactory();
		mapData = new MapData();

		try {
			ontology = manager.loadOntologyFromOntologyDocument(IRI.create(ont));
			Set<OWLClass> classes = ontology.getClassesInSignature();
			Set<OWLDatatype> datatypes = ontology.getDatatypesInSignature();
			Set<OWLObjectProperty> objectProperties = ontology.getObjectPropertiesInSignature();
			Set<OWLDataProperty> dataProperties = ontology.getDataPropertiesInSignature();

			ProcessUnit processor = new ProcessUnit(ontology, factory, mapData);
			parser = new GeneralParser(ontology, factory, mapData);

			parseClasses(classes);
			//parseDatatypes(datatypes);
			parseObjectProperty(objectProperties);
			parseDatatypeProperties(dataProperties);

			processor.processClasses();
			//processor.processDatatypes();
			processor.processProperties();

		} catch (OWLOntologyCreationException e) {
			e.printStackTrace();
		}

		if (DEBUG_EXPORT) {
			JsonExporter exporter =
					new JsonExporter(new File("C:\\Users\\Eduard\\Documents\\benchmark.json"));

			try {
				exporter.processNamespace();
				exporter.processHeader();
				exporter.processClasses(mapData.getClassMap());
				exporter.processDatatypes(mapData.getDatatypeMap());
				exporter.processObjectProperties(mapData.getObjectPropertyMap());
				exporter.processDatatypeProperties(mapData.getDatatypePropertyMap());
				exporter.processThings(mapData.getThingMap());
				exporter.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

	private static void parseDatatypeProperties(Set<OWLDataProperty> dataProperties) {
		parser.handleDatatypeProperty(dataProperties);
	}

	private static void parseObjectProperty(Set<OWLObjectProperty> objectProperties) {
		parser.handleObjectProperty(objectProperties);
	}

	private static void parseDatatypes(Set<OWLDatatype> datatypes) {
		parser.handleDatatype(datatypes);
	}

	private static void parseClasses(Set<OWLClass> classes) {
		parser.handleClass(classes);
	}
}

@@ -1780,16 +1780,114 @@
 PORT) %7B%0A
+%09%09%09String filePath = System.getProperty(%22user.dir%22) + %22%5C%5CWebVOWL%5C%5Csrc%5C%5Cjs%5C%5Cdata%5C%5Cbenchmark.json%22;%0A
 %09%09%09JsonE
@@ -1940,54 +1940,16 @@
 ile(
-%22C:%5C%5CUsers%5C%5CEduard%5C%5CDocuments%5C%5Cbenchmark.json%22
+filePath
 ));%0A

Change export path of the file as benchmark.json directly into WebVOWL.