-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
data/**.n3s | ||
yarn-error.log | ||
yarn.lock | ||
node_modules/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <n3-file> | ||
``` | ||
|
||
## Example | ||
|
||
``` | ||
$ cat demo.n3 | ||
@prefix : <urn:example.org:> . | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#> . | ||
:Alice a :Person . | ||
(_:X) log:onNegativeSurface { | ||
_:X a :Person . | ||
() log:onNegativeSurface { | ||
_:X a :Human . | ||
} . | ||
} . | ||
$ node js/index.js demo.n3 | ||
'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('<urn:example.org:Alice>','<urn:example.org:Person>'). | ||
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(['_:X'],('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'([],('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('_:X','<urn:example.org:Human>'))),'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('_:X','<urn:example.org:Person>'))). | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(['_:x'],('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'([],('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('<urn:example.org:c>','_:x'))),'<urn:example.org:b>'('<urn:example.org:a>','_:x'))). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@prefix : <urn:example.org:> . | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#> . | ||
|
||
:Alice a :Person . | ||
|
||
(_:X) log:onNegativeSurface { | ||
_:X a :Person . | ||
() log:onNegativeSurface { | ||
_:X a :Human . | ||
} . | ||
} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('<urn:example.org:Alice>','<urn:example.org:Person>'). | ||
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(['_:X'],('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'([],('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('_:X','<urn:example.org:Human>'))),'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('_:X','<urn:example.org:Person>'))). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
for f in data/*.n3; do | ||
node js/index.js $f | tee -a ${f}-result | ||
done |