diff --git a/package-lock.json b/package-lock.json index 8421dde008d5e0016de4632939a53be1841fdd73..a1255a4b550e79ef1263e9a9663d49d416c52350 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3050,7 +3050,8 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "dev": true, + "optional": true }, "coa": { "version": "2.0.2", @@ -9554,7 +9555,8 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true + "dev": true, + "optional": true }, "rx-lite-aggregates": { "version": "4.0.8", diff --git a/src/App.vue b/src/App.vue index 102a535e1d76c49662b8772c4ffc90a294e8f7ea..0a851179d5dd8936b748526f719dec2b1517bc96 100644 --- a/src/App.vue +++ b/src/App.vue @@ -266,9 +266,7 @@ export default { sections: [] }, members: [], - - pid: "o:585934", - //"o:584804", + pid: "o:588493", piddoc: {}, collection: "", sampleCollection: "", diff --git a/src/components/display/pharma_display/PhDJsonld.vue b/src/components/display/pharma_display/PhDJsonld.vue index be8821f8344bddfceeb7a6a44d012d758a9e3d94..8a5fcda5ba92fae8ce4c655e87490adcc04bfa9a 100644 --- a/src/components/display/pharma_display/PhDJsonld.vue +++ b/src/components/display/pharma_display/PhDJsonld.vue @@ -318,60 +318,41 @@ </v-toolbar> <template v-if="categ.fields.length>0"> - <v-card v-for="l in categ.fields" :key="l+'field'"> - l {{l}} - <!-- s {{s}} type {{sec.type}} label {{s.label}} if {{getSelectionElem(sec.type,s.label)}}--> - <v-layout v-if="l"> - <v-flex xs1 class="subheading"> + + <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>--> <v-flex xs11> - <v-card v-for="(inputf,index) in l.entries" :key="index+'subjectField'"> - inputf{{inputf}} + <!--<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(inputf)==undefined" - :p="getLabel(inputf['@type'])" - :o="inputf" - :key="inputf+index+'pharmafreesubject'" + v-if="getSkosexactMatch(l)==undefined" + :p="getLabel(l['@type'])" + :o="l" + :key="l+index+'pharmafreesubject'" ></p-d-skos-preflabel> <ph-d-metadata - v-if="getSkosexactMatch(inputf)" - :o="inputf" + v-if="getSkosexactMatch(l)" + :o="l" :p="p" - :key="inputf+index+'pharmasubject'" + :key="l+index+'pharmasubject'" ></ph-d-metadata> - </v-card> + <v-divider></v-divider> </v-flex> - <v-divider></v-divider> + </v-layout> </v-card> </template> - <!--<template v-else> - <v-card v-for="(inputf,index) in getCatElem(sec.type)" :key="index+'subj'"> - <v-flex xs2> - <a :href="sec.id" target="_blank">{{getLabel(inputf.data['@type'])}}</a> - </v-flex> - - <p-d-skos-preflabel - v-if="getSkosexactMatch(inputf.data)==undefined" - :p="getLabel(inputf.data['@type'])" - :o="inputf.data" - :key="inputf+index+'pharmafreesubject'" - ></p-d-skos-preflabel> - <ph-d-metadata - v-if="getSkosexactMatch(inputf.data)" - :o="inputf.data" - :p="p" - :key="inputf+index+'pharmasubject'" - ></ph-d-metadata> - - <v-divider></v-divider> - </v-card> - </template>--> + </v-card> - <v-card v-if="categ.subcategory" :key="index+categ.subcategory"> + <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> @@ -379,10 +360,11 @@ </v-toolbar> <template v-if="categ.subcategory.length>0"> - <v-card v-for="l in categ.subcategory" :key="l+'field'"> - <!-- s {{s}} type {{sec.type}} label {{s.label}} if {{getSelectionElem(sec.type,s.label)}}--> + + <v-card v-for="l in categ.subcategory" :key="l.category+'field'"> <v-layout v-if="l"> - l{{l}} + + <v-flex xs1 class="subheading"> <a :href="l.id" target="_blank">{{l.category}}</a> </v-flex> @@ -402,100 +384,18 @@ :p="p" :key="inputf+index+'pharmasubject'" ></ph-d-metadata> + <v-divider></v-divider> </v-card> + </v-flex> - <v-divider></v-divider> + </v-layout> </v-card> </template> - <!--<template v-else> - <v-card v-for="(inputf,index) in getCatElem(sec.type)" :key="index+'subj'"> - <v-flex xs2> - <a :href="sec.id" target="_blank">{{getLabel(inputf.data['@type'])}}</a> - </v-flex> - - <p-d-skos-preflabel - v-if="getSkosexactMatch(inputf.data)==undefined" - :p="getLabel(inputf.data['@type'])" - :o="inputf.data" - :key="inputf+index+'pharmafreesubject'" - ></p-d-skos-preflabel> - <ph-d-metadata - v-if="getSkosexactMatch(inputf.data)" - :o="inputf.data" - :p="p" - :key="inputf+index+'pharmasubject'" - ></ph-d-metadata> - - <v-divider></v-divider> - </v-card> - </template>--> + </v-card> </template> - <!--<template v-for="sec in pharmaSubjects"> - <v-card v-if="getCatElem(sec.type)&&getCatElem(sec.type).length>0" :key="sec.type"> - <v-toolbar dense flat> - <v-layout> - <v-toolbar-title class="font-weight-light">{{sec.title}}</v-toolbar-title> - </v-layout> - </v-toolbar> - - <template v-if="sec.selections"> - <v-card v-for="s in sec.selections" :key="s.label+'t'"> - s {{s}} type {{sec.type}} label {{s.label}} if {{getSelectionElem(sec.type,s.label)}} - <v-layout v-if="getSelectionElem(sec.type,s.label).length>0"> - <v-flex xs1 class="subheading"> - <a :href="s.id" target="_blank">{{s.label}}</a> - </v-flex> - <v-flex xs11> - <v-card - v-for="(inputf,index) in getSelectionElem(sec.type,s.label)" - :key="index+'subj'" - > - <v-flex xs2 v-if="inputf.selection">{{getLabel(inputf.data['@type'])}}</v-flex> - <p-d-skos-preflabel - v-if="getSkosexactMatch(inputf.data)==undefined" - :p="getDescription(inputf.data['@type']) + ' '+getLabel(inputf.data['@type'])" - :o="inputf.data" - :key="inputf+index+'pharmafreesubject'" - ></p-d-skos-preflabel> - - <ph-d-metadata - v-if="getSkosexactMatch(inputf.data)" - :o="inputf.data" - :p="p" - :key="inputf+index+'pharmasubject'" - ></ph-d-metadata> - </v-card> - </v-flex> - <v-divider></v-divider> - </v-layout> - </v-card> - </template> - <template v-else> - <v-card v-for="(inputf,index) in getCatElem(sec.type)" :key="index+'subj'"> - <v-flex xs2> - <a :href="sec.id" target="_blank">{{getLabel(inputf.data['@type'])}}</a> - </v-flex> - - <p-d-skos-preflabel - v-if="getSkosexactMatch(inputf.data)==undefined" - :p="getLabel(inputf.data['@type'])" - :o="inputf.data" - :key="inputf+index+'pharmafreesubject'" - ></p-d-skos-preflabel> - <ph-d-metadata - v-if="getSkosexactMatch(inputf.data)" - :o="inputf.data" - :p="p" - :key="inputf+index+'pharmasubject'" - ></ph-d-metadata> - - <v-divider></v-divider> - </v-card> - </template> - </v-card> - </template>--> + </template> <template v-else-if="p==='@type'"></template> @@ -561,14 +461,13 @@ export default { var pharmajson = subjectjson.filter( subjectjson => subjectjson["@type"] != "skos:Concept" ); - console.log("phamra json", pharmajson); - console.log("formCategories", this.s[2].categories); + var formCategories = this.s[2].categories; var jsonStructured = []; for (let i = 0; i < formCategories.length; i++) { //only look at the ones which have not a skos:Concept type var formFields = formCategories[i].fields; - console.log("formCategories @@@@@@@@@@@", formCategories[i]); + jsonStructured[i] = { category: formCategories[i].id, label: formCategories[i].description, @@ -578,35 +477,19 @@ export default { var formFieldsFiltered = formFields.filter( formFields => formFields.type != "skos:Concept" ); - //check which of those filetered fields ffields have a value in the jsonld for (var j = 0; j < formFieldsFiltered.length; j++) { - // console.log("ffields[j].type", ffields[j].type); //filter all the elem in subjects which have this type var jsonTypeArray = pharmajson.filter(function(fs) { return fs["@type"] == formFieldsFiltered[j].type; }); - /*if (jsonTypeArray.length > 0) { - console.log( - "got those", - jsonTypeArray, - "for", - formFieldsFiltered[j].type - ); - }*/ if (jsonTypeArray.length > 0) { - console.log( - "looping over fileds", - formFieldsFiltered[j].label, - formFieldsFiltered[j].category[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) { - console.log( - "formFieldsFiltered[j].subcategory", - formFieldsFiltered[j].subcategory[0] - ); //the category is formFieldsFiltered[j].category // if it exists, push to it, otherwise create it var n_categ = formFieldsFiltered[j].category[0]; @@ -615,19 +498,50 @@ export default { var result = jsonStructured.findIndex( obj => obj.category === n_categ ); - console.log( - "n_categ", - n_categ, - "result", - result, - "subcat", - n_subcat - ); + if (result >= 0) { if (jsonStructured[result].subcategory) { var r = jsonStructured[result].subcategory.findIndex( obj => obj.category === n_subcat ); + + if (r >= 0) { + for (var n = 0; n < jsonTypeArray.length; n++) { + jsonStructured[result].subcategory[r].fields.push( + jsonTypeArray[n] + ); + } + } else { + jsonStructured[result].subcategory.push({ + category: n_subcat, + id: formFieldsFiltered[j].infoRef, + fields: jsonTypeArray + }); + } + } else { + jsonStructured[result].subcategory = [ + { + category: formFieldsFiltered[j].subcategory[0], + fields: jsonTypeArray + } + ]; + } + } + } 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 + var result = jsonStructured.findIndex( + obj => obj.category === n_categ + ); + + if (result >= 0) { + /* if (jsonStructured[result].subcategory) { + var r = jsonStructured[result].subcategory.findIndex( + obj => obj.category === n_subcat + ); console.log( "n_sub r", r, @@ -645,35 +559,18 @@ export default { fields: jsonTypeArray }); } - } else { - jsonStructured[result].subcategory = [ - { - category: formFieldsFiltered[j].subcategory[0], - fields: jsonTypeArray - } - ]; - } + } else {*/ + jsonStructured[result].fields = jsonTypeArray; + // category: n_categ, + // id: formFieldsFiltered[j].infoRef, + // fields: jsonTypeArray + //}; } } - //if there is a subcategory, we need to push those as a subcategory of the category - //jsonStructured[i].fields[j].subcategory = - // formFieldsFiltered[j].subcategory; - console.log("jsonstructHERE", jsonStructured[i]); - //jsonStructured[i].fields[j].subcategory = { - // label: formFieldsFiltered[j].label, - // id: formFieldsFiltered[j].infoRef - //}; - //jsonStructured[i].fields[j].subcategory.entries = jsonTypeArray; } - //jsonStructured[i].fields[j] = { - // label: formFieldsFiltered[j].label, - // id: formFieldsFiltered[j].infoRef - //}; - //jsonStructured[i].fields[j].entries = jsonTypeArray; } } - console.log("jsonStructured", jsonStructured); return jsonStructured; }, @@ -808,6 +705,7 @@ export default { alert: function(e) { console.log("alert", e); }, + getCatElem: function(cat) { var elem = this.pharmaData.filter( pharmaData => pharmaData.category === cat diff --git a/src/components/input/PhSubmit.vue b/src/components/input/PhSubmit.vue index 677e497ee78da0a79373b76b957915347789f9ea..656fd2a2dc51c85fac178758c76c6b05b75dddac 100644 --- a/src/components/input/PhSubmit.vue +++ b/src/components/input/PhSubmit.vue @@ -19,7 +19,7 @@ :form="form" :loading="loading" :templating="templating" - :floatingsavebutton="floatingsavebutton" + :targetpid="targetpid" v-on:submit="checkWarnings()" ></ph-input-form> diff --git a/src/components/input/phaidra_inputs/PIForm.vue b/src/components/input/phaidra_inputs/PIForm.vue index 0eaa37ca7610261d2556dd450112596acfff6036..0c598bef214b38bc1a3f31b0cef328a34ff64896 100644 --- a/src/components/input/phaidra_inputs/PIForm.vue +++ b/src/components/input/phaidra_inputs/PIForm.vue @@ -61,6 +61,7 @@ <v-card-text class="mt-4"> <template v-for="(f) in s.fields"> + <v-row no-gutters :key="f.id"> <template v-if="f.component === 'p-text-field'"> diff --git a/src/components/input/pharma-input-fields/PhAssaySelection.vue b/src/components/input/pharma-input-fields/PhAssaySelection.vue index 3bd24d98bd16f658b042e2cd67cbe30ffbbdaeaa..e7ab4ca529db6e63d0dd5666dc1e8335f840b3a2 100644 --- a/src/components/input/pharma-input-fields/PhAssaySelection.vue +++ b/src/components/input/pharma-input-fields/PhAssaySelection.vue @@ -38,7 +38,7 @@ </v-flex> <!-- do we even need this freefield if , we are in the selct section...?--> - <v-flex v-if="freeField"> + <v-flex v-if="freefield"> <v-tooltip bottom> <v-btn slot="activator" @@ -176,7 +176,7 @@ export default { freeText: { type: Object }, - freeField: { + freefield: { type: Boolean }, info: { diff --git a/src/components/input/pharma-input-fields/PhEntity.vue b/src/components/input/pharma-input-fields/PhEntity.vue index 096a22a275a991ca7211641e322e01454afc4c2e..acebd96b304ede18a8f2cc5939f01697a52e7e67 100644 --- a/src/components/input/pharma-input-fields/PhEntity.vue +++ b/src/components/input/pharma-input-fields/PhEntity.vue @@ -107,7 +107,7 @@ {'@value': 'University of Vienna'}]}" :multiplicable="true" :required="true" - :freeField="true" + :freefield="true" :freeText="{ '@type': 'schema:Organization','schema:name': [ {'@value': 'No value'}]}" v-on:input-select="$emit('input-organisation',$event)" diff --git a/src/components/input/pharma-input-fields/PhFiles.vue b/src/components/input/pharma-input-fields/PhFiles.vue index 3c8b24348ed9dea05a7c3999ea06a4c1c4f83bf4..f90a732970bb82958069f89ea0a46a43e3051c54 100644 --- a/src/components/input/pharma-input-fields/PhFiles.vue +++ b/src/components/input/pharma-input-fields/PhFiles.vue @@ -23,19 +23,19 @@ ></v-select> </v-flex> - <v-flex xs2 v-if="!FileExtFreefield[i-1]"> + <v-flex xs2 v-if="!FileExtfreefield[i-1]"> <v-text-field :value="items[i-1]['type']" label="File extension" disabled></v-text-field> </v-flex> - <v-flex v-if="!FileExtFreefield[i-1]"> + <v-flex v-if="!FileExtfreefield[i-1]"> <v-tooltip bottom> - <v-btn slot="activator" small icon v-on:click="setArray(FileExtFreefield,i-1,true)"> + <v-btn slot="activator" small icon v-on:click="setArray(FileExtfreefield,i-1,true)"> <v-icon>list</v-icon> </v-btn> <span>Change input</span> </v-tooltip> </v-flex> - <v-flex xs2 v-if="FileExtFreefield[i-1]===true"> + <v-flex xs2 v-if="FileExtfreefield[i-1]===true"> <v-select item-text="@id" :label="'File extension'" @@ -47,9 +47,9 @@ return-object ></v-select> </v-flex> - <v-flex v-if="FileExtFreefield[i-1]"> + <v-flex v-if="FileExtfreefield[i-1]"> <v-tooltip bottom> - <v-btn slot="activator" small icon v-on:click="setArray(FileExtFreefield,i-1,true)"> + <v-btn slot="activator" small icon v-on:click="setArray(FileExtfreefield,i-1,true)"> <v-icon>remove</v-icon> </v-btn> <span>Remove input</span> @@ -182,7 +182,7 @@ export default { //errorMsg: '', loaderVisible: true, dragging: false, - FileExtFreefield: [] + FileExtfreefield: [] }; }, @@ -199,8 +199,8 @@ export default { array.splice(index, 1, val); }, setExt: function(index, val) { - this.FileExtFreefield[index] = val; - //console.log("in set elem", this.FileExtFreefield); + this.FileExtfreefield[index] = val; + //console.log("in set elem", this.FileExtfreefield); }, // http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/ @@ -215,8 +215,8 @@ export default { if (this.itemsExt[i] == null) { this.itemsExt[i] = this.items[i].type; } - if (this.FileExtFreefield[i] == null) { - this.FileExtFreefield[i] = false; + if (this.FileExtfreefield[i] == null) { + this.FileExtfreefield[i] = false; } if (this.itemsType[i] == null) { this.itemsType[i] = ""; @@ -302,7 +302,7 @@ export default { this.itemsSizes = []; this.itemsLicense = []; this.itemsWarning = []; - this.FileExtFreefield = []; + this.FileExtfreefield = []; this.itemsTotalSize = ""; this.loaderVisible = true; /* if (this.items.length > 0) { @@ -334,7 +334,7 @@ export default { this.itemsSizes.splice(i, 1); this.itemsLicense.splice(i, 1); this.itemsWarning.splice(i, 1); - this.FileExtFreefield.splice(i, 1); + this.FileExtfreefield.splice(i, 1); for (var i = 0; i < this.items.length; i++) { fileSizes += this.items[i].size; } diff --git a/src/components/input/pharma-input-fields/PhInputForm.vue b/src/components/input/pharma-input-fields/PhInputForm.vue index fb930c7532ef45431b444605245e8f4a965cee68..61de03fee46f7b755e8ffd0c1a8be2418b0e7130 100644 --- a/src/components/input/pharma-input-fields/PhInputForm.vue +++ b/src/components/input/pharma-input-fields/PhInputForm.vue @@ -30,6 +30,7 @@ <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> @@ -107,6 +108,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" @@ -160,6 +162,7 @@ <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" @@ -179,12 +182,13 @@ </v-flex> <v-flex v-if=" f.component == 'selection'&&f.visible==true"> + <ph-selection v-bind.sync="f" :required="false" :field="[]" :commit="true" - :freeField="f.freefield" + :freefield="f.freefield" :text="'skos:prefLabel'" :nested="['@value']" v-on:input-select="f.value=$event;updateSubfields(f.multiplicable,c.fields,f)" @@ -225,7 +229,7 @@ :required="false" :field="[]" :commit="true" - :freeField="true" + :freefield="true" :text="'skos:prefLabel'" :nested="['@value']" v-on:input-select="f.value=$event;updateSubfields(f.multiplicable,c.fields,f)" @@ -412,7 +416,6 @@ export default { }, data() { return { - loading: false, templatedialog: "", templatename: "", @@ -550,9 +553,11 @@ export default { arrays.remove(arr, f); }, updateSubfields: function(mult, arr, el) { + //mult is to deal with the fact that we might want to allow those selection fields to be multipled if (mult) { var self = this; var sub = []; + console.log("f value", el.value); if (el.subcategory) { sub = arr.filter(function(a) { if (a.category) { @@ -568,20 +573,27 @@ export default { } for (var a2 in sub) { + //empty the fields that are not selected if ( self.$store.state.metadataInputs[el.category[0]].indexOf( sub[a2].description ) < 0 && sub[a2].description != "selection" ) { + console.log( + "clearing here ", + + sub[a2].description + ); sub[a2].value = ""; sub[a2].text = ""; //and remove the value of the subfields, if there are some if (sub[a2].subcategory) { - this.$store.commit(sub[a2].stateVoc, []); + //this.$store.commit(sub[a2].stateVoc, []); //then clear all the subcategories for (var b in sub) { + //console.log("sub", sub[b], "subcat", sub[a2]); if (sub[b].category[0] === sub[a2].subcategory[0]) { //it's a subcategory of what we selected //clear values and store @@ -592,6 +604,12 @@ export default { } } } else { + console.log( + "should keep this ", + + sub[a2].description, + sub[a2].value + ); } } // } else { diff --git a/src/components/input/pharma-input-fields/PhProject.vue b/src/components/input/pharma-input-fields/PhProject.vue index e96fcca6b27c79d5a12cec0182bace4a83c5eaec..957867bcc96d18e164fcfcbc93a00d21c91b594f 100644 --- a/src/components/input/pharma-input-fields/PhProject.vue +++ b/src/components/input/pharma-input-fields/PhProject.vue @@ -35,7 +35,7 @@ :multiplicable="false" :required="true" :default="{'@type': 'foaf:Project','skos:prefLabel': [{'@value': '','@language': 'en'}],'rdfs:comment': [{'@value': '','@language': 'eng'}],'foaf:homepage': [''],'skos:notation': ['']}" - :freeField="true" + :freefield="true" v-on:input-changedType="readonly=$event" v-on:input-select="$emit('input-project',$event);validate(), $emit('validation', validationWarning)" ></ph-selection-proj> @@ -49,7 +49,7 @@ :multiplicable="false" :multiline="true" :required="false" - :freeField="!readonly" + :freefield="!readonly" v-on:input-select="$emit('input-project', proj)" ></ph-textselected> </v-flex> @@ -61,7 +61,7 @@ :label="$t('Project homepage')" :multiplicable="false" :required="false" - :freeField="!readonly" + :freefield="!readonly" v-on:input-select="$emit('input-project', proj)" ></ph-textselected> </v-flex> @@ -74,7 +74,7 @@ :label="$t('Project ID')" :multiplicable="false" :required="false" - :freeField="!readonly" + :freefield="!readonly" v-on:input-select="$emit('input-project',proj);" ></ph-textselected> </v-flex> @@ -90,7 +90,7 @@ :multiplicable="false" :required="true" :default="{'@type': 'frapo:FundingAgency','skos:prefLabel': [{'@value': ''}],'skos:exactMatch': ['']}" - :freeField="true" + :freefield="true" v-on:input-changedType="readonlyAg=$event" v-on:input-select="$emit('input-agency',$event);validate(), $emit('validation', validationWarning)" ></ph-selection-proj> @@ -103,7 +103,7 @@ :label="$t('Funding agency ID')" :multiplicable="false" :required="false" - :freeField="!readonlyAg" + :freefield="!readonlyAg" v-on:input-select="$emit('input-agency',ag);" ></ph-textselected> </v-flex> diff --git a/src/components/input/pharma-input-fields/PhSelect.vue b/src/components/input/pharma-input-fields/PhSelect.vue index fcf92f405345297e3714566eec9148f18dfa3176..eaf8a39b4f9271aed79282cb1b4175aadc0f601a 100644 --- a/src/components/input/pharma-input-fields/PhSelect.vue +++ b/src/components/input/pharma-input-fields/PhSelect.vue @@ -40,7 +40,7 @@ </v-flex> <!-- do we even need this freefield if , we are in the selct section...?--> - <v-flex v-if="freeField"> + <v-flex v-if="freefield"> <v-tooltip bottom> <v-btn slot="activator" @@ -179,7 +179,7 @@ export default { freeText: { type: Object }, - freeField: { + freefield: { type: Boolean }, info: { diff --git a/src/components/input/pharma-input-fields/PhSelection.vue b/src/components/input/pharma-input-fields/PhSelection.vue index 73605e5a02b051cef6c7f4899b8b46521c330098..166e626d6f05e323212f74ba658c75e4337e789c 100644 --- a/src/components/input/pharma-input-fields/PhSelection.vue +++ b/src/components/input/pharma-input-fields/PhSelection.vue @@ -1,6 +1,8 @@ <template> <v-layout row wrap> + <v-flex xs6 v-if="multiplicable"> + <v-autocomplete v-model="fieldArray" :label="label" @@ -143,7 +145,7 @@ export default { freeText: { type: Object }, - freeField: { + freefield: { type: Boolean }, info: { @@ -299,6 +301,7 @@ export default { // } //} else { this.$store.commit(para, val); + //} } } diff --git a/src/components/input/pharma-input-fields/PhSelectionProj.vue b/src/components/input/pharma-input-fields/PhSelectionProj.vue index d3fa9b641cde99299bc6988ece91e7c8207deeef..617b94144c5c57b0d0569710d8e5515f2ccd960d 100644 --- a/src/components/input/pharma-input-fields/PhSelectionProj.vue +++ b/src/components/input/pharma-input-fields/PhSelectionProj.vue @@ -40,7 +40,7 @@ </v-flex> <!-- do we even need this freefield if , we are in the selct section...?--> - <v-flex v-if="freeField"> + <v-flex v-if="freefield"> <v-tooltip bottom> <v-btn slot="activator" @@ -179,7 +179,7 @@ export default { freeText: { type: Object }, - freeField: { + freefield: { type: Boolean }, info: { diff --git a/src/components/input/pharma-input-fields/PhTextselected.vue b/src/components/input/pharma-input-fields/PhTextselected.vue index 25680dd55e84defc20b92ccaf2ae35b87a009cd0..6fb77a20aab78b1c6c959377b9ee46d41301f220 100644 --- a/src/components/input/pharma-input-fields/PhTextselected.vue +++ b/src/components/input/pharma-input-fields/PhTextselected.vue @@ -2,7 +2,7 @@ <v-layout row wrap> <v-flex v-for="(i,index) in fieldArray" :key="index" xs12> <v-toolbar v-if="!multiline" flat color="white"> - <v-flex v-if="!freeField" xs10> + <v-flex v-if="!freefield" xs10> <v-text-field :label="label" :value="parseOutput(i)" @@ -14,7 +14,7 @@ readonly ></v-text-field> </v-flex> - <v-flex v-if="freeField" xs10> + <v-flex v-if="freefield" xs10> <v-text-field v-model="textValue[index]" :label="label" @@ -51,7 +51,7 @@ </v-toolbar> <v-toolbar class="py-5" v-if="multiline" flat color="white"> - <v-flex v-if="!freeField" xs10> + <v-flex v-if="!freefield" xs10> <v-textarea box background-color="white" @@ -63,7 +63,7 @@ auto-grow ></v-textarea> </v-flex> - <v-flex v-if="freeField" xs10> + <v-flex v-if="freefield" xs10> <v-textarea box background-color="white" @@ -135,7 +135,7 @@ export default { required: { type: Boolean }, - freeField: { + freefield: { type: Boolean } }, diff --git a/src/utils/fields.js b/src/utils/fields.js index 010121f3da0765bf62c50afe56fe1970cb985179..11484f95317d10a687ced335b41b34f91211ca96 100644 --- a/src/utils/fields.js +++ b/src/utils/fields.js @@ -1,8 +1,7 @@ import uuid from "./uuid"; import inputFormats from "./inputFormats"; -const fields = [ - { +const fields = [{ id: "pharma-title", predicate: "dce:title", label: "Title", @@ -28,8 +27,7 @@ const fields = [ hideType: false, formValidation: true, warning: false, - definition: - "A point or period of time associated with an event in the lifecycle of the resource." + definition: "A point or period of time associated with an event in the lifecycle of the resource." }, { id: "abstract", @@ -74,37 +72,27 @@ const fields = [ header: "Association with projects", label: "Projects", predicate: "frapo:isOutputOf", - project: [ - { - "@type": "foaf:Project", - "skos:prefLabel": [ - { - "@value": "", - "@language": "en" - } - ], - "rdfs:comment": [ - { - "@value": "", - "@language": "eng" - } - ], - "foaf:homepage": [""], - "skos:notation": [""] - } - ], - agency: [ - { - "@type": "frapo:FundingAgency", - "skos:prefLabel": [ - { - "@value": "", - "@language": "eng" - } - ], - "skos:exactMatch": [""] - } - ], + project: [{ + "@type": "foaf:Project", + "skos:prefLabel": [{ + "@value": "", + "@language": "en" + }], + "rdfs:comment": [{ + "@value": "", + "@language": "eng" + }], + "foaf:homepage": [""], + "skos:notation": [""] + }], + agency: [{ + "@type": "frapo:FundingAgency", + "skos:prefLabel": [{ + "@value": "", + "@language": "eng" + }], + "skos:exactMatch": [""] + }], component: "project", type: "foaf:Project", multiplicable: true, @@ -134,8 +122,7 @@ const fields = [ value: "", warning: false, "skos:prefLabel": [], - definition: - "The value will indicate the copyright, usage and access rights that apply to this digital representation." + definition: "The value will indicate the copyright, usage and access rights that apply to this digital representation." }, { id: "file", @@ -163,8 +150,7 @@ const fields = [ label: "Rights statement", 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." + 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." }, { id: "resource-type", @@ -177,7 +163,7 @@ const fields = [ id: "1-Biological-macromolecule", predicate: "dcterms:subject", // predicate: "select", - type: "skos:Concept", + type: "pharmaWien:biological_macromolecule", //subjectType: "BiologicalMacromolecule:", label: "Biological macromolecule:", value: "", @@ -213,8 +199,7 @@ const fields = [ subcategory: ["Protein"], description: "Protein", infoRef: "http://purl.obolibrary.org/obo/", - info: - "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" + info: "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" }, { id: "1-Isoform", @@ -231,8 +216,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein"], 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.", + 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" }, { @@ -250,8 +234,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein"], 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 ]", + 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" }, { @@ -269,8 +252,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein"], 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 ]", + 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" }, { @@ -288,8 +270,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Gene"], description: "Gene", - info: - "EntrezGene_ID NCIT:C49379 Indicates the accession number for a Gene within the Entrez Gene database. [ NCI ]", + 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" }, { @@ -307,8 +288,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Gene"], description: "Gene", - info: - "Gene modification NCIT:C126104 Any gene manipulation method used to generate a product with an altered sequence, structure, or conformation. [ NCI ]", + 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" }, { @@ -349,8 +329,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Polynucleotide"], description: "Polynucleotide", - info: - "RefSeq accession EDAM > data:1098 Accession number of a RefSeq database entry. Synonyms: RefSeq ID", + info: "RefSeq accession EDAM > data:1098 Accession number of a RefSeq database entry. Synonyms: RefSeq ID", infoRef: "" }, { @@ -368,8 +347,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Family"], description: "Protein Family", - info: - "PFAM accession number EDAM > data:1138 Accession number of a Pfam entry.", + info: "PFAM accession number EDAM > data:1138 Accession number of a Pfam entry.", infoRef: "" }, { @@ -390,8 +368,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Subunit"], description: "Protein Subunit", - info: - "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" + info: "UniProt ID EDAM>data:3021 Accession number of a UniProt (protein sequence) database entry" }, { id: "1-Isoform-protein-subunit", @@ -409,8 +386,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Subunit"], 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.", + 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: "" }, { @@ -429,8 +405,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Subunit"], 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 ]", + 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" }, { @@ -449,8 +424,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Subunit"], 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 ]", + 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" }, { @@ -468,8 +442,7 @@ const fields = [ category: ["biologicalMacromolecule"], subcategory: ["Protein Complex"], description: "Protein Complex", - info: - "A persistent (stable) and unique identifier of the manually curated EMBL-EBI Complex-Portal (Complex Portal", + info: "A persistent (stable) and unique identifier of the manually curated EMBL-EBI Complex-Portal (Complex Portal", infoRef: "" }, { @@ -532,8 +505,7 @@ const fields = [ category: ["life"], vocabulary: "life", - info: - "Life NCIT:C142142 Thee biochemical phenomenon that distinguishes organisms from inorganic matter. It is characterized by growth, metabolism, and reproduction. [ NCI ]" + info: "Life NCIT:C142142 Thee biochemical phenomenon that distinguishes organisms from inorganic matter. It is characterized by growth, metabolism, and reproduction. [ NCI ]" }, { @@ -744,8 +716,7 @@ const fields = [ //ontClass: "MONDO_0000620", //baseurl: "http://purl.obolibrary.org/obo/", 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 ]", + 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" }, { @@ -784,8 +755,7 @@ const fields = [ freefield: true, category: ["anatomicalCategory"], description: "Anatomical entity, cross species", - 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 ]" + 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 ]" }, { id: "4-Plant-anatomical-entity", @@ -807,8 +777,7 @@ const fields = [ freefield: true, category: ["anatomicalCategory"], description: "Plant anatomical entity", - info: - "plant anatomical entity PO:0025131 An anatomical entity that is or was part of a plant. [ CARO:0000000 POC:curators ]" + info: "plant anatomical entity PO:0025131 An anatomical entity that is or was part of a plant. [ CARO:0000000 POC:curators ]" }, { id: "4-Fungal-structure", @@ -899,8 +868,7 @@ const fields = [ freefield: true, 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." + 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." }, { id: "5-Biological-process", @@ -922,8 +890,7 @@ const fields = [ description: "GO Biological Process:", 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." + 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." }, { id: "5-Cellular-component", @@ -945,8 +912,7 @@ const fields = [ freefield: true, 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)" + 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)" }, { id: "6-Chemical-entities", @@ -966,8 +932,7 @@ const fields = [ freefield: true, inchi: true, category: ["chebi"], - info: - "A chemical entity is a physical entity of interest in chemistry including molecular entities, parts thereof, and chemical substances. ", + info: "A chemical entity is a physical entity of interest in chemistry including molecular entities, parts thereof, and chemical substances. ", description: "Chemical entity" }, /* { @@ -1069,8 +1034,7 @@ const fields = [ description: "Research technique:", category: ["technique"], freefield: true, - infoRef: - "http://www.ontobee.org/ontology/NCIT?iri=http://purl.obolibrary.org/obo/NCIT_C20368", + infoRef: "http://www.ontobee.org/ontology/NCIT?iri=http://purl.obolibrary.org/obo/NCIT_C20368", info: "Technique used in the laboratory for scientific research. " }, { @@ -1105,8 +1069,7 @@ const fields = [ freefield: false, multiplicable: false, visible: true, - 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.", + 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:" }, @@ -1124,10 +1087,8 @@ const fields = [ value: "", component: "text-field", description: "Assay title", - 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" + 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" }, { id: "0-Assay-protocol", @@ -1142,8 +1103,7 @@ const fields = [ component: "text-field", multiline: true, category: ["assay"], - 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.", + 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:" }, @@ -1182,8 +1142,7 @@ const fields = [ category: ["assay"], topId: "BAO_0000015", description: "Bioassay category:", - info: - "General assay types like enzyme assay and their subtypes like kinase activity assay", + info: "General assay types like enzyme assay and their subtypes like kinase activity assay", infoRef: "http://www.bioassayontology.org/bao#BAO_0000015" }, { @@ -1202,8 +1161,7 @@ const fields = [ topId: "BAO_0000019", description: "Assay format:", 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.", + 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" }, { @@ -1223,8 +1181,7 @@ const fields = [ //category: ["assay"], topId: "BAO_0002202", 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.", + 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" }, @@ -1245,8 +1202,7 @@ const fields = [ ontClass: "BAO_0002094", topId: "BAO_0002094", description: "Computational method", - info: - "Method based on the application of information technology to chemistry and biology.", + info: "Method based on the application of information technology to chemistry and biology.", infoRef: "http://www.bioassayontology.org/bao#BAO_0002094" }, { @@ -1266,8 +1222,7 @@ const fields = [ category: ["assay"], // baseurl: "http://www.bioassayontology.org/bao#", 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.", + 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" }, { @@ -1287,8 +1242,7 @@ const fields = [ category: ["assay"], subcategory: ["assayOrganism"], multiplicable: true, - info: - "The organism related to the target / meta-target of the bioassay. It includes both bacterium and eukaryote.", + 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:" }, @@ -1309,8 +1263,7 @@ const fields = [ category: ["assayTarget"], subcategory: ["organismAssayTarget"], multiplicable: true, - info: - "The organism related to the target / meta-target of the bioassay. It includes both bacterium and eukaryote.", + info: "The organism related to the target / meta-target of the bioassay. It includes both bacterium and eukaryote.", infoRef: "BAO:0000551" }, { @@ -1384,8 +1337,7 @@ const fields = [ ontClass: "", treeview: false, 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 ]", + 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" }, { @@ -1464,8 +1416,7 @@ const fields = [ component: "ext-service", category: ["assayTarget"], 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 ]", + 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" }, { @@ -1485,8 +1436,7 @@ const fields = [ component: "ext-service", category: ["assayTarget"], 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 ]", + 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" }, { @@ -1508,8 +1458,7 @@ const fields = [ category: ["assayDetection"], multiplicable: true, component: "selection", - info: - "The physical method (technology) used to measure / readout the effect caused by a perturbagen in the assay environment.", + info: "The physical method (technology) used to measure / readout the effect caused by a perturbagen in the assay environment.", infoRef: "" }, { @@ -1627,11 +1576,11 @@ const predicateOrder = [ ]; export default { - getFields: function() { + getFields: function () { return fields; }, - getEditableFields: function() { + getEditableFields: function () { var editable = fields.filter(item => !item.readonly); // hack: some bug in vuetify autocomplete can't handle the value property var newarr = []; @@ -1642,7 +1591,7 @@ export default { } return newarr; }, - getField: function(id, ordergroup) { + getField: function (id, ordergroup) { for (var i = 0; i < fields.length; i++) { if (fields[i]["id"] === id) { var field = JSON.parse(JSON.stringify(fields[i])); @@ -1652,7 +1601,7 @@ export default { } } }, - getFieldbySubject: function(subject) { + getFieldbySubject: function (subject) { for (var i = 0; i < fields.length; i++) { if (fields[i]["type"] === subject) { var field = JSON.parse(JSON.stringify(fields[i])); @@ -1661,7 +1610,7 @@ export default { } } }, - getFieldsLabelsbyCateg: function(categ) { + getFieldsLabelsbyCateg: function (categ) { var ar = []; for (var i = 0; i < fields.length; i++) { @@ -1676,7 +1625,7 @@ export default { } return ar; }, - getPredicateOrder: function() { + getPredicateOrder: function () { return predicateOrder; } -}; +}; \ No newline at end of file diff --git a/src/utils/json-ld.js b/src/utils/json-ld.js index 637c3890ec8fc7d76647ad2af3772b07bc202202..1eb19dc18f83341d67729fff8b8d60c5b3b39495 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,14 +182,15 @@ 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"]; @@ -214,7 +215,7 @@ export default { } else if (value[i]["@type"] === "phaidra:Subject") { // ignore, handled elsewhere } else { - //console.log("here else"); + } break; @@ -385,17 +386,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": @@ -409,9 +410,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 { @@ -441,7 +442,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"]) { @@ -450,7 +451,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"]) { @@ -459,7 +460,7 @@ export default { components.push(f); break; - // edm:rights + // edm:rights case "edm:rights": f = fields.getField("license"); f.vocabulary = "alllicenses"; @@ -467,17 +468,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"]) { @@ -525,16 +526,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; @@ -542,7 +543,7 @@ export default { components.push(f); break; - // rdau:P60227 + // rdau:P60227 case "rdau:P60227": f = fields.getField("movieadaptation"); if (value[i]["dce:title"]) { @@ -594,7 +595,7 @@ export default { components.push(f); break; - // frapo:hasFundingAgency + // frapo:hasFundingAgency case "frapo:hasFundingAgency": if (value[i]["@type"] === "frapo:FundingAgency") { //ISA take here off @@ -617,7 +618,7 @@ export default { } break; - // frapo:isOutputOf + // frapo:isOutputOf case "frapo:isOutputOf": if (value[i]["@type"] === "foaf:Project") { //ISA take here off @@ -676,10 +677,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"]) { @@ -692,7 +693,7 @@ export default { } break; - // rdax:P00009 + // rdax:P00009 case "rdax:P00009": f = fields.getField("association"); for (let em of value[i]["skos:exactMatch"]) { @@ -701,21 +702,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; @@ -723,7 +724,7 @@ export default { components.push(f); break; - // bf:soundCharacteristic + // bf:soundCharacteristic case "bf:soundCharacteristic": f = fields.getField("sound-characteristic"); f.label = key; @@ -731,31 +732,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"]) { @@ -764,7 +765,7 @@ export default { components.push(f); break; - // ebucore:filename + // ebucore:filename case "ebucore:filename": f = fields.getField("filename"); f.predicate = key; @@ -773,7 +774,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++) { @@ -782,7 +783,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++) { @@ -791,7 +792,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++) { @@ -800,41 +801,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"); @@ -845,15 +846,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 { @@ -871,7 +872,7 @@ export default { } break; - // vra:hasTechnique + // vra:hasTechnique case "vra:hasTechnique": if ( value[i]["@type"] === "vra:Technique" && @@ -880,9 +881,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 { @@ -900,7 +901,7 @@ export default { } break; - // dcterms:audience + // dcterms:audience case "dcterms:audience": if ( value[i]["@type"] === "dcterms:audience" && @@ -909,9 +910,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 { @@ -929,7 +930,7 @@ export default { } break; - // schema:width + // schema:width case "schema:width": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("width"); @@ -943,7 +944,7 @@ export default { } break; - // schema:height + // schema:height case "schema:height": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("height"); @@ -957,7 +958,7 @@ export default { } break; - // schema:depth + // schema:depth case "schema:depth": if (value[i]["@type"] === "schema:QuantitativeValue") { f = fields.getField("depth"); @@ -971,7 +972,7 @@ export default { } break; - // dates + // dates case "dcterms:date": case "dcterms:created": case "dcterms:modified": @@ -994,7 +995,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++) { @@ -1003,7 +1004,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++) { @@ -1012,13 +1013,14 @@ 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")) { @@ -1127,7 +1129,7 @@ export default { return components; }, - getOrderedComponents: function(components) { + getOrderedComponents: function (components) { var predicateOrder = fields.getPredicateOrder(); var ordered = []; var i; @@ -1146,7 +1148,7 @@ export default { } return ordered; }, - json2form: function(jsonld, options) { + json2form: function (jsonld, options) { var levels = { digital: { components: [] @@ -1164,7 +1166,9 @@ export default { if (value[i]["@type"] === "phaidra:Subject") { var subcomp = this.json2components(value[i], options); if (subcomp.length > 0) { - levels.subject.push({ components: subcomp }); + levels.subject.push({ + components: subcomp + }); } } } @@ -1206,21 +1210,17 @@ 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; } @@ -1364,18 +1364,14 @@ export default { "@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"] = []; @@ -1384,11 +1380,9 @@ export default { } } if (email) { - h["schema:email"] = [ - { - "@value": email - } - ]; + h["schema:email"] = [{ + "@value": email + }]; } if (orcid) { h["skos:exactMatch"] = orcid; @@ -1402,11 +1396,9 @@ export default { }; if (description) { - h["skos:prefLabel"] = [ - { - "@value": description - } - ]; + h["skos:prefLabel"] = [{ + "@value": description + }]; if (descriptionLanguage) { h["skos:prefLabel"][0]["@language"] = descriptionLanguage; } @@ -1419,11 +1411,9 @@ export default { }; if (description) { - h["skos:prefLabel"] = [ - { - "@value": description - } - ]; + h["skos:prefLabel"] = [{ + "@value": description + }]; if (descriptionLanguage) { h["skos:prefLabel"][0]["@language"] = descriptionLanguage; } @@ -1443,21 +1433,17 @@ export default { }; 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; } @@ -1488,11 +1474,9 @@ export default { if (title) { let tit = { "@type": "bf:Title", - "bf:mainTitle": [ - { - "@value": title - } - ] + "bf:mainTitle": [{ + "@value": title + }] }; if (titleLanguage) { tit["bf:mainTitle"][0]["@language"] = titleLanguage; @@ -1534,21 +1518,17 @@ export default { 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; } @@ -1560,25 +1540,19 @@ export default { "@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]; } @@ -1591,22 +1565,18 @@ export default { 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]; } @@ -1621,11 +1591,9 @@ export default { "@type": "aaiso:Programme" }; if (name) { - h["skos:prefLabel"] = [ - { - "@value": name - } - ]; + h["skos:prefLabel"] = [{ + "@value": name + }]; if (nameLanguage) { h["skos:prefLabel"][0]["@language"] = nameLanguage; } @@ -1641,11 +1609,9 @@ export default { }; if (name) { - h["skos:prefLabel"] = [ - { - "@value": name - } - ]; + h["skos:prefLabel"] = [{ + "@value": name + }]; if (nameLanguage) { h["skos:prefLabel"][0]["@language"] = nameLanguage; } @@ -1725,7 +1691,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"]) { @@ -1762,7 +1728,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"]) { @@ -1809,7 +1775,7 @@ export default { ); } break; - // dates + // dates case "date": case "dcterms:date": case "dcterms:created": @@ -1884,7 +1850,10 @@ export default { jsonld, f.predicate, this.get_json_object( - [{ "@value": f.value, "@language": f.language }], + [{ + "@value": f.value, + "@language": f.language + }], null, "skos:Concept" ) @@ -1895,10 +1864,7 @@ export default { case "dcterms:subject": if (f.value) { if (f.component === "ext-service") { - //if (f.type === "skos:Concept") { - //this is to take care of the fact that the getChildren response has still - //detailed info we do not want sent to phaidra for (var k = 0; k < f.value.length; k++) { if (typeof f.value[k] !== "undefined") { if (f.value[k].geneName) { @@ -1941,10 +1907,14 @@ export default { } } } else if (f.component === "selection") { - //console.log("selection", f.value); - this.push_object(jsonld, f.predicate, f.value[0]); + + + for (var m = 0; m < f.value.length; m++) { + this.push_object(jsonld, f.predicate, f.value[m]); + } + } else { - //console.log("else", f); + this.push_object( jsonld, f.predicate, @@ -1952,19 +1922,7 @@ export default { ); } } - /* if (f.type === "skos:Concept" && f.value) { - this.push_object( - jsonld, - f.predicate, - this.get_json_concept( - f["skos:prefLabel"], - f["rdfs:label"], - "skos:Concept", - [f.value], - f["skos:notation"] ? [f["skos:notation"]] : null - ) - ); - }*/ + break; @@ -2015,12 +1973,10 @@ 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" ] @@ -2089,4 +2045,4 @@ export default { } return jsonld; } -}; +}; \ No newline at end of file