/*//all keywords of the posts
Map<String, Collection<String>> keywords = new HashMap<String, Collection<String>>();*/
//get the triples from DB (sesame)
QueryResultTable results = null;
try
{
results = model.querySelect(RdfQuery.RDFQ_GIVEN_RESOURCE_POST.toString(
SIOC.postedResource, SIOC.Post, SIOC.postedWhen, SIOC.postedBy, SIOC.postBody, SIOC.topic, SIOC.hasReply, SIOC.title, uri)
,"SPARQL");
}
catch (Exception e)
{
return null;
}
//TODO:chang numbers of parameters to names
for(QueryRow qr:results) {
Person i_person = PersonFactory.findPerson(qr.getValue(results.getVariables().get(3)).toString());
if (i_person == null) {
i_person = PersonFactory.createPerson(qr.getValue(results.getVariables().get(3)).toString(), null, false);
}
String i_postUri = qr.getValue(results.getVariables().get(0)).toString();
String i_createdAt = qr.getLiteralValue(results.getVariables().get(2));
String i_body = qr.getLiteralValue(results.getVariables().get(4));
String i_keyword = null;
try {
i_keyword = qr.getLiteralValue(results.getVariables().get(5));
} catch(Exception e) {/* ignore */}
String i_reply = null;
try {
i_reply = qr.getLiteralValue(results.getVariables().get(6));
} catch(Exception e) {/* ignore */}
String i_title = null;
try {
i_title = qr.getLiteralValue(results.getVariables().get(7));
} catch(Exception e) {/* ignore */}
// build tree of the posts
if (allPosts.get(i_postUri) == null) {
SiocPostBean post = new SiocPostBean(i_postUri,uri,i_person,i_createdAt,i_title,i_body);