Skip to content

Commit

Permalink
Merge pull request #827 from EBISPOT/update-api-fields
Browse files Browse the repository at this point in the history
Update ontolog_purl and mailing_list fields
  • Loading branch information
haideriqbal authored Jan 27, 2025
2 parents 7e6bf8e + ff70aa1 commit 751acf7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
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

0 comments on commit 751acf7

Please sign in to comment.