// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTDocumentFormat.java
// public class SNOMEDCTDocumentFormat extends OWLDocumentFormatImpl {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 2159844877279654256L;
// 
// 	@Override
// 	public String getKey() {
//         return "SNOMED CT Compositional Grammar Format";
// 	}
// 
// 	@Override
// 	public PrefixDocumentFormat asPrefixOWLOntologyFormat() {
// 		// TODO Auto-generated method stub
// 		return null;
// 	}
// 
// 	@Override
// 	public boolean isPrefixOWLOntologyFormat() {
// 		// TODO Auto-generated method stub
// 		return false;
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTOntologyStorer.java
// public class SNOMEDCTOntologyStorer extends AbstractOWLStorer {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 30406L;
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.model.OWLOntologyStorer#canStoreOntology(org.semanticweb.owlapi.model.OWLOntologyFormat)
// 	 */
// 	@Override
// 	public boolean canStoreOntology(OWLDocumentFormat ontologyFormat) {
// 		return ontologyFormat.equals(new SNOMEDCTDocumentFormat());
// 	}
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.util.AbstractOWLOntologyStorer#storeOntology(org.semanticweb.owlapi.model.OWLOntology, java.io.Writer, org.semanticweb.owlapi.model.OWLOntologyFormat)
// 	 */
// 	@Override
// 	protected void storeOntology(OWLOntology ontology, Writer writer,
// 			OWLDocumentFormat format) throws OWLOntologyStorageException {
// 		try {
//             SNOMEDCTRenderer ren = new SNOMEDCTRenderer((boolean) format.getParameter("labels", true));
//             ren.render(ontology, writer);
//         } catch (Exception e) {
//             throw new OWLOntologyStorageException(e);
//         }
// 
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTOntologyStorerFactory.java
// public class SNOMEDCTOntologyStorerFactory extends OWLStorerFactoryImpl {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = -7039843405327813026L;
// 
// 	public SNOMEDCTOntologyStorerFactory() {
// 		super(new SNOMEDCTDocumentFormatFactory());
// 	}
// 	
// 	@Override
// 	public OWLStorer createStorer() {
// 		// TODO Auto-generated method stub
// 		return new SNOMEDCTOntologyStorer();
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTParserFactory.java
// public class SNOMEDCTParserFactory extends OWLParserFactoryImpl {
// 
// 	public SNOMEDCTParserFactory() {
// 		super(new SNOMEDCTDocumentFormatFactory());
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 3285098326875692657L;
// 	/* BASE IRI - can be overridden */
// 	public String subject = null;
// 	/* isPrimitive - defaults to false to preserve existing behavior */
// 	public boolean isPrimitive = false;
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.io.OWLParserFactory#createParser(org.semanticweb.owlapi.model.OWLOntologyManager)
// 	 */
// 	@Override
// 	public OWLParser createParser() {
// 		return new SNOMEDCTOWLParser(); //subject, isPrimitive);
// 	}
// 
// }


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.formats.TurtleDocumentFormat;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLDocumentFormat;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLOntologyStorageException;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTDocumentFormat;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTOntologyStorer;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTOntologyStorerFactory;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTParserFactory;
/**
 * 
 */
package test;






/**
 * @author Daniel Karlsson, Linköping University, daniel.karlsson@liu.se
 * 
 */
public class TestSNOMEDCTOWLParser {

	private OWLOntologyManager manager;
	private OWLOntology ontology;

	static Logger logger = Logger.getLogger(TestSNOMEDCTOWLParser.class);

//	public static final String snomedOWLFileName = "/res_StatedOWLF_Core_INT_20140131.owl";

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		manager = OWLManager.createOWLOntologyManager();
		// logger.info("Loading SNOMED CT ontology...");
		// ontology = manager.loadOntologyFromOntologyDocument(new
		// File("src/test/resources/snomed.owl"));
		// logger.info("Loaded SNOMED CT ontology");

