aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-08-14 16:40:38 +0300
committerMunyoki Kilyungi2023-08-15 19:32:47 +0300
commit6e4359319695a6d93de55339b758b6ec6926c5ca (patch)
tree6a67d40b5cb54b4d53a76efa20247cb45470734f
parent1777732368f2f766c857f04f4d7e33ab0b13b5a1 (diff)
downloadgn-transform-databases-6e4359319695a6d93de55339b758b6ec6926c5ca.tar.gz
Use prism, fabio and dct ontologies to represent a publication
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rwxr-xr-xexamples/dump-publication.scm52
1 files 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:" "<http://genenetwork.org/terms/>")
+ ("fabio:" "<http://purl.org/spar/fabio/>")
+ ("dct:" "<http://purl.org/dc/terms/>")
+ ("prism:" "<http://prismstandard.org/namespaces/basic/2.0/>")
("gn:" "<http://genenetwork.org/id/>")
("gnc:" "<http://genenetwork.org/category/>")
("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>")
("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
+ ("xsd:" "<http://www.w3.org/2001/XMLSchema#>")
("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")))
(inputs
(list dump-publication))
(outputs
'(#:documentation "./docs/dump-publication.md"
- #:rdf "./verified-data/dump-publication.md")))
+ #:rdf "./verified-data/dump-publication.ttl")))