diff --git a/frontend/components/Viewing/PageJSON/Rendering/SectionRenderer.js b/frontend/components/Viewing/PageJSON/Rendering/SectionRenderer.js index ebb9005d..3e9240be 100644 --- a/frontend/components/Viewing/PageJSON/Rendering/SectionRenderer.js +++ b/frontend/components/Viewing/PageJSON/Rendering/SectionRenderer.js @@ -80,6 +80,7 @@ export default function SectionRenderer({ section, metadata }) { } }) } + console.log(section.text); if (/SO:\s*(\d{7})/.test(section.text)) { for (let key in sequenceOntology) { if (section.text === key) { @@ -96,7 +97,13 @@ export default function SectionRenderer({ section, metadata }) { } } } - if (/http:\/\/edamontology\.org\/format_\d{4}/.test(section.text)) { + if (/^(http:\/\/edamontology\.org\/format_\d{4}|edam:format_\d{4})$/.test(section.text)) { + // Normalize the section.text to the full URL format + if (/^edam:format_\d{4}$/.test(section.text)) { + section.text = section.text.replace(/^edam:format_(\d{4})$/, 'http://edamontology.org/format_$1'); + } + + // Now proceed with checking against the keys in edamOntology for (let key in edamOntology) { if (section.text === key) { section.text = edamOntology[key]; diff --git a/frontend/components/Viewing/PageJSON/Types/Sequence.json b/frontend/components/Viewing/PageJSON/Types/Sequence.json index 3254f513..3145914a 100644 --- a/frontend/components/Viewing/PageJSON/Types/Sequence.json +++ b/frontend/components/Viewing/PageJSON/Types/Sequence.json @@ -20,7 +20,6 @@ { "title": "Encoding", "stripAfter": "/", - "text": "Encoding", "predicates": [ ], "link": "$" diff --git a/frontend/components/Viewing/PageJSON/Types/Sequence3.json b/frontend/components/Viewing/PageJSON/Types/Sequence3.json index b8679a64..e18ff559 100644 --- a/frontend/components/Viewing/PageJSON/Types/Sequence3.json +++ b/frontend/components/Viewing/PageJSON/Types/Sequence3.json @@ -11,27 +11,39 @@ "PREFIX rdfs: ", "PREFIX purl: " ], - "metadata": [], + "metadata": [ + { + "title": "Encoding", + "rootPredicate": "sbol:encoding", + "icon": "faCode", + "sections": [ + { + "title": "Encoding", + "stripAfter": "/", + "predicates": [ + ], + "link": "$" + }, + { + "title": "encodingLink", + "predicates": [], + "hide": true + } + ] + } + ], "tables": [ { - "icon": "faDna", - "title": "Sequence", - "rootPredicate": "sbol:elements", - "sections": [ - { - "title": "Sequence", - "infoLink": "$", - "predicates": [] - }, - { - "title": "Encoding", - "rootPredicateOverride": "sbol:encoding", - "predicates": [ - "rdf:resource" - ], - "hide": true - } - ] + "icon": "faDna", + "title": "Sequence", + "rootPredicate": "sbol:elements", + "sections": [ + { + "title": "Sequence", + "infoLink": "https://sbols.org/v3#sequence", + "predicates": [] + } + ] } ], "pages": [