Page MenuHomeSoftware Heritage
Paste P1300

(An Untitled Masterwork)
ActivePublic

Authored by seirl on Feb 23 2022, 4:32 PM.
class SwhGraphTinkerpopProvider extends WebGraphTinkerpopProvider {
@Override
public ImmutableGraph load() {
var graph = SwhBidirectionalImmutableGraph.loadLabelled(...);
graph.loadCommitAuthors(LoadMethod.MAPPED);
graph.loadMessages(LoadMethod.MAPPED);
return graph;
}
public Object getProperty(PropertyType p, long nodeId) {
var graph = (SwhBidirectionalImmutableGraph) this.getGraph();
switch (p) {
case COMMIT_AUTHOR:
return graph.getCommitAuthor(nodeId);
case COMMIT_MESSAGE:
return graph.getMessage(nodeId);
}
}
}