|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.store.TripleStoreUtility
public class TripleStoreUtility
Utility class for comparing graphs for equality, bulk export, etc.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
TripleStoreUtility()
|
|
| Method Summary | |
|---|---|
static TempTripleStore |
bulkExport(AbstractTripleStore db)
Exports all statements found in the data and all backchained entailments for the db into a TempTripleStore. |
static void |
log(String s)
|
static void |
main(String[] args)
Compares two LocalTripleStores |
static boolean |
modelsEqual(AbstractTripleStore expected,
AbstractTripleStore actual)
Compares two RDF graphs for equality (same statements). |
static ICloseableIterator<BigdataStatement> |
notFoundInTarget(AbstractTripleStore expected,
AbstractTripleStore actual)
Visits expected BigdataStatements not found in actual. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
| Constructor Detail |
|---|
public TripleStoreUtility()
| Method Detail |
|---|
public static boolean modelsEqual(AbstractTripleStore expected,
AbstractTripleStore actual)
throws Exception
Note: This does NOT handle bnodes, which much be treated as variables for RDF semantics.
Note: Comparison is performed in terms of the externalized RDF
Statements rather than SPOs since different graphs use
different lexicons.
Note: If the graphs differ in which entailments they are storing in their
data and which entailments are backchained then you MUST make them
consistent in this regard. You can do this by exporting one or both using
bulkExport(AbstractTripleStore), which will cause all
entailments to be materialized in the returned TempTripleStore.
expected - One graph.actual - Another graph with a consistent policy for forward and
backchained entailments.
Exceptionpublic static void log(String s)
public static ICloseableIterator<BigdataStatement> notFoundInTarget(AbstractTripleStore expected,
AbstractTripleStore actual)
throws InterruptedException,
ExecutionException
BigdataStatements not found in actual.
expected - actual -
BigdataStatements present in
expected but not found in actual.
ExecutionException
InterruptedExceptionpublic static TempTripleStore bulkExport(AbstractTripleStore db)
TempTripleStore. This may be used to
compare graphs purely in their data by pre-generation of all backchained
entailments.
Note: This is not a general purpose bulk export as it uses only a single
access path, does not store justifications, and does retain the
Axioms model of the source graph. This method is specifically
designed to export "just the triples", e.g., for purposes of comparison.
db - The source database.
TempTripleStore.
public static void main(String[] args)
throws Exception
LocalTripleStores
args - filename filename (namespace)
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||