Package org.jrdf.graph

Examples of org.jrdf.graph.TripleImpl


    // TODO AN Not tested - can change first and last values and tests still pass.
    public Triple createTriple(Long... nodes) {
        SubjectNode subject = (SubjectNode) nodePool.getNodeById(nodes[2]);
        PredicateNode predicate = (PredicateNode) nodePool.getNodeById(nodes[0]);
        ObjectNode object = (ObjectNode) nodePool.getNodeById(nodes[1]);
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here


        Set<Triple> set = findTriple(molecules, triple);
        return set.iterator();
    }

    public Iterator<Triple> find(SubjectNode subject, PredicateNode predicateNode, ObjectNode object) {
        Triple triple = new TripleImpl(subject, predicateNode, object);
        return find(triple);
    }
View Full Code Here

            ClosableIterable<Triple> triples = graph.find(ANY_SUBJECT_NODE, ANY_PREDICATE_NODE, oldONode);
            for (Triple triple : triples) {
                Triple newTriple =
                    tripleFactory.createTriple(triple.getSubject(), triple.getPredicate(), (ObjectNode) newNode);
                triplesToAdd.add(newTriple);
                triplesToRemove.add(new TripleImpl(triple.getSubject(), triple.getPredicate(), oldONode));
            }
            triples.iterator().close();
            addRemoveTriples();
        }
    }
View Full Code Here

            ClosableIterable<Triple> triples = graph.find(ANY_SUBJECT_NODE, oldONode, ANY_OBJECT_NODE);
            for (Triple triple : triples) {
                Triple newTriple =
                    tripleFactory.createTriple(triple.getSubject(), (PredicateNode) newNode, triple.getObject());
                triplesToAdd.add(newTriple);
                triplesToRemove.add(new TripleImpl(triple.getSubject(), oldONode, triple.getObject()));
            }
            triples.iterator().close();
            addRemoveTriples();
        }
    }
View Full Code Here

            ClosableIterable<Triple> triples = graph.find(oldSNode, ANY_PREDICATE_NODE, ANY_OBJECT_NODE);
            for (Triple triple : triples) {
                Triple newTriple =
                    tripleFactory.createTriple((SubjectNode) newNode, triple.getPredicate(), triple.getObject());
                triplesToAdd.add(newTriple);
                triplesToRemove.add(new TripleImpl(oldSNode, triple.getPredicate(), triple.getObject()));
            }
            triples.iterator().close();
            addRemoveTriples();
        }
    }
View Full Code Here

    // TODO AN Not tested - can change first and last values and tests still pass.
    public Triple createTriple(Long... nodes) {
        SubjectNode subject = (SubjectNode) nodePool.getNodeById(nodes[1]);
        PredicateNode predicate = (PredicateNode) nodePool.getNodeById(nodes[2]);
        ObjectNode object = (ObjectNode) nodePool.getNodeById(nodes[0]);
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here

        final Node objNode = nodePool.getNodeById(nodes[2]);

        SubjectNode subject = (SubjectNode) subNode;
        PredicateNode predicate = (PredicateNode) predNode;
        ObjectNode object = (ObjectNode) objNode;
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here

    public Triple entryToObject(TupleInput input) {
        SubjectNode subject = (SubjectNode) nodeBinding.entryToObject(input);
        PredicateNode predicate = (PredicateNode) nodeBinding.entryToObject(input);
        ObjectNode object = (ObjectNode) nodeBinding.entryToObject(input);
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here

        return getUnsortedTuplesFromGraph(ALL_TRIPLE, attributes);
    }

    public Set<Tuple> getTuples(Map<Attribute, Node> nameValues) {
        Attribute[] attributes = nameValues.keySet().toArray(new Attribute[TRIPLE]);
        Triple searchTriple = new TripleImpl((SubjectNode) nameValues.get(attributes[0]),
            (PredicateNode) nameValues.get(attributes[1]),
            (ObjectNode) nameValues.get(attributes[2]));
        return getUnsortedTuplesFromGraph(searchTriple, attributes);
    }
View Full Code Here

            subject = map.get(subject);
        }
        if (map.containsKey(object)) {
            object = map.get(object);
        }
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here

TOP

Related Classes of org.jrdf.graph.TripleImpl

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.