Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.StatementPattern


        attributeVars.add(attributeVar);

        Var attributePredVar = new Var("-acl_attr_pred_" + i, attribute);

        // SP(?subject, accessAttr_i, ?accessAttrValue_i)
        StatementPattern attributePattern = new StatementPattern(subjectVar, attributePredVar,
            attributeVar);

        if (inheritanceProp != null) {
          // create a union expression for this attribute.
          Union union = new Union();
          union.addArg(attributePattern);

          // the join for checking if the access attribute is inherited.
          Join inheritJoin = new Join();
          Var inheritVar = new Var("-acl_inherited_value" + i);
          // SP (?subject, inheritProp, ?S_i)
          StatementPattern inheritPattern = new StatementPattern(subjectVar, inheritPredVar, inheritVar);
          inheritJoin.addArg(inheritPattern);
          // SP (?S_i, accessAttr_i, ?accessAttrValue_i)
          StatementPattern inheritAttrPattern = new StatementPattern(inheritVar, attributePredVar,
              attributeVar);
          inheritJoin.addArg(inheritAttrPattern);

          union.addArg(inheritJoin);
View Full Code Here


  public void addRequiredTE(TupleExpr te) {
    requiredTEs.add(te);
  }

  public void addRequiredSP(Var subjVar, Var predVar, Var objVar) {
    addRequiredTE(new StatementPattern(spScope, subjVar, predVar, objVar, contextVar));
  }
View Full Code Here

    Var contextVar = graphPattern.getContextVar();
    StatementPattern.Scope spScope = graphPattern.getStatementPatternScope();

    for (Var subjVar : subjVars) {
      for (Var objVar : objVars) {
        StatementPattern sp = new StatementPattern(spScope, subjVar, predVar, objVar, contextVar);
        graphPattern.addRequiredTE(sp);
      }
    }

    // Process next tail segment
View Full Code Here

    Var rdfStatement = new Var("_rdfStatement", RDF.STATEMENT);
    Var rdfSubject = new Var("_rdfSubject", RDF.SUBJECT);
    Var rdfPredicate = new Var("_rdfPredicate", RDF.PREDICATE);
    Var rdfObject = new Var("_rdfObject", RDF.OBJECT);

    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfType, rdfStatement, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfSubject, subjVar, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfPredicate, predVar, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfObject, objVar, contextVar));

    return idVar;
  }
View Full Code Here

    // Create a graph query that produces the statements that have the
    // requests resources as subject or object
    Var subjVar = createAnonVar("-descr-subj");
    Var predVar = createAnonVar("-descr-pred");
    Var objVar = createAnonVar("-descr-obj");
    StatementPattern sp = new StatementPattern(subjVar, predVar, objVar);

    if (result == null) {
      result = sp;
    }
    else {
View Full Code Here

    public Var getAllItems(TupleQueryBuilder builder, Var defaultVar) {
        Var var = defaultVar != null ? defaultVar : builder.makeVar("item");
       
        builder.addTupleExpr(
            new StatementPattern(
                var,
                builder.makeVar("p", RDF.TYPE),
                builder.makeVar("type", _typeURI)
            )
        );
View Full Code Here

   
    public Var getAllItems(TupleQueryBuilder builder, Var defaultVar) {
        Var var = defaultVar != null ? defaultVar : builder.makeVar("item");
       
        builder.addTupleExpr(
            new StatementPattern(
                var,
                builder.makeVar("p", RDF.TYPE),
                builder.makeVar("ignore")
            )
        );
View Full Code Here

                }
               
                Var output = builder.makeVar("seg");
                Var propertyVar = builder.makeVar("seg", record.uri);
                if (segment.forward) {
                    builder.addTupleExpr(new StatementPattern(input, propertyVar, output));
                    valueType = record.valueType;
                } else {
                    builder.addTupleExpr(new StatementPattern(output, propertyVar, input));
                    valueType = "item";
                }
               
                valueExpr = output;
            } else {
View Full Code Here

    Var contextVar = graphPattern.getContextVar();
    StatementPattern.Scope spScope = graphPattern.getStatementPatternScope();

    for (Var subjVar : subjVars) {
      for (Var objVar : objVars) {
        StatementPattern sp = new StatementPattern(spScope, subjVar, predVar, objVar, contextVar);
        graphPattern.addRequiredTE(sp);
      }
    }

    // Process next tail segment
View Full Code Here

    Var rdfStatement = new Var("_rdfStatement", RDF.STATEMENT);
    Var rdfSubject = new Var("_rdfSubject", RDF.SUBJECT);
    Var rdfPredicate = new Var("_rdfPredicate", RDF.PREDICATE);
    Var rdfObject = new Var("_rdfObject", RDF.OBJECT);

    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfType, rdfStatement, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfSubject, subjVar, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfPredicate, predVar, contextVar));
    graphPattern.addRequiredTE(new StatementPattern(spScope, idVar, rdfObject, objVar, contextVar));

    return idVar;
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.algebra.StatementPattern

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.