/** * Return all {@link ClassificationModel} instances that are attached to the given {@link FileModel} instance. */ public Iterable<ClassificationModel> getClassifications(FileModel model) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), ClassificationModel.class); }
/** * Return all {@link ClassificationModel} instances that are attached to the given {@link FileModel} instance. */ public Iterable<ClassificationModel> getClassifications(FileModel model) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), ClassificationModel.class); }
/** * Return all {@link ClassificationModel} instances that are attached to the given {@link FileModel} instance with a specific classification name. */ public Iterable<ClassificationModel> getClassificationByName(FileModel model, String classificationName) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); pipeline.has(ClassificationModel.CLASSIFICATION, classificationName); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), ClassificationModel.class); }
/** * Return all {@link ClassificationModel} instances that are attached to the given {@link FileModel} instance with a specific classification name. */ public Iterable<ClassificationModel> getClassificationByName(FileModel model, String classificationName) { GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(model.getElement()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); pipeline.has(ClassificationModel.CLASSIFICATION, classificationName); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), ClassificationModel.class); }
GraphTraversal<Vertex, Vertex> pipeline = this.getGraphContext().getGraph().traversal().V(); FileService fileService = new FileService(getGraphContext()); for (Vertex v : pipeline.toSet())
GraphTraversal<Vertex, Vertex> pipeline = this.getGraphContext().getGraph().traversal().V(); FileService fileService = new FileService(getGraphContext()); for (Vertex v : pipeline.toSet())
/** * Returns the total effort points in all of the {@link ClassificationModel}s associated with the provided {@link FileModel}. */ public int getMigrationEffortPoints(FileModel fileModel) { GraphTraversal<Vertex, Vertex> classificationPipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement()); classificationPipeline.in(ClassificationModel.FILE_MODEL); classificationPipeline.has(EffortReportModel.EFFORT, P.gt(0)); classificationPipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); int classificationEffort = 0; for (Vertex v : classificationPipeline.toList()) { Property<Integer> migrationEffort = v.property(ClassificationModel.EFFORT); if (migrationEffort.isPresent()) { classificationEffort += migrationEffort.value(); } } return classificationEffort; }
/** * Returns the total effort points in all of the {@link ClassificationModel}s associated with the provided {@link FileModel}. */ public int getMigrationEffortPoints(FileModel fileModel) { GraphTraversal<Vertex, Vertex> classificationPipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement()); classificationPipeline.in(ClassificationModel.FILE_MODEL); classificationPipeline.has(EffortReportModel.EFFORT, P.gt(0)); classificationPipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(ClassificationModel.TYPE)); int classificationEffort = 0; for (Vertex v : classificationPipeline.toList()) { Property<Integer> migrationEffort = v.property(ClassificationModel.EFFORT); if (migrationEffort.isPresent()) { classificationEffort += migrationEffort.value(); } } return classificationEffort; }