Hi all,
I used to use the "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" endpoint. However, I got an "HTTP
400 Bad Request" exception (whereas it used to work with
"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/> " +
"PREFIX dbpprop: <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")
.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