eu.larkc.shared
Class RdfGraphUtils

java.lang.Object
  extended by eu.larkc.shared.RdfGraphUtils

public class RdfGraphUtils
extends java.lang.Object

Various utility methods used for testing the LarKC data layer.

Author:
Christoph Fuchs

Constructor Summary
RdfGraphUtils()
           
 
Method Summary
static void assertStatementsInGraph(SetOfStatements graph, int expectedCount)
          The implementor of the method does not know whether it's a value or reference graph.
static int getNumberOfStatementsViaSelectAll(DataFactory df, SetOfStatements graph)
          Retrieves the number of statements contained in the RDF graph graph as returned by SELECT * WHERE {?s ?p ?o} query.
static boolean isGraphContained(DataFactory df, SetOfStatements containedGraph, SetOfStatements largeGraph)
          Checks if containedGraph is contained in largeGraph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfGraphUtils

public RdfGraphUtils()
Method Detail

getNumberOfStatementsViaSelectAll

public static int getNumberOfStatementsViaSelectAll(DataFactory df,
                                                    SetOfStatements graph)
Retrieves the number of statements contained in the RDF graph graph as returned by SELECT * WHERE {?s ?p ?o} query.

Parameters:
df - the DataFactory which holds the RDF graph
graph - an RDF graph
Returns:
the number of statements contained in the RDF graph

isGraphContained

public static boolean isGraphContained(DataFactory df,
                                       SetOfStatements containedGraph,
                                       SetOfStatements largeGraph)
Checks if containedGraph is contained in largeGraph.

Parameters:
df - the DataFactory which holds the RDF graphs
containedGraph - an RDF graph
largeGraph - another RDF graph
Returns:
true if every statement in containedGraph can be found in largeGraph, false otherwise.

assertStatementsInGraph

public static void assertStatementsInGraph(SetOfStatements graph,
                                           int expectedCount)
The implementor of the method does not know whether it's a value or reference graph.

Parameters:
graph - the SetOfStatements describing the RDF graph
expectedCount - the expected number of triples in the RDF graph