---
name: "AtteanX::Store::SPARQL"
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/AtteanX::Store::SPARQL"
---

# AtteanX::Store::SPARQL(3pm)

Attean SPARQL store

## NAME

AtteanX::Store::SPARQL - Attean SPARQL store

## SYNOPSIS

```
  my $store = Attean->get_store('SPARQL')->new(endpoint_url => $url);
```

## DESCRIPTION

This implements a simple immutable triple store, which simply allows programmers to use Attean facilities to query remote SPARQL endpoints.

This distribution also brings a corresponding AtteanX::Model::SPARQL, which allows query plans to be made, and a AtteanX::Plan::SPARQLBGP plan class, which contains a rudimentary cost estimate that attempts to avoid sending Cartesian joins to remote endpoints if possible.

### Attributes and methods

- "endpoint\_url"

  The URL of a remote SPARQL endpoint. Will be coerced into a URI object, so it may be set as a string or whatever. Required attribute.

- "ua"

  An LWP::UserAgent object to use for remote queries. Will be set to a reasonable default if not supplied.

- "get\_triples"

  Method to query the remote endpoint, as required by Attean::API::TripleStore.

- "count\_triples"

  Reimplemented using an aggregate query for greater efficiency.

- "get\_sparql($sparql, \[ $ua \])"

  Will submit the given `$sparql` query to the above `"endpoint_url"` attribute. Optionally, you may pass an LWP::UserAgent, if not it will use the user agent set using the `"ua"` method. Will return an iterator with the results if the request is successful.

## BUGS

Please report any bugs to \<https://github.com/kjetilk/p5-atteanx-store-sparql/issues\>.

## ACKNOWLEDGEMENTS

This module is heavily influenced by RDF::Trine::Store::SPARQL.

## AUTHOR

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

## COPYRIGHT AND LICENCE

This software is copyright (c) 2015, 2016 by Kjetil Kjernsmo and Gregory Todd Williams.

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

## DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
