Skip to content

Instantly share code, notes, and snippets.

View okram's full-sized avatar
🏠
Working from home

Marko A. Rodriguez okram

🏠
Working from home
View GitHub Profile
package com.tinkerpop.gremlin.scala.transform
import com.tinkerpop.blueprints.pgm.Vertex
import com.tinkerpop.blueprints.pgm.impls.tg.TinkerGraphFactory
import com.tinkerpop.gremlin.test.UtilitiesTest
import com.tinkerpop.gremlin.scala._
import com.tinkerpop.pipes.branch.LoopPipe.LoopBundle
class PathStepTest extends com.tinkerpop.gremlin.test.transform.PathStepTest {
val g = TinkerGraphFactory.createTinkerGraph()
package com.cisco.hmp.graph.gui;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Graph;
import com.tinkerpop.blueprints.pgm.Vertex;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
package com.cisco.hmp.graph.gui;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Graph;
import com.tinkerpop.blueprints.pgm.impls.tg.TinkerGraphFactory;
import junit.framework.TestCase;
import java.util.Arrays;
/**
AuditGraph graph = new AuditGraph(new Neo4jGraph("/tmp/hmp")); // realize that you can do the graph stacking as in: new SchemaGraph(new AuditGraph(new Neo4jGraph("/tmp/hmp"))
graph.setUser("bim"); // this name is recorded with a representation (i.e. who created this representation?)
graph.inThePresentMoment(true); // our perspective is startTime:System.currentTimeMillis() and endTime:startTime+1
Vertex marko = graph.addVertex(null);
Vertex sumit = graph.addVertex(null);
graph.addEdge(null, marko, sumit, "knows");
assertTrue(count(graph.getVertices()) == 2)
public class ReadOnlyVertex extends ReadOnlyElement implements Vertex {
public ReadOnlyVertex(final Vertex rawVertex) {
super(rawVertex);
}
public Iterable<Edge> getInEdges(final String... labels) {
return new ReadOnlyEdgeIterable(((Vertex) this.rawElement).getInEdges(labels));
}
package com.tinkerpop.gremlin.pipes.filter;
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.pipes.AbstractPipe;
import com.tinkerpop.pipes.filter.FilterPipe;
import com.tinkerpop.pipes.util.PipeHelper;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
package com.tinkerpop.blueprints;
/**
* A vertex maintains pointers to both a set of incoming and outgoing edges.
* The outgoing edges are those edges for which the vertex is the tail.
* The incoming edges are those edges for which the vertex is the head.
* Diagrammatically, ---inEdges---> vertex ---outEdges--->.
*
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Matthias Brocheler (http://matthiasb.com)
package com.tinkerpop.blueprints.impls.tg;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Query;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.util.DefaultQuery;
import com.tinkerpop.blueprints.util.MultiIterable;
import com.tinkerpop.blueprints.util.StringFactory;
import com.tinkerpop.blueprints.util.VerticesFromEdgesIterable;
package com.tinkerpop.blueprints.util;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import java.util.Iterator;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
/**
* A CloseableIterable which wraps a simple iterator.
*
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class IteratorCloseableIterable<T> implements CloseableIterable<T> {
private final Iterator<T> iterator;
public IteratorCloseableIterable(Iterator<T> iterator) {
this.iterator = iterator;