I have the DBPedia Ontology that I downloaded from http://wiki.dbpedia.org/Downloads39. In this ontology, I have, for example, this situation:
<owl:Class rdf:about="http://dbpedia.org/ontology/BasketballLeague">
<rdfs:label xml:lang="el">Ομοσπονδία Καλαθοσφαίρισης</rdfs:label><rdfs:label xml:lang="fr">ligue de basketball</rdfs:label><rdfs:label xml:lang="en">basketball league</rdfs:label><rdfs:label xml:lang="it">lega di pallacanestro</rdfs:label><rdfs:label xml:lang="ja">バスケットボールリーグ</rdfs:label><rdfs:comment xml:lang="en">a group of sports teams that compete against each other in Basketball</rdfs:comment><rdfs:subClassOf rdf:resource="http://dbpedia.org/ontology/SportsLeague"/>
</owl:Class>
Now, I want to read this ontology using Jena and to retrieve the owl class that has as its object ""ligue de basketball" in French language. I don't know how I can use Jena library to set French language in this case.
From DBPedia Ontology, it seems that xml:lang="fr" is a predicate, but I have tried this code:
String inputFileName = "C:\\dbpedia_3.9.owl";
// Create an empty in-memory ontology model
OntDocumentManager mgr = new OntDocumentManager();
OntModelSpec s = new OntModelSpec( OntModelSpec.RDFS_MEM );
s.setDocumentManager( mgr );
OntModel m = ModelFactory.createOntologyModel( s, null );
// use the FileManager to open the ontology from the filesystem
InputStream in = FileManager.get().open(inputFileName);
if (in == null) {
throw new IllegalArgumentException( "File: " + inputFileName + " not found");
}
// read the ontology file
m.read( in, "" );
StmtIterator stmti = m.listStatements();
while (stmti.hasNext()){
Statement statement = stmti.nextStatement();
System.out.println (statement.getPredicate());
}
but I get only:
I don't get the information on the language in the predicate. Why? How I can retrieve this information and the owl class? What am I doing wrong here?