From 00839df3e3af722658063c3b927ff8236c3d7dea Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Wed, 19 Nov 2025 13:35:32 +0100 Subject: [PATCH 01/14] 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 02/14] 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 03/14] 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 04/14] 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 05/14] 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 06/14] 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 07/14] 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; From 1b9c1e74aaa2ac91c6c8a8743e0765a14eeffb40 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Tue, 27 Jan 2026 09:59:02 +0100 Subject: [PATCH 08/14] Fix Curation error display --- public/.hermes/process/transport.json | 16 +++++---- public/curation/extract.js | 49 +++++++++++++++++---------- public/curation/index.html | 1 - public/style.css | 21 ++++++------ 4 files changed, 52 insertions(+), 35 deletions(-) diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json index 5909f12..c37de8a 100644 --- a/public/.hermes/process/transport.json +++ b/public/.hermes/process/transport.json @@ -10,9 +10,8 @@ "local_path": "CITATION.cff", "timestamp": "2025-03-18T13:28:37.657148", "harvester": "cff"}, - {"conflict:":"None"} - ] - , + {"conflict":"None"} + ], "@type":[ "SoftwareSourceCode", { "plugin": "codemeta", @@ -473,9 +472,14 @@ "plugin": "cff", "local_path": "CITATION.cff", "timestamp": "2025-03-18T13:28:37.657148", - "harvester": "cff" - }, - {"conflict": "None"} + "harvester": "cff", + "alternative_source":{"plugin": "codemeta", + "value": "0.1.1", + "local_path": "codemeta.md", + "timestamp": "2025-04-18T13:28:38.657148", + "harvester": "codemeta"} + }, + {"conflict": "Curation"} ], "policiy-report":{"policy 1": "Validated"} diff --git a/public/curation/extract.js b/public/curation/extract.js index 7dacb2e..3fda587 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -3,7 +3,17 @@ function extract_info(cell, obj, tag, category){ obj = [obj]; } if(typeof obj[0] === "string" || typeof obj[0] == "number"){ + console.log("einfahc", obj[0], obj[2]); + if(obj[2] && obj[2]["conflict"] == "Curation"){ + console.log(`${Object.keys(obj[2])}`); + const element = document.createElement("div"); + element.className += " error"; + element.appendChild(document.createTextNode(` ${obj[0]}`)); + cell.appendChild(element); + }else{ cell.appendChild(document.createTextNode(` ${obj[0]}`)); + } + } else if(!Array.isArray(obj[0]) && Object.keys(obj[0]).includes("familyName")){ obj.forEach(e =>{ @@ -14,10 +24,12 @@ function extract_info(cell, obj, tag, category){ })} else if(Array.isArray(obj[0])){ obj[0].forEach(e =>{ + console.log(e); const element = document.createElement("div"); extract_info(element, e, tag); //element.appendChild(document.createTextNode(`hh ${e}`)); cell.appendChild(element); + }) } @@ -40,6 +52,7 @@ function extract_info(cell, obj, tag, category){ divTag.appendChild(document.createTextNode(`${obj[1]["local_path"]}`)); tag.appendChild(divTag); } + } function extract_person(e, element, tag){ @@ -54,22 +67,34 @@ function extract_info(cell, obj, tag, category){ 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 => { + const pair = document.createElement("p"); if(!Array.isArray(e[k])){ for (let key in e[k]) { + const pair_in_list = document.createElement("p"); names.push(`${k}:${key}: ${e[k][key][0]}`); + pair_in_list.appendChild(document.createTextNode(`${k}:${key}: ${e[k][key][0]}`)); + if(e[k][key][2] && e[k][key][2]["conflict"] == "Curation"){ + pair_in_list.className += " error"; + tooltiptag.className += " error"; } + pair.appendChild(pair_in_list); + } }else{ names.push(`${k}: ${e[k][0]}`); + pair.appendChild(document.createTextNode(`${k}: ${e[k][0]}`)); + + if(e[k][2] && e[k][2]["conflict"] == "Curation"){ + pair.className += " error"; + tooltiptag.className += " error"; } + } + tooltiptext.appendChild(pair); }) - tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); + //tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); tooltip.appendChild(tooltiptext); tooltip.appendChild(text); element.appendChild(tooltip); @@ -82,16 +107,12 @@ function extract_info(cell, obj, tag, category){ const hermes = document.getElementById("hermes"); const tbl = document.createElement("table"); const tblBody = document.createElement("tbody"); - - const tags = document.getElementById("tags"); - const tblTags = document.createElement("table"); - const tblBodyTags = document.createElement("tbody"); + // creating all cells keys.forEach(element => { // creates a table row - const row = document.createElement("tr"); - const rowTags = document.createElement("tr"); + const row = document.createElement("tr"); const cell = document.createElement("td"); const cell2 = document.createElement("td"); @@ -106,20 +127,14 @@ function extract_info(cell, obj, tag, category){ row.appendChild(cell2); cellTag.appendChild(cellTextTag); - rowTags.appendChild(cellTag); + row.appendChild(cellTag); - - // 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); - } export {extract_info}; diff --git a/public/curation/index.html b/public/curation/index.html index b8b8625..f5b065f 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -29,7 +29,6 @@

Software CaRD
-
diff --git a/public/style.css b/public/style.css index 190253b..3ab47d4 100644 --- a/public/style.css +++ b/public/style.css @@ -15,6 +15,7 @@ a{ table { border: 1px solid; border-collapse: collapse; + width:100%; } @@ -37,17 +38,10 @@ button{ #content{ display: flex; - align-items: stretch; justify-content: center; } - -.elements{ - display: flex; - align-items: center; - justify-content: flex-end; - flex-direction: column; - flex-wrap: nowrap; - +#hermes{ + width: 80%; } .tooltip { @@ -63,11 +57,15 @@ color: #fff; text-align: center; position: absolute; z-index: 1; +width: 80%; bottom: 125%; -left:20%; -translate: -12%; +left: 10%; opacity: 0; transition: opacity 0.3s; +border-radius: 12px; +} +.tooltip .tooltiptext p{ +font-size: large; } @@ -90,4 +88,5 @@ opacity: 1; .error{ color: red; + border-color:black; } From 4e4f8366002c0e41eaa9e0fc96762217a6f60da9 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 13 Feb 2026 11:41:26 +0100 Subject: [PATCH 09/14] Start refactor to template form --- public/.hermes/process/transport.json | 2 +- public/curation/curation.js | 76 ++++++++++----------------- public/curation/extract.js | 3 +- public/curation/index.html | 28 ++++++++-- public/dashboard/main.js | 2 +- public/style.css | 10 +++- 6 files changed, 66 insertions(+), 55 deletions(-) diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json index c37de8a..b368a4f 100644 --- a/public/.hermes/process/transport.json +++ b/public/.hermes/process/transport.json @@ -482,6 +482,6 @@ {"conflict": "Curation"} ], - "policiy-report":{"policy 1": "Validated"} + "policy-report":{"policy 1": "Validated"} } \ No newline at end of file diff --git a/public/curation/curation.js b/public/curation/curation.js index ec99901..3794013 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -2,57 +2,37 @@ import { extract_info } from "./extract.js"; 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[0]+''; - const keys = Object.keys(data); - const hermes = document.getElementById("hermes"); - const tbl = document.createElement("table"); - const tblBody = document.createElement("tbody"); + fetch(json_document) + .then(response => response.json()) + .then(data => { + document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; + const keys = Object.keys(data); + const metadateTemp = document.querySelector("#metadate"); + const tbody = document.querySelector("#metadata"); + + keys.forEach(element => { + const row = document.importNode(metadateTemp.content, true); + const mkey = row.querySelector("#key"), + mvalue = row.querySelector("#value"), + mtag = row.querySelector("#tag"); + + mkey.textContent = `${element}`; + extract_info(mvalue, data[element], mtag); + /* + mvalue.textContent = `${data[element][0]}`; + mtag.textContent = `${data[element][1]["local_path"]}`;*/ + tbody.appendChild(row); + }) + }) - 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 => { - // creates a table row - const row = document.createElement("tr"); - const cell = document.createElement("td"); - const cell2 = document.createElement("td"); - const cellText = document.createTextNode(` ${element}`); - const cellTag = document.createElement("td"); - const cellTextTag = document.createElement('div'); - extract_info(cell2, data[element], cellTextTag, element); - - cell.appendChild(cellText); - row.appendChild(cell); - row.appendChild(cell2); - - - cellTag.appendChild(cellTextTag); - row.appendChild(cellTag); - - // add the row to the end of the table body - tblBody.appendChild(row); - }) - tbl.appendChild(tblBody); - hermes.appendChild(tbl); - - }) -} const checkbox = document.getElementById("extended"); checkbox.addEventListener('change', (event)=>{ - if(checkbox.checked){ - document.getElementById("col2").style.visibility = ""; - }else{ - document.getElementById("col2").style.visibility = "collapse"; - } +if(checkbox.checked){ + document.getElementById("col2").style.visibility = ""; +}else{ + document.getElementById("col2").style.visibility = "collapse"; +} }) +} \ No newline at end of file diff --git a/public/curation/extract.js b/public/curation/extract.js index 3fda587..b7b526c 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -101,7 +101,8 @@ function extract_info(cell, obj, tag, category){ } function link_to_person(data){ - document.body.innerHTML = '

'; + document.body.innerHTML = '

'; + document.getElementById("test").innerHTML = 'Person '+data.familyName[0]+''; const keys = Object.keys(data); const hermes = document.getElementById("hermes"); diff --git a/public/curation/index.html b/public/curation/index.html index f5b065f..569b49a 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -25,9 +25,31 @@

Software CaRD
-
-
-
+
+ + + + + + + + + + +
+ +
+ + diff --git a/public/dashboard/main.js b/public/dashboard/main.js index 07e56c8..a5a4d59 100644 --- a/public/dashboard/main.js +++ b/public/dashboard/main.js @@ -7,7 +7,7 @@ window.onload = async function () { const token = localStorage.getItem("gitlab-api-token"); if (!token) { alert("Please set up the GitLab connection first!"); - window.location = "./"; + window.location = "../"; return; } diff --git a/public/style.css b/public/style.css index 3ab47d4..f76431f 100644 --- a/public/style.css +++ b/public/style.css @@ -58,6 +58,7 @@ text-align: center; position: absolute; z-index: 1; width: 80%; +padding: 10px; bottom: 125%; left: 10%; opacity: 0; @@ -66,7 +67,7 @@ border-radius: 12px; } .tooltip .tooltiptext p{ font-size: large; - +margin: 0px; } .tooltip .tooltiptext::after { @@ -86,6 +87,13 @@ visibility: visible; opacity: 1; } +button{ + border-radius: 12px; + background-image: -webkit-linear-gradient(166.66deg, rgb(34, 198, 227) 4.62%, rgb(23, 124, 207) 10.62%, rgb(116, 75, 196) 86.29%); + color: white; + border-color: white; + padding: 10px; +} .error{ color: red; border-color:black; From fa57427b4e57ec142f99756376dfac8834d997ab Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 13 Feb 2026 17:42:02 +0100 Subject: [PATCH 10/14] Select dataset via searchparams --- public/curation/curation.js | 35 +++++++++++++++++++++++++++++----- public/curation/extract.js | 38 ++----------------------------------- public/curation/index.html | 1 + public/curation/person.html | 30 ----------------------------- 4 files changed, 33 insertions(+), 71 deletions(-) delete mode 100644 public/curation/person.html diff --git a/public/curation/curation.js b/public/curation/curation.js index 3794013..5d69fca 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -5,7 +5,17 @@ export function displayJSON(json_document){ fetch(json_document) .then(response => response.json()) .then(data => { - document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; + const params = new URLSearchParams(location.search); + if(params.has("id")){ + const id = params.get("id") + data = get_data_snippet(data, "@id", id); + + document.body.innerHTML += ``; + } + + + + //document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; const keys = Object.keys(data); const metadateTemp = document.querySelector("#metadate"); const tbody = document.querySelector("#metadata"); @@ -24,15 +34,30 @@ export function displayJSON(json_document){ tbody.appendChild(row); }) }) - - +} +function get_data_snippet(data, skey, svalue){ + const stack = [data]; + search: while (stack?.length > 0) { + const obj = stack.pop(); + for(let i=0; i{ -if(checkbox.checked){ + if(checkbox.checked){ document.getElementById("col2").style.visibility = ""; }else{ document.getElementById("col2").style.visibility = "collapse"; } + }) -} \ No newline at end of file diff --git a/public/curation/extract.js b/public/curation/extract.js index b7b526c..94ceb30 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -3,7 +3,6 @@ function extract_info(cell, obj, tag, category){ obj = [obj]; } if(typeof obj[0] === "string" || typeof obj[0] == "number"){ - console.log("einfahc", obj[0], obj[2]); if(obj[2] && obj[2]["conflict"] == "Curation"){ console.log(`${Object.keys(obj[2])}`); const element = document.createElement("div"); @@ -66,6 +65,7 @@ function extract_info(cell, obj, tag, category){ tooltiptag.appendChild(document.createTextNode("See Details")); tooltiptag.appendChild(document.createElement("br")); tooltiptag.onclick = function(){link_to_person(e)}; + console.log(e); tag.appendChild(tooltiptag); //const data = JSON.stringify(e, null, 2); @@ -101,41 +101,7 @@ function extract_info(cell, obj, tag, category){ } function link_to_person(data){ - document.body.innerHTML = '

'; - - document.getElementById("test").innerHTML = 'Person '+data.familyName[0]+''; - const keys = Object.keys(data); - const hermes = document.getElementById("hermes"); - const tbl = document.createElement("table"); - const tblBody = document.createElement("tbody"); - - - // creating all cells - keys.forEach(element => { - // creates a table row - const row = document.createElement("tr"); - - const cell = document.createElement("td"); - const cell2 = document.createElement("td"); - const cellText = document.createTextNode(` ${element}`); - - const cellTag = document.createElement("td"); - const cellTextTag = document.createElement('div'); - - extract_info(cell2, data[element], cellTextTag, element); - cell.appendChild(cellText); - row.appendChild(cell); - row.appendChild(cell2); - - cellTag.appendChild(cellTextTag); - row.appendChild(cellTag); - - // add the row to the end of the table body - tblBody.appendChild(row); - }) - tbl.appendChild(tblBody); - hermes.appendChild(tbl); - + window.location.href += `?id=${data["@id"][0]}`; } export {extract_info}; diff --git a/public/curation/index.html b/public/curation/index.html index 569b49a..66e0663 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -48,6 +48,7 @@

Software CaRD diff --git a/public/curation/person.html b/public/curation/person.html deleted file mode 100644 index 92be1a3..0000000 --- a/public/curation/person.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - Software CaRD - - - - - -

- -
-
-
- -
- - - - - \ No newline at end of file From d672198ede852e7a4b4c2ae0d9676ef9aa9617e0 Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Fri, 13 Feb 2026 18:15:48 +0100 Subject: [PATCH 11/14] Fix missing eventlistener --- public/curation/curation.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/public/curation/curation.js b/public/curation/curation.js index 5d69fca..f8e8fa3 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -10,7 +10,10 @@ export function displayJSON(json_document){ const id = params.get("id") data = get_data_snippet(data, "@id", id); - document.body.innerHTML += ``; + const back = document.createElement("button"); + back.innerText = "Back to Overview"; + back.onclick = () => {window.location = window.location.href.split('?')[0];} + document.body.appendChild(back); } @@ -34,10 +37,21 @@ export function displayJSON(json_document){ tbody.appendChild(row); }) }) + const checkbox = document.querySelector("#extended"); +checkbox.addEventListener('change', (event)=>{ + if(checkbox.checked){ + document.getElementById("col2").style.visibility = ""; +}else{ + document.getElementById("col2").style.visibility = "collapse"; +} + +}) + + } function get_data_snippet(data, skey, svalue){ const stack = [data]; - search: while (stack?.length > 0) { + while (stack?.length > 0) { const obj = stack.pop(); for(let i=0; i{ - if(checkbox.checked){ - document.getElementById("col2").style.visibility = ""; -}else{ - document.getElementById("col2").style.visibility = "collapse"; -} - -}) From 9755a96150297f9af40aafa1d2b9faf39d6a964a Mon Sep 17 00:00:00 2001 From: "Kernchen, Sophie" Date: Mon, 16 Feb 2026 14:57:39 +0100 Subject: [PATCH 12/14] Begin integration policies --- public/.hermes/process/transport.json | 16 ++++++++- public/curation/curation.js | 52 ++++++++++++++++++++++++--- public/curation/extract.js | 2 +- public/curation/index.html | 20 ++++++++--- public/style.css | 8 +++++ 5 files changed, 88 insertions(+), 10 deletions(-) diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json index b368a4f..93cf775 100644 --- a/public/.hermes/process/transport.json +++ b/public/.hermes/process/transport.json @@ -482,6 +482,20 @@ {"conflict": "Curation"} ], - "policy-report":{"policy 1": "Validated"} + "policies": [{"policy 1": {"conforms": true}}, + {"policy 2": {"conforms": false, + "resultMessage": "String length not >= Literal(\"100\", datatype=xsd:integer)" , + "resultPath": "https://schema.org/description" , + "resultSeverity": "Violation" , + "sourceConstraintComponent": "MinLengthConstraintComponent" , + "sourceShape": { "datatype": "string" , + "description": "The software description must have a certain length.", + "minLength": 100 , + "name": "Long description" , + "path": "https://schema.org/description" }, + "value": "Proof-of-concept implementation of the HERMES workflow." + }} + +] } \ No newline at end of file diff --git a/public/curation/curation.js b/public/curation/curation.js index f8e8fa3..5681b0d 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -16,15 +16,59 @@ export function displayJSON(json_document){ document.body.appendChild(back); } - - - //document.getElementById("test").innerHTML = 'Project '+data.name[0]+''; const keys = Object.keys(data); + const metadateTemp = document.querySelector("#metadate"); const tbody = document.querySelector("#metadata"); + const policyTemp = document.querySelector("#policy"), + policyDiv = document.querySelector("#sw-policies"); + + + const header = document.querySelector("#header-policies"); + header.style.display = "none"; + + keys.forEach(element => { + if(element.toLowerCase().includes("name")){ + console.log(element); + document.getElementById("project-name").innerHTML = element.charAt(0).toUpperCase() + element.slice(1) +' '+data[element][0]+''; + } + if(element=="policies"){ + header.style.display = "block"; + console.log("policies"); + data[element].forEach(pol =>{ + console.log(pol); + const policy = document.importNode(policyTemp.content, true); + console.log(policy); + const tbodyPol = policy.querySelector("tbody"), + polname = policy.querySelector("#policy-name"); + const policyId = Object.keys(pol)[0]; + polname.textContent = `${policyId}`; + policyDiv.appendChild(policy); + const policyReportTemp = document.querySelector("#policy-report"); + const polKeys = Object.keys(pol[policyId]); + console.log(polKeys); + polKeys.forEach(report =>{ + console.log(report); + const prow = document.importNode(policyReportTemp.content, true); + + const pkey = prow.querySelector("#pkey"), + pvalue = prow.querySelector("#pvalue"); + //pconforms = prow.querySelector("#policy-conforms"); + if(report=="conforms"){ + console.log("conforms"); + } + console.log(report,pol[policyId][report]); + pkey.textContent = `${report}`; + extract_info(pvalue, pol[policyId][report]); + //pvalue.textContent = `${pol[policyId][report]}`; + tbodyPol.appendChild(prow); + }) + }) - keys.forEach(element => { + return; + } const row = document.importNode(metadateTemp.content, true); + console.log(row); const mkey = row.querySelector("#key"), mvalue = row.querySelector("#value"), mtag = row.querySelector("#tag"); diff --git a/public/curation/extract.js b/public/curation/extract.js index 94ceb30..983b925 100644 --- a/public/curation/extract.js +++ b/public/curation/extract.js @@ -2,7 +2,7 @@ function extract_info(cell, obj, tag, category){ if(!Array.isArray(obj)){ obj = [obj]; } - if(typeof obj[0] === "string" || typeof obj[0] == "number"){ + if(typeof obj[0] === "string" || typeof obj[0] == "number" || typeof obj[0] == "boolean"){ if(obj[2] && obj[2]["conflict"] == "Curation"){ console.log(`${Object.keys(obj[2])}`); const element = document.createElement("div"); diff --git a/public/curation/index.html b/public/curation/index.html index 66e0663..5cced2c 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -20,7 +20,7 @@

Software CaRD -

+

Metadata


@@ -46,10 +46,22 @@

Software CaRD -