Java Code Examples for com.tinkerpop.blueprints.Edge.setProperty()

The following are Jave code examples for showing how to use setProperty() of the com.tinkerpop.blueprints.Edge class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: titan0.5.4-hbase1.1.1-custom   File: TitanWritePerformanceTest.java   Source Code and License Vote up 6 votes
public void run() {
    for (int i = 0; i < noNodes; i++) {
        Vertex v = bgraph.addVertex(i);
        v.setProperty("name", getName(i));
        v.setProperty("uid", i);
    }

    for (int i = 0; i < noNodes; i++) {
        // Out vertex
        Vertex n = bgraph.getVertex(i);

        // Iterate over in vertices
        for (int e = 0; e < noEdgesPerNode; e++) {
            Vertex n2 = bgraph.getVertex(wrapAround(i + e, noNodes));
            Edge edge = n.addEdge("knows", n2);
            edge.setProperty("uid", RandomGenerator.randomInt(0, Integer.MAX_VALUE));
            edge.setProperty("weight", Math.random());
        }
    }

    bgraph.commit();
}
 
Example 2
Project: titan0.5.4-hbase1.1.1-custom   File: GraphGenerator.java   Source Code and License Vote up 6 votes
/**
 * As in {@code vertexAnnotator} above, choose a sequence of
 * contiguously-stored property names with a random offset and length.
 * However, omit the initial {@link Schema#getEdgeLabels()} property
 * keys from consideration. These keys are used by sort keys.
 * <p>
 * In addition to the preceding, lookup the sort key for the edge's
 * label and set that to a randomly chosen value.
 */
@Override
public void annotate(Edge edge) {
    // Set sort key edge property
    edge.setProperty(schema.getSortKeyForLabel(edge.getLabel()),
            random.nextInt(schema.getMaxEdgePropVal()));

    // Set additional (non-sort-key) edge properties
    if (0 >= schema.getEdgePropKeys() - schema.getEdgeLabels())
        return;

    int eligible = schema.getEdgePropKeys() - schema.getEdgeLabels();
    Preconditions.checkArgument(0 < eligible);
    int count = random.nextInt(eligible);
    int offset = random.nextInt(eligible);
    int length = schema.getEdgePropKeys();
    Preconditions.checkArgument(length == eligible + schema.getEdgeLabels());
    Preconditions.checkArgument(length >= count + schema.getEdgeLabels());

    for (int i = 0; i < count; i++) {
        String key = schema.getEdgePropertyName(schema.getEdgeLabels() + ((offset + i) % eligible));
        edge.setProperty(key, random.nextInt(schema.getMaxEdgePropVal()));
    }
}
 
Example 3
Project: poi-visio-graph   File: VisioPageParser.java   Source Code and License Vote up 6 votes
protected void createEdge(ShapeData sd1, ShapeData sd2, String edgeType, Double x, Double y) {

	// note: visio doesn't always support direction, and neither do we. So, to
	//       save time, and make sure we don't accidentally create duplicate 
	//       edges, we sort by id
	
	ShapeData from = sd1;
	ShapeData to = sd2;
	
	if (sd1.shapeId > sd2.shapeId) {
		from = sd2;
		to = sd1;
	}
	
	String eId = getConnId(from, to);
	
	Edge edge = graph.getEdge(eId);
	if (edge == null) {
		edge = graph.addEdge(eId, from.vertex, to.vertex, edgeType);
		
		if (x != null && y != null) {
			edge.setProperty("x", x);
			edge.setProperty("y", y);
		}
	}
}
 
Example 4
Project: mesh   File: BinaryStorageMigration.java   Source Code and License Vote up 5 votes
private Edge createNewFieldEdge(Vertex container, Vertex binary, String fileName, String contentType, String dominantColor, String fieldKey) {
	Edge edge = getGraph().addEdge("class:BinaryGraphFieldImpl", container, binary, "HAS_FIELD");
	edge.setProperty("ferma_type", "BinaryGraphFieldImpl");
	edge.setProperty("uuid", randomUUID());
	edge.setProperty(BINARY_FILENAME_PROPERTY_KEY, fileName);
	edge.setProperty(BINARY_CONTENT_TYPE_PROPERTY_KEY, contentType);
	if (dominantColor != null) {
		edge.setProperty(BINARY_IMAGE_DOMINANT_COLOR_PROPERTY_KEY, dominantColor);
	}
	edge.setProperty(FIELD_KEY_PROPERTY_KEY, fieldKey);
	return null;
}
 
