String queryFilterOut = SscfRdfQuery.RDF_GET_RECOM_BY_PERSON_FILTEROUT.toString(this.person);
//this.searchType.getWordNetQuery(this.person,wncOne.getURI());
System.out.println(query);
QueryResultTable results = null;
QueryResultTable resTmp = null;
List<String> filterOut = new ArrayList<String>();
List<String> inserted = new ArrayList<String>();
try
{
results = DbFace.getModel().querySelect(query,"SPARQL");
resTmp = DbFace.getModel().querySelect(queryFilterOut,"SPARQL");
for(QueryRow qr:resTmp)
filterOut.add(qr.getValue(resTmp.getVariables().get(0)).toString());
}
catch (Exception e1)
{
//do nothing
}
if(getNew)
{
String prolog,trustPolicies;
//properties set by the SSCFTrustSampleServlet
prolog = System.getProperty("RealTrust.XSBEnginePath");
trustPolicies = System.getProperty("sscftrust.policies");
SSCFTrustEngineExecuter stee = new SSCFTrustEngineExecuter(prolog,trustPolicies,null);
stee.execute(person);
//QueryResultsTable resultsAfter = SesameDbFace.getDbFace().performTableQuery(query);
QueryResultTable resultsAfter=null;
try
{
resultsAfter = DbFace.getModel().querySelect(query,"SPARQL");
}
catch (Exception e1)
{
//
}
if(resultsAfter!=null&&(results==null || getIteratorLength(resultsAfter.iterator())!=getIteratorLength(results.iterator())))
{
for(QueryRow qr : resultsAfter) {
FilterResult fr = new FilterResult();
String uriTmp = qr.getValue(resultsAfter.getVariables().get(0)).toString();
if(!filterOut.contains(uriTmp)&&!inserted.contains(uriTmp))
{
fr.setResourceUri(uriTmp);
inserted.add(uriTmp);
fr.setResourceType(S3B_SSCF.Directory);
fr.setLabel(qr.getLiteralValue(resultsAfter.getVariables().get(1)));
try {
fr.setContent(qr.getLiteralValue(resultsAfter.getVariables().get(2)));
} catch (Exception e) {
fr.setContent(null);
}
try {
fr.setCreator(qr.getValue(resultsAfter.getVariables().get(3)).toString());
} catch (Exception e) {
fr.setCreator(null);
}
newResults.put(fr.getResourceUri(),fr);
}