Skip to content

Commit

Permalink
Merge 3cce435 into d6e4b66
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed May 23, 2022
2 parents d6e4b66 + 3cce435 commit e69f7f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/transformers/biothings_transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export default class BioThingsTransformer extends BaseTransformer {
});
return res;
} else {
let _input = generateCurie(this.edge.association.input_id, this.edge.input);
return { [_input]: [this.data["response"]] }
return super.pairCurieWithAPIResponse();
}

}
Expand Down
5 changes: 4 additions & 1 deletion src/transformers/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export default class BaseTransformer {
* Create an object with key representing input, and value representing the output of API
*/
pairCurieWithAPIResponse() {
let input = generateCurie(this.edge.association.input_id, this.edge.input);
let input = generateCurie(
this.edge.association.input_id,
this.edge.input.hasOwnProperty('queryInputs') ? this.edge.input["queryInputs"] : this.edge.input as string
);
return {
[input]: [this.data.response],
};
Expand Down
6 changes: 5 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ interface SmartAPIKGOperationObject {
tags?: string[];
}

interface templatedInput {
queryInputs: any;
}

export interface BTEKGOperationObject extends SmartAPIKGOperationObject {
input: string | string[];
input: string | string[] | templatedInput;
reasoner_edge?: any;
filter?: string;
original_input?: object;
Expand Down

0 comments on commit e69f7f6

Please sign in to comment.