Hi Manish,

I think you need to use the full URI for rdfs:label. QNAME support is
implemented on the RESTful service layer and not supported when using
the Java API.

So changing

     String field = NamespaceEnum.rdfs + "label";

should solve your issue (assuming that the initialization with the
dbpedia index was successful)

best
Rupert

On Wed, Jul 10, 2013 at 4:00 PM, Manish Aggarwal <mani.i...@gmail.com> wrote:
> Hi,
>
> I am trying to use the entityhub/yard/solr module to directly query the
> dbpedia.solrindex.
> I have unzipped the dbpedia.solrindex.zip file
> in entityhub/yard/solr/target/indexes/default folder.
>
> And modified the Solryardtest.java as given below but unable to find any
> results. Am I missing something?
>
>
>
> public static final String TEST_SOLR_CORE_NAME = "dbpedia";
>
>
> @Test
>
>     public void testFieldQuery() throws YardException {
>
>         Yard yard = getYard();
>
>         String field = "rdfs:label";
>
>
>         TextConstraint tc = new TextConstraint("Roger Federer",
> PatternType.wildcard, false, "en");
>
>         FieldQuery query = yard.getQueryFactory().createFieldQuery();
>
>         query.addSelectedField(field);
>
>         query.setOffset(0);
>
>         query.setLimit(10);
>
>         query.setConstraint(field, tc);
>
>         QueryResultList<Representation> results = yard.find(query);
>
>         Representation result;
>
>         Iterator<Representation> it = results.iterator();
>
>         log.info("Number of results: " + results.size());
>
>    }



-- 
| Rupert Westenthaler             rupert.westentha...@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Reply via email to