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

Update ontolog_purl and mailing_list fields #827

Merged
merged 1 commit into from
Jan 27, 2025
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 @@ -13,7 +13,7 @@
import java.util.Map;
import java.util.Objects;

import static uk.ac.ebi.ols.shared.DefinedFields.LANGUAGE;
import static uk.ac.ebi.ols.shared.DefinedFields.*;

public class V1OntologyMapper {

Expand Down Expand Up @@ -43,12 +43,12 @@ public static V1Ontology mapOntology(JsonElement json, String lang) {
ontology.config.description = JsonHelper.getString(localizedJson, "description");
ontology.config.homepage = JsonHelper.getString(localizedJson, "homepage");
ontology.config.version = JsonHelper.getString(localizedJson, "version");
ontology.config.mailingList = JsonHelper.getString(localizedJson, "mailing_list");
ontology.config.mailingList = JsonHelper.getString(localizedJson, MAILING_LIST.getText());
ontology.config.tracker = JsonHelper.getString(localizedJson, "tracker");
ontology.config.logo = JsonHelper.getString(localizedJson, "logo");
ontology.config.creators = JsonHelper.getStrings(localizedJson, "creators");
ontology.config.annotations = gson.fromJson(localizedJson.get("annotations"), Map.class);
ontology.config.fileLocation = JsonHelper.getString(localizedJson, "ontology_purl");
ontology.config.fileLocation = JsonHelper.getString(localizedJson, ONTOLOGY_PURL.getText());
ontology.config.oboSlims = localizedJson.has("oboSlims") && localizedJson.get("oboSlims").getAsBoolean();

ontology.config.labelProperty = JsonHelper.getString(localizedJson, "label_property");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,17 @@ public void write(JsonWriter writer) throws Throwable {
}

}

if(configKey.equalsIgnoreCase("ontology_purl")) {
// Config uses "ontology_purl" whereas rest of code base uses ONTOLOGY_PURL.getText().
configKey = ONTOLOGY_PURL.getText();
}

if(configKey.equalsIgnoreCase("mailing_list")) {
// Config uses "mailing_list" whereas rest of code base uses MAILING_LIST.getText().
configKey = MAILING_LIST.getText();
}

// annotated as hasPreferredRoot by PreferredRootsAnnotator, no need to duplicate
if (configKey.equals("preferred_root_term"))
continue;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/model/Ontology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export default class Ontology extends Thing {
return this.properties["depicted_by"] || undefined;
}
getOntologyPurl(): string {
return this.properties["ontology_purl"];
return this.properties["ontologyPurl"];
}
getHomepage(): string {
return this.properties["homepage"];
}
getMailingList(): string {
return this.properties["mailing_list"];
return this.properties["mailingList"];
}
getTracker(): string {
return this.properties["tracker"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public enum DefinedFields {
" in defining this class. It only considers classes in the filler position, not classes expressions in the filler position." +
"I.e. 'liver disease' (EFO:0001421) has a relatedTo relation with 'liver' (UBERON:0002107) because " +
"'liver disease' is a subclass of 'has_disease_location some liver'.", "array"),
SYNONYM("synonym", "", "The list of names that are synonyms of this entity.", "array"),;
SYNONYM("synonym", "", "The list of names that are synonyms of this entity.", "array"),
MAILING_LIST("mailingList", "", "The mailing list for the ontology.", "string"),
ONTOLOGY_PURL("ontologyPurl", "", "The URL of the ontology to download the ontology file.", "string");

private final String text;
private final String ols3Text;
Expand Down
Loading