compiler optimizations
ensime
the WWW (hypertexts)
pipe network analysis
circuit theory
language models
gene interactions
just as you would draw it
SELECT pizza.name
FROM
Person as person
JOIN Likes as likes ON person.id = likes.person
JOIN Pizza as pizza ON likes.pizza = pizza.id AND
WHERE person.id = 10
graph.V(10).out("likes")
val graph = TinkerGraph.open.asScala
// typed keys
val Founded = Key[String]("founded")
val Distance = Key[Int]("distance")
// two vertices
val paris = graph + "Paris"
val london = graph + ("London", Founded → "43 AD")
// some edges
paris --- "OneWayRoad" --> london
paris <-- "OtherWayAround" --- london
paris <-- "Eurostar" --> london
paris --- ("Eurostar", Distance → 495) --> london
paris.out("Eurostar").value(Founded).head //43 AD : String
paris.outE("Eurostar").value(Distance).head //495 : Int
graph.V.outE.inV //compiles
graph.V.outE.outE //does _not_ compile
paris.as("x")
.outE("Eurostar").as("y")
.value(Distance).as("z")
.select
// returns `(Vertex, Edge, Int)` for each path
for {
person <- graph.V.hasLabel("person")
favorite <- person.outE("likes")
.orderBy("weight", Order.decr)
.limit(1)
.inV
} yield (person, favorite.label)
// returns (Vertex, String)
@label("example")
case class Example(@id id: Option[Int],
longValue: Long,
stringValue: Option[String])
val example = Example(None, Long.MaxValue, Some("optional value"))
val v: Vertex = graph + example
v.toCC[Example] // equal to `example`, but with id set
graph.V.hasLabel[Example]
kudos to ryanmart - I stole some of his slides