public Var getContextVar() { return geoStatement.getContextVar(); }
public Var getContextVar() { return geoStatement.getContextVar(); }
/** * @inheritDoc */ @Override public void meet(StatementPattern thePattern) throws Exception { Var aCtxVar = thePattern.getContextVar(); if (aCtxVar != null) { mContexts.put(thePattern, aCtxVar); } }
/** * Override this if you are able to determine the cardinality based not * only on the contextVar itself but also the other vars (e.g. the subject * value might determine a context subset). */ protected double getContextCardinality(StatementPattern sp) { return getContextCardinality(sp.getContextVar()); }
/** * Returns the URI of a graph of a statement pattern. * * @param sp a statement pattern * @return the URI as string, null otherwise */ protected String getContext(StatementPattern sp) { return getURIString(sp.getContextVar()); }
private Set<Var> getProjectionVars(Collection<StatementPattern> statementPatterns) { Set<Var> vars = new LinkedHashSet<Var>(statementPatterns.size() * 2); for (StatementPattern sp : statementPatterns) { vars.add(sp.getSubjectVar()); vars.add(sp.getPredicateVar()); vars.add(sp.getObjectVar()); if (sp.getContextVar() != null) { vars.add(sp.getContextVar()); } } return vars; } }
public SQLPattern(String name, StatementPattern sparqlPattern) { super(); this.name = name; this.conditions.add(name + ".deleted = false"); this.sparqlPattern = sparqlPattern; tripleFields.put(TripleColumns.SUBJECT, sparqlPattern.getSubjectVar()); tripleFields.put(TripleColumns.PREDICATE, sparqlPattern.getPredicateVar()); tripleFields.put(TripleColumns.OBJECT, sparqlPattern.getObjectVar()); tripleFields.put(TripleColumns.CONTEXT, sparqlPattern.getContextVar()); }
@Override public void meet(StatementPattern node) throws RuntimeException { if (node.getContextVar() != null) { buf.append("GRAPH <").append(node.getContextVar().getValue()).append("> { "); } buf.append("<").append(node.getSubjectVar().getValue()).append("> <").append( node.getPredicateVar().getValue()).append("> <").append(node.getObjectVar().getValue()).append( "> ."); if (node.getContextVar() != null) { buf.append(" } "); } } }
public StarQuery(final List<StatementPattern> nodes) { this.nodes = nodes; if(nodes.size() == 0) { throw new IllegalArgumentException("Nodes cannot be empty!"); } nodeColumnCond = new TextColumn[nodes.size()]; final Var tempContext = nodes.get(0).getContextVar(); if(tempContext != null) { context = tempContext.clone(); } else { context = new Var(); } try { this.init(); } catch (final RyaTypeResolverException e) { e.printStackTrace(); } }
public void meet(StatementPattern node) { if (!Scope.DEFAULT_CONTEXTS.equals(node.getScope())) { basicPattern = false; } else if (node.getContextVar() != null) { basicPattern = false; } else { super.meet(node); } } }
public StatementBindingSetCursor( Iteration<? extends Statement, ? extends QueryEvaluationException> iter, StatementPattern sp, BindingSet bindings) { super(iter); subjVar = sp.getSubjectVar(); predVar = sp.getPredicateVar(); objVar = sp.getObjectVar(); conVar = sp.getContextVar(); this.bindings = bindings; }
public StatementPatternCursor( Iteration<? extends Statement, ? extends QueryEvaluationException> iter, StatementPattern sp) { super(iter); subjVar = sp.getSubjectVar(); predVar = sp.getPredicateVar(); objVar = sp.getObjectVar(); conVar = sp.getContextVar(); }
@Override public void meet(final StatementPattern pattern) { pattern.getSubjectVar().setValue(makeNativeValue(pattern.getSubjectVar().getValue())); pattern.getPredicateVar().setValue(makeNativeValue(pattern.getPredicateVar().getValue())); pattern.getObjectVar().setValue(makeNativeValue(pattern.getObjectVar().getValue())); if (pattern.getContextVar() != null) { pattern.getContextVar().setValue(makeNativeValue(pattern.getContextVar().getValue())); } } }
@Override public StatementPattern clone() { StatementPattern clone = (StatementPattern)super.clone(); clone.setSubjectVar(getSubjectVar().clone()); clone.setPredicateVar(getPredicateVar().clone()); clone.setObjectVar(getObjectVar().clone()); if (getContextVar() != null) { clone.setContextVar(getContextVar().clone()); } return clone; } }
@Override public void meet(final StatementPattern pattern) { pattern.getSubjectVar().setValue(makeNativeValue(pattern.getSubjectVar().getValue())); pattern.getPredicateVar().setValue(makeNativeValue(pattern.getPredicateVar().getValue())); pattern.getObjectVar().setValue(makeNativeValue(pattern.getObjectVar().getValue())); if (pattern.getContextVar() != null) { pattern.getContextVar().setValue(makeNativeValue(pattern.getContextVar().getValue())); } } }
public Var[] getFields() { return new Var[] { getSparqlPattern().getSubjectVar(), getSparqlPattern().getPredicateVar(), getSparqlPattern().getObjectVar(), getSparqlPattern().getContextVar() }; }
@Override public boolean equals(Object other) { if (other instanceof StatementPattern) { StatementPattern o = (StatementPattern)other; return subjectVar.equals(o.getSubjectVar()) && predicateVar.equals(o.getPredicateVar()) && objectVar.equals(o.getObjectVar()) && nullEquals(contextVar, o.getContextVar()) && scope.equals(o.getScope()); } return false; }
@Override public void meet(StatementPattern node) throws RepositoryException { Resource subj = (Resource)node.getSubjectVar().getValue(); URI pred = (URI)node.getPredicateVar().getValue(); Value obj = node.getObjectVar().getValue(); Resource[] ctx = getContexts(node.getContextVar()); for (RepositoryConnection member : members) { if (member.hasStatement(subj, pred, obj, true, ctx)) { return; } } node.replaceWith(new EmptySet()); }
@Override public void meet(StatementPattern node) throws RepositoryException { Resource subj = (Resource)node.getSubjectVar().getValue(); IRI pred = (IRI)node.getPredicateVar().getValue(); Value obj = node.getObjectVar().getValue(); Resource[] ctx = getContexts(node.getContextVar()); for (RepositoryConnection member : members) { if (member.hasStatement(subj, pred, obj, true, ctx)) { return; } } node.replaceWith(new EmptySet()); }
@Override public void meet(StatementPattern node) { handleType(SeRQO.STATEMENTPATTERN); handleLiteral(SeRQO.SCOPE, node.getScope().name()); handleChild(SeRQO.SUBJECTVAR, node.getSubjectVar()); handleChild(SeRQO.PREDICATEVAR, node.getPredicateVar()); handleChild(SeRQO.OBJECTVAR, node.getObjectVar()); handleChild(SeRQO.CONTEXTVAR, node.getContextVar()); super.meet(node); }