Technology•November 24, 2013
Boutique Graph Data with Titan
cache.db-cache=true
cache.db-cache-size=0.5
cache.db-cache-time=0
// what products has the user liked in the last year?
// user preference
user.outE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).inV
// what users have liked the same products that the user liked within the last year?
// user similarity
user.outE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).inV
.inE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).outV()
.except([user])
// what products are liked by the users that like the same products as the user within the last year?
// product recommendation
user.outE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).inV.aggregate(x)
.inE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).outV
.except([user])[0.<1000]
.outE('reviewed').has('score',5f).has('time',T.gte,ONE_YEAR_AGO).inV
.except(x).groupCount(m)