Search in sources :

Example 1 with NodeIsomorphismMap

use of org.apache.jena.sparql.util.NodeIsomorphismMap in project jena by apache.

the class UpdateCompare method isomorphic.

public static boolean isomorphic(UpdateRequest req1, UpdateRequest req2) {
    if (req1 == req2)
        return true;
    if (!req1.samePrologue(req2))
        return false;
    List<Update> updates1 = req1.getOperations();
    List<Update> updates2 = req2.getOperations();
    if (updates1.size() != updates2.size())
        return false;
    NodeIsomorphismMap isomap = new NodeIsomorphismMap();
    for (int i = 0; i < updates1.size(); i++) {
        Update upd1 = updates1.get(i);
        Update upd2 = updates2.get(i);
        if (!isomorphic(upd1, upd2, isomap))
            return false;
    }
    return true;
}
Also used : NodeIsomorphismMap(org.apache.jena.sparql.util.NodeIsomorphismMap) Update(org.apache.jena.update.Update)

Aggregations

NodeIsomorphismMap (org.apache.jena.sparql.util.NodeIsomorphismMap)1 Update (org.apache.jena.update.Update)1