Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sequence for sbol3, added a different variation of encoding for… #745

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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];
Expand Down
1 change: 0 additions & 1 deletion frontend/components/Viewing/PageJSON/Types/Sequence.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
{
"title": "Encoding",
"stripAfter": "/",
"text": "Encoding",
"predicates": [
],
"link": "$<encodingLink>"
Expand Down
50 changes: 31 additions & 19 deletions frontend/components/Viewing/PageJSON/Types/Sequence3.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,39 @@
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>",
"PREFIX purl: <http://purl.obolibrary.org/obo/>"
],
"metadata": [],
"metadata": [
{
"title": "Encoding",
"rootPredicate": "sbol:encoding",
"icon": "faCode",
"sections": [
{
"title": "Encoding",
"stripAfter": "/",
"predicates": [
],
"link": "$<encodingLink>"
},
{
"title": "encodingLink",
"predicates": [],
"hide": true
}
]
}
],
"tables": [
{
"icon": "faDna",
"title": "Sequence",
"rootPredicate": "sbol:elements",
"sections": [
{
"title": "Sequence",
"infoLink": "$<Encoding>",
"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": [
Expand Down
Loading