我有一个用例,我需要在一个大房间内对人们的轨迹进行分类。
在性能和最佳 Neo4j 实践方面,如果我想对这些数据进行分类以便以后能够使用这些分类的任何类型组合进行搜索/获取,那么哪种选择会更好?
不同的分类是:
轨迹包含一组点(时间、x、y、motion_type),基本上可以告诉人去了哪里。一个点告诉您在给定时间该人在房间中的确切位置,以及他是在居住、行走还是跑步(这是运动类型)。
例如,获取年龄在 21 到 30 岁之间的女性、客户的所有轨迹
选项1:
// Here I get the set of trajectories that fall within a certain time range (:Trajectory(at) is indexed)
MATCH (trajectory:Trajectory)
WHERE datetime("2020-01-01T00:00:00.000000+13:00") <= trajectory.at < datetime("2020-01-11T00:00:00.000000+13:00")
// Once I have all the trajectories I start filtering by the different criteria
MATCH (trajectory)-[:GENDER]->(:Female)
MATCH (trajectory)-[:PERSON_TYPE]->(:Customer)
// AgeGroup could have quite a lot of groups depending on how accurate the data is. At this stage we …Run Code Online (Sandbox Code Playgroud) 我有以下代码:
@RequestMapping(value = "/test", method = RequestMethod.POST)
public void test(@RequestParam(required= false) String fromDate,
@RequestParam(required= false) String toDate) {
}
Run Code Online (Sandbox Code Playgroud)
“规则”是:
可以使用自定义 Spring 验证来做到这一点吗?
就像是...
@RequestParam(required = false)
@ValidateDependingOnAnotherField(field = "fromDate") String toDate
Run Code Online (Sandbox Code Playgroud)
谢谢!