Skip to content

Commit

Permalink
feat(ontology): enable tags on ontology rows (#4392)
Browse files Browse the repository at this point in the history
  • Loading branch information
mswertz authored Oct 25, 2024
1 parent 714ab92 commit 3ecba5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ public static TableMetadata getOntologyTableDefinition(
// constraint so we can ensure unique labels on each level
.setDescription("User-friendly label for this term. Should be unique in parent")
.setSemantics("http://purl.obolibrary.org/obo/NCIT_C45561"),
column("tags")
.setType(STRING_ARRAY)
.setDescription("Any tags that you might need to slice and dice the ontology"),
column("parent")
// .setKey(2) when we upgrade to psql 15 so we can allow parent == null in
// constraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface ITag {
order?: number;
name: string;
label?: string;
tags?: string[];
parent?: ITag;
codesystem?: string;
code?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public void testCsvApi_tableCsvUploadDownload() {
String path = "/pet store/api/csv/Tag";

String result = given().sessionId(SESSION_ID).accept(ACCEPT_CSV).when().get(path).asString();
assertTrue(result.contains("green,,colors"));
assertTrue(result.contains("green,,,colors"));

String update = "name,parent\r\nyellow,colors\r\n";
given().sessionId(SESSION_ID).body(update).when().post(path).then().statusCode(200);
Expand All @@ -549,7 +549,7 @@ public void testCsvApi_tableCsvUploadDownload() {
given().sessionId(SESSION_ID).body(update).when().delete(path).then().statusCode(200);

result = given().sessionId(SESSION_ID).accept(ACCEPT_CSV).when().get(path).asString();
assertTrue(result.contains("green,,colors"));
assertTrue(result.contains("green,,,colors"));
}

@Test
Expand Down

0 comments on commit 3ecba5e

Please sign in to comment.