Skip to content
Open
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 @@ -67,9 +67,11 @@ export default class AsyncOperationsBuilderWithReasoner extends AsyncOperationsB
association: {
input_type: this.removeBioLinkPrefix(sbj),
output_type: this.removeBioLinkPrefix(obj),
predicate: this.removeBioLinkPrefix(pred),
predicate: this.removeBioLinkPrefix(typeof(pred) === "string" ? pred : pred.predicate),
api_name: metadata.title,
smartapi: metadata.smartapi,
association_id: typeof(pred) === "string" ? undefined : pred.association_id,
qualifiers: typeof(pred) === "string" ? undefined : pred.qualifiers,
"x-translator": metadata["x-translator"],
},
tags: [...metadata.tags, ...["bte-trapi"]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ export default class SyncOperationsBuilderWithReasoner extends BaseOperationsBui
input_id: metadata?.nodes?.[sbj]?.id_prefixes,
output_type: this.removeBioLinkPrefix(obj),
output_id: metadata?.nodes?.[obj]?.id_prefixes,
predicate: this.removeBioLinkPrefix(pred),
predicate: this.removeBioLinkPrefix(typeof(pred) === "string" ? pred : pred.predicate),
api_name: metadata.association.api_name,
smartapi: metadata.association.smartapi,
association_id: typeof(pred) === "string" ? undefined : pred.association_id,
qualifiers: typeof(pred) === "string" ? undefined : pred.qualifiers,
"x-translator": metadata.association["x-translator"],
"x-trapi": metadata.association["x-trapi"],
},
Expand Down
1 change: 1 addition & 0 deletions src/parser/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default class Endpoint {
output_id: this.removeBioLinkPrefix(output.id),
output_type: this.removeBioLinkPrefix(output.semantic),
predicate: this.removeBioLinkPrefix(op.predicate),
association_id: this.removeBioLinkPrefix(op.biolink_association_type),
qualifiers: op.qualifiers
? Object.fromEntries(
Object.entries(op.qualifiers).map(([qualifierType, qualifier]) => [
Expand Down
2 changes: 2 additions & 0 deletions src/parser/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export interface XBTEKGSOperationObject {
inputs: XBTEKGSOperationBioEntityObject[];
outputs: XBTEKGSOperationBioEntityObject[];
predicate: string;
biolink_association_type?: string;
qualifiers?: { [qualifierType: string]: string; };
source?: string;
parameters?: XBTEParametersObject;
Expand Down Expand Up @@ -158,6 +159,7 @@ interface KGAssociationObject {
api_name?: string;
component?: string;
smartapi?: SmartAPIRegistryRecordObject;
association_id?: string;
"x-translator"?: any;
"x-trapi"?: XTRAPIObject;
qualifiers?: {
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface PredicatesQueryOperationInterface {
interface PredicatesAssociationInterface {
api_name: string;
smartapi: SmartAPIRegistryRecordObject;
association_id?: string;
"x-translator": any;
"x-trapi"?: XTRAPIObject;
}
Expand All @@ -58,7 +59,7 @@ interface PredicatesNode {
}

interface ReasonerSubjectAndPredicate {
[propName: string]: string[];
[propName: string]: any[];
}

export interface ReasonerPredicatesResponse {
Expand Down