From: Jonathan P. <pan...@gm...> - 2011-11-29 12:08:30
|
hi i have the following problem: i am trying to convert rdf files from dbpedia into an owl ontology (example url: http://dbpedia.org/data/Pablo_Picasso.rdf) right now i am doing it using the following code: public static void convert(OWLOntologyManager manager, OWLOntology ontology, OWLOntologyFormat ontologyFormat, String savePath){ try{ File file = new File(savePath); OWLOntologyFormat format = manager.getOntologyFormat(ontology); if(ontologyFormat.isPrefixOWLOntologyFormat() && format.isPrefixOWLOntologyFormat()){ ((PrefixOWLOntologyFormat) ontologyFormat).copyPrefixesFrom(format.asPrefixOWLOntologyFormat()); //((PrefixOWLOntologyFormat) ontologyFormat). } manager.saveOntology(ontology, ontologyFormat, IRI.create(file.toURI())); //manager.setOntologyFormat(ontology, ontologyFormat); }catch(UnknownOWLOntologyException e){ System.out.println("Could not convert ontology: " + e.getMessage()); }catch (OWLOntologyStorageException e) { System.out.println("Could not save ontology: " + e.getMessage()); } } however the following problem occurs: some properties aren't converted correctly. for example the rdf triple from example url: <rdf:Description rdf:about="http://dbpedia.org/resource/Purvis_Young"> <dbpedia-owl:influencedBy xmlns:dbpedia-owl=" http://dbpedia.org/ontology/" rdf:resource=" http://dbpedia.org/resource/Pablo_Picasso"/> </rdf:Description> is converted into: AnnotationAssertion(<http://dbpedia.org/ontology/influencedBy> < http://dbpedia.org/resource/Purvis_Young> < http://dbpedia.org/resource/Pablo_Picasso>) what makes me think that i am making something wrong is that if i use the http://owl.cs.manchester.ac.uk/converter/ (which is down for the time being, however i guess that in a couple of hours it will be online again...) (which is using owlapi) it converts it into: ObjectPropertyAssertion(<http://dbpedia.org/ontology/influencedBy> < http://dbpedia.org/resource/Purvis_Young> < http://dbpedia.org/resource/Pablo_Picasso>) which is exactly what i want. does anybody knows what i am doing wrong? -- Panagiotidis Ionathan Giannis |