}
}
public void testEntityOwlToJenaResource() {
JenaToOwlConvert j2o = new JenaToOwlConvert();
OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
OWLOntology ont = null;
StmtIterator resource = null;
try{
ont = mgr.createOntology();
} catch (OWLOntologyCreationException e) {
e.printStackTrace();
fail("Could not load ontology");
}
OWLDataFactory factory = mgr.getOWLDataFactory();
OWLClass cls = factory.getOWLClass(IRI.create(CLAZZ));
OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(DP));
OWLObjectProperty op = factory.getOWLObjectProperty(IRI.create(OP));
OWLAnnotationProperty oa = factory.getOWLAnnotationProperty(IRI.create(label));
OWLAnnotation oav = factory.getOWLAnnotation(oa, factory.getOWLStringLiteral(clazzlabel,"en"));
OWLDatatype dt = factory.getOWLDatatype(IRI.create(DATATYPE));
OWLNamedIndividual sub = factory.getOWLNamedIndividual(IRI.create(SUBJECT));
OWLNamedIndividual obj = factory.getOWLNamedIndividual(IRI.create(OBJECT));
OWLLiteral literal1 = factory.getOWLTypedLiteral(VALUE,dt);
OWLDeclarationAxiom daxiomcls = factory.getOWLDeclarationAxiom(cls); //Classe
OWLDeclarationAxiom daxiomop = factory.getOWLDeclarationAxiom(op); //obj prop
OWLDeclarationAxiom daxiomdp = factory.getOWLDeclarationAxiom(dp); //data prop
OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); //subject
OWLDeclarationAxiom daxiomobj = factory.getOWLDeclarationAxiom(obj); //object
OWLClassAssertionAxiom axiomsub = factory.getOWLClassAssertionAxiom(cls,sub); //Istanza
OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls,obj); //Istanza
OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); //Obj prop tra individui
OWLDataPropertyAssertionAxiom axiomvalue = factory.getOWLDataPropertyAssertionAxiom(dp, sub,literal1); //Dataprop all'istanza;
OWLAnnotationAssertionAxiom axioman = factory.getOWLAnnotationAssertionAxiom(cls.getIRI(), oav); //Annotazione
mgr.addAxiom(ont,daxiomcls);
mgr.addAxiom(ont,daxiomop);
mgr.addAxiom(ont,daxiomdp);
mgr.addAxiom(ont,daxiomsub);
mgr.addAxiom(ont,daxiomobj);
mgr.addAxiom(ont,axiomsub);
mgr.addAxiom(ont,axiomobj);
mgr.addAxiom(ont,axiomop);
mgr.addAxiom(ont,axiomvalue);
mgr.addAxiom(ont,axioman);
Set<OWLIndividualAxiom> ind = ont.getAxioms(sub);
try{
resource = j2o.EntityOwlToJenaResource(daxiomsub.getEntity(), ont, RDFXML);
if(resource == null){
fail("Some errors accour");
}else{
int cont = 0;