AtteanX-Store-LDF
view release on metacpan or search on metacpan
- Use Dist::Inkt packaging.
0.006 2016-02-04 LDF query planning
[ Bug Fixes ]
- Fix bugs so that variables can be passed to selecting methods.
[ Other ]
- Added: Lots of changes related to integrating LDF into query planning.
- endpoint_url attribute has been deprecated in favour of a start_url
attribute.
0.003 2015-08-17 changing count_triples into more accurate count_triples_estimate
0.002 2015-07-06 Setting minimum requirements for RDF::LinkedData test
0.001 2015-07-03 Initial release
demo/README view on Meta::CPAN
To create an LDF server change the test.json file to set up a correct path to a Turtle file,
then run:
$ ./boot.sh
A LDF endpoint should now be available at http://localhost:8000/fragments
$ curl -H "Accept: text/turtle" http://localhost:8000/fragments
dc:issued "2016-02-04"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Bugfix;
rdfs:label "Fix bugs so that variables can be passed to selecting methods.";
], [
a doap-changeset:Addition;
rdfs:label "Lots of changes related to integrating LDF into query planning.";
], [
a doap-changeset:Change;
rdfs:label "endpoint_url attribute has been deprecated in favour of a start_url attribute.";
];
doap-changeset:versus <http://purl.org/NET/cpan-uri/dist/AtteanX-Store-LDF/v_0-003>;
];
doap-changeset:released-by <http://purl.org/NET/cpan-uri/person/kjetilk>;
doap:file-release <http://backpan.cpan.org/authors/id/K/KJ/KJETILK/AtteanX-Store-LDF-0.006.tar.gz>;
doap:revision "0.006"^^xsd:string.
<http://purl.org/NET/cpan-uri/dist/AtteanX-Store-LDF/v_0-01>
a doap:Version;
rdfs:label "Dist::Inkt packaging";
lib/AtteanX/Query/AccessPlan/LDF.pm view on Meta::CPAN
around 'access_plans' => sub {
my $orig = shift;
my @params = @_;
my $self = shift;
my $model = shift;
my $active_graphs = shift;
my $pattern = shift;
# First, add any plans coming from the original planner (which will
# include queries to the remote SPARQL endpoint
my @plans = $orig->(@params);
# Add my plans
push(@plans, AtteanX::Plan::LDF::Triple->new(subject => $pattern->subject,
predicate => $pattern->predicate,
object => $pattern->object,
distinct => 0));
return @plans;
};
1;
lib/AtteanX/Store/LDF.pm view on Meta::CPAN
=item new( start_url => $start_url )
Returns a new LDF-backed storage object. The required C<start_url>
argument is a URL pointing at any Linked Data Fragment. The attribure
will be coerced, so it can be a string, a URI object, etc.
=cut
has start_url => (is => 'ro', isa => Uri, coerce => 1, required => 1);
has endpoint_url => (is => 'ro', lazy => 1, builder => '_croak_on_endpoint');
has ldf => (is => 'ro', lazy => 1, builder => '_ldf');
sub _croak_on_endpoint {
Carp::croak "endpoint_url has been deprecated, use start_url instead";
}
sub _ldf {
my $self = shift;
RDF::LDF->new(url => $self->start_url->as_string);
}
sub _term_as_string {
my ($self,$term) = @_;
if (!defined $term) {
lib/Test/Attean/Store/LDF/Role/CreateStore.pm view on Meta::CPAN
use Data::Dumper;
use namespace::clean;
our $AUTHORITY = 'cpan:KJETILK';
our $VERSION = '0.04';
sub create_store {
my $self = shift;
my %args = @_;
my $triples = $args{triples} // [];
my $model = RDF::Trine::Model->temporary_model; # For creating endpoint
foreach my $atteantriple (@{$triples}) {
my $s = iri($atteantriple->subject->value);
if ($atteantriple->subject->is_blank) {
$s = blank($atteantriple->subject->value);
}
my $p = iri($atteantriple->predicate->value);
my $o = iri($atteantriple->object->value);
if ($atteantriple->object->is_literal) {
# difference with RDF 1.0 vs RDF 1.1 datatype semantics
if ($atteantriple->object->datatype->value eq 'http://www.w3.org/2001/XMLSchema#string') {
lib/Test/Attean/Store/LDF/Role/CreateStore.pm view on Meta::CPAN
base_uri => 'http://example.org' ,
void_config => {
urispace => 'http://example.org/'
} ,
fragments_config => {
fragments_path => '/fragments' ,
allow_dump_dataset => 1,
} ,
);
my $endpoint = 'http://example.org/fragments';
my $useragent = Test::LWP::UserAgent->new;
$useragent->register_psgi('example.org', sub {
my $env = shift;
$ld->request(Plack::Request->new($env));
my $uri = $endpoint;
$uri .= sprintf "?%s" , $env->{QUERY_STRING} if length $env->{QUERY_STRING};
return $ld->response($uri)->finalize;
});
my $store = Attean->get_store('LDF')->new(start_url => $endpoint);
RDF::Trine->default_useragent($useragent);
return $store;
}
1;
=pod
( run in 1.513 second using v1.01-cache-2.11-cpan-49f99fa48dc )