* @param value
*/
public void setEvaluation(Person person, Float value) {
this.synchronize();
synchronized (this) {
Node eval = null;
if (this.mapIsEvaluated.get(person) != null) {
try
{
QueryResultTable results = model.querySelect(RdfQuery.RDFQ_EVAL_QUERY.toString(
this.resource, S3B_SSCF.isEvaluatedWith,
SIOC.postedBy, person.getResource()),"SPARQL");
for(QueryRow qr: results){
eval = qr.getValue(results.getVariables().get(0));
}
}
catch (Exception e)
{
eval = null;
}
}
try {
if (eval == null) {
BlankNode bnodeEval = model.createBlankNode();
model.addStatement(null,bnodeEval, RDF.type, model.createURI(S3B_SSCF.Evaluation));
model.addStatement(null,bnodeEval, model.createURI(SIOC.postedBy),person.getResource());
model.addStatement(null,bnodeEval, model.createURI(S3B_SSCF.value),model.createDatatypeLiteral(value.toString(),XSD._string));
model.addStatement(null,this.resource,model.createURI(S3B_SSCF.isEvaluatedWith),bnodeEval);
} else {
model.removeStatements(null,eval.asBlankNode(), model.createURI(S3B_SSCF.value), null);
//XXX: not sure if it will be working...
model.addStatement(null,eval.asBlankNode(),model.createURI(S3B_SSCF.value),model.createDatatypeLiteral(value.toString(),XSD._string));
}
this.mapIsEvaluated.put(person, value);
} catch (Exception e) {