diff --git a/.gitignore b/.gitignore index f049506..939006d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -data/**.n3s yarn-error.log yarn.lock node_modules/** diff --git a/README.md b/README.md new file mode 100644 index 0000000..0c9e645 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# n32s + +The n32s code is a precompiler from Notation3 to a N3S format that is used by Prolog reasoners such as [eye](https://github.com/eyereasoner/eye), [retina](https://github.com/eyereasoner/retina) and [Latar](https://github.com/MellonScholarlyCommunication/Latar) + +## Installation + +``` +yarn install +``` + +## Usage + +``` +node js/index.js +``` + +## Example + +``` +$ cat demo.n3 +@prefix : . +@prefix log: . + +:Alice a :Person . + +(_:X) log:onNegativeSurface { + _:X a :Person . + () log:onNegativeSurface { + _:X a :Human . + } . +} . + +$ node js/index.js demo.n3 +''('',''). +''(['_:X'],(''([],(''('_:X',''))),''('_:X',''))). +``` \ No newline at end of file diff --git a/data/00-simple.n3-result b/data/00-simple.n3-result new file mode 100644 index 0000000..0d57c2d --- /dev/null +++ b/data/00-simple.n3-result @@ -0,0 +1 @@ +''(['_:x'],(''([],(''('','_:x'))),''('','_:x'))). diff --git a/data/01-alice.n3 b/data/01-alice.n3 new file mode 100644 index 0000000..f07be1c --- /dev/null +++ b/data/01-alice.n3 @@ -0,0 +1,11 @@ +@prefix : . +@prefix log: . + +:Alice a :Person . + +(_:X) log:onNegativeSurface { + _:X a :Person . + () log:onNegativeSurface { + _:X a :Human . + } . +} . \ No newline at end of file diff --git a/data/01-alice.n3-result b/data/01-alice.n3-result new file mode 100644 index 0000000..1d2210a --- /dev/null +++ b/data/01-alice.n3-result @@ -0,0 +1,2 @@ +''('',''). +''(['_:X'],(''([],(''('_:X',''))),''('_:X',''))). diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..3ac001d --- /dev/null +++ b/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for f in data/*.n3; do + node js/index.js $f | tee -a ${f}-result +done