I need to get a list of "tokens" that are semantically related to a certain query: the field "dcterms:subject" of a DBpedia page would be perfect (see for example http://dbpedia.org/page/Michelle_Obama). I can correctly get the dbpedia URL related to my query, using a CURL http post request. This query
"text=Michelle%20Obama.&confidence=0.2&support=20";
returns this object:
{ "@text": "Michelle Obama.", "@confidence": "0.2", "@support": "20", "@types": "", "@sparql": "", "@policy": "whitelist", "Resources": [ { "@URI": "http://dbpedia.org/resource/Michelle_Obama", "@support": "321", "@types": "DBpedia:OfficeHolder,DBpedia:Person,Schema:Person,Freebase:/award/ranked_item,Freebase:/award,Freebase:/organization/organization_member,Freebase:/organization,Freebase:/book/book_subject,Freebase:/book,Freebase:/celebrities/celebrity,Freebase:/celebrities,Freebase:/people/person,Freebase:/people,Freebase:/tv/tv_actor,Freebase:/tv,Freebase:/education/honorary_degree_recipient,Freebase:/education", "@surfaceForm": "Michelle Obama", "@offset": "0", "@similarityScore": "0.20646192133426666", "@percentageOfSecondRank": "-1.0" }] }
At the moment, I use this object only to get the URL and I use the URL to get the entire html content of the DBpedia page and then look for what I need (the "dcterms:subject" paragraph), but I think there's a more efficient way to do this, maybe directly from spotlight. How can I adjust my query to get that list (or something similar) with only one post to spotlight? I don't even need the links, just a list of tokens.