Example 5
Project: mesh   File: ChangeAddVersioning.java   Source Code and License Vote up 5 votes
/**
 * Migrate the basenode and create a new NodeGraphFieldContainer for it.
 * 
 * @param baseNode
 * @param admin
 */
private void migrateBaseNode(Vertex baseNode, Vertex admin) {

	log.info("Migrating basenode {" + baseNode.getProperty("uuid") + "}");
	Vertex schemaContainer = baseNode.getVertices(Direction.OUT, "HAS_SCHEMA_CONTAINER").iterator().next();
	Vertex schemaVersion = schemaContainer.getVertices(Direction.OUT, "HAS_LATEST_VERSION").iterator().next();

	Vertex english = findEnglish();
	Iterator<Edge> it = baseNode.getEdges(Direction.OUT, "HAS_FIELD_CONTAINER").iterator();

	// The base node has no field containers. Lets create the default one
	if (!it.hasNext()) {
		Vertex container = getGraph().addVertex("class:NodeGraphFieldContainerImpl");
		container.setProperty("ferma_type", "NodeGraphFieldContainerImpl");
		container.setProperty("uuid", randomUUID());

		// Fields
		container.setProperty("name-field", "name");
		container.setProperty("name-string", "");

		// field container edge which will later be migrated
		Edge edge = baseNode.addEdge("HAS_FIELD_CONTAINER", container);
		edge.setProperty("ferma_type", "GraphFieldContainerEdgeImpl");
		edge.setProperty("languageTag", "en");
		container.addEdge("HAS_SCHEMA_CONTAINER_VERSION", schemaVersion);
		container.addEdge("HAS_LANGUAGE", english);
	}

}
 
Example 6
Project: mesh   File: ChangeTVCMigration.java   Source Code and License Vote up 5 votes
private void migrateFermaTypes() {

		int i = 0;
		log.info("Migrating vertices");
		for (Vertex vertex : getGraph().getVertices()) {
			String type = vertex.getProperty("ferma_type");
			if (type != null && type.endsWith("TagGraphFieldContainerImpl")) {
				vertex.setProperty("ferma_type", "com.gentics.mesh.core.data.container.impl.TagGraphFieldContainerImpl");
				i++;
			}

			if (type != null && type.endsWith("SchemaContainerImpl")) {
				vertex.setProperty("ferma_type", "com.gentics.mesh.core.data.schema.impl.SchemaContainerImpl");
				i++;
			}

			if (type != null && type.endsWith("NodeGraphFieldContainerImpl")) {
				vertex.setProperty("ferma_type", "com.gentics.mesh.core.data.container.impl.NodeGraphFieldContainerImpl");
				i++;
			}

		}
		log.info("Completed migration of " + i + " vertices.");

		log.info("Migrating edges");
		i = 0;
		for (Edge edge : getGraph().getEdges()) {
			if ("com.gentics.mesh.core.data.node.field.impl.nesting.NodeGraphFieldImpl".equals(edge.getProperty("ferma_type"))) {
				edge.setProperty("ferma_type", "com.gentics.mesh.core.data.node.field.impl.NodeGraphFieldImpl");
				i++;
			}
		}
		log.info("Completed migration of " + i + " edges.");

	}
 
Example 7
Project: bjoern   File: EdgeProcessor.java   Source Code and License Vote up 5 votes
@Override
protected void processRow(String[] row)
{
	if (row.length < 3)
		return;

	String srcId = row[0];
	String dstId = row[1];
	String label = row[2];

	Graph graph = importer.getGraph();

	Vertex outVertex = lookupVertex(srcId, graph);
	Vertex inVertex = lookupVertex(dstId, graph);

	if (outVertex == null)
	{
		logger.info("Cannot resolve source node {} for {} -> {}", srcId,
				srcId, dstId);
		return;
	}

	if (inVertex == null)
	{
		logger.info("Cannot resolve destination node {} for {} -> {}",
				dstId, srcId, dstId);
		return;
	}

	Edge edge = graph.addEdge(0, outVertex, inVertex, label);

	for (int i = 3; i < row.length; i++)
	{
		edge.setProperty(importer.getEdgeKeys()[i], row[i]);
	}
}
 
