java.lang.Object
org.apache.jena.sparql.util.IsoMatcher
Simple isomorphism testing for on unordered collections.
This code is simple and slow.
For graphs, the Graph isomorphism code in Jena is much better (better tested, better performance)
This code can work on any tuples of nodes.
See
Iso
for isomorphism for ordered lists.
See IsoAlg
for the isomorphism algorithm.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isomorphic
(Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x1, Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x2) Collection of tuples isomorphismstatic boolean
isomorphic
(Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x1, Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x2, EqualityTest nodeTest) Collection of tuples isomorphism, with choice of when two nodes are "equal".static boolean
isomorphic
(org.apache.jena.graph.Graph g1, org.apache.jena.graph.Graph g2) Graph isomorphismstatic boolean
isomorphic
(DatasetGraph dsg1, DatasetGraph dsg2) Dataset isomorphismstatic List<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>>
tuplesQuads
(Iterator<Quad> iter) Helper - convert toList<Tuple<Node>>
-
Constructor Details
-
IsoMatcher
public IsoMatcher()
-
-
Method Details
-
isomorphic
public static boolean isomorphic(org.apache.jena.graph.Graph g1, org.apache.jena.graph.Graph g2) Graph isomorphism -
isomorphic
Dataset isomorphism -
isomorphic
public static boolean isomorphic(Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x1, Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x2) Collection of tuples isomorphism -
tuplesQuads
public static List<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> tuplesQuads(Iterator<Quad> iter) Helper - convert toList<Tuple<Node>>
-
isomorphic
public static boolean isomorphic(Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x1, Collection<org.apache.jena.atlas.lib.tuple.Tuple<org.apache.jena.graph.Node>> x2, EqualityTest nodeTest) Collection of tuples isomorphism, with choice of when two nodes are "equal". See alsoIsoAlg.isIsomorphic(Collection, Collection, org.apache.jena.sparql.util.Iso.Mappable, EqualityTest)
for isomorphisms testing for more than just blank nodes.
-