in';
with 'HPC::Runner::Command::execute_job::Utils::Plugin';
with 'HPC::Runner::Command::Logger::JSON';
with 'HPC::Runner::Command::Utils::Base';
with 'HPC::Runner::Command::Utils::Log';
with 'BioSAI
Runner::Command::submit_jobs::Utils::Scheduler';
with 'HPC::Runner::Command::submit_jobs::Logger::JSON';
command_short_description 'Submit jobs to the HPC system';
command_long_description 'This job
$self->parse_file_slurm;
$self->create_json_submission;
$self->app_log->info('Submitting jobs');
$self->iterate_schedule;
$self->update_json_submission;
$self->app_log->info('Your
<Group::Git> tag repositories containing Node files by
looking to see if they contain a I<package.json> in the root of the repository.
=head1 INSTALLATION
To install this module, run the following c
=> '');
my $user = 'pavelsr@cpan.org'; # full gmail
$gapi->auth_storage->setup({type => 'jsonfile', path => '/path' }); # by default
# $gapi->auth_storage->setup({ type => 'dbi', path =>
api->do_autorefresh(1);
my $r1 = $gapi->Calendar->Events->list({ calendarId => 'primary' })->json;
warn scalar @{$r1->{items}};
To create authorization file with tokens in current folder run
fferent app credentials (client_id, client_secret, users access_token && refresh_token) storage - json file, DBI, MongoDB (u can add your own even)
=item Automatic access_token refresh (if user has r
mper;
use Config::JSON;
use Tie::File;
use Crypt::JWT qw(decode_jwt);
use feature 'say';
use Mojo::Util 'getopt';
use Mojolicious::Plugin::OAuth2;
# use Mojo::JWT;
# sub return_json_filename {
# u
iles = readdir $dir;
# my @j = grep { $_ =~ /\w+.json/ } @files;
# return $j[0];
# }
# my $f = return_json_filename();
my $config = Config::JSON->new( $ENV{'GOAUTH_TOKENSFILE'} );
delete $ENV{'G
c->ua->post(
'https://www.googleapis.com/oauth2/v4/token' => form => $hash )
->res->json;
return $tokens;
};
helper get_email => sub {
my ( $c, $access_token ) = @_;
my %h
)
{
$tx = $self->ua->build_tx(
uc $http_method => $path => $headers => json => $optional_data );
}
elsif (
(
( lc $http_method eq 'post' )
# warn $response->json->{error}{message}; # Invalid Credentials
# warn $response->code; # 401
# warn $response->is_error; # 1
# my $res = $self->ua->start($tx)->res->json; # Mojo::Messag
post(
'https://www.googleapis.com/oauth2/v4/token' => form => $credentials )
->res->json; # tokens
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Moo::Google::Client - User Agent
>{version}
. '/rest' )->result->json;
}
sub discover_all {
shift->ua->get('https://www.googleapis.com/discovery/v1/apis')
->result->json;
}
sub availableAPIs {
my $self = s
hods to fetch tokens from different types of data sources. Default is jsonfile
use Moo;
use Moo::Google::AuthStorage::ConfigJSON;
use Moo::Google::AuthStorage::DBI;
use Moo::Google::AuthStorage::Mon
::AuthStorage::ConfigJSON->new } )
; # by default
has 'is_set' => ( is => 'rw', default => 0 );
sub setup {
my ( $self, $params ) = @_;
if ( $params->{type} eq 'jsonfile' ) {
$s
;
$self->is_set(1);
}
else {
die "Unknown storage type. Allowed types are jsonfile, dbi and mongo";
}
}
sub file_exists {
my ( $self, $filename ) = @_;
if ( -e $f
:Iterator::JSONHandler
# -----------------------------------------------------------------------------
=head1 NAME
RDF::Trine::Iterator::JSONHandler - JSON Handler for parsing SPARQL JSON Results fo
rmat
=head1 VERSION
This document describes RDF::Trine::Iterator::JSONHandler version 1.019
=head1 STATUS
This module's API and functionality should be considered unstable.
In the future, this mod
e::Iterator::JSONHandler;
my $handler = RDF::Trine::Iterator::JSONHandler->new();
my $iter = $handler->parse( $json );
=head1 METHODS
=over 4
=cut
package RDF::Trine::Iterator::JSONHandler;
use
cut
package RDF::Trine::Iterator::Graph;
use strict;
use warnings;
no warnings 'redefine';
use JSON;
use List::Util qw(max);
use Scalar::Util qw(blessed);
use RDF::Trine::Iterator qw(sgrep);
use R
tion>\n];
}
print {$fh} "</rdf:RDF>\n";
}
=item C<as_json ( $max_size )>
Returns a JSON serialization of the stream data.
=cut
sub as_json {
my $self = shift;
my $max_result_size = shift;
t
Error ( -text => 'There is no JSON serialization specified for graph query results' );
}
=item C<< as_hashref >>
Returns a hashref representing the model in an RDF/JSON-like manner.
See C<< as_hash
e XML::SAX;
use RDF::Trine::Node;
use RDF::Trine::Iterator::SAXHandler;
use RDF::Trine::Iterator::JSONHandler;
our ($VERSION, @ISA, @EXPORT_OK);
BEGIN {
$VERSION = '1.019';
require Exporter;
@IS
issing, defaults to XML serialization.
Other options are:
http://www.w3.org/2001/sw/DataAccess/json-sparql/
=cut
sub to_string {
my $self = shift;
my $format = shift || 'http://www.w3.org/2005/
$format->as_string;
}
if ($format eq 'http://www.w3.org/2001/sw/DataAccess/json-sparql/') {
return $self->as_json;
} else {
return $self->as_xml;
}
}
=item C<< from_string ( $xml ) >>
Ret
@args );
}
=item C<< add_hashref ( $hashref [, $context] ) >>
Add triples represented in an RDF/JSON-like manner to the model.
See C<< as_hashref >> for full documentation of the hashref format.
=
ts( qw(s p o g) );
}
=item C<< as_hashref >>
Returns a hashref representing the model in an RDF/JSON-like manner.
A graph like this (in Turtle):
@prefix ex: <http://example.com/> .
ex:subje
the convention of starting blank nodes with "_:".
This hashref structure is compatible with RDF/JSON and with the ARC2
library for PHP.
=cut
sub as_hashref {
my $self = shift;
$self->end_bulk_op
# RDF::Trine::Parser::RDFJSON
# -----------------------------------------------------------------------------
=head1 NAME
RDF::Trine::Parser::RDFJSON - RDF/JSON RDF Parser
=head1 VERSION
This docu
ment describes RDF::Trine::Parser::RDFJSON version 1.019
=head1 SYNOPSIS
use RDF::Trine::Parser;
my $parser = RDF::Trine::Parser->new( 'RDF/JSON' );
$parser->parse_into_model( $base_uri, $data, $
rits methods from the
L<RDF::Trine::Parser> class.
=over 4
=cut
package RDF::Trine::Parser::RDFJSON;
use strict;
use warnings;
no warnings 'redefine';
no warnings 'once';
use base qw(RDF::Trine::P
:Parser> - RDF parsers for various serialization formats including RDF/XML, Turtle, RDFa, and RDF/JSON.
=item
L<RDF::Trine::Store::Memory> - An in-memory, non-persistant triple store. Typically use
# RDF::Trine::Serializer::RDFJSON
# -----------------------------------------------------------------------------
=head1 NAME
RDF::Trine::Serializer::RDFJSON - RDF/JSON Serializer
=head1 VERSION
T
describes RDF::Trine::Serializer::RDF/JSON version 1.019
=head1 SYNOPSIS
use RDF::Trine::Serializer::RDFJSON;
my $serializer = RDF::Trine::Serializer::RDFJSON->new();
=head1 DESCRIPTION
The RDF:
RDF/JSON syntax.
=head1 METHODS
Beyond the methods documented below, this class inherits methods from the
L<RDF::Trine::Serializer> class.
=over 4
=cut
package RDF::Trine::Serializer::RDFJSON;
u
>_compare( $b );
}
}
=item C<< as_hashref >>
Returns a hashref representing the node in an RDF/JSON-like manner.
See C<< as_hashref >> at L<RDF::Trine::Model> for full documentation of the
hashref
or::Bindings;
use utf8;
use strict;
use warnings;
no warnings 'redefine';
use Data::Dumper;
use JSON 2.0;
use Text::Table;
use Log::Log4perl;
use Scalar::Util qw(blessed reftype);
use RDF::Trine::It
indings {
my $self = shift;
return 1;
}
=item C<as_json ( $max_size )>
Returns a JSON serialization of the stream data.
=cut
sub as_json {
my $self = shift;
my $max_result_size = shift ||
@sorted = $self->sorted_by;
my $order = scalar(@sorted) ? JSON::true : JSON::false;
my $dist = $self->_args->{distinct} ? JSON::true : JSON::false;
my $data = {
head => { vars => \@variables
::Util qw(first);
use Scalar::Util qw(refaddr reftype blessed);
use HTTP::Request::Common ();
use JSON;
use RDF::Trine::Error qw(:try);
##############################################################
ccept = join(',',
"application/sparql-results+json",
"application/rdf+xml;q=0.5",
"application/x-turtle;q=0.7",
"application/json;q=0.4",
"text/turtle;q=0.7",
"text/xml;q
/json");
$req->header(Host => "dydra.com");
$req->authorization_basic($self->{token}) if (defined $self->{token});
my $resp = $ua->request( $req );
if ($resp->is_success) {
my $data = from_json(
model );
}
=item C<< add_hashref ( $hashref [, $context] ) >>
Add triples represented in an RDF/JSON-like manner to the model.
=cut
sub add_hashref {
my $self = shift;
return $self->model->add_h
oreUtils qw(zip);
use Scalar::Util qw(refaddr reftype blessed);
use HTTP::Request::Common ();
use JSON;
use RDF::Trine::Error qw(:try);
##############################################################
ut
package RDF::Trine::Iterator::Boolean;
use strict;
use warnings;
no warnings 'redefine';
use JSON 2.0;
use base qw(RDF::Trine::Iterator);
our ($VERSION);
BEGIN {
$VERSION = '1.019';
}
=item C<
_json ( $max_size )>
Returns a JSON serialization of the stream data.
=cut
sub as_json {
my $self = shift;
my $max_result_size = shift || 0;
my $value = $self->get_boolean ? JSON::true : JSON:
:false;
my $data = { head => { vars => [] }, boolean => $value };
return to_json( $data );
}
=item C<< construct_args >>
Returns the arguments necessary to pass to the stream constructor _new
to r