Example 8
Project: hybridbpm   File: DashboardAPI.java   Source Code and License Vote up 5 votes
public void savePermission(Object id, Permission permission) {
    try (OObjectDatabaseTx database = getOObjectDatabaseTx()) {
        if (permission.getId() == null) {
            Vertex doc = getOrientGraph().getVertex(id);
            Vertex role = getOrientGraph().getVertex(permission.getOut().getId());
            Edge perm = getOrientGraph().addEdge("class:Permission", role, doc, null);
            perm.setProperty("permissions", permission.getPermissions());
        } else {
            getOrientGraph().getEdge(permission.getId()).setProperty("permissions", permission.getPermissions());
        }
    }
}
 
Example 9
Project: hybridbpm   File: InternalAPI.java   Source Code and License Vote up 5 votes
private void inheritPermissions(ODocument parent, ODocument doc) {
    Vertex parentV = getOrientGraph().getVertex(parent.getIdentity());
    Vertex docV = getOrientGraph().getVertex(doc.getIdentity());
    Iterable<Edge> permissions = parentV.getEdges(Direction.IN, "Permission");
    for (Edge permission : permissions) {
        Vertex role = permission.getVertex(Direction.OUT);
        Edge perm = getOrientGraph().addEdge("class:Permission", role, docV, null);
        perm.setProperty("permissions", permission.getProperty("permissions"));
    }
}
 
Example 10
Project: hybridbpm   File: DevelopmentAPI.java   Source Code and License Vote up 5 votes
private Module saveProcessModule(Module module) {
    ProcessModel processModel;
    if (module.getModel() == null) {
        processModel = ProcessModel.createDefault();
        processModel.setName(module.getName());
        processModel.setTitle(module.getTitle());
        module.setModel(HybridbpmCoreUtil.objectToJson(processModel));
    } else {
        processModel = HybridbpmCoreUtil.jsonToObject(module.getModel(), ProcessModel.class);
    }
    try (OObjectDatabaseTx database = getOObjectDatabaseTx()) {
        module.setUpdateDate(new Date());
        module = database.save(module);

        database.command(new OCommandSQL("DELETE EDGE Permission WHERE in = " + module.getId())).execute();

        Vertex pv = getOrientGraph().getVertex(module.getId());
        List<Permission.PERMISSION> permissions = new ArrayList<>();
        for (Permission.PERMISSION permission : Permission.PERMISSION.getPermissionsForClass(Module.class)) {
            permissions.add(permission);
        }

        for (TaskModel taskModel : processModel.getStartTaskModels().values()) {
            if (taskModel.getRole() != null && !taskModel.getRole().isEmpty()) {
                Vertex role = getOrientGraph().getVertex(getRole(taskModel.getRole()).getId());
                Edge perm = getOrientGraph().addEdge("class:Permission", role, pv, null);
                perm.setProperty("permissions", permissions);
                perm.setProperty("parameter", taskModel.getName());
            }
        }

        database.commit();
        module = detach(module);
        return module;
    }
}
 
Example 11
Project: hybridbpm   File: DocumentAPI.java   Source Code and License Vote up 5 votes
public void saveDocumentPermission(Document document, Permission permission) {
    try (OObjectDatabaseTx database = getOObjectDatabaseTx()) {
        if (permission.getId() == null) {
            Vertex doc = getOrientGraph().getVertex(document.getId());
            Vertex role = getOrientGraph().getVertex(permission.getOut().getId());
            Edge perm = getOrientGraph().addEdge("class:Permission", role, doc, null);
            perm.setProperty("permissions", permission.getPermissions());
        } else {
            getOrientGraph().getEdge(permission.getId()).setProperty("permissions", permission.getPermissions());
        }
    }
}
 
Example 12
Project: hybridbpm   File: DocumentAPI.java   Source Code and License Vote up 5 votes
private void inheritPermissions(ODocument parent, ODocument doc) {
    Vertex parentV = getOrientGraph().getVertex(parent.getIdentity());
    Vertex docV = getOrientGraph().getVertex(doc.getIdentity());
    Iterable<Edge> permissions = parentV.getEdges(Direction.IN, "Permission");
    for (Edge permission : permissions) {
        Vertex role = permission.getVertex(Direction.OUT);
        Edge perm = getOrientGraph().addEdge("class:Permission", role, docV, null);
        perm.setProperty("permissions", permission.getProperty("permissions"));
    }
}
 
