1

I am new in semantic web,I want to make an ontology based data base. i created an ontology using protégé then using java i created an ontology model(ontologyModel), also to convert relationnel data base to RDF i used D2RQ then modify the mapping file resulted by D2RQ to match the terminology used in the ontology created in protégé,now i have an RDF file of the database(instances). i want to combine the ontology and the RDF file,it means i want to populate the ontology using the instances of the RDF file. I created an RDF model (RDFmodel) and import the RDF file to it. then I tried to combine them using OntModel.add(RDFmodel) like this:

    String file = "/Users/.../file.owl";
      String file2 = "/Users/...file2.ttl";
   OntModel ontologyModel = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);

      InputStream in = FileManager.get().open(file);
        
      jenaModel.read(in, null);
      Model RDFmodel = ModelFactory.createDefaultModel();
      InputStream in2 = FileManager.get().open(file2);
        
      RDFmodel.read(in2, null);
     
      ontologyModel.add(RDFmodel);

But it doesn't work Because i get in the resulted model duplicate classes with the same name that means in the RDF file there is a class (Person) with instances and the ontology we have also the class Person without instances. finally we get two classes of (Person) in the same model .I wish that you could help me. Thanks in advance.

MIRIBEL
  • 11
  • 2

0 Answers0