-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
227 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"doi": "10.5061/dryad.8515", | ||
"creators": [ | ||
{ | ||
"name": "Benjamin, Ollomo", | ||
"givenName": "Benjamin", | ||
"familyName": "Ollomo", | ||
"nameType": "Personal", | ||
"affiliation": [ | ||
"Centre International de Recherches Médicales de Franceville" | ||
] | ||
}, | ||
{ | ||
"name": "Patrick, Durand", | ||
"givenName": "Patrick", | ||
"familyName": "Durand", | ||
"nameType": "Personal", | ||
"affiliation": ["French National Centre for Scientific Research"] | ||
}, | ||
{ | ||
"name": "Franck, Prugnolle", | ||
"givenName": "Franck", | ||
"familyName": "Prugnolle", | ||
"nameType": "Personal", | ||
"affiliation": ["French National Centre for Scientific Research"] | ||
}, | ||
{ | ||
"name": "Emmanuel J. P., Douzery", | ||
"givenName": "Emmanuel J. P.", | ||
"familyName": "Douzery", | ||
"nameType": "Personal" | ||
}, | ||
{ | ||
"name": "Céline, Arnathau", | ||
"givenName": "Céline", | ||
"familyName": "Arnathau", | ||
"nameType": "Personal", | ||
"affiliation": ["French National Centre for Scientific Research"] | ||
}, | ||
{ | ||
"name": "Dieudonné, Nkoghe", | ||
"givenName": "Dieudonné", | ||
"familyName": "Nkoghe", | ||
"nameType": "Personal", | ||
"affiliation": [ | ||
"Centre International de Recherches Médicales de Franceville" | ||
] | ||
}, | ||
{ | ||
"name": "Eric, Leroy", | ||
"givenName": "Eric", | ||
"familyName": "Leroy", | ||
"nameType": "Personal", | ||
"affiliation": [ | ||
"Centre International de Recherches Médicales de Franceville" | ||
] | ||
}, | ||
{ | ||
"name": "François, Renaud", | ||
"givenName": "François", | ||
"familyName": "Renaud", | ||
"nameType": "Personal", | ||
"affiliation": ["French National Centre for Scientific Research"] | ||
} | ||
], | ||
"publisher": { | ||
"name": "Dryad" | ||
}, | ||
"container": {}, | ||
"publicationYear": 2011, | ||
"titles": [ | ||
{ | ||
"title": "Data from: A new malaria agent in African hominids." | ||
} | ||
], | ||
"url": "https://datadryad.org/stash/dataset/doi:10.5061/dryad.8515", | ||
"subjects": [ | ||
{ | ||
"subject": "Plasmodium" | ||
}, | ||
{ | ||
"subject": "Malaria" | ||
}, | ||
{ | ||
"subject": "mitochondrial genome" | ||
}, | ||
{ | ||
"subject": "Parasites" | ||
} | ||
], | ||
"dates": [ | ||
{ | ||
"date": "2011-02-01T17:22:41Z", | ||
"dateType": "Issued" | ||
} | ||
], | ||
"language": "en", | ||
"types": { | ||
"resourceTypeGeneral": "Dataset", | ||
"ris": "DATA", | ||
"citeproc": "dataset", | ||
"schemaOrg": "Dataset" | ||
}, | ||
"version": "1", | ||
"rightsList": [ | ||
{ | ||
"rightsUri": "https://creativecommons.org/publicdomain/zero/1.0/legalcode", | ||
"schemeUri": "https://spdx.org/licenses/", | ||
"rightsIdentifier": "cc0-1.0", | ||
"rightsIdentifierScheme": "SPDX" | ||
} | ||
], | ||
"descriptions": [ | ||
{ | ||
"description": "Plasmodium falciparum is the major human malaria agent responsible for 200\n to 300 million infections and one to three million deaths annually, mainly\n among African infants. The origin and evolution of this pathogen within\n the human lineage is still unresolved. A single species, P. reichenowi,\n which infects chimpanzees, is known to be a close sister lineage of P.\n falciparum. Here we report the discovery of a new Plasmodium species\n infecting Hominids. This new species has been isolated in two chimpanzees\n (Pan troglodytes) kept as pets by villagers in Gabon (Africa). Analysis of\n its complete mitochondrial genome (5529 nucleotides including Cyt b, Cox I\n and Cox III genes) reveals an older divergence of this lineage from the\n clade that includes P. falciparum and P. reichenowi (approximately 21+/-9\n Myrs ago using Bayesian methods and considering that the divergence\n between P. falciparum and P. reichenowi occurred 4 to 7 million years ago\n as generally considered in the literature). This time frame would be\n congruent with the radiation of hominoids, suggesting that this Plasmodium\n lineage might have been present in early hominoids and that they may both\n have experienced a simultaneous diversification. Investigation of the\n nuclear genome of this new species will further the understanding of the\n genetic adaptations of P. falciparum to humans. The risk of transfer and\n emergence of this new species in humans must be now seriously considered\n given that it was found in two chimpanzees living in contact with humans\n and its close relatedness to the most virulent agent of malaria.", | ||
"descriptionType": "Abstract" | ||
}, | ||
{ | ||
"description": "Ollomo_PLoSPathog_2009Nucleotide alignment concatenation of 4\n mitochondrial genes for 17 Plasmodium species and one\n outgroup.Ollomo_PLoSPathog_2009_PHYMLMaximum likelihood tree inferred from\n the 4-gene concatenation using PHYML.", | ||
"descriptionType": "Other" | ||
} | ||
], | ||
"geoLocations": [ | ||
{ | ||
"geoLocationPoint": {}, | ||
"geoLocationBox": {}, | ||
"geoLocationPlace": "Africa" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package datacite_test | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/front-matter/commonmeta/commonmeta" | ||
"github.com/front-matter/commonmeta/crossref" | ||
"github.com/front-matter/commonmeta/datacite" | ||
"github.com/front-matter/commonmeta/doiutils" | ||
"github.com/google/go-cmp/cmp" | ||
) | ||
|
||
func TestWrite(t *testing.T) { | ||
t.Parallel() | ||
|
||
type testCase struct { | ||
name string | ||
id string | ||
from string | ||
} | ||
|
||
testCases := []testCase{ | ||
//{name: "journal article", id: "https://doi.org/10.7554/elife.01567", from: "crossref"}, | ||
//{name: "preprint", id: "https://doi.org/10.1101/097196", from: "crossref"}, | ||
{name: "dataset", id: "https://doi.org/10.5061/dryad.8515", from: "datacite"}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
var data commonmeta.Data | ||
var err error | ||
if tc.from == "crossref" { | ||
data, err = crossref.Fetch(tc.id) | ||
} else if tc.from == "datacite" { | ||
data, err = datacite.Fetch(tc.id) | ||
} | ||
if err != nil { | ||
t.Errorf("Crossref Fetch (%v): error %v", tc.id, err) | ||
} | ||
|
||
got, err := datacite.Write(data) | ||
if err != nil { | ||
t.Errorf("Datacite Write (%v): error %v", tc.id, err) | ||
} | ||
// read json file from testdata folder and convert to Data struct | ||
doi, ok := doiutils.ValidateDOI(tc.id) | ||
if !ok { | ||
t.Fatal(errors.New("invalid doi")) | ||
} | ||
filename := strings.ReplaceAll(doi, "/", "_") + ".json" | ||
filepath := filepath.Join("testdata/writer", filename) | ||
content, err := os.ReadFile(filepath) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
var want datacite.Datacite | ||
err = json.Unmarshal(content, &want) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if diff := cmp.Diff(want, got); diff != "" { | ||
t.Errorf("Schemaorg Fetch (%v): -want +got %s", tc.id, diff) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters