Package org.corrib.s3b.mbb.beans

Examples of org.corrib.s3b.mbb.beans.AxisPath


   * @throws AccessDeniedException
   * @throws IOException
   */
  protected void removeAction(String url, LocalRepository lr, List<Integer> _usedPath) throws AccessDeniedException{
    String spathAxis = this.getParams().get(2);
    AxisPath axisPath = new AxisPath(spathAxis);
   
    LocalRepository globalLr = Repository.MAIN_REPOSITORY.getLocalRepository();
   
    Graph g = lr.getGraph();
    ValueFactory vf = g.getValueFactory();
    URI context = vf.createURI(url);
   
    Graph g1 = SesameUtils.getEmptyGraph();
    Graph g2 = SesameUtils.getEmptyGraph();
   
    axisPath.getLastOnList(globalLr, context, g1, true, _usedPath);
    axisPath.getLastOnList(globalLr, context, g2, false, _usedPath);
   
    g1.remove(g2);
   
    globalLr.getGraph().remove(g1);
   
View Full Code Here


   * @throws AccessDeniedException
   * @throws IOException
   */
  protected void loadAction(String url, LocalRepository lr, List<Integer> _usedPath) throws AccessDeniedException{
    String spathAxis = this.getParams().get(2);
    AxisPath axisPath = new AxisPath(spathAxis);
   
    LocalRepository globalLr = Repository.MAIN_REPOSITORY.getLocalRepository();
   
    Graph g = lr.getGraph();
    ValueFactory vf = g.getValueFactory();
    URI context = vf.createURI(url);
    Resource action = axisPath.getLastOnList(globalLr, context, lr.getGraph(), true, _usedPath);
   
    //--inferr isFollowedBy properties
    Graph ginf = SesameWrapper.performGraphQuery(lr, QueryLanguage.SERQL, RDFQuery.RDFQ_INFER_ISFOLLOWEDBY.toString());
    lr.getGraph().add(ginf);

View Full Code Here

      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()) {
View Full Code Here

TOP

Related Classes of org.corrib.s3b.mbb.beans.AxisPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.