Example 13
Project: hybridbpm   File: DocumentAPI.java   Source Code and License Vote up 5 votes
private void defaultPermissions(ODocument doc) {
    List<Permission.PERMISSION> permissions = new ArrayList<>();
    for (Permission.PERMISSION permission : Permission.PERMISSION.getPermissionsForClass(Document.class)) {
        permissions.add(permission);
    }
    Vertex role = getOrientGraph().getVertex(getRole(Role.ADMINISTRATOR).getId());
    Vertex docV = getOrientGraph().getVertex(doc.getIdentity());
    Edge perm = getOrientGraph().addEdge("class:Permission", role, docV, null);
    perm.setProperty("permissions", permissions);
}
 
Example 14
Project: riscoss-corporate   File: GDomDB.java   Source Code and License Vote up 5 votes
void createEdge( NodeID idFrom, NodeID idTo, String className, String linkName ) {
	Vertex from = graph.getVertex( idFrom );
	Vertex to = graph.getVertex( idTo );
	Edge e = graph.addEdge( null, from, to, className );
	if( linkName != null )
		e.setProperty( "name", linkName );
	graph.commit();
}
 
Example 15
Project: titan0.5.4-hbase1.1.1-custom   File: TitanGraphTest.java   Source Code and License Vote up 5 votes
@Category({ BrittleTests.class })
@Test
public void testEdgeTTLWithVertexCentricIndex() throws Exception {
    if (!features.hasCellTTL()) {
        return;
    }

    int ttl = 1; // artificially low TTL for test
    final PropertyKey time = mgmt.makePropertyKey("time").dataType(Integer.class).make();
    EdgeLabel wavedAt = mgmt.makeEdgeLabel("wavedAt").signature(time).make();
    mgmt.buildEdgeIndex(wavedAt, "timeindex", Direction.BOTH, Order.DESC, time);
    mgmt.setTTL(wavedAt, ttl, TimeUnit.SECONDS);
    assertEquals(0, mgmt.getTTL(time).getLength(TimeUnit.SECONDS));
    assertEquals(ttl, mgmt.getTTL(wavedAt).getLength(TimeUnit.SECONDS));
    mgmt.commit();

    Vertex v1 = graph.addVertex(null), v2 = graph.addVertex(null);
    Edge e1 = graph.addEdge(null, v1, v2, "wavedAt");
    e1.setProperty("time", 42);

    assertTrue(v1.getEdges(Direction.OUT).iterator().hasNext());
    assertTrue(v1.query().direction(Direction.OUT).interval("time", 0, 100).edges().iterator().hasNext());

    graph.commit();
    long commitTime = System.currentTimeMillis();

    assertTrue(v1.getEdges(Direction.OUT).iterator().hasNext());
    assertTrue(v1.query().direction(Direction.OUT).interval("time", 0, 100).edges().iterator().hasNext());

    Thread.sleep(commitTime + (ttl * 1000L + 100) - System.currentTimeMillis());
    graph.rollback();

    assertFalse(v1.getEdges(Direction.OUT).iterator().hasNext());
    assertFalse(v1.query().direction(Direction.OUT).interval("time", 0, 100).edges().iterator().hasNext());
}
 
Example 16
Project: titan0.5.4-hbase1.1.1-custom   File: TitanGraphTest.java   Source Code and License Vote up 5 votes
@Test
public void testEdgeTTLWithCompositeIndex() throws Exception {
    if (!features.hasCellTTL()) {
        return;
    }

    PropertyKey edgeName = mgmt.makePropertyKey("edge-name").dataType(String.class).make();
    mgmt.buildIndex("edge-name", Edge.class).addKey(edgeName).buildCompositeIndex();
    EdgeLabel label = mgmt.makeEdgeLabel("likes").make();
    mgmt.setTTL(label, 1, TimeUnit.SECONDS);
    assertEquals(0, mgmt.getTTL(edgeName).getLength(TimeUnit.SECONDS));
    assertEquals(1, mgmt.getTTL(label).getLength(TimeUnit.SECONDS));
    mgmt.commit();

    Vertex v1 = graph.addVertex(null), v2 = graph.addVertex(null);

    Edge e = graph.addEdge(null, v1, v2, "likes");
    e.setProperty("edge-name", "v1-likes-v2");

    graph.commit();

    assertTrue(v1.getEdges(Direction.OUT).iterator().hasNext());
    assertTrue(graph.getEdges("edge-name", "v1-likes-v2").iterator().hasNext());

    Thread.sleep(1001);

    graph.rollback();

    // the edge is gone not only from its previous endpoints, but also from key indices
    assertFalse(graph.getEdges("edge-name", "v1-likes-v2").iterator().hasNext());
    assertFalse(v1.getEdges(Direction.OUT).iterator().hasNext());
}
 
