https://github.com/smessie/eye-mock
EYE mock solving your n3 reasoning on a server instead of client side Prolog execution
https://github.com/smessie/eye-mock
eye mock n3 notation3 reasoning
Last synced: about 1 year ago
JSON representation
EYE mock solving your n3 reasoning on a server instead of client side Prolog execution
- Host: GitHub
- URL: https://github.com/smessie/eye-mock
- Owner: smessie
- License: mit
- Created: 2022-11-21T13:16:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T09:08:12.000Z (almost 2 years ago)
- Last Synced: 2025-03-20T00:41:00.046Z (about 1 year ago)
- Topics: eye, mock, n3, notation3, reasoning
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eye-mock
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eye-mock
EYE mock solving your n3 reasoning on a server instead of client side Prolog execution
## Usage
Install the package via NPM
```
npm install eye-mock
```
Import and use the function in your code
```javascript
import { n3reasoner } from 'eye-mock';
const data = `
@prefix : .
:Alice a :Person .
{ ?S a :Person } => { ?S a :Human } .
`;
const query = `{?S ?P ?O . } => {?S ?P ?O . } .`;
const options = { output: "derivations", outputType: "string", bnodeRelabeling: true };
const result = await n3reasoner(data, query, options);
```
### Options
The `options` parameter is optional and can be used to configure the reasoning process. The following options are available:
- `output`: What to output with implicit queries.
- `none`: no implicit query is passed
- `derivations`: output only new derived triples, a.k.a `--pass-only-new` (default)
- `deductive_closure`: output deductive closure, a.k.a `--pass`
- `deductive_closure_plus_rules`: output deductive closure plus rules, a.k.a `--pass-all`
- `grounded_deductive_closure_plus_rules`: ground the rules and output deductive closure plus rules, a.k.a `--pass-all-ground`
- `outputType`: The type of output
- `string`: output as string (default)
- `quads`: output as array of RDF/JS Quads
- `bnodeRelabeling`: Whether or not to perform bnodeRelabeling
- `true`: perform bnodeRelabeling (default)
- `false`: do not perform bnodeRelabeling