Package org.jrdf.graph

Examples of org.jrdf.graph.Node


        this.attribute = newAttribute;
    }

    public int compare(Tuple tuple, Tuple tuple1) {
        checkNotNull(attribute);
        final Node vo1 = tuple.getValue(attribute);
        final Node vo2 = tuple1.getValue(attribute);
        return nodeComparator.compare(vo1, vo2);
    }
View Full Code Here


        return result;
    }

    private boolean equateAVOs(Map<Attribute, Node> lhs, Map<Attribute, Node> rhs) {
        Attribute attribute = lhs.keySet().iterator().next();
        Node lvo = lhs.get(attribute);
        Node rvo = rhs.get(attribute);
        if (isAnyNode(lvo)) {
            if (rvo != null) {
                updateAttributeValue(attribute, lvo, rvo);
            } else {
                // assuming a variable now
View Full Code Here

    }

    public int size() {
        int result = 0;
        for (Attribute attribute : singleAvp.keySet()) {
            final Node node = singleAvp.get(attribute);
            if (isAnyNode(node)) {
                result += 2;
            } else if (isBuiltinNode(node)) {
                result++;
            }
View Full Code Here

    private void process(SortedSet<Attribute> headings, SortedSet<Tuple> result, Tuple tuple1, Tuple tuple2) {
        Map<Attribute, Node> allAttributeValuePairs = new HashMap<Attribute, Node>();
        Map<Attribute, Node> lhsAttributeValuePairs = new HashMap<Attribute, Node>();
        boolean contradiction = false;
        for (Attribute attribute : headings) {
            Node avp1 = tuple1.getValue(attribute);
            Node avp2 = tuple2.getValue(attribute);
            contradiction = addAttributeValuePair(attribute, avp1, avp2, allAttributeValuePairs,
                lhsAttributeValuePairs);

            // If we didn't find one for the current heading end early.
            if (contradiction) {
View Full Code Here

    private Expression updateoneExpression(Expression lhs,
        Set<Attribute> lhsAttrs, Set<Attribute> rhsAttrs) {
        if (lhs instanceof SingleValue && lhsAttrs.contains(NULLARY_ATTRIBUTE) && rhsAttrs.size() == 1) {
            Map<Attribute, Node> map = lhs.getValue();
            Node vo = map.get(NULLARY_ATTRIBUTE);
            map.clear();
            map.put(rhsAttrs.iterator().next(), vo);
            ((SingleValue) lhs).setAVO(map);
        }
        return lhs;
View Full Code Here

        }
    }

    @Override
    public void caseAResourceResourceTripleElement(AResourceResourceTripleElement node) {
        Node value = createResource(getResource(node.getResource()));
        avp.put(attribute, value);
    }
View Full Code Here

    }

    @Override
    public void caseAQnameResourceTripleElement(AQnameResourceTripleElement node) {
        AQnameQnameElement element = (AQnameQnameElement) node.getQnameElement();
        Node value = createQNameResource(element.getNcnamePrefix().getText(), element.getNcName().getText());
        avp.put(attribute, value);
    }
View Full Code Here

        createAttributeValuePair(nodeType, graphNode, getVariableName(node));
    }

    @Override
    public void caseAResourceObjectTripleElement(AResourceObjectTripleElement node) {
        Node value = createResource(getResource(node.getResource()));
        avp.put(attribute, value);
    }
View Full Code Here

    }

    @Override
    public void caseAQnameObjectTripleElement(AQnameObjectTripleElement node) {
        AQnameQnameElement element = (AQnameQnameElement) node.getQnameElement();
        Node value = createQNameResource(element.getNcnamePrefix().getText(), element.getNcName().getText());
        avp.put(attribute, value);
    }
View Full Code Here

        createAttributeValuePair(nodeType, graphNode, getVariableName(node));
    }

    @Override
    public void caseALiteralObjectTripleElement(ALiteralObjectTripleElement node) {
        Node value = createLiteral(node);
        avp.put(attribute, value);
    }
View Full Code Here

TOP

Related Classes of org.jrdf.graph.Node

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.