---
name: "Test::Attean::Store::SPARQL::Role::CreateStore"
section: "3pm"
platform: "linux"
package: "libatteanx-store-sparql-perl"
version: "0.012-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::Attean::Store::SPARQL::Role::CreateStore"
---

# Test::Attean::Store::SPARQL::Role::CreateStore(3pm)

Create a SPARQL store for tests

## NAME

Test::Attean::Store::SPARQL::Role::CreateStore - Create a SPARQL store for tests

## SYNOPSIS

Either:

```
  use Test::More;
  use Test::Roo;
  with 'Test::Attean::TripleStore', 'Test::Attean::Store::SPARQL::Role::CreateStore';
  run_me;
  done_testing;
```

or:

```
  package TestCreateStore {
        use Moo;
        with 'Test::Attean::Store::SPARQL::Role::CreateStore';
  };
  my $triples = [
                                   triple(iri('http://example.org/bar'), iri('http://example.org/c'), iri('http://example.org/foo')),
               # [...]
                                  ];
  my $test = TestCreateStore->new;
  my $store = $test->create_store(triples => $triples);
```

## DESCRIPTION

There are two ways of using this. The original idea is to use it to test a triple/quad that uses Test::Attean::TripleStore, like in the first example in the synopsis.

It is also possible to utilize this role like in the second example to create a store for testing other parts of the code too. In that example, first wrap a class around the role, then create an arrayref of triples, which should be used to populate the store. Then, instantiate an object of the class, and call it's `"create_store"` method with the triples. Now, you have a proper store that can be used in tests.

## AUTHOR

Kjetil Kjernsmo \<kjetilk@cpan.org\>.

## COPYRIGHT AND LICENCE

This software is copyright (c) 2015, 2016 by Kjetil Kjernsmo.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
