Package org.jrdf.graph

Examples of org.jrdf.graph.PredicateNode


            return false;
        }
    }

    private void getNextUniquePredicate() {
        PredicateNode tmpPredicate = getNextPredicate();
        while ((tmpPredicate != null) && tmpPredicate.equals(currentPredicate)) {
            tmpPredicate = getNextPredicate();
        }
        currentPredicate = tmpPredicate;
    }
View Full Code Here


    }

    public Triple parseTripleLine(final RegexMatcher subjectMatcher, final RegexMatcher predicateMatcher,
        final RegexMatcher objectMatcher) throws ParseException {
        final SubjectNode subject = (SubjectNode) nodeParser.parseNode(nodeMaps.getSubjectMap(), subjectMatcher);
        final PredicateNode predicate = (PredicateNode) nodeParser.parseNode(nodeMaps.getPredicateMap(),
            predicateMatcher);
        final ObjectNode object = (ObjectNode) nodeParser.parseNode(nodeMaps.getObjectMap(), objectMatcher);
        if (subject != null && predicate != null && object != null) {
            return tripleFactory.createTriple(subject, predicate, object);
        } else {
View Full Code Here

        //search for the city: "Bedford"
        ObjectNode city = graph.getElementFactory().createLiteral("Bedford");
        print("Search for city ('Bedford'): ", graph.find(ANY_SUBJECT_NODE, ANY_PREDICATE_NODE, city));

        //search for any subject that has an address
        PredicateNode hasAddress = graph.getElementFactory().createURIReference(HAS_ADDRESS);
        Triple findAddresses = tripleFactory.createTriple(ANY_SUBJECT_NODE, hasAddress, ANY_OBJECT_NODE);
        print("Search for subjects that have an address: ", graph.find(findAddresses));
    }
View Full Code Here

    public static PredicateNode makePredicateResourceFromRel(String predicate,
                                                             Map<String, String> map)
            throws URISyntaxException {
        URI predURI = RelationshipTuple.makePredicateFromRel(predicate, map);
        PredicateNode node = new SimpleURIReference(predURI);
        return node;
    }
View Full Code Here

        if (subject == null) {
            logger.warn("Subject cannot be null");
            return rels;
        }
        SubjectNode s;
        PredicateNode p;
        try {
                s = TripleMaker.createResource(getFedoraResourceURI(subject));
            if (relationship != null) {
                p = TripleMaker.createResource(relationship);
            } else {
View Full Code Here

        if (object == null) {
            logger.warn("Object cannot be null");
            return rels;
        }
        PredicateNode p;
        ObjectNode o;
        try {
                o = TripleMaker.createResource(getFedoraResourceURI(object));
            if (relationship != null) {
                p = TripleMaker.createResource(relationship);
View Full Code Here

            logger.debug("Getting attribute " + attribute +" for resource " + resourceID);
        }

        try{
            SubjectNode snode = new SimpleURIReference(new URI(resourceID));
            PredicateNode pnode = new SimpleURIReference(new URI(attribute));
            TripleIterator triples = m_resourceIndex.findTriples(snode, pnode, null, 0);
            results = new HashSet<String>();
            while (triples.hasNext()){
                Triple triple = triples.next();
                String object = triple.getObject().stringValue();
View Full Code Here

        logger.debug("Getting attribute for resource " + resourceID);

        try{
            SubjectNode snode = new SimpleURIReference(new URI(resourceID));
            PredicateNode pnode = new SimpleURIReference(new URI(attribute));
            DOReader reader = m_doManager.getReader(false, getContext(), pid);
            Set<RelationshipTuple> triples = reader.getRelationships(snode, pnode, null);
            results = new HashSet<String>();

            for (RelationshipTuple triple:triples){
View Full Code Here

TOP

Related Classes of org.jrdf.graph.PredicateNode

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.