Skip to content

Commit

Permalink
add documentation on new metakg options
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed Mar 9, 2024
1 parent c30a949 commit 915888a
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,28 @@ pnpm i @biothings-explorer/smartapi-kg
meta_kg.constructMetaKGSync();
```

- Option 9: Load Meta-KG with an api list
- Option 9: Load Meta-KG from data you specify

```javascript
const smartapiSpecs = {} // This should contain your smartapi specs: could be from file read, redis, etc.
const predicates = [] // This should contain predicates data on TRAPI APIs (optional)
let meta_kg = new MetaKG();
meta_kg.constructMetaKGSync(includeReasoner = true, { predicates, smartapiSpecs });
```

- Option 10: Load Meta-KG from operations you specify

```javascript
const meta_kg_old = new MetaKG();
meta_kg_old.constructMetaKGSync();
const ops = meta_kg_old.ops; // ops can be transfered over a network/threads since it just stores JSON
// loading a new MetaKG from the operations
const meta_kg = new MetaKG(undefined, undefined, ops);
```

- Option 11: Load Meta-KG with an api list
```javascript
meta_kg.constructMetaKGSync(includeReasoner=true, {apiList: [
{
Expand Down

0 comments on commit 915888a

Please sign in to comment.