public class TripleStoreUtility extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
TripleStoreUtility() |
Modifier and Type | Method and Description |
---|---|
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
LocalTripleStore s |
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
BigdataStatement s not found in actual. |
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
Statement
s rather than SPO
s 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.Exception
public static void log(String s)
public static ICloseableIterator<BigdataStatement> notFoundInTarget(AbstractTripleStore expected, AbstractTripleStore actual) throws InterruptedException, ExecutionException
BigdataStatement
s not found in actual.expected
- actual
- BigdataStatement
s present in
expected but not found in actual.ExecutionException
InterruptedException
public 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
LocalTripleStore
sargs
- filename filename (namespace)Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.