| java.lang.Object org.openrdf.repository.util.RepositoryUtil
RepositoryUtil | public class RepositoryUtil (Code) | | Utility methods for comparing sets of statements (graphs) with each other.
The supplied comparison operations map bnodes in the two supplied models on
to each other and thus define a graph isomorphism.
author: jeen author: Arjohn Kampman |
Method Summary | |
public static Collection<? extends Statement> | difference(Repository rep1, Repository rep2) Compares two models defined by the default context of two repositories and
returns the difference between the first and the second model (that is,
all statements that are present in rep1 but not in rep2). | public static Collection<? extends Statement> | difference(Collection<? extends Statement> model1, Collection<? extends Statement> model2) Compares two models, defined by two statement collections, and returns the
difference between the first and the second model (that is, all statements
that are present in model1 but not in model2). | public static boolean | equals(Repository rep1, Repository rep2) Compares the models in the default contexts of the two supplied
repositories and returns true if they are equal. | public static boolean | isSubset(Repository rep1, Repository rep2) Compares the models of the default context of two repositories and returns
true if rep1 is a subset of rep2. |
difference | public static Collection<? extends Statement> difference(Repository rep1, Repository rep2) throws RepositoryException(Code) | | Compares two models defined by the default context of two repositories and
returns the difference between the first and the second model (that is,
all statements that are present in rep1 but not in rep2). Blank node IDs
are not relevant for model equality, they are mapped from one model to the
other by using the attached properties. Note that the method pulls the
entire default context of both repositories into main memory. Use with
caution.
NOTE: this algorithm is currently broken; it doesn't actually map blank
nodes between the two models.
The collection of statements that is the difference between rep1and rep2. |
difference | public static Collection<? extends Statement> difference(Collection<? extends Statement> model1, Collection<? extends Statement> model2)(Code) | | Compares two models, defined by two statement collections, and returns the
difference between the first and the second model (that is, all statements
that are present in model1 but not in model2). Blank node IDs are not
relevant for model equality, they are mapped from one model to the other
by using the attached properties. *
NOTE: this algorithm is currently broken; it doesn't actually map blank
nodes between the two models.
The collection of statements that is the difference between model1and model2. |
equals | public static boolean equals(Repository rep1, Repository rep2) throws RepositoryException(Code) | | Compares the models in the default contexts of the two supplied
repositories and returns true if they are equal. Models are equal if they
contain the same set of statements. bNodes IDs are not relevant for model
equality, they are mapped from one model to the other by using the
attached properties. Note that the method pulls the entire default context
of both repositories into main memory. Use with caution.
|
isSubset | public static boolean isSubset(Repository rep1, Repository rep2) throws RepositoryException(Code) | | Compares the models of the default context of two repositories and returns
true if rep1 is a subset of rep2. Note that the method pulls the entire
default context of both repositories into main memory. Use with caution.
|
|
|