Package org.openrdf.model

Examples of org.openrdf.model.Graph


    String query = RDFQuery.RDFQ_LIST_CONTEXTS.toString(serviceUri,
                              serviceUri2,
                              _user,
                              allusers);
    Graph g = SesameWrapper.performGraphQuery(Repository.MAIN_REPOSITORY.getLocalRepository(),
                          QueryLanguage.SERQL,
                          query);
   
    try {
      inGraph.addGraph(g);
View Full Code Here


   
   
    if(ql != null && ql.getQL()!=null) {
      try {
        String query = URLDecoder.decode(squery, "UTF-8");
        Graph g = SesameWrapper.performGraphQuery(inGraph, ql.getQL(), query);
        lr.addGraph(g);
      } catch (UnsupportedEncodingException e1) {
        e1.printStackTrace();
      } catch (IOException e) {
        Repository.logger.warning("Could not add graph results: "+e);
View Full Code Here

   */
  public List<Integer> checkPath(LocalRepository lr, URI context, boolean withLast) throws AccessDeniedException{
    List<Integer> result = new ArrayList<Integer>();
    int i = 0;
    Value vresult = null;
    Graph g = lr.getGraph();
   
    //--get first on the list
    StatementIterator it = g.getStatements(context, MultiBeeBrowseRDF.MBB_HASFIRSTACTION.getURI(g), (Resource)null);
    if(it!=null && it.hasNext())
      vresult = it.next().getObject();

    Set<Value> snoloop = new HashSet<Value>();
   
View Full Code Here

             " USING NAMESPACE mbb = <http://s3b.corrib.org/mbb#>";
    String query = String.format(pquery, contextUri);
   
   
    //execute query and return results
    Graph g = SesameWrapper.performGraphQuery(lr, QueryLanguage.SERQL, query);
   
    outG.add(g);
   
    String spquery = "SELECT DISTINCT action"+i+" "+ sb.toString()+
             sb2.toString()+
View Full Code Here

   * @throws AccessDeniedException
   */
  public static Resource getLastAction(LocalRepository lr, URI context, List<Integer> usedPath) throws AccessDeniedException {
    Resource result = null;
    Value vresult = null;
    Graph g = lr.getGraph();
   
    usedPath.clear();
   
    StatementIterator it = g.getStatements(context, MultiBeeBrowseRDF.MBB_HASFIRSTACTION.getURI(g), (Resource)null);
    if(it!=null && it.hasNext())
      vresult = it.next().getObject();
 
    Set<Value> snoloop = new HashSet<Value>();
   
View Full Code Here

   * @param repository
   * @return
   */
  public static Graph getGraph(LocalRepository repository) {
   
    Graph graph = null;
    try {
      graph = repository.getGraph();
    } catch (AccessDeniedException e) {
      e.printStackTrace();
    }
View Full Code Here

      }catch(NullPointerException ex) {
        ex.printStackTrace();
      }
     
    }else {
      Graph g = repo.getGraph();
      GraphStatistics gstats = GraphStatistics.get(g);
      StatementIterator it;
      int[] reg = new int[3];
     
      for(ValueStats propst : filterProps.values()) {
        it = g.getStatements(null, propst.getProperty(), null);
        reg[0] = 0;
        reg[1] = 0;
        reg[2] = 0;
       
        while(it.hasNext()) {
View Full Code Here

   * @return
   */
  public static final String getServiceId(String serviceCallUri) {
    String serviceid = null;
    try {
      Graph g = Repository.MAIN_REPOSITORY.getLocalRepository().getGraph();
      StatementIterator stmtit = g.getStatements(g.getValueFactory().createURI(serviceCallUri), MBB_SERVICEID.getURI(g), null);
     
      if(stmtit != null && stmtit.hasNext()) {
        Statement s = stmtit.next();
        serviceid = s.getObject().toString();
      }
View Full Code Here

   * @return
   */
  public static final boolean checkServiceId(String serviceId) {
    StatementIterator stmtit = null;
    try {
      Graph g = Repository.MAIN_REPOSITORY.getLocalRepository().getGraph();
      stmtit = g.getStatements(null, MBB_SERVICEID.getURI(g), g.getValueFactory().createLiteral(serviceId));
    } catch (AccessDeniedException e) {
      Repository.logger.warning("problems when checking service id: "+e);
    }
   
    return (stmtit != null && stmtit.hasNext());
View Full Code Here

   * @return
   */
  public static final boolean checkContextUri(String contextUri) {
    StatementIterator stmtit = null;
    try {
      Graph g = Repository.MAIN_REPOSITORY.getLocalRepository().getGraph();
      stmtit = g.getStatements(g.getValueFactory().createURI(contextUri),
                   g.getValueFactory().createURI(RDF.TYPE),
                   MBB_BROWSECONTEXT.getURI(g));
    } catch (AccessDeniedException e) {
      Repository.logger.warning("problems when checking context URI: "+e);
    }
   
View Full Code Here

TOP

Related Classes of org.openrdf.model.Graph

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.