Skip to content

Commit

Permalink
Update metadata and add conformsTo
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgarcia committed Nov 1, 2023
1 parent d4f35a8 commit bc6245f
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 50 deletions.
45 changes: 23 additions & 22 deletions code/createPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import subprocess
import shutil

docsSubfolders = ['consortia', 'projects', 'theses']
DOCS_SUBFOLDERS = ['consortia', 'projects', 'theses']
MAPPINGS = [("employee", "Current project members"), ("alumni", "Previous project members"), ("member", "External contributors"), ("knowsAbout", "Outcomes"), ("parentOrganization", "Parent organization, consortium or research project"), ("subOrganization", "Sub-projects")]
MAPPINGS_FROM = [i[0] for i in MAPPINGS]
MAPPINGS_TO = [i[1] for i in MAPPINGS]

def createTableLink(data):
"""
Expand Down Expand Up @@ -257,7 +260,7 @@ def processNamesInProject(item) :
idURL = item["@id"]
md += f'<a href="{idURL}" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit {subTypeURL}</a>\n\n'
for prop, val in item.items():
if prop not in ["@type", "@id", "name", "funder", "givenName", "familyName"]:
if prop not in ["@type", "@id", "name", "http://purl.org/dc/terms/conformsTo", "funder", "givenName", "familyName"]:
if prop == 'url':
md += renderUrlAsHref(val)
else :
Expand All @@ -274,35 +277,26 @@ def processProjectData(data, jsonFileURL):
Returns:
A markdown text with the rendered metadata.
"""
mappings = [("employee", "Current project members"), ("alumni", "Previous project members"), ("member", "External contributors"), ("knowsAbout", "Outcomes"), ("parentOrganization", "Parent organization, consortium or research project"), ("subOrganization", "Sub-projects")]
mappings_from = [i[0] for i in mappings]
mappings_to = [i[1] for i in mappings]

md = ""

for property, value in data.items():
if property == 'name':
md += f'## {value}\n\n'
md += f'<p>{createGetJsonLink(jsonFileURL)}</p>\n'

if property == "foundingDate" :
md += f'_Started in {value}_\n'
elif property == 'dissolutionDate':
md += f'_Concluded in {value}_\n'

if property not in ["@type", "@id", "@context", "name", "dissolutionDate", "foundingDate"]:
if property in mappings_from :
i = mappings_from.index(property)
md += f'### {mappings_to[i]}\n\n'
if property not in ["@type", "@id", "@context", "http://purl.org/dc/terms/conformsTo", "name", "dissolutionDate", "foundingDate"]:
if property in MAPPINGS_FROM :
i = MAPPINGS_FROM.index(property)
md += f'### {MAPPINGS_TO[i]}\n\n'
else :
md += f'### {property.capitalize()}\n\n'

#ToDo: analyze and refactor code
if property == 'url':
md += renderUrlAsHref(value)
elif isinstance(value, list):
#knowsAbout is a list of objects
#there is a bug with inner lists (keywords) and objects (license) inside those objects
for item in value:
if isinstance(item, (dict, list)):
#each item is an object/dict
#loop on each key, value pair
for mdFolderName in item:
subItem = item.get(mdFolderName, "")
if (isinstance(subItem,(dict, list))):
Expand All @@ -327,6 +321,13 @@ def processProjectData(data, jsonFileURL):
md += f'- {subProperty.capitalize()}: {subValue}\n'
else:
md += f'{value}\n'
elif property == 'name':
md += f'## {value}\n\n'
md += f'<p>{createGetJsonLink(jsonFileURL)}</p>\n'
elif property == "foundingDate" :
md += f'_Started in {value}_\n'
elif property == 'dissolutionDate':
md += f'_Concluded in {value}_\n'

return md