		manager.getOntologyParsers().add(new SNOMEDCTParserFactory());
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTDocumentFormat.java
// public class SNOMEDCTDocumentFormat extends OWLDocumentFormatImpl {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 2159844877279654256L;
// 
// 	@Override
// 	public String getKey() {
//         return "SNOMED CT Compositional Grammar Format";
// 	}
// 
// 	@Override
// 	public PrefixDocumentFormat asPrefixOWLOntologyFormat() {
// 		// TODO Auto-generated method stub
// 		return null;
// 	}
// 
// 	@Override
// 	public boolean isPrefixOWLOntologyFormat() {
// 		// TODO Auto-generated method stub
// 		return false;
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTOntologyStorer.java
// public class SNOMEDCTOntologyStorer extends AbstractOWLStorer {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 30406L;
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.model.OWLOntologyStorer#canStoreOntology(org.semanticweb.owlapi.model.OWLOntologyFormat)
// 	 */
// 	@Override
// 	public boolean canStoreOntology(OWLDocumentFormat ontologyFormat) {
// 		return ontologyFormat.equals(new SNOMEDCTDocumentFormat());
// 	}
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.util.AbstractOWLOntologyStorer#storeOntology(org.semanticweb.owlapi.model.OWLOntology, java.io.Writer, org.semanticweb.owlapi.model.OWLOntologyFormat)
// 	 */
// 	@Override
// 	protected void storeOntology(OWLOntology ontology, Writer writer,
// 			OWLDocumentFormat format) throws OWLOntologyStorageException {
// 		try {
//             SNOMEDCTRenderer ren = new SNOMEDCTRenderer((boolean) format.getParameter("labels", true));
//             ren.render(ontology, writer);
//         } catch (Exception e) {
//             throw new OWLOntologyStorageException(e);
//         }
// 
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTOntologyStorerFactory.java
// public class SNOMEDCTOntologyStorerFactory extends OWLStorerFactoryImpl {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = -7039843405327813026L;
// 
// 	public SNOMEDCTOntologyStorerFactory() {
// 		super(new SNOMEDCTDocumentFormatFactory());
// 	}
// 	
// 	@Override
// 	public OWLStorer createStorer() {
// 		// TODO Auto-generated method stub
// 		return new SNOMEDCTOntologyStorer();
// 	}
// 
// }
// 
// Path: src/main/java/se/liu/imt/mi/snomedct/parser/SNOMEDCTParserFactory.java
// public class SNOMEDCTParserFactory extends OWLParserFactoryImpl {
// 
// 	public SNOMEDCTParserFactory() {
// 		super(new SNOMEDCTDocumentFormatFactory());
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 3285098326875692657L;
// 	/* BASE IRI - can be overridden */
// 	public String subject = null;
// 	/* isPrimitive - defaults to false to preserve existing behavior */
// 	public boolean isPrimitive = false;
// 
// 	/* (non-Javadoc)
// 	 * @see org.semanticweb.owlapi.io.OWLParserFactory#createParser(org.semanticweb.owlapi.model.OWLOntologyManager)
// 	 */
// 	@Override
// 	public OWLParser createParser() {
// 		return new SNOMEDCTOWLParser(); //subject, isPrimitive);
// 	}
// 
// }


// Path: src/test/java/test/TestSNOMEDCTOWLParser.java
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.formats.TurtleDocumentFormat;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLDocumentFormat;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLOntologyStorageException;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTDocumentFormat;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTOntologyStorer;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTOntologyStorerFactory;
import se.liu.imt.mi.snomedct.parser.SNOMEDCTParserFactory;

/**
 * 
 */
package test;






/**
 * @author Daniel Karlsson, Linköping University, daniel.karlsson@liu.se
 * 
 */
public class TestSNOMEDCTOWLParser {

	private OWLOntologyManager manager;
	private OWLOntology ontology;

	static Logger logger = Logger.getLogger(TestSNOMEDCTOWLParser.class);

//	public static final String snomedOWLFileName = "/res_StatedOWLF_Core_INT_20140131.owl";

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		manager = OWLManager.createOWLOntologyManager();
		// logger.info("Loading SNOMED CT ontology...");
		// ontology = manager.loadOntologyFromOntologyDocument(new
		// File("src/test/resources/snomed.owl"));
		// logger.info("Loaded SNOMED CT ontology");

		manager.getOntologyParsers().add(new SNOMEDCTParserFactory());
		manager.getOntologyStorers().add(new SNOMEDCTOntologyStorerFactory());