Hi Cecile,

It seems there is a problem indeed, here is the traceback:
https://gist.github.com/dav009/485b6c2281247669ff89

I will have a play with it tonight and check what is wrong



On Mon, Sep 29, 2014 at 11:23 AM, Cécile Robin <[email protected]> wrote:

>  Hi all,
>
> I used to use the "http://spotlight.dbpedia.org/rest";
> <http://spotlight.dbpedia.org/rest> endpoint for my queries, with
> "annotate" and Sparql query for filtering. I read somewhere that this
> endpoint is no more updated, so I changed to
> "http://spotlight.sztaki.hu:2222/rest";
> <http://spotlight.sztaki.hu:2222/rest> endpoint. However, I got an "HTTP
> 400 Bad Request" exception (whereas it used to work with
> "http://spotlight.dbpedia.org/rest"; <http://spotlight.dbpedia.org/rest>
> endpoint). I need to use Sparql filtering as I'm looking for companies that
> do not have  Band, SportsLeague or SportsTeam types, or also occupations
> (as there is no type related to occupation, I thus need to filter out using
> other triples like : ?personName dbpedia-owl:occupation
> <http://dbpedia.org/ontology/occupation>  ?occupation).
>
> Is there something wrong in my understanding of the endpoint use?
>
> Here is my code :
>
> **************************************************************************
>   String occupationQueryTemplate =
>             "PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
> <http://dbpedia.org/ontology/> " +
>             "PREFIX dbpprop: <http://dbpedia.org/property/>
> <http://dbpedia.org/property/> " +
>             "SELECT DISTINCT ?occupation " +
>             "WHERE %7B " +
>             "    %7B ?occupation dbpprop:type dbpedia:Profession . %7D " +
>             "    UNION %7B" +
>             "    ?x dbpedia-owl:occupation ?occupation . %7D" +
>             "    UNION %7B" +
>             "    ?x dbpedia-owl:profession ?occupation . %7D" +
>             "    UNION %7B" +
>             "    ?x dbpprop:occupation ?occupation . %7D" +
>             "    UNION %7B" +
>             "    ?x dbpprop:profession ?occupation . %7D" +
>             "    UNION %7B" +
>             "    ?x dbpprop:occupation ?occupation . %7D" +
>             "    UNION %7B" +
>             "    ?x dbpprop:occupation ?occupation . %7D" +
>             "%7D ";
>
>  Client client = ClientBuilder.newClient();
>  String response = client
>                     .target("http://spotlight.sztaki.hu:2222/rest";
> <http://spotlight.sztaki.hu:2222/rest>)
>                     .path("annotate")
>                     .queryParam("text", "java programmer")
>                     .queryParam("confidence", 0.2)
>                     .queryParam("sparql", occupationQueryTemplate )
>                     .request(MediaType.APPLICATION_JSON).get(String.class);
>
> System.out.println(response);
>
> **************************************************************************
>
> Thanks!
>
> Cécile R.
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.  Videos for Nerds.  Stuff that Matters.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
> _______________________________________________
> Dbp-spotlight-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbp-spotlight-users
>
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Dbp-spotlight-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbp-spotlight-users

Reply via email to