Package org.hobbit.utils.test
Class ModelComparisonHelper
java.lang.Object
org.hobbit.utils.test.ModelComparisonHelper
A simple utility class that helps comparing two models.
- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
ModelComparisonHelper
public ModelComparisonHelper()
-
-
Method Details
-
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
-