+
+ private JanusGraphQuery<? extends JanusGraphQuery> getJanusGraphQuery(final VertexTypeEnum type, final Map<GraphPropertyEnum, Object> hasProps,
+ final Map<GraphPropertyEnum, Object> hasNotProps,
+ final Map<String, Entry<JanusGraphPredicate, Object>> predicates,
+ final JanusGraph graph) {
+ JanusGraphQuery<? extends JanusGraphQuery> query = graph.query();
+
+ if (type != null) {
+ query = query.has(GraphPropertyEnum.LABEL.getProperty(), type.getName());
+ }
+ if (hasProps != null && !hasProps.isEmpty()) {
+ for (Entry<GraphPropertyEnum, Object> entry : hasProps.entrySet()) {
+ query = query.has(entry.getKey().getProperty(), entry.getValue());
+ }
+ }
+ if (hasNotProps != null && !hasNotProps.isEmpty()) {
+ for (Entry<GraphPropertyEnum, Object> entry : hasNotProps.entrySet()) {
+ if (entry.getValue() instanceof List) {
+ buildMultipleNegateQueryFromList(entry, query);
+ } else {
+ query = query.hasNot(entry.getKey().getProperty(), entry.getValue());
+ }
+ }
+ }
+ if (predicates != null && !predicates.isEmpty()) {
+ for (Entry<String, Entry<JanusGraphPredicate, Object>> entry : predicates.entrySet()) {
+ query = query.has(entry.getKey(), entry.getValue().getKey(), entry.getValue().getValue());
+ }
+ }
+ return query;
+ }