Package org.jrdf.query.relation

Examples of org.jrdf.query.relation.Tuple


    private EvaluatedRelation project(EvaluatedRelation relation, Set<Attribute> newHeading) {
        Set<Tuple> newTuples = new HashSet<Tuple>();
        Set<Tuple> tuples = relation.getTuples();
        for (Tuple tuple : tuples) {
            Tuple newTuple = createNewTuples(tuple, newHeading);
            // TODO (AN) Only add non empty attributes - this failed.
            if (!newTuple.getAttributeValues().isEmpty()) {
                newTuples.add(newTuple);
            }
        }

        // TODO (AN) Used to just be getRelation(newHeading) - this failed.
View Full Code Here


    private int compareTuplesWithSameCardinality(final Iterator<Tuple> iterator1, final Iterator<Tuple> iterator2) {
        int result = 0;
        boolean equal = true;
        while (iterator1.hasNext() && iterator2.hasNext() && equal) {
            Tuple tuple1 = iterator1.next();
            Tuple tuple2 = iterator2.next();
            result = tupleComparator.compare(tuple1, tuple2);
            equal = result == 0;
        }
        return result;
    }
View Full Code Here

    public boolean hasNext() {
        return tupleIterator.hasNext();
    }

    public TypeValue[] next() {
        Tuple tuple = tupleIterator.next();
        return getDataWithValues(tuple.getAttributeValues());
    }
View Full Code Here

        Map<Attribute, Node> resultantAttributeValues = new HashMap<Attribute, Node>();
        final boolean contradiction = relationHelper.addTuplesIfEqual(headings, tuple1, tuple2,
            resultantAttributeValues);
        // Only add results if we have found more items to add and there wasn't a contradiction in bound values.
        if (!contradiction && !resultantAttributeValues.isEmpty()) {
            final Tuple t = tupleFactory.getTuple(resultantAttributeValues);
            result.add(t);
        }
    }
View Full Code Here

            }
        }

        // Only add results if they are the same size
        if ((!allAttributeValuePairs.isEmpty() && !contradiction)) {
            Tuple t = tupleFactory.getTuple(lhsAttributeValuePairs);
            result.add(t);
        }
    }
View Full Code Here

TOP

Related Classes of org.jrdf.query.relation.Tuple

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.