use of de.catma.repository.git.graph.NodeType.SourceDocument in project catma by forTEXT.
the class TPGraphProjectHandler method removeTagReferences.
@Override
public void removeTagReferences(String rootRevisionHash, AnnotationCollection collection, List<TagReference> tagReferences) throws Exception {
logger.info("Removing " + tagReferences.size() + " references, graph size: " + graph);
Set<String> tagInstanceIds = tagReferences.stream().map(tr -> tr.getTagInstanceId()).collect(Collectors.toSet());
GraphTraversalSource g = graph.traversal();
g.V().has(nt(ProjectRevision), "revisionHash", rootRevisionHash).outE(rt(hasDocument)).inV().has(nt(SourceDocument), "documentId", collection.getSourceDocumentId()).outE(rt(hasCollection)).inV().has(nt(MarkupCollection), "collectionId", collection.getId()).outE(rt(hasInstance)).inV().has(nt(TagInstance), "tagInstanceId", P.within(tagInstanceIds)).store("instances").outE(rt(hasProperty)).inV().drop().cap("instances").unfold().drop().iterate();
logger.info("Finished removing " + tagReferences.size() + " references, graph size: " + graph);
}
Aggregations