@Override public void visit(ElementUnion union) { ElementUnion newunion = new ElementUnion(); for (Element e: union.getElements()) { e.visit(this); newunion.addElement(result); } result = newunion; }
final public Element GroupOrUnionGraphPattern() throws ParseException { Element el = null ; ElementUnion el2 = null ; el = GroupGraphPattern(); label_19: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case UNION: ; break; default: jj_la1[79] = jj_gen; break label_19; } jj_consume_token(UNION); if ( el2 == null ) { el2 = new ElementUnion() ; el2.addElement(el) ; } el = GroupGraphPattern(); el2.addElement(el) ; } {if (true) return (el2==null)? el : el2 ;} throw new Error("Missing return statement in function"); }
@Override public int hashCode() { int calcHashCode = Element.HashUnion ; calcHashCode ^= getElements().hashCode() ; return calcHashCode ; }
public ElementUnion(Element el) { //Used by the SPARQL 1.1 style UNION this() ; addElement(el) ; }
final public Element GroupOrUnionGraphPattern() throws ParseException { Element el = null ; ElementUnion el2 = null ; el = GroupGraphPattern(); label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case UNION: ; break; default: jj_la1[33] = jj_gen; break label_10; } jj_consume_token(UNION); if ( el2 == null ) { el2 = new ElementUnion() ; el2.addElement(el) ; } el = GroupGraphPattern(); el2.addElement(el) ; } {if (true) return (el2==null)? el : el2 ;} throw new Error("Missing return statement in function"); }
@Override public int hashCode() { int calcHashCode = Element.HashUnion ; calcHashCode ^= getElements().hashCode() ; return calcHashCode ; }
public ElementUnion(Element el) { //Used by the SPARQL 1.1 style UNION this() ; addElement(el) ; }
final public Element GroupOrUnionGraphPattern() throws ParseException { Element el = null ; ElementUnion el2 = null ; el = GroupGraphPattern(); label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case UNION: ; break; default: jj_la1[33] = jj_gen; break label_10; } jj_consume_token(UNION); if ( el2 == null ) { el2 = new ElementUnion() ; el2.addElement(el) ; } el = GroupGraphPattern(); el2.addElement(el) ; } {if (true) return (el2==null)? el : el2 ;} throw new Error("Missing return statement in function"); }
@Override public void visit(ElementUnion union) { ElementUnion ret = new ElementUnion(); for (Element elt: union.getElements()) { elt.visit(this); ret.addElement(result); } result = ret; }
@Override public boolean equalTo(Element el2, NodeIsomorphismMap isoMap) { if ( el2 == null ) return false ; if ( ! ( el2 instanceof ElementUnion) ) return false ; ElementUnion eu2 = (ElementUnion)el2 ; if ( this.getElements().size() != eu2.getElements().size() ) return false ; for ( int i = 0 ; i < this.getElements().size() ; i++ ) { Element e1 = getElements().get(i) ; Element e2 = eu2.getElements().get(i) ; if ( ! e1.equalTo(e2, isoMap) ) return true ; } return true ; }
protected void addOnlyAboxTriples(ElementUnion patterns, List<Triple> triples){ boolean isAbsentFromAbox = false; ElementTriplesBlock sp = new ElementTriplesBlock(); for (Triple t : triples) { if (isTripleAbsentFromAbox(t)) { isAbsentFromAbox = true; break; } sp.addTriple(t); } if (!isAbsentFromAbox) patterns.addElement(sp); }
public void visit(OpUnion opUnion) { Element eLeft = asElementGroup(opUnion.getLeft()) ; Element eRight = asElementGroup(opUnion.getRight()) ; if ( eLeft instanceof ElementUnion ) { ElementUnion elUnion = (ElementUnion)eLeft ; elUnion.addElement(eRight) ; return ; } // if ( eRight instanceof ElementUnion ) // { // ElementUnion elUnion = (ElementUnion)eRight ; // elUnion.getElements().add(0, eLeft) ; // return ; // } ElementUnion elUnion = new ElementUnion() ; elUnion.addElement(eLeft) ; elUnion.addElement(eRight) ; currentGroup().addElement(elUnion) ; }
@Override public void visit(ElementUnion union) { ElementUnion newunion = new ElementUnion(); for (Element e: union.getElements()) { e.visit(this); newunion.addElement(result); } result = newunion; }
@Override public boolean equalTo(Element el2, NodeIsomorphismMap isoMap) { if ( el2 == null ) return false ; if ( ! ( el2 instanceof ElementUnion) ) return false ; ElementUnion eu2 = (ElementUnion)el2 ; if ( this.getElements().size() != eu2.getElements().size() ) return false ; for ( int i = 0 ; i < this.getElements().size() ; i++ ) { Element e1 = getElements().get(i) ; Element e2 = eu2.getElements().get(i) ; if ( ! e1.equalTo(e2, isoMap) ) return true ; } return true ; }
final public Element GroupOrUnionGraphPattern() throws ParseException { Element el = null ; ElementUnion el2 = null ; el = GroupGraphPattern(); label_21: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case UNION: ; break; default: jj_la1[89] = jj_gen; break label_21; } jj_consume_token(UNION); if ( el2 == null ) { el2 = new ElementUnion() ; el2.addElement(el) ; } el = GroupGraphPattern(); el2.addElement(el) ; } {if (true) return (el2==null)? el : el2 ;} throw new Error("Missing return statement in function"); }
@Override public void visit(ElementUnion union) { // remove nested unions ElementUnion ret = new ElementUnion(); for (Element elt : union.getElements()) { elt.visit(this); if (result instanceof ElementUnion) { ElementUnion nestedUnion = (ElementUnion) result; for (Element subelt: nestedUnion.getElements()) { assert !(subelt instanceof ElementUnion) : subelt +"\n"+ nestedUnion; ret.addElement(subelt); } } else { ret.addElement(result); } } if (ret.getElements().size() == 1) { result = ret.getElements().get(0); } else { result = ret; } }
@Override public void visit(ElementUnion e) { for (Element ge : e.getElements()) { ge.visit(this); } }
final public Element GroupOrUnionGraphPattern() throws ParseException { Element el = null ; ElementUnion el2 = null ; el = GroupGraphPattern(); label_18: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case UNION: ; break; default: jj_la1[76] = jj_gen; break label_18; } jj_consume_token(UNION); if ( el2 == null ) { el2 = new ElementUnion() ; el2.addElement(el) ; } el = GroupGraphPattern(); el2.addElement(el) ; } {if (true) return (el2==null)? el : el2 ;} throw new Error("Missing return statement in function"); }
ElementUnion patterns = new ElementUnion(); NewVariableGenerator varGen = new NewVariableGenerator("var_"); for (OWLAxiom ax: getNegativeInclClosure()) { if (!isTripleAbsentFromAbox(triple)) { sp.addTriple(toTriple(subp, x, x, varGen)); patterns.addElement(sp); if (patterns.getElements().size()>1) { ret.setQueryPattern(patterns); } else if (patterns.getElements().size() ==1) { ret.setQueryPattern(patterns.getElements().get(0)); } else { return new ConsistencyCheckResult(true);
@Override public void visit(ElementUnion el) { unionCount++; for (Iterator<Element> iterator = el.getElements().iterator(); iterator.hasNext();) { Element e = iterator.next(); e.visit(this); } }