Example 17
Project: titan0.5.4-hbase1.1.1-custom   File: GraphGenerator.java   Source Code and License Vote up 5 votes
/**
 * Generate a scale-free graph using parameters specified in the
 * {@link Schema} object provided to this instance's constructor. The types
 * must already exist. The types can be created by either calling
 * {@link #generateTypesAndData(TitanGraph)} instead of this method or by
 * calling {@link Schema#makeTypes(TitanGraph)} before calling this method.
 *
 * @param g A graph with types predefined. If it already contains vertices
 *          or relations, they may be overwritten.
 */
public void generateData(TitanGraph g) {

    // Generate vertices
    for (long i = uidCounter; i < schema.getVertexCount() + INITIAL_VERTEX_UID - 1; i++) {
        Vertex v = g.addVertex(i);
        // DistributionGenerator doesn't currently support VertexAnnotator
        vertexAnnotator.annotate(v, null);
    }

    // Generate edges
    for (int i = 0; i < schema.getEdgeLabels(); i++) {
        DistributionGenerator gen = new DistributionGenerator(schema.getEdgeLabelName(i), edgeAnnotator);
        gen.setOutDistribution(new PowerLawDistribution(GAMMA));
        gen.setInDistribution(new PowerLawDistribution(GAMMA));
        gen.generate(g, schema.getEdgeCount());
    }

    g.commit();

    TitanTransaction tx = g.newTransaction();
    // Add a vertex that has an out edge to every other vertex
    Vertex hiOutDeg = tx.addVertex(Schema.SUPERNODE_UID);
    String label = schema.getSupernodeOutLabel();
    PropertyKey uidKey = tx.getPropertyKey(Schema.UID_PROP);
    hiOutDeg.setProperty(Schema.UID_PROP, Schema.SUPERNODE_UID);
    String pKey = schema.getSortKeyForLabel(label);
    for (long i = INITIAL_VERTEX_UID; i < schema.getVertexCount(); i++) {
        Vertex in = Iterables.getOnlyElement(tx.getVertices(uidKey, i));
        Edge e = hiOutDeg.addEdge(label, in);
        e.setProperty(pKey, (int) i);
    }

    tx.commit();
}
 
Example 18
Project: titan0.5.4-hbase1.1.1-custom   File: TitanGraphTest.java   Source Code and License Vote up 4 votes
@Test
public void testCreateDelete() {
    makeKey("weight",Double.class);
    PropertyKey id = makeVertexIndexedUniqueKey("uid",Integer.class);
    ((StandardEdgeLabelMaker)mgmt.makeEdgeLabel("knows")).sortKey(id).sortOrder(Order.DESC).directed().make();
    mgmt.makeEdgeLabel("father").multiplicity(Multiplicity.MANY2ONE).make();
    finishSchema();

    id = tx.getPropertyKey("uid");
    TitanVertex n1 = graph.addVertex(null), n3 = graph.addVertex(null);
    TitanEdge e = n3.addEdge("knows", n1);
    Edge e2 = n1.addEdge("friend",n3);
    e.setProperty(id, 111);
    n3.addProperty(id, 445);
    assertEquals(111, e.getProperty(id));
    graph.commit();

    n3 = graph.getVertex(n3.getLongId());
    assertEquals(445, n3.getProperty("uid"));
    e = (TitanEdge) Iterables.getOnlyElement(n3.getEdges(OUT, "knows"));
    assertEquals(111, e.getProperty("uid"));
    assertEquals(e, graph.getEdge(e.getId()));
    assertEquals(e, graph.getEdge(e.getId().toString()));
    TitanProperty p = Iterables.getOnlyElement(n3.getProperties("uid"));
    p.remove();
    n3.addProperty("uid", 353);

    e = (TitanEdge)Iterables.getOnlyElement(n3.getEdges(Direction.OUT,"knows"));
    e.setProperty(id,222);

    e2 = Iterables.getOnlyElement(n1.getEdges(OUT,"friend"));
    e2.setProperty("uid", 1);
    e2.setProperty("weight", 2.0);

    assertEquals(1,e2.getProperty("uid"));
    assertEquals(2.0,e2.getProperty("weight"));


    clopen();

    n3 = graph.getVertex(n3.getLongId());
    assertEquals(353, n3.getProperty("uid"));

    e = (TitanEdge)Iterables.getOnlyElement(n3.getEdges(Direction.OUT,"knows"));
    assertEquals(222,e.getProperty(id));
}
 
