From 6e4359319695a6d93de55339b758b6ec6926c5ca Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 14 Aug 2023 16:40:38 +0300 Subject: Use prism, fabio and dct ontologies to represent a publication Signed-off-by: Munyoki Kilyungi --- examples/dump-publication.scm | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/dump-publication.scm b/examples/dump-publication.scm index 50e4358..5b1af83 100755 --- a/examples/dump-publication.scm +++ b/examples/dump-publication.scm @@ -20,16 +20,6 @@ (define-dump dump-publication (tables (Publication)) - (schema-triples - (gnt:pubMedId rdfs:range rdfs:Literal) - (gnt:title rdfs:range rdfs:Literal) - (gnt:journal rdfs:range rdfs:Literal) - (gnt:volume rdfs:range rdfs:Literal) - (gnt:pages rdfs:range rdfs:Literal) - (gnt:month rdfs:range rdfs:Literal) - (gnt:year rdfs:range rdfs:Literal) - (gnt:author rdfs:range rdfs:Literal) - (gnt:abstract rdfs:range rdfs:Literal)) (triples (let ((pmid (field ("IF(Publication.PubMed_ID IS NULL, '', CONVERT(Publication.PubMed_Id, INT))" @@ -39,27 +29,33 @@ (string->identifier "unpublished" (number->string publication-id)) (ontology 'pubmed: pmid))) - (set rdf:type 'gnc:publication) - (set gnt:pubMedId + (set rdf:type 'fabio:ResearchPaper) + (set fabio:hasPubMedId (ontology 'pubmed: (field ("IFNULL(PubMed_ID, '')" pubmedId)))) - (set gnt:title (delete-substrings (field Publication Title) + (set dct:title (delete-substrings (field Publication Title) + "Unknown")) + (set fabio:Journal (delete-substrings (field Publication Journal) "Unknown")) - (set gnt:journal (delete-substrings (field Publication Journal) - "Unknown")) - (set gnt:volume (delete-substrings (field Publication Volume) - "Unknown")) - (set gnt:pages (delete-substrings (field Publication Pages) - "Unknown")) - (set gnt:month (delete-substrings (field Publication Month) - "Unknown")) - (set gnt:year (field Publication Year)) - (multiset gn:author + (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 gn:abstract + (set dct:abstract (sanitize-rdf-string - (field ("CAST(CONVERT(BINARY CONVERT(Publication.Abstract USING latin1) USING utf8) AS VARCHAR(100))" Abstract)))))) + (field Publication Abstract))))) @@ -69,13 +65,17 @@ (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.md"))) + #:rdf "./verified-data/dump-publication.ttl"))) -- cgit v1.2.3