public static Graph applyMapping(Graph graph, Map mapping) {
SimpleGraph result = new SimpleGraph();
for (Iterator iter = graph.iterator(); iter.hasNext();) {
Triple triple = (Triple) iter.next();
Node subject = triple.getSubject();
PropertyNode predicate = triple.getPredicate();
Node object = triple.getObject();
if (!(subject instanceof GroundedNode)) {
subject = (Node) mapping.get(subject);
}
if (!(object instanceof GroundedNode)) {