Example 19
Project: titan0.5.4-hbase1.1.1-custom   File: TitanEventualGraphTest.java   Source Code and License Vote up 4 votes
/**
 * Tests that timestamped edges and properties can be updated
 */
@Test
public void testTimestampedUpdates() {
    clopen(option(GraphDatabaseConfiguration.STORE_META_TIMESTAMPS, "edgestore"), true,
            option(GraphDatabaseConfiguration.STORE_META_TTL, "edgestore"), true);
    final TimeUnit unit = TimeUnit.SECONDS;

    // Transaction 1: Init graph with two vertices, having set "name" and "age" properties
    TitanTransaction tx = graph.buildTransaction().setCommitTime(100, unit).start();
    TitanVertex v1 = tx.addVertex();
    TitanVertex v2 = tx.addVertex();
    TitanProperty p = v1.addProperty("name","xyz");
    p.setProperty("time",15);
    Edge e = v1.addEdge("related",v2);
    e.setProperty("time",25);
    tx.commit();


    tx = graph.buildTransaction().setCommitTime(200, unit).start();
    v1 = (TitanVertex)tx.getVertex(v1);
    assertNotNull(v1);
    p = Iterables.getOnlyElement(v1.getProperties("name"));
    e = Iterables.getOnlyElement(v1.getEdges(Direction.OUT, "related"));
    assertEquals(3, p.getPropertyKeys().size());
    assertEquals(3, p.getPropertyKeys().size());
    p.setProperty("time", 115);
    e.setProperty("time",125);
    tx.commit();

    tx = graph.buildTransaction().setCommitTime(300, unit).start();
    v1 = (TitanVertex)tx.getVertex(v1);
    assertNotNull(v1);
    p = Iterables.getOnlyElement(v1.getProperties("name"));
    e = Iterables.getOnlyElement(v1.getEdges(Direction.OUT, "related"));
    assertEquals(115,p.getProperty("time"));
    assertEquals(125, e.getProperty("time"));
    p.remove();
    e.remove();
    tx.commit();

}
 
Example 20
Project: molgraph   File: Psi25Handler.java   Source Code and License Vote up 4 votes
@Override
public void endElement(String uri, String localName, String element) throws SAXException
{
  if (!stack.removeLast().equals(element)) throw new RuntimeException("Unmatched element!");

  // if end of book element add to list
  if (Strs.equals(element, "entry"))
  {
    // clear out the record
    clearEntry();
  }
  else if (Strs.equals(element,"interactorList"))
  {
    System.out.println("Total interactors: " + actors.size());
  }
  else if (Strs.equals(element,"interactionList"))
  {
    System.out.println("Total interactions: " + interaction_counts);
  }
  else if (Strs.equals(element, "shortLabel"))
  {
    if      (matchStack("names", "interaction"))
    {
      interaction.setDescription(content.toString());
    }
    else if (matchStack("names", "interactor"))
    {
      actors.get(lastID).setProperty(NAME, content.toString());
    }
    else if (matchStack("names", "interactorType"))
    {
      actors.get(lastID).setProperty("Type", content.toString());
    }
    else if (matchStack("names", ORGANISM))
    {
      actors.get(lastID).setProperty(ORGANISM, content.toString());
    }
    else if (matchStack("names", "interactionType"))
    {
      interaction.setProperty("Type", content.toString());
    }
  }
  else if (Strs.equals(element, "interactorRef"))
  {
    participants.add(new Long(content.toString()));
  }
  else if (Strs.equals(element, "interaction"))
  {
    // done with this group of interactors
    if (Tools.isSet(participants))
    {
      Set<Integer> hashes = new HashSet<>();
      for (Long A : participants)
        for (Long B : participants)
        {
          if (A!=B && !Tools.isSet(hashes) || !hashes.contains(A.hashCode()+B.hashCode()))
          {
            Edge E = titan.addEdge(actors.get(A), actors.get(B), interaction.getDescription());
            E.setProperty("Type", interaction.getProperty("Type"));
            hashes.add(A.hashCode()+B.hashCode());
            if (++interaction_counts%5000==0) System.out.print(".");
          }
        }
      participants.clear();
    }
  }
  isParsing=false;
}