Package org.jrdf.graph

Examples of org.jrdf.graph.Node


    }

    private boolean findAnyEqualAttributeValue(Map<Attribute, Node> avps1, Map<Attribute, Node> avps2) {
        boolean found = false;
        for (Map.Entry<Attribute, Node> attributeValue : avps1.entrySet()) {
            final Node avpsNode2 = avps2.get(attributeValue.getKey());
            found = avpsNode2 != null && attributeValue.getValue().equals(avpsNode2);
            if (found) {
                break;
            }
        }
View Full Code Here


    }

    private boolean onlyContainsAttributesValues(Map<Attribute, Node> avps1, Map<Attribute, Node> avps2) {
        boolean found = false;
        for (Map.Entry<Attribute, Node> attributeValue : avps2.entrySet()) {
            final Node avpsNode1 = avps1.get(attributeValue.getKey());
            found = avpsNode1 != null && avpsNode1.equals(attributeValue.getValue());
            if (!found) {
                break;
            }
        }
        return found;
View Full Code Here

        return node;
    }

    public void visitBlankNode(BlankNode blankNode) {
        currentId = ((LocalizedNode) blankNode).getId();
        Node node = nodePool.getNodeIfExists(currentId);
        if (node == null) {
            try {
                node = createLocalBlankNode();
                currentId = ((LocalizedNode) node).getId();
            } catch (GraphException e) {
View Full Code Here

    public boolean nodeExists(Long nodeToTest) {
        return (getNodeIfExists(nodeToTest) != null);
    }

    public Node get(Long nodeId) {
        Node node = getNodeIfExists(nodeId);
        if (node == null) {
            throw new IllegalArgumentException("Couldn't find: " + nodeId);
        } else {
            return node;
        }
View Full Code Here

            return node;
        }
    }

    public Node getNodeIfExists(Long nodeId) {
        Node node = null;
        if (blankNodePool.keySet().contains(nodeId)) {
            node = mapper.convertToBlankNode(blankNodePool.get(nodeId));
        } else if (uriNodePool.keySet().contains(nodeId)) {
            node = mapper.convertToURIReference(uriNodePool.get(nodeId), nodeId);
        } else if (literalNodePool.keySet().contains(nodeId)) {
View Full Code Here

        this.tuple = newTuple;
    }

    @Override
    public Boolean visitBound(BoundOperator bound) {
        final Node value = getNextValue(bound);
        return (value != null);
    }
View Full Code Here

        return !notExpression.getExpression().accept(this);
    }

    @Override
    public Boolean visitEqualsExpression(EqualsExpression equalsExpression) {
        Node lhsValue = VALUE_EVALUATOR.getValue(tuple, equalsExpression.getLhs());
        Node rhsValue = VALUE_EVALUATOR.getValue(tuple, equalsExpression.getRhs());
        return compareNodes(lhsValue, rhsValue) == 0;
    }
View Full Code Here

        return compareNodes(lhsValue, rhsValue) == 0;
    }

    @Override
    public Boolean visitNEqualsExpression(NEqualsExpression nEqualsExpression) {
        Node lhsValue = VALUE_EVALUATOR.getValue(tuple, nEqualsExpression.getLhs());
        Node rhsValue = VALUE_EVALUATOR.getValue(tuple, nEqualsExpression.getRhs());
        return compareNodes(lhsValue, rhsValue) != 0;
    }
View Full Code Here

        return compareNodes(lhsValue, rhsValue) != 0;
    }

    @Override
    public Boolean visitLessThanExpression(LessThanExpression lessThanExpression) {
        Node lhsValue = VALUE_EVALUATOR.getValue(tuple, lessThanExpression.getLhs());
        Node rhsValue = VALUE_EVALUATOR.getValue(tuple, lessThanExpression.getRhs());
        return compareNodes(lhsValue, rhsValue) < 0;
    }
View Full Code Here

    @Override
    public Node visitSingleValue(SingleValue singleValue) {
        Map<Attribute, Node> avo = singleValue.getValue();
        Attribute attribute = avo.keySet().iterator().next();
        Node node = avo.get(attribute);
        final Node newValue = tuple.getValue(attribute);
        if (ANY_NODE.equals(node)) {
            if (newValue != null) {
                return newValue;
            } else {
                return null;
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.