date = DATEFORMAT.format(new Date());
}
String serviceId = this.getRequestParams().getValueS("action");
String serviceUri = ServiceById.getServiceUriById(serviceId);
String spathAxis = this.getParams().get(2);
AxisPath axisPath = new AxisPath(spathAxis);
LocalRepository globalLr = Repository.MAIN_REPOSITORY.getLocalRepository();
if(serviceUri == null)
serviceUri = ConfigKeeper.getServiceUrl()+"/mbb/service/"+serviceId;
Graph g = lr.getGraph();
ValueFactory vf = g.getValueFactory();
URI xsdString = XSD_STRING.getURI(g);
URI xsdDateTime = XSD_DATETIME.getURI(g);
URI xsdInt = XSD_INT.getURI(g);
URI rdfType = vf.createURI(RDF.TYPE);
URI context = vf.createURI(url);
URI call = vf.createURI(serviceUri);
String actionUri = url+"/action/";
Resource lastAction = null;
// --------------- BEGIN : to be removed -------------------------
// if(axisPath.isInitial()) {
// lastAction = AxisPath.getLastAction(globalLr, context, _usedPath);
// if(lastAction != null)
// _usedPath.add(0);
// } else {
// ///--- follows along axis
// LocalRepository lr2 = Repository.TEMP_REPOSITORY.getLocalRepository();
// lastAction = axisPath.getLastOnList(globalLr, context, lr2.getGraph(), false, _usedPath);
//
// //--inferr isFollowedBy properties
// Graph ginf = SesameWrapper.performGraphQuery(lr2, QueryLanguage.SERQL, RDFQuery.RDFQ_INFER_ISFOLLOWEDBY.toString());
// lr2.getGraph().add(ginf);
// }
//
//
// URI action = vf.createURI(actionUri+AxisPath.pathToString(_usedPath));
//
// if(globalg.contains(action,
// globalg.getValueFactory().createURI(RDF.TYPE),
// MBB_BROWSEACTION.getURI(globalg))) {
// lastAction = AxisPath.getLastAction(globalLr, context, _usedPath);
// if(lastAction != null)
// _usedPath.add(0);
// action = vf.createURI(actionUri+AxisPath.pathToString(_usedPath));
// }
// --------------- END : to be removed -------------------------
Graph globalg = globalLr.getGraph();
boolean isGetLastAction = false;
//--A
if(axisPath.isInitial()) //--A.1
isGetLastAction = true;
else {//--A.2
LocalRepository lr2 = RepositoryFactory.createTempRepository();
lastAction = axisPath.getLastOnList(globalLr, context, lr2.getGraph(), false, _usedPath);
//--inferr isFollowedBy properties
Graph ginf = SesameWrapper.performGraphQuery(lr2, QueryLanguage.SERQL, RDFQuery.RDFQ_INFER_ISFOLLOWEDBY.toString());
lr2.getGraph().add(ginf);
//--B
if((axisPath.getPath().size() - 1) == _usedPath.size())//--B.1
_usedPath.add(axisPath.getPath().get(axisPath.getPath().size()-1));
else if(lastAction != null){//--B.2
StatementIterator stit = lr2.getGraph().getStatements(lastAction, MultiBeeBrowseRDF.MBB_ISFOLLOWEDSALONGAXIS.getURI(lr2.getGraph()), null);
Set<Integer> saxis = new HashSet<Integer>();
while(stit.hasNext()) {