Examples of Relationship


Examples of org.neo4j.api.core.Relationship

import ${package}.MyRelationshipTypes;

class SomeReturnableEvaluator implements ReturnableEvaluator {
    public boolean isReturnableNode(
    TraversalPosition currentPosition) {
        Relationship rel = currentPosition.lastRelationshipTraversed();
        return rel != null && rel.isType(MyRelationshipTypes.CODED_BY);
    }
View Full Code Here

Examples of org.neo4j.batchimport.structs.Relationship

                throw new IllegalStateException(String.format("relationship-rows not pre-sorted found id %d less than node-id %d", min, nodeId));
            if (min > nodeId) break; // keep already parsed data

            long target = Math.max(from, to);
            final boolean outgoing = from == min;
            final Relationship rel = nodeStruct.addRel(target, outgoing, type(relChunker.nextWord()));

            addProperties(rel, relChunker, relPropIds,relPropCount, relPropertyTypes);
            from = -1;
            to = -1;
        }
View Full Code Here

Examples of org.neo4j.batchimport.structs.Relationship

        // long prevId = futureNodeRelInfo.done(nodeId, getFirstOwnRelationshipId(event));
        long prevId = event.prevId;

        for (int i = 0; i < count; i++) {
            long nextId = i+1 < count ? event.getRelationship(i+1).id : followingNextRelationshipId;
            Relationship relationship = event.getRelationship(i);
            relationshipWriter.create(nodeId,event, relationship, prevId, nextId);
            prevId = relationship.id;
            // storeFutureRelId(nodeId, relationship,prevId);

            counter++;
View Full Code Here

Examples of org.neo4j.batchimport.structs.Relationship

public class RelationshipIdHandler implements EventHandler<NodeStruct> {
    volatile long relId = 0;

    public void onEvent(NodeStruct event, long nodeId, boolean endOfBatch) throws Exception {
        for (int i = 0; i < event.relationshipCount; i++) {
            Relationship relationship = event.getRelationship(i);
            relationship.id = relId++;
        }
    }
View Full Code Here

Examples of org.neo4j.batchimport.structs.Relationship

        event.prevId = futureNodeRelInfo.done(nodeId, getFirstOwnRelationshipId(event));

        int count = event.relationshipCount;

        for (int i = 0; i < count; i++) {
            Relationship relationship = event.getRelationship(i);
            storeFutureRelId(nodeId, relationship);

            counter++;
        }
    }
View Full Code Here

Examples of org.neo4j.graphdb.Relationship

  }

  private Relationship createRelationshipWithEmbeddedNode(AssociationKey associationKey, Tuple associationRow, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) {
    EntityKey entityKey = getEntityKey( associationRow, associatedEntityKeyMetadata );
    Node embeddedNode = entityQueries.get( entityKey.getMetadata() ).createEmbedded( executionEngine, entityKey.getColumnValues() );
    Relationship relationship = createRelationshipWithTargetNode( associationKey, associationRow, embeddedNode );
    applyProperties( associationKey, associationRow, relationship );
    return relationship;
  }
View Full Code Here

Examples of org.neo4j.graphdb.Relationship

  }

  private Relationship createRelationshipWithTargetNode(AssociationKey associationKey, Tuple associationRow, Node targetNode) {
    EntityKey entityKey = associationKey.getEntityKey();
    Node ownerNode = entityQueries.get( entityKey.getMetadata() ).findEntity( executionEngine, entityKey.getColumnValues() );
    Relationship relationship = ownerNode.createRelationshipTo( targetNode, withName( associationKey.getMetadata().getCollectionRole() ) );
    applyProperties( associationKey, associationRow, relationship );
    return relationship;
  }
View Full Code Here

Examples of org.neo4j.graphdb.Relationship

      break;
    }
  }

  private void putAssociationOperation(Association association, AssociationKey associationKey, AssociationOperation action, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) {
    Relationship relationship = associationQueries.get( associationKey.getMetadata() ).findRelationship( executionEngine, associationKey, action.getKey() );

    if (relationship != null) {
      for ( String relationshipProperty : associationKey.getMetadata().getRowKeyIndexColumnNames() ) {
        relationship.setProperty( relationshipProperty, action.getValue().get( relationshipProperty ) );

      }
      GraphLogger.log( "Updated relationship: %1$s", relationship );
    }
    else {
View Full Code Here

Examples of org.neo4j.graphdb.Relationship

        }
        if (value instanceof Node) {
            return value.toString() + props((PropertyContainer) value);
        }
        if (value instanceof Relationship) {
            Relationship rel = (Relationship) value;
            return ":" + rel.getType().name() + "[" + rel.getId() + "] " + props(rel);
        }
        if (value instanceof Iterable) {
            return formatIterator(((Iterable) value).iterator());
        }
        if (value.getClass().isArray()) {
View Full Code Here

Examples of org.neo4j.graphdb.Relationship

    query.append( " - " );
    query.append( relationshipCypher( associationKey, rowKey, parameters, entityKey.getColumnNames().length ) );
    query.append( " -> () RETURN r" );
    ExecutionResult result = engine.execute( query.toString(), parameters );
    ResourceIterator<Relationship> column = result.columnAs( "r" );
    Relationship relationship = null;
    if ( column.hasNext() ) {
      relationship = column.next();
    }
    column.close();
    return relationship;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.