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

#4463 - Add human phenotype ontology knowledge base profile #4464

Merged
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 @@ -37,7 +37,13 @@ public class KnowledgeBaseInfo
private String authorName;

@JsonProperty("website-url")
private String websiteURL;
private String websiteUrl;

@JsonProperty("license-name")
private String licenseName;

@JsonProperty("license-url")
private String licenseUrl;

public String getDescription()
{
Expand Down Expand Up @@ -69,14 +75,34 @@ public void setAuthorName(String aAuthorName)
authorName = aAuthorName;
}

public String getWebsiteURL()
public String getWebsiteUrl()
{
return websiteUrl;
}

public void setWebsiteUrl(String aWebsiteURL)
{
websiteUrl = aWebsiteURL;
}

public String getLicenseName()
{
return licenseName;
}

public void setLicenseName(String aLicenseName)
{
licenseName = aLicenseName;
}

public String getLicenseUrl()
{
return websiteURL;
return licenseUrl;
}

public void setWebsiteURL(String aWebsiteURL)
public void setLicenseUrl(String aLicenseUrl)
{
websiteURL = aWebsiteURL;
licenseUrl = aLicenseUrl;
}

@Override
Expand All @@ -92,12 +118,15 @@ public boolean equals(Object o)
return Objects.equals(description, that.description)
&& Objects.equals(hostInstitutionName, that.hostInstitutionName)
&& Objects.equals(authorName, that.authorName)
&& Objects.equals(websiteURL, that.websiteURL);
&& Objects.equals(websiteUrl, that.websiteUrl)
&& Objects.equals(licenseName, that.licenseName)
&& Objects.equals(licenseUrl, that.licenseUrl);
}

