Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perspective snapshot language integration #49

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
Merge branch 'main' into perspective-snapshot-integration
weswalla committed Jan 25, 2022

Verified

This commit was signed with the committer’s verified signature.
commit d431a88a46d1edeb26a1019d7fb6c6435dddee23
56,308 changes: 35,505 additions & 20,803 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -62,7 +62,8 @@
"dependencies": {
"fs-extra": "^10.0.0",
"@holochain/conductor-api": "0.2.4",
"@perspect3vism/ad4m": "0.1.24",
"@peculiar/webcrypto": "^1.1.7",
"@perspect3vism/ad4m": "file:../ad4m",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
2 changes: 1 addition & 1 deletion scripts/get-builtin-test-langs.js
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ const languages = {
bundle: "https://github.com/perspect3vism/lang-note-ipfs/releases/download/0.0.1/bundle.js",
},
"direct-message-language": {
bundle: "https://github.com/perspect3vism/direct-message-language/releases/download/0.0.1/bundle.js"
bundle: "https://github.com/perspect3vism/direct-message-language/releases/download/0.0.3/bundle.js"
},
"perspective-language": {
bundle: "https://github.com/perspect3vism/perspective-language/releases/download/0.0.1/bundle.js"
20 changes: 20 additions & 0 deletions src/tests/perspective.ts
Original file line number Diff line number Diff line change
@@ -188,6 +188,26 @@ export default function perspectiveTests(testContext: TestContext) {
expect(1).toEqual(2)
}
})

it('can run Prolog queries', async () => {
const ad4mClient: Ad4mClient = testContext.ad4mClient!
const p = await ad4mClient.perspective.add("Prolog test")
await p.add(new Link({
source: "ad4m://root",
target: "note-ipfs://Qm123"
}))
await p.add(new Link({
source: "note-ipfs://Qm123",
target: "todo-ontology://is-todo"
}))

const result = await p.infer('triple(X, _, "todo-ontology://is-todo").')
expect(result).toBeTruthy()
expect(result.length).toBe(1)
expect(result[0].X).toBe('note-ipfs://Qm123')

expect(await p.infer('reachable("ad4m://root", "todo-ontology://is-todo")')).toBeTruthy()
})
})

describe('PerspectiveProxy', () => {
You are viewing a condensed version of this merge commit. You can view the full changes here.