Skip to content

Commit

Permalink
Merge pull request #747 from SynBioHub/updateMetadataSparql
Browse files Browse the repository at this point in the history
updated edam, updated get metadata sparql for sbol3, updated model3
  • Loading branch information
danielfang97 authored Sep 4, 2024
2 parents c4bfc3e + 8dd55cb commit 7c99e18
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ export default function SectionRenderer({ section, metadata }) {
}
}
}
if (/^(http:\/\/edamontology\.org\/format_\d{4}|edam:format_\d{4})$/.test(section.text)) {
if (/^(http:\/\/edamontology\.org\/format_\d{4}|edam:format_\d{4}|https:\/\/identifiers\.org\/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');
} else if (/^https:\/\/identifiers\.org\/edam:format_\d{4}$/.test(section.text)) {
section.text = section.text.replace(/^https:\/\/identifiers\.org\/edam:format_(\d{4})$/, 'http://edamontology.org/format_$1');
}

// Now proceed with checking against the keys in edamOntology
Expand All @@ -111,6 +113,7 @@ export default function SectionRenderer({ section, metadata }) {
}
}


if (section.grouped) {
const items = section.text.split(', ');
const content = items.map((item, index) => {
Expand Down
134 changes: 73 additions & 61 deletions frontend/components/Viewing/PageJSON/Types/Model3.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@

{

"type": "http://sbols.org/v3#Model",
"prefixes": [
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>",
"PREFIX dcterms: <http://purl.org/dc/terms/>",
"PREFIX dc: <http://purl.org/dc/elements/1.1/>",
"PREFIX sbh: <http://wiki.synbiohub.org/wiki/Terms/synbiohub#>",
"PREFIX prov: <http://www.w3.org/ns/prov#>",
"PREFIX sbol: <http://sbols.org/v3#>",
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>",
"PREFIX purl: <http://purl.obolibrary.org/obo/>"
],
"metadata": [
{
"title": "Language",
"icon": "faVials",
"rootPredicate": "sbol:language",
"sections": [
{
"title": "lang",
"predicates": [
],
"link": "$<This>"
}
]
},
{
"title": "Framework",
"rootPredicate": "sbol:framework",
"icon": "faVials",
"sections": [
{
"title": "framework",
"predicates": [],
"link": "$<This>",
"stripAfter": "/"
}
]
},
{
"title": "Model File",
"rootPredicate": "sbol:source",
"icon": "faVials",
"sections": [
{
"title": "mfile",
"predicates": [],
"link": "$<This>"
}
]
"type": "http://sbols.org/v3#Model",
"prefixes": [
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>",
"PREFIX dcterms: <http://purl.org/dc/terms/>",
"PREFIX dc: <http://purl.org/dc/elements/1.1/>",
"PREFIX sbh: <http://wiki.synbiohub.org/wiki/Terms/synbiohub#>",
"PREFIX prov: <http://www.w3.org/ns/prov#>",
"PREFIX sbol: <http://sbols.org/v3#>",
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>",
"PREFIX purl: <http://purl.obolibrary.org/obo/>"
],
"metadata": [
{
"title": "Language",
"icon": "faVials",
"rootPredicate": "sbol:language",
"sections": [
{
"title": "lang",
"predicates": [],
"link": "$<languageLink>"
},
{
"title": "languageLink",
"predicates": [],
"hide": true
}
],
"tables": [],
"pages": [
"Details",
"Other Properties",
"Member of these Collections",
"Attachments"
]
}
]
},
{
"title": "Framework",
"rootPredicate": "sbol:framework",
"icon": "faVials",
"sections": [
{
"title": "framework",
"predicates": [],
"link": "$<frameworkLink>",
"stripAfter": "/"
},
{
"title": "frameworkLink",
"predicates": [],
"hide": true
}
]
},
{
"title": "Model File",
"rootPredicate": "sbol:source",
"icon": "faVials",
"sections": [
{
"title": "mfile",
"predicates": [],
"link": "$<sourceLink>"
},
{
"title": "sourceLink",
"predicates": [],
"hide": true
}
]
}
],
"tables": [],
"pages": [
"Details",
"Other Properties",
"Member of these Collections",
"Attachments"
]
}
4 changes: 4 additions & 0 deletions frontend/sparql/getMetadata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const query = `PREFIX sbol2: <http://sbols.org/v2#>
PREFIX sbol3: <http://sbols.org/v3#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX synbiohub: <http://synbiohub.org#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
Expand All @@ -23,6 +24,9 @@ WHERE {
OPTIONAL { <$uri> sbol2:persistentIdentity ?persistentIdentity . }
OPTIONAL { <$uri> sbol2:displayId ?displayId . }
OPTIONAL { <$uri> sbol2:version ?version . }
OPTIONAL { <$uri> sbol3:persistentIdentity ?persistentIdentity . }
OPTIONAL { <$uri> sbol3:displayId ?displayId . }
OPTIONAL { <$uri> sbol3:version ?version . }
OPTIONAL { <$uri> dcterms:title ?name . }
OPTIONAL { <$uri> dcterms:description ?description . }
OPTIONAL { <$uri> dc:creator ?creator . }
Expand Down

0 comments on commit 7c99e18

Please sign in to comment.