I'm using Pellet with OWL API in order to populate the ontologies and Jena to make some query. The problem is that I don't obtain results when querying for labels. My Code is:
reasoner=PelletReasonerFactory.getInstance().createReasoner
KnowledgeBase kb = reasoner.getKB();
PelletInfGraph graph = new org.mindswap.pellet.jena.PelletReasoner().bind( kb );
InfModel model = ModelFactory.createInfModel( graph );
Query q = QueryFactory.create(query );
QueryExecution qe = QueryExecutionFactory.create( q, model );
ResultSet rs = qe.execSelect();
ResultSetFormatter.out( rs );
If I ask for a label, for example using
Select ?x ?y
WHERE { ?x rdfs:label ?y.}
I obtain an empty string as label. The query works in protegè giving the labels requested. Any suggestion?
A snippet of the ontology:
<Thing rdf:about="onto.owl#Erba">
<rdf:type rdf:resource="http://linkedgeodata.org/ontology/Municipality"/>
<rdf:type rdf:resource="http://linkedgeodata.org/ontology/Place"/>
<rdf:type rdf:resource="onto.owl#Comune"/>
<rdf:type rdf:resource="onto.owl#Localizzazione"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Erba</rdfs:label>
<Locations:haLocalizzazione rdf:resource="onto.owl#Italia"/>
<Locations:haLocalizzazione rdf:resource="onto.owl#Como"/>
<Locations:haLocalizzazione rdf:resource="onto.owl#Lombardia"/>
<Locations:haProvincia rdf:resource="onto.owl#Como"/>
</Thing>
Here the maven pom file of the project:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20141113</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>pellet-profiler-ignazio1977</artifactId>
<version>2.4.0-ignazio1977</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>