@Override
public int hashCode()
{
return Objects.hash(description, hostInstitutionName, authorName, websiteURL);
return Objects.hash(description, hostInstitutionName, authorName, websiteUrl, licenseName,
licenseUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
*/
package de.tudarmstadt.ukp.inception.kb.yaml;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.emptyList;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -217,9 +216,9 @@ public void setDefaultDataset(String aDefaultDataset)

public static Map<String, KnowledgeBaseProfile> readKnowledgeBaseProfiles() throws IOException
{
try (Reader r = new InputStreamReader(
try (var r = new InputStreamReader(
KnowledgeBaseProfile.class.getResourceAsStream(KNOWLEDGEBASE_PROFILES_YAML),
StandardCharsets.UTF_8)) {
UTF_8)) {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
return mapper.readValue(r, new TypeReference<HashMap<String, KnowledgeBaseProfile>>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ babel_net:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
BabelNet is a multilingual lexicalized semantic network and ontology that was automatically
created by linking Wikipedia to WordNet.
host-institution-name: Linguistic Computing Laboratory at Sapienza University of Rome
Expand All @@ -64,7 +64,7 @@ db_pedia:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
DBpedia is a crowd-sourced community effort to extract structured content from the information
created in various Wikimedia projects.
host-institution-name: Leipzig University, University of Mannheim, OpenLink Software
Expand Down Expand Up @@ -92,7 +92,7 @@ wikidata:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.wikidata.org/prop/direct/P1647
info:
description: >
description: |
Wikidata is a free and open knowledge base and acts as central storage for the structured data
of its Wikimedia sister projects including Wikipedia, Wikivoyage, Wikisource, and others.
host-institution-name: Wikimedia Foundation, Inc.
Expand Down Expand Up @@ -147,7 +147,7 @@ zbw-stw-economics:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
Thesaurus that provides vocabulary on any economic subject. Almost 6,000 standardized subject
headings and about 20,000 additional entry terms to support individual keywords.
host-institution-name: ZBW - Leibniz Information Centre for Economics
Expand All @@ -173,7 +173,7 @@ zbw-gnd:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
Mapping Integrated Authority File (GND).The Integrated Authority File (GND) is a controlled
keyword system, that is mainly used for indexing in German libraries.
host-institution-name: ZBW - Leibniz Information Centre for Economics
Expand Down Expand Up @@ -251,7 +251,7 @@ wine_ontology:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
An example OWL ontology. Derived from the DAML Wine ontology at
http://ontolingua.stanford.edu/doc/chimaera/ontologies/wines.daml
host-institution-name: "-"
Expand All @@ -277,9 +277,66 @@ olia_penn.owl:
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: >
description: |
Ontologies of Linguistic Annotation (OLiA)
host-institution-name: Applied Computational Linguistics (ACoLi) Lab at the Goethe University Frankfurt, Germany
author-name: Christian Chiarcos and Maria Sukhareva
website-url: http://www.acoli.informatik.uni-frankfurt.de/resources/olia/


iao:
name: Information Artifact Ontology (IAO) (v2022-11-07)
type: LOCAL
default-language: en
reification: NONE
access:
access-url: https://raw.githubusercontent.com/information-artifact-ontology/IAO/v2022-11-07/iao.owl
full-text-search: http://www.openrdf.org/contrib/lucenesail#matches
mapping:
class: http://www.w3.org/2000/01/rdf-schema#Class
subclass-of: http://www.w3.org/2000/01/rdf-schema#subClassOf
instance-of: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
label: http://www.w3.org/2000/01/rdf-schema#label
property-type: http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
description: http://www.w3.org/2000/01/rdf-schema#comment
property-label: http://www.w3.org/2000/01/rdf-schema#label
property-description: http://www.w3.org/2000/01/rdf-schema#comment
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
info:
description: |
The Information Artifact Ontology (IAO) is a new ontology of information entities, originally driven by work by
the OBI digital entity and realizable information entity branch.

For more information, please refer to the project's website.
website-url: https://github.com/information-artifact-ontology/IAO/

hpo-2024-01-16:
name: Human Phenotype Ontology (v2024-01-16)
type: LOCAL
default-language: en
reification: NONE
access:
access-url: https://github.com/obophenotype/human-phenotype-ontology/releases/download/v2024-01-16/hp-full.owl
full-text-search: http://www.openrdf.org/contrib/lucenesail#matches
mapping:
class: http://www.w3.org/2002/07/owl#Class
subclass-of: http://www.w3.org/2000/01/rdf-schema#subClassOf
instance-of: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
description: http://purl.obolibrary.org/obo/IAO_0000115
label: http://www.w3.org/2000/01/rdf-schema#label
property-type: http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
subproperty-of: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
property-label: http://www.w3.org/2000/01/rdf-schema#label
property-description: http://www.w3.org/2000/01/rdf-schema#comment
additional-matching-properties:
- http://www.geneontology.org/formats/oboInOwl#hasExactSynonym
info:
description: |
The Human Phenotype Ontology (HPO) project provides an ontology of medically relevant phenotypes,
disease-phenotype annotations, and the algorithms that operate on these.

This resources is quite large. Downloading and importing it may take some time.

Find out more at [http://www.human-phenotype-ontology.org](http://www.human-phenotype-ontology.org).
host-institution-name: The Jackson Laboratory
website-url: https://hpo.jax.org/app/
license-url: https://hpo.jax.org/app/license
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private KnowledgeBaseInfo createReferenceInfo()
referenceInfo.setDescription(description);
referenceInfo.setAuthorName(author);
referenceInfo.setHostInstitutionName(host);
referenceInfo.setWebsiteURL(website);
referenceInfo.setWebsiteUrl(website);
return referenceInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,23 @@
</label>
<label wicket:id="authorName" class="col-sm-9 text-muted" style="font-weight: normal;"></label>
</div>
<div class="row form-row" wicket:enclosure="websiteURL">
<div class="row form-row" wicket:enclosure="websiteUrl">
<label class="col-form-label col-sm-3">
<wicket:message key="kb.wizard.steps.accessSpecific.homepage" />
</label>
<a wicket:id="websiteURL" class="col-sm-9" target="_blank"></a>
<div class="col-sm-9">
<a wicket:id="websiteUrl" target="_blank"></a>
<i class="fas fa-external-link-alt text-secondary"></i>
</div>
</div>
<div class="row form-row" wicket:enclosure="licenseUrl">
<label class="col-form-label col-sm-3">
<wicket:message key="kb.wizard.steps.accessSpecific.license" />
</label>
<div class="col-sm-9">
<a wicket:id="licenseUrl" target="_blank"></a>
<i class="fas fa-external-link-alt text-secondary"></i>
</div>
</div>
</wicket:panel>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static de.tudarmstadt.ukp.inception.support.lambda.LambdaBehavior.visibleWhen;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.panel.Panel;
Expand All @@ -36,13 +37,26 @@ public KnowledgeBaseInfoPanel(String aId, CompoundPropertyModel<KnowledgeBaseInf
{
super(aId, aModel);

queue(new MarkdownLabel("description", aModel.bind("description"))
.add(visibleWhen(() -> aModel.getObject() != null)));
queue(new Label("hostInstitutionName", aModel.bind("hostInstitutionName"))
.add(visibleWhen(() -> aModel.getObject() != null)));
queue(new Label("authorName", aModel.bind("authorName"))
.add(visibleWhen(() -> aModel.getObject() != null)));
queue(new ExternalLink("websiteURL", aModel.bind("websiteURL"), aModel.bind("websiteURL"))
.add(visibleWhen(() -> aModel.getObject() != null)));
var description = aModel.map(KnowledgeBaseInfo::getDescription);
queue(new MarkdownLabel("description", description)
.add(visibleWhen(description.map(StringUtils::isNotBlank))));

var hostInstitutionName = aModel.map(KnowledgeBaseInfo::getHostInstitutionName);
queue(new Label("hostInstitutionName", hostInstitutionName)
.add(visibleWhen(hostInstitutionName.map(StringUtils::isNotBlank))));

var authorName = aModel.map(KnowledgeBaseInfo::getAuthorName);
queue(new Label("authorName", authorName)
.add(visibleWhen(authorName.map(StringUtils::isNotBlank))));

var websiteURL = aModel.map(KnowledgeBaseInfo::getWebsiteUrl);
queue(new ExternalLink("websiteUrl", websiteURL, websiteURL)
.add(visibleWhen(websiteURL.map(StringUtils::isNotBlank))));

var licenseUrl = aModel.map(KnowledgeBaseInfo::getLicenseUrl);
var licenseName = aModel.map(KnowledgeBaseInfo::getLicenseName)
.orElseGet(licenseUrl::getObject);
queue(new ExternalLink("licenseUrl", licenseUrl, licenseName)
.add(visibleWhen(licenseUrl.map(StringUtils::isNotBlank))));
}
}
Loading