Expand All @@ -344,9 +345,9 @@ def prepareDocsSubfolder(docsPath):
Returns:
A list with the local path for all docs subfolders corresponding to research projects
"""
docsSubfoldersPath = [(docsPath + "/") + subfolder for subfolder in docsSubfolders]
docsSubfoldersPath = [(docsPath + "/") + subfolder for subfolder in DOCS_SUBFOLDERS]
docsSubfoldersPath = [subfolder + "/" for subfolder in docsSubfoldersPath]

for subfolder in docsSubfoldersPath:
try:
shutil.rmtree(subfolder)
Expand Down Expand Up @@ -400,7 +401,7 @@ def fromMetadatatoDocs():
md = ""
folderIndex = -1
try:
folderIndex = docsSubfolders.index(mdFolderName)
folderIndex = DOCS_SUBFOLDERS.index(mdFolderName)
md = f'# {mdFolderName.capitalize()} metadata\n\n'
md += processProjectData(data, jsonFileURL)
docFileProjectsPath = os.path.join(docsSubfoldersPath[folderIndex], jsonFileName.removesuffix('.json') + ".md")
Expand Down
5 changes: 4 additions & 1 deletion docs/consortia/2021_NFDI4DataScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ NFDI, Data Science, Artificial Intelligence
- Alternatename: German Research Foundation
- URL: <a href="http://www.dfg.de/en/" target="_blank">http://www.dfg.de/en/</a>

<a href="https://gepris.dfg.de/gepris/projekt/460234259" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Grant</a>

- Identifier: 460234259
- Description: Project no. 460234259 (corresponding to the NFDI4DataScience consortium)


<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@id": "https://gepris.dfg.de/gepris/projekt/460234259",
"@id": "https://gepris.dfg.de/gepris/projekt/460234259#project",
"@type": "ResearchProject",
"name": "NFDI4DataScience",
"foundingDate": "2021-10-01",
Expand Down Expand Up @@ -78,6 +80,7 @@ NFDI, Data Science, Artificial Intelligence
"funding": [
{
"@type": "Grant",
"@id": "https://gepris.dfg.de/gepris/projekt/460234259",
"funder": {
"@type": "Organization",
"@id": "https://ror.org/018mejw64",
Expand Down
12 changes: 6 additions & 6 deletions docs/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tbody>
<tr>
<td>identifier</td>
<td><a href="https://doi.org/10.5281/zenodo.4903981" target="_blank">https://doi.org/10.5281/zenodo.4903981</a></td>
<td>DOI:10.5281/zenodo.4903981</td>
</tr>
<tr>
<td>name</td>
Expand Down Expand Up @@ -141,7 +141,7 @@
"@type": "DataCatalog",
"@id": "https://doi.org/10.5281/zenodo.4903981",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/DataCatalog/0.4-DRAFT",
"identifier": "https://doi.org/10.5281/zenodo.4903981",
"identifier": "DOI:10.5281/zenodo.4903981",
"name": "Whatizit performance evaluation against CRAFT corpus",
"description": "Whatizit performance evaluation against CRAFT corpus wrt Gene Ontology annotations",
"keywords": [
Expand Down Expand Up @@ -197,7 +197,7 @@
<tbody>
<tr>
<td>identifier</td>
<td><a href="https://doi.org/10.5281/zenodo.5035290" target="_blank">https://doi.org/10.5281/zenodo.5035290</a></td>
<td>DOI:10.5281/zenodo.5035290</td>
</tr>
<tr>
<td>name</td>
Expand Down Expand Up @@ -344,7 +344,7 @@
"@type": "DataCatalog",
"@id": "https://doi.org/10.5281/zenodo.5035290",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/DataCatalog/0.4-DRAFT",
"identifier": "https://doi.org/10.5281/zenodo.5035290",
"identifier": "DOI:10.5281/zenodo.5035290",
"name": "Complete Medline abstracts corpus between 2015-2019 annotated Whatizit text annotation tool",
"description": "Gene Ontology annotations for Medline abstracts from 2015 to 2019 using Whatizit",
"keywords": [
Expand Down Expand Up @@ -878,7 +878,7 @@
<tbody>
<tr>
<td>identifier</td>
<td><a href="https://doi.org/10.5281/zenodo.7793384" target="_blank">https://doi.org/10.5281/zenodo.7793384</a></td>
<td>DOI:10.5281/zenodo.7793384</td>
</tr>
<tr>
<td>name</td>
Expand Down Expand Up @@ -1017,7 +1017,7 @@
"@type": "DataCatalog",
"@id": "https://doi.org/10.5281/zenodo.7793384",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/DataCatalog/0.4-DRAFT",
"identifier": "https://doi.org/10.5281/zenodo.7793384",
"identifier": "DOI:10.5281/zenodo.7793384",
"name": "Protein Function Embeddings: First Beta Release of Datasets",
"description": "Datasets generated from a thesis work that explores how information for protein functions can be exploited through embeddings so that the produced information can be used to improve protein function annotations",
"keywords": [
Expand Down
72 changes: 68 additions & 4 deletions docs/projects/2021_OntoClue.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,

#### NFDI4DataScience

<a href="https://www.nfdi4datascience.de/" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Consortium</a>
<a href="https://gepris.dfg.de/gepris/projekt/460234259#project" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Consortium</a>

#### STELLA Living Labs Project

<a href="https://stella-project.org/" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit ResearchProject</a>
<a href="ttps://gepris.dfg.de/gepris/projekt/407518790#project" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit ResearchProject</a>

### Funding

Expand All @@ -68,6 +68,8 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,
- Alternatename: German Research Foundation
- URL: <a href="http://www.dfg.de/en/" target="_blank">http://www.dfg.de/en/</a>

<a href="https://gepris.dfg.de/gepris/projekt/460234259" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Grant</a>

- Identifier: 460234259
- Description: Project no. 460234259 (corresponding to the NFDI4DataScience consortium)
#### Deutsche Forschungsgemeinschaft
Expand All @@ -77,6 +79,8 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,
- Alternatename: German Research Foundation
- URL: <a href="http://www.dfg.de/en/" target="_blank">http://www.dfg.de/en/</a>

<a href="https://gepris.dfg.de/gepris/projekt/407518790" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Grant</a>

- Identifier: 407518790
- Description: Project no. 407518790 (corresponding to the STELLA project)
### Outcomes
Expand All @@ -85,26 +89,55 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,

<a href="https://doi.org/10.4126/FRL01-006440397" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit ScholarlyArticle</a>

- Identifier: DOI:10.4126/FRL01-006440397s
- Datepublished: 2023-06-22
#### OntoClue, a framework to compare vector-based approaches for document relatedness using the RELISH corpus - Poster

<a href="https://ceur-ws.org/Vol-3415/paper-38.pdf" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit Poster</a>

- Identifier: CEUR:Vol-3415/paper-38
- Datepublished: 2023-03-01
#### Ontology Clustering with OWL2Vec*

<a href="https://ceur-ws.org/Vol-2918/short3.pdf" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit ScholarlyArticle</a>

- Identifier: CEUR:Vol-2918/short3
- Datepublished: 2021-07-28
#### Creative Commons Attribution 4.0 International

<a href="https://spdx.org/licenses/CC-BY-4.0.html" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit CreativeWork</a>

- Alternatename: CC BY 4.0
- URL: <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">https://creativecommons.org/licenses/by/4.0/</a>

#### Complete Medline abstracts corpus between 2015-2019 annotated Whatizit text annotation tool

<a href="https://doi.org/10.5281/zenodo.5035290" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit DataCatalog</a>

- Identifier: DOI:10.5281/zenodo.5035290
- Description: Gene Ontology annotations for Medline abstracts from 2015 to 2019 using Whatizit
- Keywords: Whatizit, Semantic annotation, Medline, text-mining
- License: {'@type': 'CreativeWork', '@id': 'https://spdx.org/licenses/CC-BY-4.0.html', 'name': 'Creative Commons Attribution 4.0 International', 'alternateName': 'CC BY 4.0', 'url': 'https://creativecommons.org/licenses/by/4.0/'}
- URL: <a href="https://zenodo.org/record/5035290" target="_blank">https://zenodo.org/record/5035290</a>

- Datepublished: 2021-06-27
#### Creative Commons Attribution 4.0 International

<a href="https://spdx.org/licenses/CC-BY-4.0.html" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit CreativeWork</a>

- Alternatename: CC BY 4.0
- URL: <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">https://creativecommons.org/licenses/by/4.0/</a>

#### Whatizit performance evaluation against CRAFT corpus

<a href="https://doi.org/10.5281/zenodo.4903981" target="_blank"><img src = "/images/visit.svg" alt="Visit URL"/> Visit DataCatalog</a>

- Identifier: DOI:10.5281/zenodo.4903981
- Description: Whatizit performance evaluation against CRAFT corpus wrt Gene Ontology annotations
- Keywords: Whatizit, Semantic annotation, CRAFT, manual annotation, performance
- License: {'@type': 'CreativeWork', '@id': 'https://spdx.org/licenses/CC-BY-4.0.html', 'name': 'Creative Commons Attribution 4.0 International', 'alternateName': 'CC BY 4.0', 'url': 'https://creativecommons.org/licenses/by/4.0/'}
- URL: <a href="https://zenodo.org/record/4903981" target="_blank">https://zenodo.org/record/4903981</a>

- Datepublished: 2021-06-05
### External contributors

Expand Down Expand Up @@ -208,18 +241,19 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,
},
{
"@type": "Consortium",
"@id": "https://www.nfdi4datascience.de/",
"@id": "https://gepris.dfg.de/gepris/projekt/460234259#project",
"name": "NFDI4DataScience"
},
{
"@type": "ResearchProject",
"@id": "https://stella-project.org/",
"@id": "ttps://gepris.dfg.de/gepris/projekt/407518790#project",
"name": "STELLA Living Labs Project"
}
],
"funding": [
{
"@type": "Grant",
"@id": "https://gepris.dfg.de/gepris/projekt/460234259",
"funder": {
"@type": "Organization",
"@id": "https://ror.org/018mejw64",
Expand All @@ -232,6 +266,7 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,
},
{
"@type": "Grant",
"@id": "https://gepris.dfg.de/gepris/projekt/407518790",
"funder": {
"@type": "Organization",
"@id": "https://ror.org/018mejw64",
Expand All @@ -247,31 +282,60 @@ word-embeddings, document-embeddings, ontology-embeddings, document similarity,
{
"@type": "ScholarlyArticle",
"@id": "https://doi.org/10.4126/FRL01-006440397",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/ScholarlyArticle/0.3-DRAFT",
"identifier": "DOI:10.4126/FRL01-006440397s",
"name": "OntoClue, a framework to compare vector-based approaches for document relatedness using the RELISH corpus",
"datePublished": "2023-06-22"
},
{
"@type": "Poster",
"@id": "https://ceur-ws.org/Vol-3415/paper-38.pdf",
"identifier": "CEUR:Vol-3415/paper-38",
"name": "OntoClue, a framework to compare vector-based approaches for document relatedness using the RELISH corpus - Poster",
"datePublished": "2023-03-01"
},
{
"@type": "ScholarlyArticle",
"@id": "https://ceur-ws.org/Vol-2918/short3.pdf",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/ScholarlyArticle/0.3-DRAFT",
"identifier": "CEUR:Vol-2918/short3",
"name": "Ontology Clustering with OWL2Vec*",
"datePublished": "2021-07-28"
},
{
"@type": "DataCatalog",
"@id": "https://doi.org/10.5281/zenodo.5035290",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/DataCatalog/0.4-DRAFT",
"identifier": "DOI:10.5281/zenodo.5035290",
"name": "Complete Medline abstracts corpus between 2015-2019 annotated Whatizit text annotation tool",
"description": "Gene Ontology annotations for Medline abstracts from 2015 to 2019 using Whatizit",
"keywords": "Whatizit, Semantic annotation, Medline, text-mining",
"license": {
"@type": "CreativeWork",
"@id": "https://spdx.org/licenses/CC-BY-4.0.html",
"name": "Creative Commons Attribution 4.0 International",
"alternateName": "CC BY 4.0",
"url": "https://creativecommons.org/licenses/by/4.0/"
},
"url": "https://zenodo.org/record/5035290",
"datePublished": "2021-06-27"
},
{
"@type": "DataCatalog",
"@id": "https://doi.org/10.5281/zenodo.4903981",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/DataCatalog/0.4-DRAFT",
"identifier": "DOI:10.5281/zenodo.4903981",
"name": "Whatizit performance evaluation against CRAFT corpus",
"description": "Whatizit performance evaluation against CRAFT corpus wrt Gene Ontology annotations",
"keywords": "Whatizit, Semantic annotation, CRAFT, manual annotation, performance",
"license": {
"@type": "CreativeWork",
"@id": "https://spdx.org/licenses/CC-BY-4.0.html",
"name": "Creative Commons Attribution 4.0 International",
"alternateName": "CC BY 4.0",
"url": "https://creativecommons.org/licenses/by/4.0/"
},
"url": "https://zenodo.org/record/4903981",
"datePublished": "2021-06-05"
}
],
Expand Down
Loading

0 comments on commit bc6245f

Please sign in to comment.