Package org.hobbit.utils.test
Class ModelComparisonHelper
- java.lang.Object
-
- org.hobbit.utils.test.ModelComparisonHelper
-
public class ModelComparisonHelper extends Object
A simple utility class that helps comparing two models.- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
-
Constructor Summary
Constructors Constructor Description ModelComparisonHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<org.apache.jena.rdf.model.Statement>getMissingStatements(org.apache.jena.rdf.model.Model modelA, org.apache.jena.rdf.model.Model modelB)Collects statements that can be found in model A but not in model B.static booleanmodelContainsStatement(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Statement s)Checks whether the given statement can be found in the given model.
-
-
-
Method Detail
-
getMissingStatements
public static Set<org.apache.jena.rdf.model.Statement> getMissingStatements(org.apache.jena.rdf.model.Model modelA, org.apache.jena.rdf.model.Model modelB)
Collects statements that can be found in model A but not in model B. If A and B are seen as sets of statements, this method returns the difference A\B.- Parameters:
modelA- the model that should be fully contained inside model B.modelB- the model that should fully contain model A.- Returns:
- the difference A\B which is empty if A is a subset of B
-
modelContainsStatement
public static boolean modelContainsStatement(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Statement s)Checks whether the given statement can be found in the given model. If the given statement contains blank nodes (= Anon nodes) they are replaced by variables.- Parameters:
model- the model that might contain the given statements- the statement which could be contained in the given model- Returns:
trueif the statement can be found in the model,falseotherwise
-
-