Skip to content

Instantly share code, notes, and snippets.

@jorol
jorol / gmk67-manual.md
Created December 4, 2023 12:52 — forked from Joao-Peterson/gmk67-manual.md
GMK67 manual (English)
@jorol
jorol / sru-oai.md
Created May 5, 2023 15:13
SRU & OAI-PMH client examples

SRU & OAI-PMH clients

SRU

Catmandu::Importer::SRU

$ catmandu convert -v SRU \
--base https://services.dnb.de/sru/zdb \
--recordSchema MARC21-xml \
@jorol
jorol / conneg test.md
Created December 8, 2021 15:37 — forked from namedgraph/conneg test.md
SBB Linked Data

Returns Turtle:

curl -L -i https://ld.zdb-services.de/data/organisations/DE-1a -H "Accept: text/turtle"

Returns HTML:

curl -L -i https://ld.zdb-services.de/data/organisations/DE-1a -H "Accept: application/rdf+xml;q=0.8,application/n-triples;q=0.9,application/trix;q=0.8,application/ld+json;q=0.8,text/shaclc;q=0.8,application/rdf+thrift,text/turtle;q=0.8,text/rdf+n3;q=0.8,application/rdf+json;q=0.8,application/sparql-results+xml,application/sparql-results+json"
@jorol
jorol / pica_sort.pm
Created July 31, 2020 13:34
Catmandu::Fix::pica_sort.pm
package Catmandu::Fix::pica_sort;
use Catmandu::Sane;
use Moo;
sub fix {
my ( $self, $data ) = @_;
return $self->sort_record($data);
}
@jorol
jorol / store_item_in_var.pl
Last active July 5, 2020 09:18
Request data from SRU by ID and store it in an array
#! /usr/bin/perl -w
use strict;
use warnings;
use DDP;
use Catmandu::Importer::SRU;
# create array to store items
my @array = ();
@jorol
jorol / sru_by_id_fixed.pl
Created July 3, 2020 10:55
Request data from SRU by ID and fix them
#! /usr/bin/perl -w
use strict;
use warnings;
use Catmandu::Importer::SRU;
# specify I/O layer
open( my $fh, '>:encoding(UTF-8)', 'fixed.jsonl' );
@jorol
jorol / sru_by_id.pl
Created July 3, 2020 09:46
Request data from SRU by ID
#! /usr/bin/perl -w
use strict;
use warnings;
use Catmandu::Importer::SRU;
# specify I/O layer
open( my $fh, '>>:encoding(UTF-8)', 'blabla.txt' );
#!/usr/bin/env perl
use strict;
use warnings;
use DDP;
use Catmandu::Importer::SRU;
use Catmandu::PICA;
my %attrs = (
base => 'https://services.dnb.de/sru/dnb',
@jorol
jorol / check_nls_marcxml_data.md
Last active September 3, 2019 18:25
Check and validate MARCXML data
@jorol
jorol / graph_paper.pl
Created January 19, 2018 15:22 — forked from jacoby/graph_paper.pl
Code to generate graph paper in SVG with Perl
#!/usr/bin/env perl
use strict ;
use warnings ;
use utf8 ;
use feature qw{ postderef say signatures state } ;
no warnings qw{ experimental::postderef experimental::signatures } ;
use Carp ;
use Getopt::Long ;