Adapters

We provide many adapters for external libraries that you can use in the verification process. The adapters for a particular framework are represented as submodules in our codebase so you will need to add them explicitly as dependencies.

Sesame

Sesame is one of the frameworks that we support out of the box. The integration allows you to verify Graph objects through graphviz.

  1. Ok so first you will need the dot binary otherwise our reporter will fail. Go to the Graphviz, download and install graphviz.
  2. Add the dependency in maven:
<dependencies>
    <dependency>
        <groupId>com.github.nikolavp</groupId>
        <artifactId>approval-sesame</artifactId>
        <version>${approval.version}</version>
    </dependency>
</dependencies>
  1. Now you will be able to approve graph objects with the following:
        Graph graph = new TreeModel();
        // populate our graph with statements(maybe from GraphQueryResult?

        // Note: this is still thread safe...
        Approval<Graph> graphApproval = Approval.of(Graph.class)
                .withConveter(new GraphConverter())
                .withReporter(GraphReporter.getInstance())
                .build();

        // Verify the graph, change the path accordingly
        graphApproval.verify(graph, Paths.get("graph-result.dot"));