private static final URI OBJECT = URI.create(_BASE + "#" + "Linus");
public void testAxiomOwlToJenaResource(){
JenaToOwlConvert j2o = new JenaToOwlConvert();
OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
OWLOntology ont = null;
try{
ont = mgr.createOntology();
} catch(OWLOntologyCreationException e){
e.printStackTrace();
fail("Can not create ontology");
}
OWLDataFactory factory = mgr.getOWLDataFactory();
StmtIterator resource = null;
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, obj,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<OWLAxiom> setaxiom = ont.getAxioms();
try{
resource = j2o.AxiomOwlToJenaResource(setaxiom, RDFXML);
if(resource == null){
fail("Some errors occur");
}else{
String statment = "[http://www.w3.org/2000/01/rdf-schema#label, http://www.w3.org/2000/01/rdf-schema#range, http://www.w3.org/2000/01/rdf-schema#Literal] "+
"[http://example.org/dummy#hasAge, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/07/owl#DatatypeProperty] "+