Use DISTINCT in trialdata queries
bug fix, refactor tripleService, update front-end id's