private static void setPathMod(ArbitraryLengthPathNode alp, PathMod mod ) { alp.setProperty(Annotations.LOWER_BOUND, mod == PathMod.ONE_OR_MORE ? 1L : 0L); alp.setProperty(Annotations.UPPER_BOUND,mod == PathMod.ZERO_OR_ONE ? 1L : Long.MAX_VALUE); } };
private static void setPathMod(ArbitraryLengthPathNode alp, PathMod mod ) { alp.setProperty(Annotations.LOWER_BOUND, mod == PathMod.ONE_OR_MORE ? 1L : 0L); alp.setProperty(Annotations.UPPER_BOUND,mod == PathMod.ZERO_OR_ONE ? 1L : Long.MAX_VALUE); } };
/** * Set the edge var and middle term. Only used by the ALP service when * projecting edges. */ public void setEdgeVar(final VarNode edgeVar, final TermNode middle) { setProperty(Annotations.MIDDLE_TERM, middle); setProperty(Annotations.EDGE_VAR, edgeVar); }
/** * Set the edge var and middle term. Only used by the ALP service when * projecting edges. */ public void setEdgeVar(final VarNode edgeVar, final TermNode middle) { setProperty(Annotations.MIDDLE_TERM, middle); setProperty(Annotations.EDGE_VAR, edgeVar); }
private static void setPathMod(ArbitraryLengthPathNode alp, PathMod mod ) { alp.setProperty(Annotations.LOWER_BOUND, mod == PathMod.ONE_OR_MORE ? 1L : 0L); alp.setProperty(Annotations.UPPER_BOUND,mod == PathMod.ZERO_OR_ONE ? 1L : Long.MAX_VALUE); } };
/** * Fully construct an arbitrary length path node with all required * annotations. */ public ArbitraryLengthPathNode(final TermNode left, final TermNode right, final VarNode tVarLeft, final VarNode tVarRight, final long lowerBound, final long upperBound) { this(new BOp[] { new JoinGroupNode() }, NV.asMap( new NV(Annotations.LEFT_TERM, left), new NV(Annotations.RIGHT_TERM, right), new NV(Annotations.TRANSITIVITY_VAR_LEFT, tVarLeft), new NV(Annotations.TRANSITIVITY_VAR_RIGHT, tVarRight), new NV(Annotations.DROP_VARS, new ArrayList<VarNode>()), new NV(Annotations.LOWER_BOUND, lowerBound), new NV(Annotations.UPPER_BOUND, upperBound) )); final Set<VarNode> dropVars = new LinkedHashSet<>(); dropVars.add(tVarLeft); dropVars.add(tVarRight); setProperty(Annotations.DROP_VARS, dropVars); }
/** * Fully construct an arbitrary length path node with all required * annotations. */ public ArbitraryLengthPathNode(final TermNode left, final TermNode right, final VarNode tVarLeft, final VarNode tVarRight, final long lowerBound, final long upperBound) { this(new BOp[] { new JoinGroupNode() }, NV.asMap( new NV(Annotations.LEFT_TERM, left), new NV(Annotations.RIGHT_TERM, right), new NV(Annotations.TRANSITIVITY_VAR_LEFT, tVarLeft), new NV(Annotations.TRANSITIVITY_VAR_RIGHT, tVarRight), new NV(Annotations.DROP_VARS, new ArrayList<VarNode>()), new NV(Annotations.LOWER_BOUND, lowerBound), new NV(Annotations.UPPER_BOUND, upperBound) )); final Set<VarNode> dropVars = new LinkedHashSet<>(); dropVars.add(tVarLeft); dropVars.add(tVarRight); setProperty(Annotations.DROP_VARS, dropVars); }
/** * Fully construct an arbitrary length path node with all required * annotations. */ public ArbitraryLengthPathNode(final TermNode left, final TermNode right, final VarNode tVarLeft, final VarNode tVarRight, final PathMod mod) { this(new BOp[] { new JoinGroupNode() }, NV.asMap( new NV(Annotations.LEFT_TERM, left), new NV(Annotations.RIGHT_TERM, right), new NV(Annotations.TRANSITIVITY_VAR_LEFT, tVarLeft), new NV(Annotations.TRANSITIVITY_VAR_RIGHT, tVarRight), new NV(Annotations.LOWER_BOUND, mod == PathMod.ONE_OR_MORE ? 1L : 0L), new NV(Annotations.UPPER_BOUND, mod == PathMod.ZERO_OR_ONE ? 1L : Long.MAX_VALUE) )); final Set<VarNode> dropVars = new LinkedHashSet<>(); dropVars.add(tVarLeft); dropVars.add(tVarRight); setProperty(Annotations.DROP_VARS, dropVars); }
/** * Fully construct an arbitrary length path node with all required * annotations. */ public ArbitraryLengthPathNode(final TermNode left, final TermNode right, final VarNode tVarLeft, final VarNode tVarRight, final PathMod mod) { this(new BOp[] { new JoinGroupNode() }, NV.asMap( new NV(Annotations.LEFT_TERM, left), new NV(Annotations.RIGHT_TERM, right), new NV(Annotations.TRANSITIVITY_VAR_LEFT, tVarLeft), new NV(Annotations.TRANSITIVITY_VAR_RIGHT, tVarRight), new NV(Annotations.LOWER_BOUND, mod == PathMod.ONE_OR_MORE ? 1L : 0L), new NV(Annotations.UPPER_BOUND, mod == PathMod.ZERO_OR_ONE ? 1L : Long.MAX_VALUE) )); final Set<VarNode> dropVars = new LinkedHashSet<>(); dropVars.add(tVarLeft); dropVars.add(tVarRight); setProperty(Annotations.DROP_VARS, dropVars); }
alp.setProperty(Annotations.ESTIMATED_CARDINALITY, cardinality);
alp.setProperty(Annotations.ESTIMATED_CARDINALITY, cardinality);