https://bintray.com/dama-upc/Babel-Platform/babel
Add the following snippet to the build.sbt
file:
resolvers += "maven" at "https://dl.bintray.com/dama-upc/Babel-Platform"
libraryDependencies += "edu.upc.dama" %% "babel" % "0.4.1"
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M11" cross CrossVersion.full)
import babel._
import java.time.LocalDate
@node class Actor(name: String,
gender: Option[String],
country: String,
birthDate: LocalDate)
import babel._
@node class Movie(director: String,
title: String,
releaseDate: LocalDate,
country: String,
budgetInUSDollars: Option[Double])
import babel._
import java.time.LocalDate
@edge
class Portrayed(characterName: String)
### Property generators definition
import babel._
object ActorBirthDateGenerator extends PropertyGenerator[LocalDate] {
override def run(id: Id,
r: (Id) => Long,
dependencies: Any*): LocalDate =
LocalDateGenerator.nextLocalDate(
hash = r(id),
min = NOW().minusYears(90),
max = NOW(),
distribution = Distribution.Uniform
)
}
For defining graph structure generators, we need to implement the following interface:
trait GraphStructureGenerator[T] {
val run(n: Long): T
val getNumberNodes(numberEdges: Long): Long
}