I have successfully created the following graph:
trait VertexProperty
case class ShopperProperty(memberID: String) extends VertexProperty
case class BasketProperty(basketID: String, epochDate: Long) extends VertexProperty
val vertices: Seq[(VertexId, VertexProperty)] = Seq(
VertexId(1) -> ShopperProperty("shopper1"),
VertexId(2) -> BasketProperty("basket1", 1398900001),
VertexId(3) -> BasketProperty("basket2", 1390000000))
My question is, how do I filter on these vertex properties when they are case classes? For example, if I wanted to filter on the vertices which have the BasketProperty case class as their vertex property with Epoch date's that are greater than 1398900000, how would I do that?
I have been trying to use something like this:
vertices.filter{case (id,classthing) => classthing.BasketProperty.epoch > 1398900000}.count
But it is obviously incorrect as BasketProperty is not a member of classthing. However, I don't know how to proceed.