From 51b3c0548c98e0bc05e11a89cbf6b75d31b9f8d5 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 21 Aug 2023 14:54:21 +0300 Subject: Remove "dump-" prefix Signed-off-by: Munyoki Kilyungi --- examples/dump-publication.scm | 81 ------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 examples/dump-publication.scm (limited to 'examples/dump-publication.scm') diff --git a/examples/dump-publication.scm b/examples/dump-publication.scm deleted file mode 100755 index 1881872..0000000 --- a/examples/dump-publication.scm +++ /dev/null @@ -1,81 +0,0 @@ -#! /usr/bin/env guile -!# - -(use-modules (srfi srfi-1) - (srfi srfi-26) - (ice-9 match) - (ice-9 regex) - (dump strings) - (dump sql) - (dump triples) - (dump special-forms)) - - - -(define %connection-settings - (call-with-input-file (list-ref (command-line) 1) - read)) - - - -(define-transformer dump-publication - (tables (Publication)) - (triples - (let ((pmid (field - ("IF(Publication.PubMed_ID IS NULL, '', CONVERT(Publication.PubMed_Id, INT))" - pmid))) - (publication-id (field Publication Id))) - (if (string-null? pmid) - (string->identifier "unpublished" - (number->string publication-id)) - (ontology 'pubmed: pmid))) - (set rdf:type 'fabio:ResearchPaper) - (set fabio:hasPubMedId - (ontology 'pubmed: (field ("IFNULL(PubMed_ID, '')" pubmedId)))) - (set dct:title (delete-substrings (field Publication Title) - "Unknown")) - (set fabio:Journal (delete-substrings (field Publication Journal) - "Unknown")) - (set prism:volume (delete-substrings (field Publication Volume) - "Unknown")) - (set fabio:page (delete-substrings (field Publication Pages) - "Unknown")) - (set prism:publicationDate (annotate-field - (delete-substrings (field Publication Month) - "Unknown") - '^^xsd:gMonth)) - (set fabio:hasPublicationYear - (annotate-field - (field - ("IF(Publication.Year = 0, NULL, Publication.Year)" Year)) - '^^xsd:gYear)) - (multiset dct:creator - ;; The authors field is a comma - ;; separated list. Split it. - (map string-trim (string-split (sanitize-rdf-string (field Publication Authors)) #\,))) - (set dct:abstract - (sanitize-rdf-string - (field Publication Abstract))))) - - - -(dump-with-documentation - (name "Publications Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gnt:" "") - ("fabio:" "") - ("dct:" "") - ("prism:" "") - ("gn:" "") - ("gnc:" "") - ("pubmed:" "") - ("rdfs:" "") - ("xsd:" "") - ("rdf:" ""))) - (inputs - (list dump-publication)) - (outputs - '(#:documentation "./docs/dump-publication.md" - #:rdf "./verified-data/dump-publication.ttl"))) -- cgit v1.2.3