Package org.jrdf.graph

Examples of org.jrdf.graph.BlankNode


    }

    public BlankNode createLocalBlankNode() {
        String uid = UUID.randomUUID().toString();
        currentId = nodePool.getNewNodeId();
        BlankNode node = new BlankNodeImpl(uid, currentId);
        nodePool.registerLocalBlankNode(node);
        return node;
    }
View Full Code Here


        URIReference p = elementFactory.createURIReference(URI.create(predicate));
        graph.add(p, p, p);
    }

    private void addTriple(String predicate) throws Exception {
        BlankNode s = elementFactory.createBlankNode();
        URIReference p = elementFactory.createURIReference(URI.create(predicate));
        BlankNode o = elementFactory.createBlankNode();
        graph.add(s, p, o);
    }
View Full Code Here

        graph.add(s, p, o);
    }

    private void addChain(String predicate) throws Exception {
        URIReference p1 = elementFactory.createURIReference(URI.create(predicate));
        BlankNode thisNode = elementFactory.createBlankNode();
        for (int i = 0; i < CHAIN_SIZE; i++) {
            BlankNode nextNode = elementFactory.createBlankNode();
            graph.add(thisNode, p1, nextNode);
            thisNode = nextNode;
        }
    }
View Full Code Here

        }
    }

    private void addLoop(String predicate) throws Exception {
        URIReference p1 = elementFactory.createURIReference(URI.create(predicate));
        BlankNode firstNode = elementFactory.createBlankNode();
        BlankNode thisNode = firstNode;
        for (int i = 0; i < LOOP_SIZE; i++) {
            BlankNode nextNode = elementFactory.createBlankNode();
            graph.add(thisNode, p1, nextNode);
            thisNode = nextNode;
        }
        graph.add(thisNode, p1, firstNode);
    }
View Full Code Here

        return valueFactory.createBlankNode();
    }

    public BlankNode createBlankNode(String nodeID) throws GraphElementFactoryException {
        // Maybe the node ID has been used before:
        BlankNode result = bNodeIdMap.get(nodeID);

        if (null == result) {
            // This is a new node ID, create a new BNode object for it
            result = valueFactory.createBlankNode();
View Full Code Here

            NodeElement subject = (NodeElement) peekStack(1);
            PropertyElement predicate = (PropertyElement) peekStack(0);

            if (predicate.parseCollection()) {
                SubjectNode lastListRes = predicate.getLastListResource();
                BlankNode newListRes = createBNode();

                if (null == lastListRes) {
                    // first element in the list
                    reportStatement(subject.getResource(), predicate.getURI(), newListRes);
View Full Code Here

            }

            String parseTypeValue = parseType.getValue();

            if ("Resource".equals(parseTypeValue)) {
                BlankNode objectResource = createBNode();
                NodeElement subject = (NodeElement) peekStack(1);

                reportStatement(subject.getResource(), propURI, objectResource);

                if (isEmptyElt) {
View Full Code Here

TOP

Related Classes of org.jrdf.graph.BlankNode

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.