diff --git a/package-lock.json b/package-lock.json index 4c7d4b0c0a26c5060ede383834ba79b04cedf45c..ae540f96a087b6490e66dd2e7968a248a51a2115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3088,8 +3088,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "optional": true + "dev": true }, "coa": { "version": "2.0.2", @@ -9660,8 +9659,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true, - "optional": true + "dev": true }, "rx-lite-aggregates": { "version": "4.0.8", diff --git a/src/App.vue b/src/App.vue index f9257bbb344bedd3e13e46fe2087cb777a954843..683bb0ef8b2728dcefcc2de2a725b8fd071f0e6d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -90,7 +90,7 @@ > <v-tab ripple>{{ $t('Submit') }}</v-tab> <v-tab ripple>{{ $t('Display') }}</v-tab> - <!-- <v-tab ripple>{{ $t('Edit') }}</v-tab> + <!-- <v-tab ripple>{{ $t('Edit') }}</v-tab> <v-tab ripple>{{ $t('Search') }}</v-tab>--> </v-tabs> @@ -98,9 +98,8 @@ <v-flex> <v-window v-model="window"> <v-window-item> - - <ph-submit - :model="contentmodel" + <ph-submit + :model="contentmodel" :form="form" v-on:object-created="objectCreated($event)" v-on:load-form="form = $event" @@ -127,47 +126,52 @@ </v-toolbar> <v-card-text> <v-layout row> - - <ph-d-jsonld :form="form" :jsonld="displayjsonld" :pid="pid"></ph-d-jsonld> - + <ph-d-jsonld + :form="form" + :jsonld="displayjsonld" + :viewpharmameta="true" + :pid="pid" + ></ph-d-jsonld> + </v-layout> + <v-layout row> + <v-toolbar v-if="members.length>0" dense flat> + <v-toolbar-title class="font-weight-light">File Members</v-toolbar-title> + </v-toolbar> + </v-layout> + + <v-layout row wrap v-for="(mpid,order) in members" :key="mpid.pid"> + <v-flex xs2 class="subheading"> + <a + :href="'https://' + instance.baseurl +'/'+mpid.pid" + target="_blank" + >{{'https://' + instance.baseurl +'/'+mpid.pid}}</a> + </v-flex> + + <v-flex xs2> + <p-img + :src="'https://' + instance.baseurl + '/preview/' + mpid.pid + '///120'" + class="elevation-1" + > + <v-layout + slot="placeholder" + fill-height + align-center + justify-center + ma-0 + > + <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> + </v-layout> + </p-img> + </v-flex> + <v-flex xs8> + <ph-d-jsonld :jsonld="displayjsonldmembers[order]"></ph-d-jsonld> + </v-flex> </v-layout> - <v-layout row> - <v-toolbar v-if="members.length>0" dense flat> - - <v-toolbar-title class="font-weight-light">File Members</v-toolbar-title> - - </v-toolbar> - </v-layout> - - <v-layout row wrap v-for="(mpid,order) in members" :key="mpid.pid"> - - <v-flex xs2 class="subheading"> - <a :href="'https://' + instance.baseurl +'/'+mpid.pid" target="_blank">{{'https://' + instance.baseurl +'/'+mpid.pid}}</a> - - - </v-flex> - - <v-flex xs2> - <p-img - - :src="'https://' + instance.baseurl + '/preview/' + mpid.pid + '///120'" - class="elevation-1" - > - <v-layout slot="placeholder" fill-height align-center justify-center ma-0> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-layout> - </p-img> - </v-flex> - <v-flex xs8> <ph-d-jsonld :jsonld="displayjsonldmembers[order]"> </ph-d-jsonld></v-flex> - - </v-layout> - - </v-card-text> </v-card> </v-flex> </v-window-item> - <!-- <v-window-item> + <!-- <v-window-item> <v-flex> <v-card> <v-toolbar flat> @@ -190,7 +194,7 @@ </v-flex> </v-window-item>--> - <!-- <v-window-item> + <!-- <v-window-item> <v-flex> <v-card> <v-toolbar flat> diff --git a/src/components/display/pharma_display/PDSkosPreflabel.vue b/src/components/display/pharma_display/PDSkosPreflabel.vue index 91a16e49833de10e6c0743cf9429b905669e000e..56397ccb4072a5ced04e1f59fadbfd95688c1d6c 100644 --- a/src/components/display/pharma_display/PDSkosPreflabel.vue +++ b/src/components/display/pharma_display/PDSkosPreflabel.vue @@ -1,6 +1,5 @@ <template> <v-flex> - <v-layout column> <v-flex> <template v-for="(l, i) in o['skos:prefLabel']"> @@ -9,9 +8,9 @@ {{ $t(o['@type']) }} <template v-if="l['@language']">({{ l['@language'] }})</template> </v-flex> - + <v-flex md4 xs12 v-else class="pdlabel primary--text" :key="'l'+i"> - {{ $t(p) }} + {{ $t(p) }} <template v-if="l['@language']">({{ l['@language'] }})</template> </v-flex> <v-flex md8 xs12 v-if="o['skos:exactMatch']" :key="'t-id'+i"> @@ -21,7 +20,7 @@ target="_blank" >{{ l['@value'] }}</a> </v-flex> - <v-flex class="valuefield" md8 xs12 v-else :key="'t'+i"> {{ l['@value'] }}</v-flex> + <v-flex class="valuefield" md8 xs12 v-else :key="'t'+i">{{ l['@value'] }}</v-flex> </v-layout> </template> </v-flex> diff --git a/src/components/display/pharma_display/PhDJsonld.vue b/src/components/display/pharma_display/PhDJsonld.vue index 0232f31d84ccbbaaaabf95e5f05c0521fa185851..e20aa144bbbf01a3b31366fa9a7817da231cbc1d 100644 --- a/src/components/display/pharma_display/PhDJsonld.vue +++ b/src/components/display/pharma_display/PhDJsonld.vue @@ -324,82 +324,101 @@ <p-d-skos-preflabel :p="p" :o="subject" :key="componentid+'subject'+j"></p-d-skos-preflabel> </template> </template> - <template v-for="(categ,index) in pharmaStructure"> - <v-card v-if="categ.fields.length>0" :key="index+categ.category"> - <v-toolbar dense flat> - <v-layout> - <v-toolbar-title class="font-weight-light">{{categ.label}}</v-toolbar-title> - </v-layout> - </v-toolbar> + <template v-if="viewpharmameta"> + <template v-for="(categ,index) in pharmaStructure"> + <v-card v-if="categ.fields.length>0" :key="index+categ.category"> + <v-toolbar dense flat> + <v-layout> + <v-toolbar-title class="font-weight-light">{{categ.label}}</v-toolbar-title> + </v-layout> + </v-toolbar> - <template v-if="categ.fields.length>0"> - <v-card v-for="(l,index) in categ.fields" :key="l['@type']+'field'+index"> - <v-layout v-if="l"> - <!-- <v-flex xs1 class="subheading"> + <template v-if="categ.fields.length>0"> + <v-card v-for="(l,index) in categ.fields" :key="l['@type']+'field'+index"> + <v-layout v-if="l"> + <!-- <v-flex xs1 class="subheading"> <a :href="l.id" target="_blank">{{l.label}}</a> - </v-flex>--> - <v-flex xs11> - <!--<v-card v-for="(inputf,index) in l" :key="index+'subjectField'">--> - - <!-- <v-flex xs2 v-if="inputf.selection">{{getLabel(inputf.data['@type'])}}</v-flex>--> - <p-d-skos-preflabel - v-if="getSkosexactMatch(l)==undefined" - :o="l" - :key="l+index+'pharmafreesubject'" - ></p-d-skos-preflabel> - - <ph-d-metadata - v-if="getSkosexactMatch(l)" - :o="l" - :p="p" - :key="l+index+'pharmasubject'" - ></ph-d-metadata> - <v-divider></v-divider> - </v-flex> - </v-layout> - </v-card> - </template> - </v-card> - <v-card v-if="categ.subcategory" :key="index+categ.label"> - <v-toolbar dense flat> - <v-layout> - <v-toolbar-title class="font-weight-light">{{categ.label}}</v-toolbar-title> - </v-layout> - </v-toolbar> + </v-flex>--> + <v-flex xs11> + <!--<v-card v-for="(inputf,index) in l" :key="index+'subjectField'">--> - <template v-if="categ.subcategory.length>0"> - <v-card v-for="l in categ.subcategory" :key="l.category+'field'"> - <v-layout v-if="l"> - <v-flex xs1 class="subheading"> - <div class="text-xs-center"> - <a :href="l.id" target="_blank">{{l.category}}</a> - </div> - </v-flex> - <v-flex xs11> - - <v-card v-for="(inputf,index) in l.fields" :key="index+'subjectField'"> - + <!-- <v-flex xs2 v-if="inputf.selection">{{getLabel(inputf.data['@type'])}}</v-flex>--> <p-d-skos-preflabel - v-if="getSkosexactMatch(inputf)==undefined" - :p="getLabel(inputf['@type'])" - :o="inputf" - :key="inputf+index+'pharmafreesubject'" + v-if="getSkosexactMatch(l)==undefined" + :o="l" + :key="l+index+'pharmafreesubject'" ></p-d-skos-preflabel> - inputfhere {{inputf}} -------------------- index {{index+'subjectField'}} + <ph-d-metadata - v-if="getSkosexactMatch(inputf)" - :o="getSkosexactMatch(inputf)" + v-if="getSkosexactMatch(l)" + :o="l" :p="p" - :key="index+'pharmasubject'" + :key="l+index+'pharmasubject'" ></ph-d-metadata> <v-divider></v-divider> - </v-card> - </v-flex> + </v-flex> + </v-layout> + </v-card> + </template> + </v-card> + <v-card v-if="categ.subcategory" :key="index+categ.label"> + <v-toolbar dense flat> + <v-layout> + <v-toolbar-title class="font-weight-light">{{categ.label}}</v-toolbar-title> </v-layout> - </v-card> - </template> - </v-card> + </v-toolbar> + + <template v-if="categ.subcategory.length>0"> + <v-card v-for="l in categ.subcategory" :key="l.category+'field'"> + <v-layout v-if="l"> + <v-flex xs1 class="subheading"> + <div class="text-xs-center"> + <a :href="l.id" target="_blank">{{l.category}}</a> + </div> + </v-flex> + + <v-flex xs11 v-if="viewpharmameta"> + <v-card v-for="(inputf,index) in l.fields" :key="index+'subjectField'"> + <p-d-skos-preflabel + v-if="getSkosexactMatch(inputf)==undefined" + :p="getLabel(inputf['@type'])" + :o="inputf" + :key="inputf+index+'pharmafreesubject'" + ></p-d-skos-preflabel> + + <ph-d-metadata + v-if="getSkosexactMatch(inputf)" + :o="inputf" + :p="p" + :key="index+'pharmasubject'" + ></ph-d-metadata> + <v-divider></v-divider> + </v-card> + </v-flex> + <v-flex xs11 v-if="!viewpharmameta"> + fields {{l.fields}} + <v-card v-for="(inputf,index) in l.fields" :key="index+'subjectField'"> + <p-d-skos-preflabel + :p="getLabel(inputf['@type'])" + :o="inputf" + :key="inputf+index+'pharmafreesubject'" + ></p-d-skos-preflabel> + + <v-divider></v-divider> + </v-card> + </v-flex> + </v-layout> + </v-card> + </template> + </v-card> + </template> </template> + <template v-if="!viewpharmameta"> + <template v-for="(subject, j) in o"> + <p-d-skos-preflabel :p="p" :o="subject" :key="componentid+'subject'+j"></p-d-skos-preflabel> + </template> + </template> + <v-btn @click="pharmaStructure()">view full data</v-btn> </template> <template v-else-if="p==='@type'"></template> @@ -460,8 +479,9 @@ export default { componentid: function() { return Math.floor(Math.random() * 10000000); }, - pharmaStructure: function() { + pharmaStructure: function(json) { var subjectjson = this.jsonld["dcterms:subject"]; + //filter subjects for only the ones with subjects[i]["@type"]=!= "skos:Concept" //that would be the pharma-related subjects var pharmajson = subjectjson.filter( @@ -489,12 +509,8 @@ export default { var jsonTypeArray = pharmajson.filter(function(fs) { return fs["@type"] == formFieldsFiltered[j].type; }); - + console.log("this.jsonld", jsonTypeArray); if (jsonTypeArray.length > 0) { - //for (var k = 0; k < jsonTypeArray.length; k++) { - // console.log("jsonTypeArray", jsonTypeArray[k]); - //} - //find first whether there is a subcategory if (formFieldsFiltered[j].subcategory) { //the category is formFieldsFiltered[j].category // if it exists, push to it, otherwise create it @@ -535,8 +551,6 @@ export default { } } } else { - //the category is formFieldsFiltered[j].category - // if it exists, push to it, otherwise create it var n_categ = formFieldsFiltered[j].category[0]; //check if it exists already @@ -545,44 +559,17 @@ export default { ); if (result >= 0) { - /* if (jsonStructured[result].subcategory) { - var r = jsonStructured[result].subcategory.findIndex( - obj => obj.category === n_subcat - ); - console.log( - "n_sub r", - r, - "formFieldsFiltered[j].infoRef", - formFieldsFiltered[j].infoRef - ); - if (r >= 0) { - jsonStructured[result].subcategory[r].fields.push( - jsonTypeArray[0] - ); - } else { - jsonStructured[result].subcategory.push({ - category: n_subcat, - id: formFieldsFiltered[j].infoRef, - fields: jsonTypeArray - }); - } - } else {*/ - jsonStructured[result].fields = jsonTypeArray; - // category: n_categ, - // id: formFieldsFiltered[j].infoRef, - // fields: jsonTypeArray - //}; } } } } } - + console.log("jsonStructured", jsonStructured); return jsonStructured; }, pharmaData: function() { - var s = this.jsonld["dcterms:subject"]; + var s = this.jsonldd["dcterms:subject"]; //filter subjects for only the ones with subjects[i]["@type"]=!= "skos:Concept" //that would be the pharma-related subjects var subjects = s.filter(s => s["@type"] != "skos:Concept"); @@ -591,7 +578,6 @@ export default { // take all the jsonld["dcterms:subject"] but not the ones which have no skos:prefLabel" for (let i = 0; i < subjects.length; i++) { - console.log("subject", subjects[i]); var subcat = subjects[i]["@type"]; // thuis should be unique to each entry field, comes from "subjectType" in jsonld var categ = this.getCategory(subcat); @@ -608,8 +594,8 @@ export default { n_subjects[i].data = subjects[i]; } - console.log("pharmaData", n_subjects); - console.log("pharmaSubjects", this.pharmaSubjects); + //console.log("pharmaData", n_subjects); + //console.log("pharmaSubjects", this.pharmaSubjects); return n_subjects; } }, @@ -627,6 +613,10 @@ export default { form: { type: Object, default: null + }, + viewpharmameta: { + type: Boolean, + default: false } }, components: { @@ -654,7 +644,9 @@ export default { PImg }, data() { - return {}; + return { + jsonldd: this.jsonld + }; }, methods: { alert: function(e) { diff --git a/src/components/display/pharma_display/PhDMetadata.vue b/src/components/display/pharma_display/PhDMetadata.vue index 7aa7def852ca70dc23493797806a4bb390d6c35c..34b67a8e1913c7fe4faa5b6a74407256ec87aef8 100644 --- a/src/components/display/pharma_display/PhDMetadata.vue +++ b/src/components/display/pharma_display/PhDMetadata.vue @@ -1,32 +1,27 @@ <template> <v-flex> <v-layout column> - <v-btn @click="alert(newdata)">see metadata</v-btn> <v-flex> - o {{o}}===================== iri {{iri}} - data============================================ {{ndata}} - <template - v-for="(l, i) in ndata" - > - - <v-layout :key="'lay' + i"> + <template v-for="(l, i) in data"> + <v-layout :key="'layj' + i" row wrap> <v-flex - v-if="i == 'skos:prefLabel'" md4 xs12 + v-if="i == 'skos:prefLabel'" class="pdlabel primary--text" :key="'l' + i" >Label</v-flex> - <v-flex md8 xs12 v-if="i == 'skos:prefLabel'" class="valuefield"> - {{ - getSkosprefLabel(data) - }} - </v-flex> <v-flex - v-if="i == 'skos:exactMatch'" + md8 + xs12 + v-if="i == 'skos:prefLabel'" + class="valuefield" + >{{getSkosprefLabel(data)}}</v-flex> + <v-flex md4 xs12 + v-if="i == 'skos:exactMatch'" class="pdlabel primary--text" :key="'l' + i" >Persistent identifier</v-flex> @@ -34,54 +29,47 @@ <v-flex md8 xs12 v-if="i == 'skos:exactMatch'"> <a class="valuefield" - :href="getSkosexactMatch(ndata)" + :href="getSkosexactMatch(data)" target="_blank" >{{ getSkosexactMatch(data) }}</a> </v-flex> <!--<v-flex md8 xs12 v-if="o['skos:exactMatch']" :key="'t-id'+i"><a class="valuefield" :href="o['skos:exactMatch'][0]" target="_blank">{{ l['@value'] }}</a></v-flex>--> <v-flex - v-if="i == 'cellLineName'" md4 xs12 + v-if="i == 'cellLineName'" class="pdlabel primary--text" :key="'l' + i" >Cell Line Name</v-flex> - <v-flex md8 xs12 v-if="i == 'cellLineName'" class="valuefield"> - {{ - getCelllinename(ndata) - }} - </v-flex> + <v-flex md8 xs12 v-if="i == 'cellLineName'" class="valuefield">{{getCelllinename(data)}}</v-flex> <v-flex - v-if="i == 'accessionNumber'" md4 xs12 + v-if="i == 'accessionNumber'" class="pdlabel primary--text" :key="'l' + i" >Cellosaurus Accession Number</v-flex> - <v-flex md8 xs12 v-if="i == 'accessionNumber'" class="valuefield"> - {{ - getAccessionnumber(ndata) - }} - </v-flex> <v-flex - v-if="i == 'uniprotName'" + md8 + xs12 + v-if="i == 'accessionNumber'" + class="valuefield" + >{{getAccessionnumber(data)}}</v-flex> + <v-flex md4 xs12 + v-if="i == 'uniprotName'" class="pdlabel primary--text" :key="'l' + i" >Uniprot Name</v-flex> - <v-flex md8 xs12 v-if="i == 'uniprotName'" class="valuefield"> - {{ - getUniprotName(ndata) - }} - </v-flex> + <v-flex md8 xs12 v-if="i == 'uniprotName'" class="valuefield">{{getUniprotName(data)}}</v-flex> <v-flex - v-if="i == 'proteinRecommendedName'" md4 xs12 + v-if="i == 'proteinRecommendedName'" class="pdlabel primary--text" :key="'l' + i" >Protein Recommended Name</v-flex> @@ -91,11 +79,11 @@ xs12 v-if="i == 'proteinRecommendedName'" class="valuefield" - >{{ getProteinRecommendedName(newdata) }}</v-flex> + >{{getProteinRecommendedName(data)}}</v-flex> <v-flex - v-if="i == 'uniprotAccession'" md4 xs12 + v-if="i == 'uniprotAccession'" class="pdlabel primary--text" :key="'l' + i" >Uniprot Accession Number</v-flex> @@ -105,25 +93,21 @@ xs12 v-if="i == 'uniprotAccession'" class="valuefield" - >{{ getUniprotAccession(ndata) }}</v-flex> + >{{getUniprotAccession(data)}}</v-flex> <v-flex - v-if="i == 'organismName'" md4 xs12 + v-if="i == 'organismName'" class="pdlabel primary--text" :key="'l' + i" >Organism name</v-flex> - <v-flex md8 xs12 v-if="i == 'organismName'" class="valuefield"> - {{ - getOrganismName(ndata) - }} - </v-flex> + <v-flex md8 xs12 v-if="i == 'organismName'" class="valuefield">{{getOrganismName(data)}}</v-flex> <v-flex - v-if="i == 'proteinAlternativeName'" md4 xs12 + v-if="i == 'proteinAlternativeName'" class="pdlabel primary--text" :key="'l' + i" >Organism name</v-flex> @@ -133,20 +117,16 @@ xs12 v-if="i == 'proteinAlternativeName'" class="valuefield" - >{{ getProteinAlternativeName(ndata) }}</v-flex> + >{{getProteinAlternativeName(data)}}</v-flex> <v-flex - v-if="i == 'skos:altLabel'" md4 xs12 + v-if="i == 'skos:altLabel'" class="pdlabel primary--text" :key="'l' + i" >Alternative Labels</v-flex> - <v-flex md8 xs12 v-if="i == 'skos:altLabel'" class="valuefield"> - {{ - getSynonyms(ndata) - }} - </v-flex> + <v-flex md8 xs12 v-if="i == 'skos:altLabel'" class="valuefield">{{getSynonyms(data)}}</v-flex> </v-layout> </template> </v-flex> @@ -171,30 +151,15 @@ export default { type: String } }, - //mounted: function() { - // this.getMetadata(this.o); - //}, + mounted: function() { + this.getMetadata(); + }, computed: { - newdata() { - this.getMetadata(this.o); - return this.ndata; - }, getIri() { // console.log("o", this.getSkosexactMatch(this.o)); - this.iri = this.getSkosexactMatch(this.o); + return this.getSkosexactMatch(this.o); }, - //getData() { - //return this.getMetadata(); - //return this.getMetadata(this.getSkosexactMatch(this.o)); - //console.log( - // "O", - - // this.getSkosexactMatch(this.o), - // this.getMetadata(this.getSkosexactMatch(this.o)) - //); - //return this.getMetadata(this.getSkosexactMatch(this.o)); - //}, displaylang: function() { let lang; let somelang; @@ -209,23 +174,20 @@ export default { }, data() { return { - ndata: {} + data: {} }; }, methods: { alert: function(f) { console.log("alert", f); }, - //getIri() { - // console.log("o", this.getSkosexactMatch(this.o)); - // return this.getSkosexactMatch(this.o); - //}, - getMetadata: function(i) { - var self = this; + getMetadata: function() { + var self = this; + var iri = this.getIri; //var iri = self.getSkosexactMatch(this.o); - console.log("irir ", i); + console.log("irir ", iri); //before I was getting it all in an array in the parent component @@ -236,16 +198,16 @@ export default { //promise to fetch data var params = { - iri: i + iri: iri }; var query = qs.stringify(params); - /* console.log( - "fetch data", - self.$store.state.settings.global.suggesters.ExtServiceSuggest + - "getdata?" + - query - );*/ + //console.log( + // "fetch data", + // self.$store.state.settings.global.suggesters.ExtServiceSuggest + + // "getdata?" + + // query + //); fetch( self.$store.state.settings.global.suggesters.ExtServiceSuggest + @@ -260,14 +222,12 @@ export default { return response.json(); }) .then(function(body) { - self.ndata = body; - //ndata = body; + self.data = body; + //if body is empty, then just use whatever was there already in the data getData if (body.result == "empty") { - self.ndata = self.o; - //ndata = self.o; + self.data = self.o; } - //return ndata; }) .catch(function(error) { diff --git a/src/components/input/pharma-input-fields/PhInputForm.vue b/src/components/input/pharma-input-fields/PhInputForm.vue index c69f3d3fbe47854c59adba2c5b7439bb0808cd08..42c2a661459867efbb90fdc4b36cbc19145a6c28 100644 --- a/src/components/input/pharma-input-fields/PhInputForm.vue +++ b/src/components/input/pharma-input-fields/PhInputForm.vue @@ -27,10 +27,9 @@ </div> </v-flex> </v-layout> - + <v-flex v-if="n== 'general'"> <v-layout v-for="(f) in s[index].fields" :key="f.id" row wrap fill-height> - <v-flex xs12 v-if="f.component === 'text-field'"> <v-card-title v-if="f.header !== ''" class="title grey lighten-2 white--text"> <span>{{f.header}}</span> @@ -108,9 +107,7 @@ <v-flex v-else-if="n== 'file'"> <v-card-text> <v-layout v-for="(f) in s[index].fields" :key="f.id" row wrap> - <v-flex v-if="f.component == 'files'"> - <ph-files v-bind.sync="f" v-on:input-numberFiles="f.nfile=$event;filesNber=f.nfile" @@ -123,7 +120,6 @@ v-on:input-warning="f.licenseWarning=$event" v-on:validation="f.warning=$event" ></ph-files> - </v-flex> </v-layout> </v-card-text> @@ -133,10 +129,9 @@ <v-layout align-center justify-center fill-height> <v-flex> <v-toolbar dense flat color="white"> - <v-toolbar-title class="title"> - Fill-in the metadata for the research collection: {{$store.state.metadataInputs.containerTitle}} - - </v-toolbar-title> + <v-toolbar-title + class="title" + >Fill-in the metadata for the research collection: {{$store.state.metadataInputs.containerTitle}}</v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> </v-flex> @@ -164,7 +159,6 @@ <v-card-title class="title">{{c.description}}</v-card-title> <v-layout v-for="(f,index) in c.fields" :key="index"> - <v-flex v-if="f.component=='ext-service'&&f.visible==true"> <ph-ext-service v-bind.sync="f" @@ -184,7 +178,6 @@ </v-flex> <v-flex v-if=" f.component == 'selection'&&f.visible==true"> - <ph-selection v-bind.sync="f" :required="false" @@ -247,40 +240,36 @@ </v-layout> </v-flex> <v-flex v-else-if="n== 'submit'"> - <v-layout align-center justify-center fill-height> + <v-layout align-center justify-center fill-height> <v-flex> <v-toolbar dense flat color="white"> - <v-toolbar-title class="title"> - Submit the following metadata: - - </v-toolbar-title> + <v-toolbar-title class="title">Submit the following metadata:</v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> </v-flex> </v-layout> - <ph-d-jsonld :form="form" :jsonld="jsonDisplay"></ph-d-jsonld> - <v-layout align-center justify-center fill-height> + <ph-d-jsonld :form="form" :viewpharmameta="false" :jsonld="jsonDisplay"></ph-d-jsonld> + <v-layout align-center justify-center fill-height> <v-flex> <v-toolbar dense flat color="white"> - <v-toolbar-title class="title"> - With the following files: - - </v-toolbar-title> + <v-toolbar-title class="title">With the following files:</v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> </v-flex> </v-layout> - <v-layout row wrap v-for="(mjson,index) in jsonDisplayMembers" :key="index+'files'"> - - <v-flex xs12> - - - <v-icon>attachment</v-icon> - File {{index+1}} - </v-flex> - <v-flex xs12> <v-card> - <ph-d-jsonld :form="form" :jsonld="mjson"></ph-d-jsonld><v-spacer></v-spacer></v-card></v-flex></v-layout> + <v-layout row wrap v-for="(mjson,index) in jsonDisplayMembers" :key="index+'files'"> + <v-flex xs12> + <v-icon>attachment</v-icon> + File {{index+1}} + </v-flex> + <v-flex xs12> + <v-card> + <ph-d-jsonld :form="form" :jsonld="mjson"></ph-d-jsonld> + <v-spacer></v-spacer> + </v-card> + </v-flex> + </v-layout> <v-layout align-center justify-end row class="ma-3"> <!--<v-dialog v-if="templating" v-model="templatedialog" width="500"> <v-btn diff --git a/src/utils/fields.js b/src/utils/fields.js index 45a8f352fe20821fca6dc2b954763c47adf75201..66186c072b3457813f4bb185d7741837011e7297 100644 --- a/src/utils/fields.js +++ b/src/utils/fields.js @@ -13,7 +13,7 @@ const fields = [ formValidation: true, required: true, info: "Title of your research collection", - warning: true + warning: true, }, { id: "date", @@ -29,7 +29,7 @@ const fields = [ formValidation: true, warning: false, definition: - "A point or period of time associated with an event in the lifecycle of the resource." + "A point or period of time associated with an event in the lifecycle of the resource.", }, { id: "abstract", @@ -46,7 +46,7 @@ const fields = [ language: "eng", required: true, formValidation: true, - warning: true + warning: true, }, { id: "contributors", @@ -67,7 +67,7 @@ const fields = [ ordergroup: "entity", formValidation: true, info: "contributors to the project", - warning: true + warning: true, }, { id: "projects", @@ -80,18 +80,18 @@ const fields = [ "skos:prefLabel": [ { "@value": "", - "@language": "en" - } + "@language": "en", + }, ], "rdfs:comment": [ { "@value": "", - "@language": "eng" - } + "@language": "eng", + }, ], "foaf:homepage": [""], - "skos:notation": [""] - } + "skos:notation": [""], + }, ], agency: [ { @@ -99,11 +99,11 @@ const fields = [ "skos:prefLabel": [ { "@value": "", - "@language": "eng" - } + "@language": "eng", + }, ], - "skos:exactMatch": [""] - } + "skos:exactMatch": [""], + }, ], component: "project", type: "foaf:Project", @@ -113,7 +113,7 @@ const fields = [ ordergroup: "project", formValidation: false, warning: false, - info: "Put some info here" + info: "Put some info here", }, /* { id: "file", @@ -135,7 +135,7 @@ const fields = [ warning: false, "skos:prefLabel": [], definition: - "The value will indicate the copyright, usage and access rights that apply to this digital representation." + "The value will indicate the copyright, usage and access rights that apply to this digital representation.", }, { id: "file", @@ -150,7 +150,7 @@ const fields = [ fileLicense: "", licenseWarning: true, formValidation: true, - warning: true + warning: true, }, { @@ -164,14 +164,14 @@ const fields = [ value: "", language: "", definition: - "Information about rights held in and over the resource. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights." + "Information about rights held in and over the resource. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.", }, { id: "resource-type", fieldname: "Resource type", predicate: "dcterms:type", warning: false, - value: "" + value: "", }, { id: "1-Biological-macromolecule", @@ -190,7 +190,7 @@ const fields = [ visible: true, category: ["biologicalMacromolecule"], vocabulary: "biological_macromolecule", - info: "" + info: "", }, { id: "1-Uniprot", @@ -214,7 +214,7 @@ const fields = [ description: "Protein", infoRef: "http://purl.obolibrary.org/obo/", info: - "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" + "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry", }, { id: "1-Isoform", @@ -233,7 +233,7 @@ const fields = [ description: "Protein", info: "A quality of a protein that harbors a variation from the native protein (called canonical form), which could arise due to alternative promoter usage, alternative splicing, alternative translation initiation and ribosomal frameshifting.", - infoRef: "http://www.bioassayontology.org/bao#BAO_0002646" + infoRef: "http://www.bioassayontology.org/bao#BAO_0002646", }, { id: "1-Protein-sequence-alteration", @@ -252,7 +252,7 @@ const fields = [ description: "Protein", info: "Any subcellular or molecular event, process, or condition that produces a divergence from the usual wild-type condition in the primary sequence of a peptide or protein molecule. (NCI) [ NCI ]", - infoRef: "http://purl.obolibrary.org/obo/NCIT:C21070" + infoRef: "http://purl.obolibrary.org/obo/NCIT:C21070", }, { id: "1-Protein-modification", @@ -271,7 +271,7 @@ const fields = [ description: "Protein", info: "Covalent modification of, or a change resulting in an alteration of the measured molecular mass of, a peptide or protein amino acid residue. [ PubMed:18688235 ]", - infoRef: "http://purl.obolibrary.org/obo/MOD:00000" + infoRef: "http://purl.obolibrary.org/obo/MOD:00000", }, { id: "1-Entrez-gene-ID", @@ -290,7 +290,7 @@ const fields = [ description: "Gene", info: "EntrezGene_ID NCIT:C49379 Indicates the accession number for a Gene within the Entrez Gene database. [ NCI ]", - infoRef: "http://purl.obolibrary.org/obo/NCIT:C49379" + infoRef: "http://purl.obolibrary.org/obo/NCIT:C49379", }, { id: "1-Gene-modification", @@ -309,7 +309,7 @@ const fields = [ description: "Gene", info: "Gene modification NCIT:C126104 Any gene manipulation method used to generate a product with an altered sequence, structure, or conformation. [ NCI ]", - infoRef: "http://purl.obolibrary.org/obo/NCIT:C126104" + infoRef: "http://purl.obolibrary.org/obo/NCIT:C126104", }, { id: "1-Nucleic-acid-type", @@ -332,7 +332,7 @@ const fields = [ subcategory: ["polynucleotide"], description: "polynucleotide", info: "CHEBI:15986", - infoRef: "http://purl.obolibrary.org/obo/CHEBI:15986" + infoRef: "http://purl.obolibrary.org/obo/CHEBI:15986", }, { id: "1-RefSeq-accession", @@ -351,7 +351,7 @@ const fields = [ description: "Polynucleotide", info: "RefSeq accession EDAM > data:1098 Accession number of a RefSeq database entry. Synonyms: RefSeq ID", - infoRef: "" + infoRef: "", }, { id: "1-PFAM-accession", @@ -370,7 +370,7 @@ const fields = [ description: "Protein Family", info: "PFAM accession number EDAM > data:1138 Accession number of a Pfam entry.", - infoRef: "" + infoRef: "", }, { id: "1-Uniprot-protein-subunit", @@ -391,7 +391,7 @@ const fields = [ subcategory: ["Protein Subunit"], description: "Protein Subunit", info: - "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" + "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry", }, { id: "1-Isoform-protein-subunit", @@ -411,7 +411,7 @@ const fields = [ description: "Protein Subunit", info: "A quality of a protein that harbors a variation from the native protein (called canonical form), which could arise due to alternative promoter usage, alternative splicing, alternative translation initiation and ribosomal frameshifting.", - infoRef: "" + infoRef: "", }, { id: "1-Protein-sequence-alteration-protein-subunit", @@ -431,7 +431,7 @@ const fields = [ description: "Protein Subunit", info: "Any subcellular or molecular event, process, or condition that produces a divergence from the usual wild-type condition in the primary sequence of a peptide or protein molecule. (NCI) [ NCI ]", - infoRef: "NCIT:C21070" + infoRef: "NCIT:C21070", }, { id: "1-Protein-modification-protein-subunit", @@ -451,7 +451,7 @@ const fields = [ description: "Protein Subunit", info: "Covalent modification of, or a change resulting in an alteration of the measured molecular mass of, a peptide or protein amino acid residue. [ PubMed:18688235 ]", - infoRef: "MOD:00000" + infoRef: "MOD:00000", }, { id: "1-Complex-portal-accession", @@ -470,7 +470,7 @@ const fields = [ description: "Protein Complex", info: "A persistent (stable) and unique identifier of the manually curated EMBL-EBI Complex-Portal (Complex Portal", - infoRef: "" + infoRef: "", }, { id: "1-Polysaccharide", @@ -492,7 +492,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Polysaccharide"], description: "Polysaccharide", - info: "" + info: "", }, { id: "1-Lipid", @@ -513,7 +513,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Lipid"], description: "Lipid", - info: "" + info: "", }, { id: "2-Life", @@ -533,7 +533,7 @@ const fields = [ vocabulary: "life", info: - "Life NCIT:C142142 Thee biochemical phenomenon that distinguishes organisms from inorganic matter. It is characterized by growth, metabolism, and reproduction. [ NCI ]" + "Life NCIT:C142142 Thee biochemical phenomenon that distinguishes organisms from inorganic matter. It is characterized by growth, metabolism, and reproduction. [ NCI ]", }, { @@ -559,7 +559,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_1", - info: "NCBITaxon_1" + info: "NCBITaxon_1", }, { id: "2-Viruses", @@ -584,7 +584,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_10239", - info: "NCBITaxon_10239" + info: "NCBITaxon_10239", }, { id: "2-Viroids", @@ -609,7 +609,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_12884", - info: "NCBITaxon_10239" + info: "NCBITaxon_10239", }, { id: "2-cellular-organisms", @@ -634,7 +634,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_131567", - info: "NCBITaxon_131567" + info: "NCBITaxon_131567", }, { id: "2-otherSequences", @@ -659,7 +659,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_28384", - info: "NCBITaxon_28384" + info: "NCBITaxon_28384", }, { id: "2-unclassifiedSequences", @@ -684,7 +684,7 @@ const fields = [ //baseurl: "http://purl.obolibrary.org/obo/" description: "Living Organisms", infoRef: "http://purl.obolibrary.org/obo/NCBITaxon_12908", - info: "NCBITaxon_12908" + info: "NCBITaxon_12908", }, { id: "2-cellosaurus", @@ -701,7 +701,7 @@ const fields = [ ontology: "cellosaurus", ontClass: "", category: ["life"], - description: "Cellosaurus cell-line" + description: "Cellosaurus cell-line", }, { id: "2-cultured-cell", @@ -721,7 +721,7 @@ const fields = [ category: ["life"], description: "Cellosaurus cell-line", infoRef: "", - info: "CL_0000010" + info: "CL_0000010", }, { id: "3-Disease", @@ -746,7 +746,7 @@ const fields = [ description: "disease or disorder ", info: "disease or disorder MONDO:0000001 A disease is a disposition to undergo pathological processes that exists in an organism because of one or more disorders in that organism. [ OGMS:0000031 ]", - infoRef: "MONDO:0000001" + infoRef: "MONDO:0000001", }, { id: "4-Anatomical-category", @@ -761,7 +761,7 @@ const fields = [ visible: true, vocabulary: "anatomical_category", stateVoc: "anatomical_category", - info: "OMIT:0001001" + info: "OMIT:0001001", }, { @@ -787,7 +787,7 @@ const fields = [ description: "Anatomical entity, cross species", infoRef: "http://purl.bioontology.org/ontology/", info: - "anatomical entity UBERON:0001062 Biological entity that is either an individual member of a biological species or constitutes the structural organization of an individual member of a biological species. [ FMA:62955 http://orcid.org/0000-0001-9114-8737 ]" + "anatomical entity UBERON:0001062 Biological entity that is either an individual member of a biological species or constitutes the structural organization of an individual member of a biological species. [ FMA:62955 http://orcid.org/0000-0001-9114-8737 ]", }, { id: "4-Plant-anatomical-entity", @@ -812,7 +812,7 @@ const fields = [ description: "Plant anatomical entity", infoRef: "http://purl.bioontology.org/ontology/", info: - "plant anatomical entity PO:0025131 An anatomical entity that is or was part of a plant. [ CARO:0000000 POC:curators ]" + "plant anatomical entity PO:0025131 An anatomical entity that is or was part of a plant. [ CARO:0000000 POC:curators ]", }, { id: "4-Fungal-structure", @@ -837,7 +837,7 @@ const fields = [ description: "Anatomical entity, fungi", info: "The parts of fungi.", - infoRef: "http://purl.bioontology.org/ontology/MESH/D056229" + infoRef: "http://purl.bioontology.org/ontology/MESH/D056229", }, { id: "4-Bacterial-structures", @@ -861,7 +861,7 @@ const fields = [ subcategory: ["Bacterial structures"], description: "Anatomical entity, bacteria", info: "The parts of bacteria.", - infoRef: "http://purl.bioontology.org/ontology/MESH/D056226" + infoRef: "http://purl.bioontology.org/ontology/MESH/D056226", }, { id: "4-Viral-structures", @@ -885,7 +885,7 @@ const fields = [ subcategory: ["Viral structures"], description: "Viral structures", info: "The parts of bacteria.", - infoRef: "" + infoRef: "", }, { id: "5-Molecular-function", @@ -909,7 +909,7 @@ const fields = [ description: "GO Molecular Function:", infoRef: "http://purl.obolibrary.org/obo/GO_0003674", info: - "A molecular process that can be carried out by the action of a single macromolecular machine, usually via direct physical interactions with other molecular entities. Function in this sense denotes an action, or activity, that a gene product (or a complex) performs. These actions are described from two distinct but related perspectives: (1) biochemical activity, and (2) role as a component in a larger system/process." + "A molecular process that can be carried out by the action of a single macromolecular machine, usually via direct physical interactions with other molecular entities. Function in this sense denotes an action, or activity, that a gene product (or a complex) performs. These actions are described from two distinct but related perspectives: (1) biochemical activity, and (2) role as a component in a larger system/process.", }, { id: "5-Biological-process", @@ -933,7 +933,7 @@ const fields = [ freefield: true, infoRef: "http://purl.obolibrary.org/obo/GO_0003674", info: - "A biological process represents a specific objective that the organism is genetically programmed to achieve. Biological processes are often described by their outcome or ending state, e.g., the biological process of cell division results in the creation of two daughter cells (a divided cell) from a single parent cell. A biological process is accomplished by a particular set of molecular functions carried out by specific gene products (or macromolecular complexes), often in a highly regulated manner and in a particular temporal sequence." + "A biological process represents a specific objective that the organism is genetically programmed to achieve. Biological processes are often described by their outcome or ending state, e.g., the biological process of cell division results in the creation of two daughter cells (a divided cell) from a single parent cell. A biological process is accomplished by a particular set of molecular functions carried out by specific gene products (or macromolecular complexes), often in a highly regulated manner and in a particular temporal sequence.", }, { id: "5-Cellular-component", @@ -957,7 +957,7 @@ const fields = [ description: "GO Cellular Component:", infoRef: "http://purl.obolibrary.org/obo/GO_0005575", info: - "A location, relative to cellular compartments and structures, occupied by a macromolecular machine when it carries out a molecular function. There are two ways in which the gene ontology describes locations of gene products: (1) relative to cellular structures (e.g., cytoplasmic side of plasma membrane) or compartments (e.g., mitochondrion), and (2) the stable macromolecular complexes of which they are parts (e.g., the ribosome). [ Sao Paulo MCA-MR Syndrome (ilx_0637672)" + "A location, relative to cellular compartments and structures, occupied by a macromolecular machine when it carries out a molecular function. There are two ways in which the gene ontology describes locations of gene products: (1) relative to cellular structures (e.g., cytoplasmic side of plasma membrane) or compartments (e.g., mitochondrion), and (2) the stable macromolecular complexes of which they are parts (e.g., the ribosome). [ Sao Paulo MCA-MR Syndrome (ilx_0637672)", }, { id: "6-Chemical-entities", @@ -980,7 +980,7 @@ const fields = [ subcategory: ["Chemical Entities"], info: "A chemical entity is a physical entity of interest in chemistry including molecular entities, parts thereof, and chemical substances. ", - description: "Chemical entity" + description: "Chemical entity", }, /* { id: "6-Atom", @@ -1042,7 +1042,7 @@ const fields = [ freefield: true, category: ["chebi"], subcategory: ["Role"], - description: "Role" + description: "Role", }, { id: "6-Subatomic-particle", @@ -1064,7 +1064,7 @@ const fields = [ freefield: true, infoRef: "http://purl.obolibrary.org/obo/CHEBI_36342", info: "A particle smaller than an atom.", - description: "subatomic particle" + description: "subatomic particle", }, { id: "7-Technique", @@ -1085,7 +1085,7 @@ const fields = [ freefield: true, infoRef: "http://www.ontobee.org/ontology/NCIT?iri=http://purl.obolibrary.org/obo/NCIT_C20368", - info: "Technique used in the laboratory for scientific research. " + info: "Technique used in the laboratory for scientific research. ", }, { id: "8-Discipline", @@ -1105,7 +1105,7 @@ const fields = [ category: ["discipline"], description: "Occupation or Discipline:", infoRef: "http://purl.obolibrary.org/obo/NCIT_C19160", - info: "Info here " + info: "Info here ", }, { @@ -1122,7 +1122,7 @@ const fields = [ info: "The endpoint is a quantitive or qualitative interpretable standardized representation of a perturbation (a change from a defined reference state of a closed model system) that is measured by the bioassay. An endpoint consists of a series of data points, one for each perturbing agent (screened entity) tested the assay.", infoRef: "http://www.bioassayontology.org/bao#BAO_0000179", - description: "Assay result:" + description: "Assay result:", }, { @@ -1141,7 +1141,7 @@ const fields = [ info: "The name of a bioassay which is associated with each assay ID (AID). It contains information about the target tested, the stage of the assay (primary or confirmatory), the assay format (biochemical or cell based), etc.", infoRef: - "https://www.ebi.ac.uk/ols/ontologies/bao/terms?iri=http%3A%2F%2Fwww.bioassayontology.org%2Fbao%23BAO_0000521" + "https://www.ebi.ac.uk/ols/ontologies/bao/terms?iri=http%3A%2F%2Fwww.bioassayontology.org%2Fbao%23BAO_0000521", }, { id: "0-Assay-protocol", @@ -1159,7 +1159,7 @@ const fields = [ info: "This includes the methodology used to perform a particular bioassay and is found on the PubChem website associated with each assay ID (AID). It includes the assay components and the order in which they were added, the incubation times, detection method and the kit used, etc.", infoRef: "http://www.bioassayontology.org/bao#BAO_0000523", - description: "Assay target abstract:" + description: "Assay target abstract:", }, { id: "0-Bioassay-type", @@ -1178,7 +1178,7 @@ const fields = [ stateVoc: "bioassay_type", info: "", description: "Bioassay type:", - infoRef: "" + infoRef: "", }, { id: "0-Bioassay-category", @@ -1198,7 +1198,7 @@ const fields = [ description: "Bioassay category:", info: "General assay types like enzyme assay and their subtypes like kinase activity assay", - infoRef: "http://www.bioassayontology.org/bao#BAO_0000015" + infoRef: "http://www.bioassayontology.org/bao#BAO_0000015", }, { id: "0-Assay-format", @@ -1218,7 +1218,7 @@ const fields = [ category: ["assay"], info: "Assay format is a conceptualization of assays based on the biological and / or chemical features of the experimental system. For example assay formats include biochemical assays - referring to assays with purified protein, cell-based - referring to assays in whole cells, or organism-based - referring to assays performed in an organism.", - infoRef: "http://www.bioassayontology.org/bao#BAO_0000019" + infoRef: "http://www.bioassayontology.org/bao#BAO_0000019", }, { id: "0-Assay-design-method", @@ -1239,7 +1239,7 @@ const fields = [ description: "Assay design method:", info: "The assay design method describes how a biological or physical process screened / investigated in the model system is translated into a detectable signal. This relates to the technology / technologies used to make the assay system work, i.e. enable that the screened process can be detected. It typically involves some manipulation of the (biological) model system to detect the process of interest.", - infoRef: "http://www.bioassayontology.org/bao#BAO_0002202" + infoRef: "http://www.bioassayontology.org/bao#BAO_0002202", }, { @@ -1261,7 +1261,7 @@ const fields = [ description: "Computational method", info: "Method based on the application of information technology to chemistry and biology.", - infoRef: "http://www.bioassayontology.org/bao#BAO_0002094" + infoRef: "http://www.bioassayontology.org/bao#BAO_0002094", }, { id: "0-Assay-screening-campaign-stage", @@ -1282,7 +1282,7 @@ const fields = [ description: "Assay screening campaign stage:", info: "The assay stage describes the purpose of the assay in an assay campaign. Assay stage also relates to the order of assays in a screening campaign. For example the primary assay, which is performed first, identifies hits. The primary hits are then confirmed in a confirmatory assay. Subsequent secondary assays are run to eliminate compounds that are not of interest or to confirm hits using an alternate design / technology, or to further characterize compounds. Whether an assay is run in single concentration or concentration response is defined in the class 'assay measurement throughput quality'. For example primary assays are typically run in single concentration with single measurements. However, the NCGC runs qHTS primary assays as concentration-response assays.", - infoRef: "http://www.bioassayontology.org/bao#BAO_0000029" + infoRef: "http://www.bioassayontology.org/bao#BAO_0000029", }, { id: "0-Organism", @@ -1304,7 +1304,7 @@ const fields = [ info: "The organism related to the target / meta-target of the bioassay. It includes both bacterium and eukaryote.", infoRef: "http://www.bioassayontology.org/bao#BAO:0000551", - description: "Bioassay organism:" + description: "Bioassay organism:", }, { id: "0-Organism-assayTarget", @@ -1325,7 +1325,7 @@ const fields = [ multiplicable: true, info: "The organism related to the target / meta-target of the bioassay. It includes both bacterium and eukaryote.", - infoRef: "BAO:0000551" + infoRef: "BAO:0000551", }, { id: "0-Cellular-organism", @@ -1344,7 +1344,7 @@ const fields = [ category: ["assay"], subcategory: ["assayOrganism"], description: "Bioassay organism:", - info: "" + info: "", }, { id: "0-Viruses", @@ -1363,7 +1363,7 @@ const fields = [ category: ["assay"], subcategory: ["assayOrganism"], description: "Viruses", - info: "" + info: "", }, { id: "0-Viroids", @@ -1382,7 +1382,7 @@ const fields = [ category: ["assay"], subcategory: ["assayOrganism"], description: "Viroids", - info: "" + info: "", }, { id: "0-cell-line", @@ -1400,7 +1400,7 @@ const fields = [ description: "Cultured Cell (cellosaurus)", info: "A cell in vitro that is or has been maintained or propagated as part of a cell culture. [ ReO:mhb ]", - infoRef: "http://purl.obolibrary.org/obo/CL_0000010" + infoRef: "http://purl.obolibrary.org/obo/CL_0000010", }, { id: "0-Assay-target", @@ -1418,7 +1418,7 @@ const fields = [ vocabulary: "assay_target", category: ["assayTarget"], stateVoc: "assay_target", - info: "" + info: "", //baseurl: "http://www.bioassayontology.org/bao#", //description: "Assay target:" }, @@ -1439,7 +1439,7 @@ const fields = [ component: "ext-service", category: ["assayTarget"], description: "Small Molecule", - info: "NCIT:C48809" + info: "NCIT:C48809", }, { id: "0-cellular-anatomical-entity", @@ -1459,7 +1459,7 @@ const fields = [ multiple: true, description: "Cellular anatomical entity", info: "", - infoRef: "http://purl.obolibrary.org/obo/GO_0110165" + infoRef: "http://purl.obolibrary.org/obo/GO_0110165", }, { id: "0-tissue", @@ -1480,7 +1480,7 @@ const fields = [ description: "Tissue", info: "An anatomical structure consisting of similarly specialized cells and intercellular matrix, aggregated according to genetically determined spatial relationships, performing a specific function. [ NCI ]", - infoRef: "NCIT:C12801" + infoRef: "NCIT:C12801", }, { id: "0-carbohydrate", @@ -1501,7 +1501,7 @@ const fields = [ description: "Carbohydrate", info: "An anatomical structure consisting of similarly specialized cells and intercellular matrix, aggregated according to genetically determined spatial relationships, performing a specific function. [ NCI ]", - infoRef: "NCIT:C12801" + infoRef: "NCIT:C12801", }, { id: "0-detection", @@ -1524,7 +1524,7 @@ const fields = [ component: "selection", info: "The physical method (technology) used to measure / readout the effect caused by a perturbagen in the assay environment.", - infoRef: "" + infoRef: "", }, { id: "0-detection_method", @@ -1544,7 +1544,7 @@ const fields = [ category: ["assayDetection"], description: "Physical detection method", info: "", - infoRef: "http://www.bioassayontology.org/bao#BAO_0000035" + infoRef: "http://www.bioassayontology.org/bao#BAO_0000035", }, { id: "0-detection_instrument", @@ -1564,8 +1564,8 @@ const fields = [ category: ["assayDetection"], description: "Detection instrument", info: "", - infoRef: "http://www.bioassayontology.org/bao#BAO_0000697" - } + infoRef: "http://www.bioassayontology.org/bao#BAO_0000697", + }, ]; const predicateOrder = [ @@ -1637,7 +1637,7 @@ const predicateOrder = [ "frapo:hasFundingAgency", "frapo:isOutputOf", "rdax:P00009", - "citation" + "citation", ]; export default { @@ -1646,7 +1646,7 @@ export default { }, getEditableFields: function() { - var editable = fields.filter(item => !item.readonly); + var editable = fields.filter((item) => !item.readonly); // hack: some bug in vuetify autocomplete can't handle the value property var newarr = []; for (var i = 0; i < editable.length; i++) { @@ -1683,7 +1683,7 @@ export default { if (fields[i]["category"][0] === categ) { ar.push({ label: fields[i].description, - id: fields[i].infoRef + id: fields[i].infoRef, }); } } @@ -1692,5 +1692,5 @@ export default { }, getPredicateOrder: function() { return predicateOrder; - } + }, }; diff --git a/src/utils/json-ld.js b/src/utils/json-ld.js index 1eb19dc18f83341d67729fff8b8d60c5b3b39495..3920b0e14f661adb431e61fc52aca6670bac02c8 100644 --- a/src/utils/json-ld.js +++ b/src/utils/json-ld.js @@ -1,7 +1,7 @@ import fields from "./fields"; export default { - json2components: function (jsonld, options) { + json2components: function(jsonld, options) { var components = []; // all dce:subjects in the same language are handled by 1 component @@ -47,7 +47,7 @@ export default { components.push(f); break; - // dcterms:type + // dcterms:type case "dcterms:type": //take this off ISA /* f = fields.getField("resource-type"); @@ -58,7 +58,7 @@ export default { components.push({}); break; - // edm:hasType + // edm:hasType case "edm:hasType": f = fields.getField("object-type"); for (let em of value[i]["skos:exactMatch"]) { @@ -67,7 +67,7 @@ export default { components.push(f); break; - // schema:genre + // schema:genre case "schema:genre": f = fields.getField("genre"); for (let em of value[i]["skos:exactMatch"]) { @@ -76,7 +76,7 @@ export default { components.push(f); break; - // oaire:version + // oaire:version case "oaire:version": f = fields.getField("version-type"); for (let em of value[i]["skos:exactMatch"]) { @@ -85,7 +85,7 @@ export default { components.push(f); break; - // dcterms:accessRights + // dcterms:accessRights case "dcterms:accessRights": f = fields.getField("access-right"); for (let em of value[i]["skos:exactMatch"]) { @@ -94,7 +94,7 @@ export default { components.push(f); break; - // dce:title + // dce:title case "dce:title": if ( value[i]["@type"] === "bf:Title" || @@ -106,9 +106,9 @@ export default { if (value[i]["bf:mainTitle"]) { for (j = 0; j < value[i]["bf:mainTitle"].length; j++) { f.title = value[i]["bf:mainTitle"][j]["@value"]; - f.language = value[i]["bf:mainTitle"][j]["@language"] ? - value[i]["bf:mainTitle"][j]["@language"] : - "eng"; + f.language = value[i]["bf:mainTitle"][j]["@language"] + ? value[i]["bf:mainTitle"][j]["@language"] + : "eng"; } } if (value[i]["bf:subtitle"]) { @@ -120,7 +120,7 @@ export default { } break; - // bf:note + // bf:note case "bf:note": switch (value[i]["@type"]) { case "bf:Note": @@ -145,26 +145,26 @@ export default { for (let prefLabel of value[i]["skos:prefLabel"]) { f.value = prefLabel["@value"]; - f.language = prefLabel["@language"] ? - prefLabel["@language"] : - ""; + f.language = prefLabel["@language"] + ? prefLabel["@language"] + : ""; } components.push(f); break; - // bf:tableOfContents + // bf:tableOfContents case "bf:tableOfContents": f = fields.getField("table-of-contents"); for (let prefLabel of value[i]["skos:prefLabel"]) { f.value = prefLabel["@value"]; - f.language = prefLabel["@language"] ? - prefLabel["@language"] : - ""; + f.language = prefLabel["@language"] + ? prefLabel["@language"] + : ""; } components.push(f); break; - // dcterms:language + // dcterms:language case "dcterms:language": f = fields.getField("language"); for (j = 0; j < value[i].length; j++) { @@ -173,7 +173,7 @@ export default { components.push(f); break; - // schema:subtitleLanguage + // schema:subtitleLanguage case "schema:subtitleLanguage": f = fields.getField("subtitle-language"); for (j = 0; j < value[i].length; j++) { @@ -182,15 +182,14 @@ export default { components.push(f); break; - // dce:subject + // dce:subject case "dce:subject": // noop - we handled this already break; - // dcterms:subject + // dcterms:subject case "dcterms:subject": if (value[i]["@type"] === "skos:Concept") { - //ISA THAT THIS OFF FOR NOW /* f = fields.getField("vocab-ext-readonly"); f["skos:exactMatch"] = value[i]["skos:exactMatch"]; @@ -215,7 +214,6 @@ export default { } else if (value[i]["@type"] === "phaidra:Subject") { // ignore, handled elsewhere } else { - } break; @@ -307,7 +305,7 @@ export default { let entity = { id: "contained-in-role-" + roleidx, role: key, - ordergroup: "contained-in-role" + ordergroup: "contained-in-role", }; if (role["schema:name"]) { for (let name of role["schema:name"]) { @@ -386,17 +384,17 @@ export default { components.push(f); break; - // dcterms:temporal + // dcterms:temporal case "dcterms:temporal": f = fields.getField("temporal-coverage"); f.value = value[i]["@value"]; - f.language = value[i]["@language"] ? - value[i]["@language"] : - "eng"; + f.language = value[i]["@language"] + ? value[i]["@language"] + : "eng"; components.push(f); break; - // spatial + // spatial case "dcterms:spatial": case "vra:placeOfCreation": case "vra:placeOfRepository": @@ -410,9 +408,9 @@ export default { f.type = key; for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } else { @@ -442,7 +440,7 @@ export default { } break; - // dce:format + // dce:format case "dce:format": f = fields.getField("dce-format-vocab"); for (let em of value[i]["skos:exactMatch"]) { @@ -451,7 +449,7 @@ export default { components.push(f); break; - // rdau:P60048 + // rdau:P60048 case "rdau:P60048": f = fields.getField("carrier-type"); for (let em of value[i]["skos:exactMatch"]) { @@ -460,7 +458,7 @@ export default { components.push(f); break; - // edm:rights + // edm:rights case "edm:rights": f = fields.getField("license"); f.vocabulary = "alllicenses"; @@ -468,17 +466,17 @@ export default { components.push(f); break; - // dce:rights + // dce:rights case "dce:rights": f = fields.getField("rights"); f.value = value[i]["@value"]; - f.language = value[i]["@language"] ? - value[i]["@language"] : - "eng"; + f.language = value[i]["@language"] + ? value[i]["@language"] + : "eng"; components.push(f); break; - // bf:provisionActivity + // bf:provisionActivity case "bf:provisionActivity": f = fields.getField("bf-publication"); if (value[i]["bf:agent"]) { @@ -526,16 +524,16 @@ export default { components.push(f); break; - // citation + // citation case "cito:cites": case "cito:isCitedBy": f = fields.getField("citation"); f.type = key; for (let prefLabel of value[i]["skos:prefLabel"]) { f.citation = prefLabel["@value"]; - f.citationLanguage = prefLabel["@language"] ? - prefLabel["@language"] : - ""; + f.citationLanguage = prefLabel["@language"] + ? prefLabel["@language"] + : ""; } for (let em of value[i]["skos:exactMatch"]) { f.identifier = em; @@ -543,7 +541,7 @@ export default { components.push(f); break; - // rdau:P60227 + // rdau:P60227 case "rdau:P60227": f = fields.getField("movieadaptation"); if (value[i]["dce:title"]) { @@ -595,7 +593,7 @@ export default { components.push(f); break; - // frapo:hasFundingAgency + // frapo:hasFundingAgency case "frapo:hasFundingAgency": if (value[i]["@type"] === "frapo:FundingAgency") { //ISA take here off @@ -618,7 +616,7 @@ export default { } break; - // frapo:isOutputOf + // frapo:isOutputOf case "frapo:isOutputOf": if (value[i]["@type"] === "foaf:Project") { //ISA take here off @@ -677,10 +675,10 @@ export default { for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.name = value[i]["skos:prefLabel"][j]["@value"]; f.nameLanguage = value[i]["skos:prefLabel"][j][ - "@language" - ] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + "@language" + ] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } } if (value[i]["skos:notation"]) { @@ -693,7 +691,7 @@ export default { } break; - // rdax:P00009 + // rdax:P00009 case "rdax:P00009": f = fields.getField("association"); for (let em of value[i]["skos:exactMatch"]) { @@ -702,21 +700,21 @@ export default { components.push(f); break; - // dcterms:provenance + // dcterms:provenance case "dcterms:provenance": if (value[i]["@type"] === "dcterms:ProvenanceStatement") { f = fields.getField("provenance"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } break; - // schema:numberOfPages + // schema:numberOfPages case "schema:numberOfPages": f = fields.getField("number-of-pages"); f.label = key; @@ -724,7 +722,7 @@ export default { components.push(f); break; - // bf:soundCharacteristic + // bf:soundCharacteristic case "bf:soundCharacteristic": f = fields.getField("sound-characteristic"); f.label = key; @@ -732,31 +730,31 @@ export default { components.push(f); break; - // bf:supplementaryContent + // bf:supplementaryContent case "bf:supplementaryContent": f = fields.getField("supplementary-content"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); break; - // bf:awards + // bf:awards case "bf:awards": f = fields.getField("award"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); break; - // rdau:P60059 + // rdau:P60059 case "rdau:P60059": f = fields.getField("regional-encoding"); for (let em of value[i]["skos:exactMatch"]) { @@ -765,7 +763,7 @@ export default { components.push(f); break; - // ebucore:filename + // ebucore:filename case "ebucore:filename": f = fields.getField("filename"); f.predicate = key; @@ -774,7 +772,7 @@ export default { components.push(f); break; - // ebucore:hasMimeType + // ebucore:hasMimeType case "ebucore:hasMimeType": f = fields.getField("mime-type"); for (j = 0; j < value[i].length; j++) { @@ -783,7 +781,7 @@ export default { components.push(f); break; - // opaque:cco_accessionNumber + // opaque:cco_accessionNumber case "opaque:cco_accessionNumber": f = fields.getField("accession-number"); for (j = 0; j < value[i].length; j++) { @@ -792,7 +790,7 @@ export default { components.push(f); break; - // bf:shelfMark + // bf:shelfMark case "bf:shelfMark": f = fields.getField("shelf-mark"); for (j = 0; j < value[i].length; j++) { @@ -801,41 +799,41 @@ export default { components.push(f); break; - // bf:physicalLocation + // bf:physicalLocation case "bf:physicalLocation": f = fields.getField("physical-location"); f.value = value[i]["@value"]; - f.language = value[i]["@language"] ? - value[i]["@language"] : - "eng"; + f.language = value[i]["@language"] + ? value[i]["@language"] + : "eng"; components.push(f); break; - // rdau:P60550 + // rdau:P60550 case "rdau:P60550": f = fields.getField("extent"); f.value = value[i]["@value"]; - f.language = value[i]["@language"] ? - value[i]["@language"] : - "eng"; + f.language = value[i]["@language"] + ? value[i]["@language"] + : "eng"; components.push(f); break; - // vra:hasInscription + // vra:hasInscription case "vra:hasInscription": if (value[i]["@type"] === "vra:Inscription") { f = fields.getField("inscription"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } break; - // bf:scale + // bf:scale case "bf:scale": if (value[i]["@type"] === "bf:Scale") { f = fields.getField("scale"); @@ -846,15 +844,15 @@ export default { } break; - // vra:material + // vra:material case "vra:material": if (value[i]["@type"] === "vra:Material") { f = fields.getField("material-text"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } else { @@ -872,7 +870,7 @@ export default { } break; - // vra:hasTechnique + // vra:hasTechnique case "vra:hasTechnique": if ( value[i]["@type"] === "vra:Technique" && @@ -881,9 +879,9 @@ export default { f = fields.getField("technique-text"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } else { @@ -901,7 +899,7 @@ export default { } break; - // dcterms:audience + // dcterms:audience case "dcterms:audience": if ( value[i]["@type"] === "dcterms:audience" && @@ -910,9 +908,9 @@ export default { f = fields.getField("audience"); for (j = 0; j < value[i]["skos:prefLabel"].length; j++) { f.value = value[i]["skos:prefLabel"][j]["@value"]; - f.language = value[i]["skos:prefLabel"][j]["@language"] ? - value[i]["skos:prefLabel"][j]["@language"] : - "eng"; + f.language = value[i]["skos:prefLabel"][j]["@language"] + ? value[i]["skos:prefLabel"][j]["@language"] + : "eng"; } components.push(f); } else { @@ -930,7 +928,7 @@ export default { } break; - // schema:width + // schema:width case "schema:width": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("width"); @@ -944,7 +942,7 @@ export default { } break; - // schema:height + // schema:height case "schema:height": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("height"); @@ -958,7 +956,7 @@ export default { } break; - // schema:depth + // schema:depth case "schema:depth": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("depth"); @@ -972,7 +970,7 @@ export default { } break; - // dates + // dates case "dcterms:date": case "dcterms:created": case "dcterms:modified": @@ -995,7 +993,7 @@ export default { components.push({}); break; - // schema:duration + // schema:duration case "schema:duration": f = fields.getField("duration"); for (j = 0; j < value[i].length; j++) { @@ -1004,7 +1002,7 @@ export default { components.push(f); break; - // phaidra:systemTag + // phaidra:systemTag case "phaidra:systemTag": f = fields.getField("system-tag"); for (j = 0; j < value[i].length; j++) { @@ -1013,14 +1011,13 @@ export default { components.push(f); break; - // pages, handled insisde rdau:P60193 or rdau:P60101 + // pages, handled insisde rdau:P60193 or rdau:P60101 case "schema:pageStart": case "schema:pageEnd": // noop break; default: - // role //ISA off /*if (key.startsWith("role")) { @@ -1129,7 +1126,7 @@ export default { return components; }, - getOrderedComponents: function (components) { + getOrderedComponents: function(components) { var predicateOrder = fields.getPredicateOrder(); var ordered = []; var i; @@ -1148,11 +1145,11 @@ export default { } return ordered; }, - json2form: function (jsonld, options) { + json2form: function(jsonld, options) { var levels = { digital: { - components: [] - } + components: [], + }, }; levels.digital.components = this.json2components(jsonld, options); @@ -1167,7 +1164,7 @@ export default { var subcomp = this.json2components(value[i], options); if (subcomp.length > 0) { levels.subject.push({ - components: subcomp + components: subcomp, }); } } @@ -1176,7 +1173,7 @@ export default { }); var form = { - sections: [] + sections: [], }; console.log( "this.getOrderedComponents(levels.digital.components)", @@ -1187,7 +1184,7 @@ export default { form.sections.push({ title: "General metadata", id: 1, - fields: digitalFields + fields: digitalFields, }); if (levels["subject"]) { @@ -1199,7 +1196,7 @@ export default { title: "Subject", type: "phaidra:Subject", id: "subject-" + i, - fields: subjectFields + fields: subjectFields, }); } } @@ -1210,17 +1207,21 @@ export default { get_json_dce_title(type, title, subtitle, language) { var h = { "@type": type, - "bf:mainTitle": [{ - "@value": title - }] + "bf:mainTitle": [ + { + "@value": title, + }, + ], }; if (language) { h["bf:mainTitle"][0]["@language"] = language; } if (subtitle) { - h["bf:subtitle"] = [{ - "@value": subtitle - }]; + h["bf:subtitle"] = [ + { + "@value": subtitle, + }, + ]; if (language) { h["bf:subtitle"][0]["@language"] = language; } @@ -1272,7 +1273,7 @@ export default { h["skos:prefLabel"] = []; for (var j = 0; j < preflabels.length; j++) { h["skos:prefLabel"].push({ - "@value": preflabels[j] + "@value": preflabels[j], }); } } @@ -1341,7 +1342,7 @@ export default { }, get_json_valueobject(value, language) { var h = { - "@value": value + "@value": value, }; if (language) { @@ -1354,24 +1355,28 @@ export default { var h = { "@type": "schema:QuantitativeValue", "schema:unitCode": [unitCode], - "schema:value": [value] + "schema:value": [value], }; return h; }, get_json_role(type, firstname, lastname, institution, email, orcid) { var h = { - "@type": type + "@type": type, }; if (firstname) { - h["schema:givenName"] = [{ - "@value": firstname - }]; + h["schema:givenName"] = [ + { + "@value": firstname, + }, + ]; } if (lastname) { - h["schema:familyName"] = [{ - "@value": lastname - }]; + h["schema:familyName"] = [ + { + "@value": lastname, + }, + ]; } if (institution) { h["schema:affiliation"] = []; @@ -1380,9 +1385,11 @@ export default { } } if (email) { - h["schema:email"] = [{ - "@value": email - }]; + h["schema:email"] = [ + { + "@value": email, + }, + ]; } if (orcid) { h["skos:exactMatch"] = orcid; @@ -1392,13 +1399,15 @@ export default { }, get_json_general_description(description, descriptionLanguage) { var h = { - "@type": "bf:Note" + "@type": "bf:Note", }; if (description) { - h["skos:prefLabel"] = [{ - "@value": description - }]; + h["skos:prefLabel"] = [ + { + "@value": description, + }, + ]; if (descriptionLanguage) { h["skos:prefLabel"][0]["@language"] = descriptionLanguage; } @@ -1407,13 +1416,15 @@ export default { }, get_json_abstract(description, descriptionLanguage) { var h = { - "@type": "bf:Summary" + "@type": "bf:Summary", }; if (description) { - h["skos:prefLabel"] = [{ - "@value": description - }]; + h["skos:prefLabel"] = [ + { + "@value": description, + }, + ]; if (descriptionLanguage) { h["skos:prefLabel"][0]["@language"] = descriptionLanguage; } @@ -1429,21 +1440,25 @@ export default { homepage ) { var h = { - "@type": "foaf:Project" + "@type": "foaf:Project", }; if (name) { - h["skos:prefLabel"] = [{ - "@value": name - }]; + h["skos:prefLabel"] = [ + { + "@value": name, + }, + ]; if (nameLanguage) { h["skos:prefLabel"][0]["@language"] = nameLanguage; } } if (description) { - h["rdfs:comment"] = [{ - "@value": description - }]; + h["rdfs:comment"] = [ + { + "@value": description, + }, + ]; if (descriptionLanguage) { h["rdfs:comment"][0]["@language"] = descriptionLanguage; } @@ -1469,14 +1484,16 @@ export default { identifiers ) { var h = { - "@type": type + "@type": type, }; if (title) { let tit = { "@type": "bf:Title", - "bf:mainTitle": [{ - "@value": title - }] + "bf:mainTitle": [ + { + "@value": title, + }, + ], }; if (titleLanguage) { tit["bf:mainTitle"][0]["@language"] = titleLanguage; @@ -1513,22 +1530,26 @@ export default { lastname ) { var h = { - "@type": type + "@type": type, }; if (title) { let tit = { "@type": "bf:Title", - "bf:mainTitle": [{ - "@value": title - }] + "bf:mainTitle": [ + { + "@value": title, + }, + ], }; if (titleLanguage) { tit["bf:mainTitle"][0]["@language"] = titleLanguage; } if (subtitle) { - tit["bf:subtitle"] = [{ - "@value": subtitle - }]; + tit["bf:subtitle"] = [ + { + "@value": subtitle, + }, + ]; if (titleLanguage) { tit["bf:subtitle"][0]["@language"] = titleLanguage; } @@ -1537,22 +1558,28 @@ export default { } if (firstname || lastname || name) { let r = { - "@type": "schema:Person" + "@type": "schema:Person", }; if (firstname) { - r["schema:givenName"] = [{ - "@value": firstname - }]; + r["schema:givenName"] = [ + { + "@value": firstname, + }, + ]; } if (lastname) { - r["schema:familyName"] = [{ - "@value": lastname - }]; + r["schema:familyName"] = [ + { + "@value": lastname, + }, + ]; } if (name) { - r["schema:name"] = [{ - "@value": name - }]; + r["schema:name"] = [ + { + "@value": name, + }, + ]; } h[role] = [r]; } @@ -1560,23 +1587,27 @@ export default { }, get_json_bf_publication(publisherName, publishingPlace, publishingDate) { var h = { - "@type": "bf:Publication" + "@type": "bf:Publication", }; if (publisherName) { let pn = { "@type": "schema:Organization", - "schema:name": [{ - "@value": publisherName - }] + "schema:name": [ + { + "@value": publisherName, + }, + ], }; h["bf:agent"] = [pn]; } if (publishingPlace) { let pp = { "@type": "schema:Place", - "skos:prefLabel": [{ - "@value": publishingPlace - }] + "skos:prefLabel": [ + { + "@value": publishingPlace, + }, + ], }; h["bf:place"] = [pp]; } @@ -1588,12 +1619,14 @@ export default { }, get_json_study_plan(name, nameLanguage, notations) { var h = { - "@type": "aaiso:Programme" + "@type": "aaiso:Programme", }; if (name) { - h["skos:prefLabel"] = [{ - "@value": name - }]; + h["skos:prefLabel"] = [ + { + "@value": name, + }, + ]; if (nameLanguage) { h["skos:prefLabel"][0]["@language"] = nameLanguage; } @@ -1605,13 +1638,15 @@ export default { }, get_json_funder(name, nameLanguage, identifiers) { var h = { - "@type": "frapo:FundingAgency" + "@type": "frapo:FundingAgency", }; if (name) { - h["skos:prefLabel"] = [{ - "@value": name - }]; + h["skos:prefLabel"] = [ + { + "@value": name, + }, + ]; if (nameLanguage) { h["skos:prefLabel"][0]["@language"] = nameLanguage; } @@ -1691,7 +1726,7 @@ export default { //this.fields2json(jsonlds[jsonldid], s); } - Object.keys(jsonlds).forEach(function (key) { + Object.keys(jsonlds).forEach(function(key) { if (key.startsWith("subject-")) { if (Object.keys(jsonlds[key]).length > 1) { if (!jsonlds["container"]["dcterms:subject"]) { @@ -1720,7 +1755,7 @@ export default { if (s.type === "phaidra:Subject") { jsonldid = "subject-" + i; jsonlds[jsonldid] = { - "@type": "phaidra:Subject" + "@type": "phaidra:Subject", }; this.fields2json(jsonlds[jsonldid], s); } else { @@ -1728,7 +1763,7 @@ export default { } } - Object.keys(jsonlds).forEach(function (key) { + Object.keys(jsonlds).forEach(function(key) { if (key.startsWith("subject-")) { if (Object.keys(jsonlds[key]).length > 1) { if (!jsonlds["dcterms:subject"]) { @@ -1775,7 +1810,7 @@ export default { ); } break; - // dates + // dates case "date": case "dcterms:date": case "dcterms:created": @@ -1850,10 +1885,12 @@ export default { jsonld, f.predicate, this.get_json_object( - [{ - "@value": f.value, - "@language": f.language - }], + [ + { + "@value": f.value, + "@language": f.language, + }, + ], null, "skos:Concept" ) @@ -1864,7 +1901,6 @@ export default { case "dcterms:subject": if (f.value) { if (f.component === "ext-service") { - for (var k = 0; k < f.value.length; k++) { if (typeof f.value[k] !== "undefined") { if (f.value[k].geneName) { @@ -1907,14 +1943,10 @@ export default { } } } else if (f.component === "selection") { - - for (var m = 0; m < f.value.length; m++) { this.push_object(jsonld, f.predicate, f.value[m]); } - } else { - this.push_object( jsonld, f.predicate, @@ -1923,7 +1955,6 @@ export default { } } - break; case "frapo:isOutputOf": @@ -1973,13 +2004,15 @@ export default { if (f.value) { var mycontent = { "@type": "skos:Concept", - "skos: prefLabel": [{ - "@value": "container", - "@language": "eng" - }], + "skos:prefLabel": [ + { + "@value": "container", + "@language": "eng", + }, + ], "skos: exactMatch": [ - "https://pid.phaidra.org/vocabulary/8MY0-BQDQ" - ] + "https://pid.phaidra.org/vocabulary/8MY0-BQDQ", + ], }; this.push_object(jsonld, f.predicate, mycontent); @@ -2044,5 +2077,5 @@ export default { } } return jsonld; - } -}; \ No newline at end of file + }, +};