From 00839df3e3af722658063c3b927ff8236c3d7dea Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Wed, 19 Nov 2025 13:35:32 +0100 Subject: [PATCH 1/7] Start to integrate trainsport format --- public/curation/extract.js | 20 ++++++++++++-------- public/curation/script.js | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/public/curation/extract.js b/public/curation/extract.js index a178f00..d57023e 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -1,10 +1,15 @@ function extract_info(element, obj, tag, category){ - fetch("../.hermes/process/tags.json")//.hermes/process/hermes.json") - .then(response => response.json()) - .then(tags => { - if(typeof obj === "string" || typeof obj == "number"){ - element.appendChild(document.createTextNode(` ${obj}`)); - tag.appendChild(document.createTextNode(`${tags[category]["local_path"]}`)); + const div = document.createElement("div"); + div.classList.add("elements"); + const divTag = document.createElement("div"); + div.classList.add("elements"); + div.appendChild(document.createTextNode(` ${obj[category]}`)); + divTag.appendChild(document.createTextNode(`${obj.meta["plugin"]}`)); + element.appendChild(div); + tag.appendChild(divTag); + /*if(typeof obj[obj] === "string" || typeof obj == "number"){ + element.appendChild(document.createTextNode(` ${obj[obj]}`)); + tag.appendChild(document.createTextNode(`${obj[metadata]["local_path"]}`)); } else if(typeof obj === "object" && Array.isArray(obj) === false){ element.appendChild(document.createTextNode(` ${JSON.stringify(obj)}`)); @@ -43,8 +48,7 @@ function extract_info(element, obj, tag, category){ //const text = document.createTextNode(` ${names}`); element.appendChild(div); tag.appendChild(divTag); - } - }) + }*/ } function extract_person(e, element){ diff --git a/public/curation/script.js b/public/curation/script.js index 20fc8aa..41f9d41 100644 --- a/public/curation/script.js +++ b/public/curation/script.js @@ -16,4 +16,4 @@ drawRadar(ctx, canvas.offsetWidth/2,canvas.offsetHeight/2, [15,15,10,15,15,12], drawRadar(ctx, canvas.offsetWidth/2,canvas.offsetHeight/2, [20,20,9,10,20,15], "blue", "rgba(94, 148, 215, 0.34)"); //View for Curation -displayJSON("../.hermes/process/hermes.json"); +displayJSON("../.hermes/process/transport.json"); From 6f903c44a331641d8b4c541006abe7a33138429f Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Thu, 20 Nov 2025 16:56:16 +0100 Subject: [PATCH 2/7] Start to adapt person view --- public/curation/curation.js | 4 +- public/curation/extract.js | 111 +++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 53 deletions(-) diff --git a/public/curation/curation.js b/public/curation/curation.js index 36ec687..7e8f78f 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -5,7 +5,7 @@ export function displayJSON(json_document){ fetch(json_document)//.hermes/process/hermes.json") .then(response => response.json()) .then(data => { - document.getElementById("test").innerHTML = 'Project '+data.name+''; + document.getElementById("test").innerHTML = 'Project '+data.name.name+''; const keys = Object.keys(data); const hermes = document.getElementById("hermes"); const tags = document.getElementById("tags"); @@ -30,8 +30,8 @@ fetch(json_document)//.hermes/process/hermes.json") const cellTag = document.createElement("td"); const cellTextTag = document.createElement('div'); - extract_info(cellText2, data[element], cellTextTag, element); + cell.appendChild(cellText); cell2.appendChild(cellText2); row.appendChild(cell); diff --git a/public/curation/extract.js b/public/curation/extract.js index d57023e..a4d8667 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -1,68 +1,77 @@ function extract_info(element, obj, tag, category){ const div = document.createElement("div"); - div.classList.add("elements"); const divTag = document.createElement("div"); - div.classList.add("elements"); - div.appendChild(document.createTextNode(` ${obj[category]}`)); - divTag.appendChild(document.createTextNode(`${obj.meta["plugin"]}`)); - element.appendChild(div); - tag.appendChild(divTag); - /*if(typeof obj[obj] === "string" || typeof obj == "number"){ - element.appendChild(document.createTextNode(` ${obj[obj]}`)); - tag.appendChild(document.createTextNode(`${obj[metadata]["local_path"]}`)); - } - else if(typeof obj === "object" && Array.isArray(obj) === false){ - element.appendChild(document.createTextNode(` ${JSON.stringify(obj)}`)); - tag.appendChild(document.createTextNode("Blocker")); - } - else if(Array.isArray(obj) && Object.keys(obj[0]).includes("familyName")){ - const divTag = document.createElement("div"); - divTag.classList.add("elements"); - obj.forEach(e =>{ - //const name = e.exec("familyName"); - extract_person(e, element); - const tag = document.createElement("div"); - tag.classList.add("tooltip"); - tag.appendChild(document.createTextNode("See Person")); - divTag.appendChild(tag); - }) - tag.appendChild(divTag); - } - else{ - const names = []; - const div = document.createElement("div"); - div.classList.add("elements"); - const divTag = document.createElement("div"); - div.classList.add("elements"); - obj.forEach(e =>{ - - names.push(JSON.stringify(e).replaceAll("{","").replaceAll("}","")); - const element = document.createElement("div"); - element.appendChild(document.createTextNode(` ${JSON.stringify(e).replaceAll("{","").replaceAll("}","").replaceAll('"',"")}`)); - div.appendChild(element); + if(obj[category]){ + if(typeof obj[category] === "string" || typeof obj[category] == "number"){ + div.appendChild(document.createTextNode(` ${obj[category]}`)); + }else if(Array.isArray(obj[category])){ + if(Array.isArray(obj[category][0]) && Object.keys(obj[category][0]).includes("familyName")){ + obj[category].forEach(e =>{ + const element = document.createElement("div"); + extract_person(e, element); + div.appendChild(element); + + }) + } + obj[category].forEach(e =>{ + //const name = e.exec("familyName"); + const element = document.createElement("div"); + element.appendChild(document.createTextNode(` ${JSON.stringify(e).replaceAll("{","").replaceAll("}","").replaceAll('"',"")}`)); + div.appendChild(element); + + }) + + }else{ + const element = document.createElement("div"); + element.appendChild(document.createTextNode(` ${JSON.stringify(obj[category])}`)); + div.appendChild(element); + } + }else{ + if(Array.isArray(obj) && Object.keys(obj[0]).includes("familyName")){ + obj.forEach(e =>{ + const element = document.createElement("div"); + console.log(e, element); + extract_person(e, element); + div.appendChild(element); - const tag = document.createElement("div"); - tag.appendChild(document.createTextNode("Blocker")); - divTag.appendChild(tag); - }) - //const text = document.createTextNode(` ${names}`); + }) + }else{ + const element = document.createElement("div"); + element.appendChild(document.createTextNode(` ${JSON.stringify(obj)}`)); + div.appendChild(element); + } + } + + if(Object.keys(obj).includes("meta")){ + + divTag.appendChild(document.createTextNode(`${obj.meta["local_path"]}`)); + }else{ + divTag.appendChild(document.createTextNode(`See Details`)); + } element.appendChild(div); tag.appendChild(divTag); - }*/ -} + } function extract_person(e, element){ const tooltip = document.createElement("div"); tooltip.classList.add("tooltip"); - tooltip.onclick = function(){link_to_person(e)}; + //tooltip.onclick = function(){link_to_person(e)}; const tooltiptext = document.createElement("div"); tooltiptext.classList.add("tooltiptext"); - const text = document.createTextNode(`${e.familyName}, ${e.givenName} `); - if(e.familyName === "Sophie"){ + const text = document.createTextNode(`${e.familyName.familyName}, ${e.givenName.givenName} `); + if(e.familyName.familyName === "Sophie"){ tooltip.className += " error" } - const data = JSON.stringify(e, null, 2); - tooltiptext.appendChild(document.createTextNode(`${data.replaceAll("{","\t").replaceAll("}","\t")}`)); //{.*\n*\t*.*\n*} + //const data = JSON.stringify(e, null, 2); + + const names = []; + Object.keys(e).forEach(k => { + if (Object.keys(e[k]).includes(k)){ + names.push(`${k}: ${e[k][k]}`); + } + }) + console.log(names); + tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); //{.*\n*\t*.*\n*} tooltip.appendChild(tooltiptext); tooltip.appendChild(text); element.appendChild(tooltip); From ed4860d2c385453e7474ae6a7f818473c94affbd Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 28 Nov 2025 14:25:00 +0100 Subject: [PATCH 3/7] Clear pipeline data button --- public/callback/main.js | 1 - public/main.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/callback/main.js b/public/callback/main.js index 21877c2..395b862 100644 --- a/public/callback/main.js +++ b/public/callback/main.js @@ -60,5 +60,4 @@ async function latest(projectId, token) { const pipelineId = jobData[0]["pipeline"]["id"]; window.location = `../callback?gitlab_project_id=${projectId}&gitlab_pipeline_id=${pipelineId}&gitlab_job_id=${jobId}&latest=2`; - //gitlab_pipeline_id=618554&gitlab_job_id=2513432 } diff --git a/public/main.js b/public/main.js index d52c67c..5761d97 100644 --- a/public/main.js +++ b/public/main.js @@ -14,4 +14,10 @@ window.onload = async function () { await deleteAllPipelines(); window.location = "./"; } + + const clearPipelineDataButton = document.getElementById("clear-pipeline-button"); + clearPipelineDataButton.onclick = async function() { + await deleteAllPipelines(); + window.location = "./"; + } } From a7c75903fc7beb79e22392549a96c88e78f3c0d6 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 28 Nov 2025 14:27:03 +0100 Subject: [PATCH 4/7] Example outputs from hermes and sc-policies --- .../policies/debug-validation-report (1).json | 14 + .../policies/debug-validation-report (1).ttl | 6 + .../policies/debug-validation-report.json | 235 +++++++++ .../policies/debug-validation-report.ttl | 50 ++ public/.hermes/process/transport.json | 483 ++++++++++++++++++ 5 files changed, 788 insertions(+) create mode 100644 public/.hermes/policies/debug-validation-report (1).json create mode 100644 public/.hermes/policies/debug-validation-report (1).ttl create mode 100644 public/.hermes/policies/debug-validation-report.json create mode 100644 public/.hermes/policies/debug-validation-report.ttl create mode 100644 public/.hermes/process/transport.json diff --git a/public/.hermes/policies/debug-validation-report (1).json b/public/.hermes/policies/debug-validation-report (1).json new file mode 100644 index 0000000..44e3ccf --- /dev/null +++ b/public/.hermes/policies/debug-validation-report (1).json @@ -0,0 +1,14 @@ +[ + { + "@id": "_:N7dadb5f5fbbe4cbca887cdc620c43ab6", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationReport" + ], + "http://www.w3.org/ns/shacl#conforms": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#boolean", + "@value": true + } + ] + } +] \ No newline at end of file diff --git a/public/.hermes/policies/debug-validation-report (1).ttl b/public/.hermes/policies/debug-validation-report (1).ttl new file mode 100644 index 0000000..9b8084b --- /dev/null +++ b/public/.hermes/policies/debug-validation-report (1).ttl @@ -0,0 +1,6 @@ +@prefix sh: . +@prefix xsd: . + +[] a sh:ValidationReport ; + sh:conforms true . + diff --git a/public/.hermes/policies/debug-validation-report.json b/public/.hermes/policies/debug-validation-report.json new file mode 100644 index 0000000..c96d2a8 --- /dev/null +++ b/public/.hermes/policies/debug-validation-report.json @@ -0,0 +1,235 @@ +[ + { + "@id": "_:N8068169b02c343babe9bb8722635033a", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationReport" + ], + "http://www.w3.org/ns/shacl#conforms": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#boolean", + "@value": false + } + ], + "http://www.w3.org/ns/shacl#result": [ + { + "@id": "_:Na299b0ba08894a7f95ccd9234e8a247e" + } + ] + }, + { + "@id": "_:Na299b0ba08894a7f95ccd9234e8a247e", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationResult" + ], + "http://www.w3.org/ns/shacl#focusNode": [ + { + "@id": "_:ne00ff720add644d5b48309d25eb5efd3b10" + } + ], + "http://www.w3.org/ns/shacl#resultMessage": [ + { + "@value": "String length not >= Literal(\"100\", datatype=xsd:integer)" + } + ], + "http://www.w3.org/ns/shacl#resultPath": [ + { + "@id": "https://schema.org/description" + } + ], + "http://www.w3.org/ns/shacl#resultSeverity": [ + { + "@id": "http://www.w3.org/ns/shacl#Violation" + } + ], + "http://www.w3.org/ns/shacl#sourceConstraintComponent": [ + { + "@id": "http://www.w3.org/ns/shacl#MinLengthConstraintComponent" + } + ], + "http://www.w3.org/ns/shacl#sourceShape": [ + { + "@id": "_:n2f40e429a2ba4abe8f8925c2ca966033b1" + } + ], + "http://www.w3.org/ns/shacl#value": [ + { + "@value": "Proof-of-concept implementation of the HERMES workflow." + } + ] + }, + { + "@id": "_:n2f40e429a2ba4abe8f8925c2ca966033b1", + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://www.w3.org/ns/shacl#description": [ + { + "@value": "The software description must have a certain length." + } + ], + "http://www.w3.org/ns/shacl#minLength": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#integer", + "@value": 100 + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "Long description" + } + ], + "http://www.w3.org/ns/shacl#path": [ + { + "@id": "https://schema.org/description" + } + ] + }, + { + "@id": "_:ne00ff720add644d5b48309d25eb5efd3b10", + "@type": [ + "https://schema.org/SoftwareSourceCode", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://doi.org/10.5063/schema/codemeta-2.0#readme": [ + { + "@type": "https://schema.org/URL", + "@value": "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md" + } + ], + "https://schema.org/author": [ + { + "@id": "https://orcid.org/0000-0001-6372-3853" + }, + { + "@id": "https://orcid.org/0000-0003-1761-2591" + }, + { + "@id": "https://orcid.org/0000-0003-4925-7248" + }, + { + "@id": "_:N538b305b81934ae391b8cef6677ba07e" + }, + { + "@id": "https://orcid.org/0000-0002-2702-3419" + }, + { + "@id": "https://orcid.org/0000-0002-3145-9880" + }, + { + "@id": "https://orcid.org/0000-0001-8174-7795" + }, + { + "@id": "_:Nda10c5ecbef84b65b8015a979111ed93" + } + ], + "https://schema.org/codeRepository": [ + { + "@type": "https://schema.org/URL", + "@value": "https://github.com/hermes-hmc/hermes" + } + ], + "https://schema.org/description": [ + { + "@value": "Proof-of-concept implementation of the HERMES workflow." + } + ], + "https://schema.org/hasPart": [ + { + "@id": "_:Ncf37313a1e0340efabab1d373b7658b6" + } + ], + "https://schema.org/license": [ + { + "@value": "https://spdx.org/licenses/Apache-2.0" + } + ], + "https://schema.org/version": [ + { + "@value": "proof-of-concept" + } + ] + }, + { + "@id": "_:Ncf37313a1e0340efabab1d373b7658b6", + "@type": [ + "https://schema.org/CreativeWork", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/associatedMedia": [ + { + "@id": "_:Ndfd4d1a0eed24ccfb2f0f32df4abbed4" + } + ], + "https://schema.org/name": [ + { + "@value": "README" + } + ] + }, + { + "@id": "_:Ndfd4d1a0eed24ccfb2f0f32df4abbed4", + "@type": [ + "https://schema.org/TextObject", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/encodingFormat": [ + { + "@value": "text/markdown" + } + ], + "https://schema.org/url": [ + { + "@type": "https://schema.org/URL", + "@value": "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md" + } + ] + }, + { + "@id": "_:N538b305b81934ae391b8cef6677ba07e", + "@type": [ + "https://schema.org/Organization", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/name": [ + { + "@value": "HERMES Team" + } + ] + }, + { + "@id": "_:Nda10c5ecbef84b65b8015a979111ed93", + "@type": [ + "https://schema.org/Person", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/affiliation": [ + { + "@id": "_:N8772291b30d041d9b1a5633fbbf68439" + } + ], + "https://schema.org/email": [ + { + "@value": "gitlab-admin+bot@hzdr.de" + } + ], + "https://schema.org/givenName": [ + { + "@value": "HIFIS Bot" + } + ] + }, + { + "@id": "_:N8772291b30d041d9b1a5633fbbf68439", + "@type": [ + "https://schema.org/Organization", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/legalName": [ + { + "@value": "Helmholtz Federated IT Services (HIFIS)" + } + ] + } +] \ No newline at end of file diff --git a/public/.hermes/policies/debug-validation-report.ttl b/public/.hermes/policies/debug-validation-report.ttl new file mode 100644 index 0000000..744bd2f --- /dev/null +++ b/public/.hermes/policies/debug-validation-report.ttl @@ -0,0 +1,50 @@ +@prefix codemeta: . +@prefix rdfs: . +@prefix schema: . +@prefix sh: . +@prefix xsd: . + +[] a sh:ValidationReport ; + sh:conforms false ; + sh:result [ a sh:ValidationResult ; + sh:focusNode [ a rdfs:Resource, + schema:SoftwareSourceCode ; + codemeta:readme "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md"^^schema:URL ; + schema:author [ a rdfs:Resource, + schema:Organization ; + schema:name "HERMES Team" ], + [ a rdfs:Resource, + schema:Person ; + schema:affiliation [ a rdfs:Resource, + schema:Organization ; + schema:legalName "Helmholtz Federated IT Services (HIFIS)" ] ; + schema:email "gitlab-admin+bot@hzdr.de" ; + schema:givenName "HIFIS Bot" ], + , + , + , + , + , + ; + schema:codeRepository "https://github.com/hermes-hmc/hermes"^^schema:URL ; + schema:description "Proof-of-concept implementation of the HERMES workflow." ; + schema:hasPart [ a rdfs:Resource, + schema:CreativeWork ; + schema:associatedMedia [ a rdfs:Resource, + schema:TextObject ; + schema:encodingFormat "text/markdown" ; + schema:url "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md"^^schema:URL ] ; + schema:name "README" ] ; + schema:license "https://spdx.org/licenses/Apache-2.0" ; + schema:version "proof-of-concept" ] ; + sh:resultMessage "String length not >= Literal(\"100\", datatype=xsd:integer)" ; + sh:resultPath schema:description ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape [ sh:datatype xsd:string ; + sh:description "The software description must have a certain length." ; + sh:minLength 100 ; + sh:name "Long description" ; + sh:path schema:description ] ; + sh:value "Proof-of-concept implementation of the HERMES workflow." ] . + diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json new file mode 100644 index 0000000..7487a6b --- /dev/null +++ b/public/.hermes/process/transport.json @@ -0,0 +1,483 @@ +{ "@context":[ [ + "https://doi.org/10.5063/schema/codemeta-2.0", + { + "hermes": "https://software-metadata.pub/ns/hermes/", + "swcard": "tba" + } + ], + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff"}, + {"conflict:":"None"} + ] + , + "@type":[ "SoftwareSourceCode", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "Policy 1"} + ], + "author": [ + { + "@id": ["https://orcid.org/0000-0001-6372-3853", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff", + "alternative_source":{"plugin": "codemeta", + "value": "https://orcid.org/0000-0001-2345-6789", + "local_path": "codemeta.md", + "timestamp": "2025-04-18T13:28:37.657148", + "harvester": "codemeta"} + }, + {"conflict": "Curation"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + + }, + "familyName": ["Meinel", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": [ "Michael", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["michael.meinel@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + + { + "@id":[ "https://orcid.org/0000-0003-4925-7248", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] , + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta", + "alternative_source":{"plugin": "cff", + "value": "Deutsches Zentrum fuer Luft- und Raumfahrt e.V.", + "local_path": "CITATION.cff", + "timestamp": "2025-04-18T13:28:37.657148", + "harvester": "cff"} + }, + {"conflict": "Curation"} + ] + + }, + "familyName": ["Druskat", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Stephan", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["stephan.druskat@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0000-0002-2702-3419", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type":[ "Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["Forschungszentrum J\u00c3\u00bclich", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Bertuch", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Oliver", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["o.bertuch@fz-juelich.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0000-0002-3145-9880", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName":[ "Helmholtz-Zentrum Dresden-Rossendorf (HZDR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName":[ "Pape", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["David", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["d.pape@hzdr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0009-0005-4430-6743", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Sophie", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "Policy 1"} + ], + "givenName": ["Kernchen", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "Policy 1"} + ], + "email":["sophie.kernchen@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0009-0001-8382-4923", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["Forschungszentrum J\u00c3\u00bclich", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Heeb", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Nitai", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["n.heeb@fz-juelich.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + } + + ], + "description": ["Cool tool", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "license": ["https://spdx.org/licenses/Apache-2.0", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "name": ["SoftwareCaRD Test", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + + "version": ["0.1.0", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + + "policiy-report":{"policy 1": "Validated"} +} + \ No newline at end of file From 904d5010064e2464369810c3d053558dbbb76336 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Thu, 4 Dec 2025 12:39:54 +0100 Subject: [PATCH 5/7] Integrate metadata, tags are missing --- public/.hermes/process/transport.json | 12 +-- public/curation/curation.js | 12 ++- public/curation/extract.js | 125 ++++++++++++++------------ 3 files changed, 80 insertions(+), 69 deletions(-) diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json index 7487a6b..5909f12 100644 --- a/public/.hermes/process/transport.json +++ b/public/.hermes/process/transport.json @@ -15,10 +15,10 @@ , "@type":[ "SoftwareSourceCode", { - "plugin": "cff", - "local_path": "CITATION.cff", + "plugin": "codemeta", + "local_path": "codemeta.md", "timestamp": "2025-03-18T13:28:37.657148", - "harvester": "cff" + "harvester": "codemeta" }, {"conflict": "Policy 1"} ], @@ -59,10 +59,10 @@ ], "@legalName": ["German Aerospace Center (DLR)", { - "plugin": "codemeta", - "local_path": "codemeta.md", + "plugin": "cff", + "local_path": "CITATION.cff", "timestamp": "2025-03-18T13:28:37.657148", - "harvester": "codemeta" + "harvester": "cff" }, {"conflict": "None"} ] diff --git a/public/curation/curation.js b/public/curation/curation.js index 7e8f78f..978f050 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -5,7 +5,7 @@ export function displayJSON(json_document){ fetch(json_document)//.hermes/process/hermes.json") .then(response => response.json()) .then(data => { - document.getElementById("test").innerHTML = 'Project '+data.name.name+''; + document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; const keys = Object.keys(data); const hermes = document.getElementById("hermes"); const tags = document.getElementById("tags"); @@ -26,14 +26,12 @@ fetch(json_document)//.hermes/process/hermes.json") const cell = document.createElement("td"); const cell2 = document.createElement("td"); const cellText = document.createTextNode(` ${element}`); - const cellText2 = document.createElement('div'); const cellTag = document.createElement("td"); const cellTextTag = document.createElement('div'); - extract_info(cellText2, data[element], cellTextTag, element); + extract_info(cell2, data[element], cellTextTag, element); cell.appendChild(cellText); - cell2.appendChild(cellText2); row.appendChild(cell); row.appendChild(cell2); @@ -41,6 +39,12 @@ fetch(json_document)//.hermes/process/hermes.json") cellTag.appendChild(cellTextTag); rowTags.appendChild(cellTag); + let style = getComputedStyle(cell); + + let hei = parseInt(style.offsetHeight) || 0; + console.log(hei); + cellTag.style.height = `${cell.offsetHeight}px`; + // add the row to the end of the table body tblBody.appendChild(row); diff --git a/public/curation/extract.js b/public/curation/extract.js index a4d8667..78b4c3a 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -1,77 +1,75 @@ -function extract_info(element, obj, tag, category){ - const div = document.createElement("div"); - const divTag = document.createElement("div"); - if(obj[category]){ - if(typeof obj[category] === "string" || typeof obj[category] == "number"){ - div.appendChild(document.createTextNode(` ${obj[category]}`)); - }else if(Array.isArray(obj[category])){ - if(Array.isArray(obj[category][0]) && Object.keys(obj[category][0]).includes("familyName")){ - obj[category].forEach(e =>{ - const element = document.createElement("div"); - extract_person(e, element); - div.appendChild(element); - - }) - } - obj[category].forEach(e =>{ - //const name = e.exec("familyName"); - const element = document.createElement("div"); - element.appendChild(document.createTextNode(` ${JSON.stringify(e).replaceAll("{","").replaceAll("}","").replaceAll('"',"")}`)); - div.appendChild(element); - - }) - - }else{ - const element = document.createElement("div"); - element.appendChild(document.createTextNode(` ${JSON.stringify(obj[category])}`)); - div.appendChild(element); - } - }else{ - if(Array.isArray(obj) && Object.keys(obj[0]).includes("familyName")){ +function extract_info(cell, obj, tag, category){ + if(!Array.isArray(obj)){ + obj = [obj]; + } + if(typeof obj[0] === "string" || typeof obj[0] == "number"){ + cell.appendChild(document.createTextNode(` ${obj[0]}`)); + } + else if(!Array.isArray(obj[0]) && Object.keys(obj[0]).includes("familyName")){ obj.forEach(e =>{ const element = document.createElement("div"); - console.log(e, element); - extract_person(e, element); - div.appendChild(element); + extract_person(e, element, tag); + cell.appendChild(element); - }) - }else{ + })} + else if(Array.isArray(obj[0])){ + obj[0].forEach(e =>{ const element = document.createElement("div"); - element.appendChild(document.createTextNode(` ${JSON.stringify(obj)}`)); - div.appendChild(element); - } - } - - if(Object.keys(obj).includes("meta")){ + extract_info(element, e, tag); + //element.appendChild(document.createTextNode(`hh ${e}`)); + cell.appendChild(element); - divTag.appendChild(document.createTextNode(`${obj.meta["local_path"]}`)); - }else{ - divTag.appendChild(document.createTextNode(`See Details`)); + }) + } + else{ + const div = document.createElement("div"); + for (let key in obj[0]) { + if(typeof obj[0][key]=== "string" || typeof obj[0][key] == "number"){ + div.appendChild(document.createTextNode(`${key}: ${(obj[0][key])}`)); + }else{ + div.appendChild(document.createTextNode(`${key}: `)); + extract_info(div, obj[0][key], tag, key); + } + div.appendChild(document.createElement("br")); + } + cell.appendChild(div); + } + if(obj[1] && Object.keys(obj[1]).includes("local_path")){ + const divTag = document.createElement("div"); + divTag.classList.add("tag"); + divTag.appendChild(document.createTextNode(`${obj[1]["local_path"]}`)); + tag.appendChild(divTag); } - element.appendChild(div); - tag.appendChild(divTag); } - function extract_person(e, element){ + function extract_person(e, element, tag){ const tooltip = document.createElement("div"); + const tooltiptag = document.createElement("div"); tooltip.classList.add("tooltip"); - //tooltip.onclick = function(){link_to_person(e)}; + tooltip.onclick = function(){link_to_person(e)}; const tooltiptext = document.createElement("div"); tooltiptext.classList.add("tooltiptext"); - const text = document.createTextNode(`${e.familyName.familyName}, ${e.givenName.givenName} `); - if(e.familyName.familyName === "Sophie"){ + const text = document.createTextNode(`${e.familyName[0]}, ${e.givenName[0]} `); + tooltiptag.appendChild(document.createTextNode("See Details")); + tooltiptag.appendChild(document.createElement("br")); + tooltiptag.onclick = function(){link_to_person(e)}; + tag.appendChild(tooltiptag); + if(e.familyName[0] === "Sophie"){ tooltip.className += " error" } //const data = JSON.stringify(e, null, 2); const names = []; Object.keys(e).forEach(k => { - if (Object.keys(e[k]).includes(k)){ - names.push(`${k}: ${e[k][k]}`); + if(!Array.isArray(e[k])){ + for (let key in e[k]) { + names.push(`${k}:${key}: ${e[k][key][0]}`); + } + }else{ + names.push(`${k}: ${e[k][0]}`); } }) - console.log(names); - tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); //{.*\n*\t*.*\n*} + tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); tooltip.appendChild(tooltiptext); tooltip.appendChild(text); element.appendChild(tooltip); @@ -79,7 +77,7 @@ function extract_info(element, obj, tag, category){ function link_to_person(data){ document.body.innerHTML = '

'; - document.getElementById("test").innerHTML = 'Person '+data.familyName+''; + document.getElementById("test").innerHTML = 'Person '+data.familyName[0]+''; const keys = Object.keys(data); const hermes = document.getElementById("hermes"); const tbl = document.createElement("table"); @@ -98,15 +96,12 @@ function extract_info(element, obj, tag, category){ const cell = document.createElement("td"); const cell2 = document.createElement("td"); const cellText = document.createTextNode(` ${element}`); - const cellText2 = document.createElement('div'); const cellTag = document.createElement("td"); const cellTextTag = document.createElement('div'); - extract_info(cellText2, data[element], cellTextTag, "author[0]."+element); - //cellText2.appendChild(document.createTextNode(` ${data.affiliation[element]}`)); + extract_info(cell2, data[element], cellTextTag, element); cell.appendChild(cellText); - cell2.appendChild(cellText2); row.appendChild(cell); row.appendChild(cell2); @@ -126,4 +121,16 @@ function extract_info(element, obj, tag, category){ tags.appendChild(tblTags); } + + function getHeight(element) +{ + element.style.visibility = "hidden"; + document.body.appendChild(element); + var height = element.offsetHeight + 0; + document.body.removeChild(element); + element.style.visibility = "visible"; + console.log(height); + return height; +} + export {extract_info}; From f61fd72d6b7525584524e0fb25f4f5a56c3d675e Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 12 Dec 2025 13:51:42 +0100 Subject: [PATCH 6/7] Improve display of tags --- public/curation/curation.js | 42 +++++++++++++++++-------------------- public/curation/extract.js | 11 ---------- public/curation/index.html | 5 +---- public/style.css | 1 + 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/public/curation/curation.js b/public/curation/curation.js index 978f050..cb629e7 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -8,21 +8,28 @@ fetch(json_document)//.hermes/process/hermes.json") document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; const keys = Object.keys(data); const hermes = document.getElementById("hermes"); - const tags = document.getElementById("tags"); const tbl = document.createElement("table"); const tblBody = document.createElement("tbody"); - const tblTags = document.createElement("table"); - const tblBodyTags = document.createElement("tbody"); - - - + const colgroup = document.createElement("colgroup"); + for(let i=0; i<3; i++){ + const col = document.createElement("col"); + col.id = `col${i}`; + colgroup.appendChild(col); + } + tbl.appendChild(colgroup); + //tbl.appendChild(colgroup); // creating all cells - keys.forEach(element => { + const row = document.createElement("tr"); + const cell = document.createElement("td"); + cell.appendChild(document.createTextNode(` Curation View`)); + cell.colSpan = "3"; + row.appendChild(cell); + tblBody.appendChild(row); + + keys.forEach(element => { // creates a table row const row = document.createElement("tr"); - const rowTags = document.createElement("tr"); - const cell = document.createElement("td"); const cell2 = document.createElement("td"); const cellText = document.createTextNode(` ${element}`); @@ -37,33 +44,22 @@ fetch(json_document)//.hermes/process/hermes.json") cellTag.appendChild(cellTextTag); - rowTags.appendChild(cellTag); + row.appendChild(cellTag); - let style = getComputedStyle(cell); - - let hei = parseInt(style.offsetHeight) || 0; - console.log(hei); - cellTag.style.height = `${cell.offsetHeight}px`; - - // add the row to the end of the table body tblBody.appendChild(row); - tblBodyTags.appendChild(rowTags); }) tbl.appendChild(tblBody); hermes.appendChild(tbl); - tblTags.appendChild(tblBodyTags); - tags.appendChild(tblTags); - }) } const checkbox = document.getElementById("extended"); checkbox.addEventListener('change', (event)=>{ if(checkbox.checked){ - document.getElementById("tags").style.display = "block"; + document.getElementById("col2").style.visibility = ""; }else{ - document.getElementById("tags").style.display = "none"; + document.getElementById("col2").style.visibility = "collapse"; } }) diff --git a/public/curation/extract.js b/public/curation/extract.js index 78b4c3a..7dacb2e 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -122,15 +122,4 @@ function extract_info(cell, obj, tag, category){ } - function getHeight(element) -{ - element.style.visibility = "hidden"; - document.body.appendChild(element); - var height = element.offsetHeight + 0; - document.body.removeChild(element); - element.style.visibility = "visible"; - console.log(height); - return height; -} - export {extract_info}; diff --git a/public/curation/index.html b/public/curation/index.html index 89f9640..b8b8625 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -26,13 +26,10 @@

Software CaRD
-
-
-

-
+
diff --git a/public/style.css b/public/style.css index 368f3ea..aceb951 100644 --- a/public/style.css +++ b/public/style.css @@ -17,6 +17,7 @@ table { align-items: center; justify-content: center; } + tbody { border: 1px solid; } From 04c3b774b854e42ea15a664ad9676c9cd23b3795 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 12 Dec 2025 13:52:57 +0100 Subject: [PATCH 7/7] Remove unessasary row --- public/curation/curation.js | 7 ------- public/style.css | 8 ++------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/public/curation/curation.js b/public/curation/curation.js index cb629e7..ec99901 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -20,13 +20,6 @@ fetch(json_document)//.hermes/process/hermes.json") tbl.appendChild(colgroup); //tbl.appendChild(colgroup); // creating all cells - const row = document.createElement("tr"); - const cell = document.createElement("td"); - cell.appendChild(document.createTextNode(` Curation View`)); - cell.colSpan = "3"; - row.appendChild(cell); - tblBody.appendChild(row); - keys.forEach(element => { // creates a table row const row = document.createElement("tr"); diff --git a/public/style.css b/public/style.css index aceb951..190253b 100644 --- a/public/style.css +++ b/public/style.css @@ -13,15 +13,11 @@ a{ } table { - display: flex; - align-items: center; - justify-content: center; -} - -tbody { border: 1px solid; + border-collapse: collapse; } + th, td, tr { border: 1px solid; padding-inline: 10px;