This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:site:recherche:logiciels:sparqlwithspark:utility [15/09/2016 15:42] hubert [Utilities] |
en:site:recherche:logiciels:sparqlwithspark:utility [16/09/2016 23:05] (current) hubert [Utilities] |
||
---|---|---|---|
Line 6: | Line 6: | ||
=== Data loading utilities=== | === Data loading utilities=== | ||
- | <code> | + | <code scala> |
// TIMER | // TIMER | ||
Line 73: | Line 73: | ||
=== QUERY utilities === | === QUERY utilities === | ||
- | <code> | + | <code scala> |
case class v(n:Int) | case class v(n:Int) | ||
Line 99: | Line 99: | ||
+ | // generate selection operator for each triple pattern | ||
def tpOperators(encodedQuery: List[(Any, Int, Any)], d: Map[Int, DataFrame]) = | def tpOperators(encodedQuery: List[(Any, Int, Any)], d: Map[Int, DataFrame]) = | ||
encodedQuery.map{ case(v(a), p, v(b))=> ( (v(a), p, v(b)), d(p).withColumnRenamed("o", s"v$b")) | encodedQuery.map{ case(v(a), p, v(b))=> ( (v(a), p, v(b)), d(p).withColumnRenamed("o", s"v$b")) |