-
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.
restarted repo with clean code commit
- Loading branch information
0 parents
commit bc1285b
Showing
40 changed files
with
6,240 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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,147 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"array-bracket-spacing": [ | ||
2, | ||
"never" | ||
], | ||
"brace-style": [ | ||
2, | ||
"stroustrup" | ||
], | ||
"consistent-return": 0, | ||
"indent": [ | ||
2, | ||
"tab", | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"no-multiple-empty-lines": [ | ||
2, | ||
{ | ||
"max": 3 | ||
} | ||
], | ||
"no-use-before-define": 0, | ||
"one-var": [ | ||
2, | ||
"never" | ||
], | ||
"quote-props": [ | ||
1, | ||
"as-needed" | ||
], | ||
"quotes": [ | ||
2, | ||
"single" | ||
], | ||
"space-after-keywords": 0, | ||
"space-before-function-paren": [ | ||
2, | ||
{ | ||
"anonymous": "never", | ||
"named": "never" | ||
} | ||
], | ||
"space-in-parens": [ | ||
2, | ||
"never" | ||
], | ||
"strict": [ | ||
2, | ||
"global" | ||
], | ||
"curly": [ | ||
2, | ||
"multi-line" | ||
], | ||
"eol-last": 2, | ||
"key-spacing": [ | ||
2, | ||
{ | ||
"beforeColon": false, | ||
"afterColon": true | ||
} | ||
], | ||
"no-debugger": 1, | ||
"no-eval": 0, | ||
"no-with": 2, | ||
"space-infix-ops": 0, | ||
"dot-notation": [ | ||
2, | ||
{ | ||
"allowKeywords": true | ||
} | ||
], | ||
"eqeqeq": 2, | ||
"no-alert": 2, | ||
"no-caller": 2, | ||
"no-console": 1, | ||
"no-constant-condition": 1, | ||
"no-extend-native": 2, | ||
"no-extra-bind": 2, | ||
"no-implied-eval": 2, | ||
"no-iterator": 2, | ||
"no-label-var": 2, | ||
"no-labels": 2, | ||
"no-lone-blocks": 0, | ||
"no-loop-func": 0, | ||
"no-multi-spaces": 2, | ||
"no-multi-str": 2, | ||
"no-native-reassign": 2, | ||
"no-new": 0, | ||
"no-new-func": 2, | ||
"no-new-wrappers": 2, | ||
"no-octal-escape": 2, | ||
"no-proto": 2, | ||
"no-return-assign": 2, | ||
"no-script-url": 2, | ||
"no-sequences": 2, | ||
"no-unused-vars": 1, | ||
"no-unused-expressions": 2, | ||
"yoda": [ | ||
1, | ||
"always", | ||
{ | ||
"onlyEquality": true | ||
} | ||
], | ||
"no-shadow": 2, | ||
"no-shadow-restricted-names": 2, | ||
"no-undef-init": 2, | ||
"camelcase": 0, | ||
"comma-spacing": 2, | ||
"new-cap": 0, | ||
"new-parens": 2, | ||
"no-array-constructor": 2, | ||
"no-extra-parens": 0, | ||
"no-new-object": 2, | ||
"no-spaced-func": 2, | ||
"no-trailing-spaces": 1, | ||
"no-underscore-dangle": [ | ||
2, | ||
{ | ||
"allow": ["__proto__", "_private"] | ||
} | ||
], | ||
"comma-dangle": 0, | ||
"semi": 2, | ||
"semi-spacing": [ | ||
2, | ||
{ | ||
"before": false, | ||
"after": true | ||
} | ||
], | ||
}, | ||
"ecmaFeatures": { | ||
"modules": true | ||
} | ||
} |
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,67 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
|
||
|
||
# Directories | ||
|
||
# auxillary git repositories | ||
.git-* | ||
|
||
# user config for binaries | ||
config | ||
|
||
# data files | ||
data | ||
|
||
# compiled distribution | ||
dist | ||
|
||
# external binaries | ||
ext | ||
|
||
# runtime logs | ||
logs | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# publication | ||
publish | ||
|
||
# developer scrap files | ||
scrap | ||
|
||
# | ||
test | ||
|
||
# | ||
tools | ||
|
||
|
||
# user's gulp config file | ||
config.user.js | ||
|
||
# kill scripts | ||
kill-* | ||
|
||
# ignore files | ||
*.ignore |
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,14 @@ | ||
Copyright (c) 2016, Blake Regalia | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
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,45 @@ | ||
# VOLT | ||
|
||
|
||
This node.js module is an implementation of the **V**olt **O**ntoloy and **L**inked-data **T**echnology. | ||
|
||
## What this module is | ||
This module is for the low-level processing of SPARQL queries, compiling procedures to javascript, evaluating procedures in memory, etc. *and* compiling `.volt` source files to their serialized `.ttl` form. | ||
|
||
## The "Proxy" | ||
An HTTP proxy for VOLT is available as [volt-proxy.js](blake-regalia/volt-proxy.js), which simply wraps this module using the express library. | ||
|
||
## Demo | ||
If you simply want to connect VOLT to your local triple store and execute SPARQL queries over HTTP, go check out [volt-demo.js](blake-regalia/volt-demo.js) which launches a local webapp with a SPARQL interface for submitting queries directly to the VOLT proxy. | ||
|
||
## Install | ||
```sh | ||
$ npm install volt | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
const volt = require('volt'); | ||
|
||
// create volt instance | ||
let volt_query = volt({ | ||
plugins: | ||
}); | ||
|
||
// issue sparql query | ||
volt_query('ask {:A :b :C}', (h_sparql_results) => { | ||
// ... | ||
}); | ||
|
||
// use the library to compile .volt => .ttl | ||
let h_compiled_procedures = volt.compile({ | ||
code: fs.readFileSync('source.volt'), | ||
}); | ||
``` | ||
|
||
## Development | ||
|
||
```sh | ||
$ gulp develop | ||
``` |
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 @@ | ||
|
||
export default { | ||
src: 'lib', | ||
dest: 'dist', | ||
targets: { | ||
volt: 'js', | ||
compiler: 'language', | ||
'syntax-lex': 'syntax-highlighting', | ||
'syntax-volt': 'syntax-highlighting', | ||
}, | ||
}; |
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,6 @@ | ||
#!/bin/bash | ||
dir=$1; shift | ||
script=$1; shift | ||
nodemon --delay 2 -x 'gulp $dir && node-debug --cli --debug-brk --no-preload' \ | ||
--watch "lib/$dir" \ | ||
"dist/$dir/$script.js" $@ |
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,7 @@ | ||
#!/bin/bash | ||
dir=$1; shift | ||
script=$1; shift | ||
nodemon --delay 2 -x 'gulp $dir && node-debug --cli --debug-brk --no-preload --save-live-edit' \ | ||
--watch "lib/$dir" \ | ||
-e js,jison,jisonlex \ | ||
"dist/$dir/$script.js" $@ |
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,50 @@ | ||
|
||
import path from 'path'; | ||
import child_process from 'child_process'; | ||
import glob from 'glob'; | ||
|
||
// module | ||
export default (gulp, $, config={}) => { | ||
|
||
// | ||
const p_ace = (config.paths && config.paths.ace) || './node_modules/ace'; | ||
|
||
// task maker | ||
return function sublime(s_dir, s_task, p_src, p_dest) { | ||
|
||
// generate syntax highlighter | ||
gulp.task(s_task, [this.task('tm-language')], (cb) => { | ||
|
||
// | ||
return glob(p_dest+'/**/*.tmLanguage', (e_glob, a_files) => { | ||
if(e_glob) cb(e_glob); | ||
|
||
// | ||
a_files.map((p_file) => { | ||
|
||
// | ||
let s_mode = path.basename(p_file, '.tmLanguage'); | ||
|
||
// convert language file | ||
child_process.spawnSync('node', [`${p_ace}/tool/tmlanguage.js`, p_file]); | ||
|
||
// copy ace-mode files | ||
gulp.src(`${p_ace}/lib/ace/mode/${s_mode}*.js`) | ||
|
||
// replace | ||
.pipe($.replace(/require\("(\.\.\/)/g, 'ace.require("ace/')) | ||
.pipe($.replace(/require\("(\.\/)/g, 'ace.require("ace/mode/')) | ||
// .pipe($.replace(/define\(/, `ace.define("ace/mode/volt_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],`)) | ||
|
||
// concat | ||
.pipe($.concat('mode-'+s_mode+'.js')) | ||
|
||
.pipe($.debug()) | ||
|
||
// to output directory | ||
.pipe(gulp.dest(p_dest+'/ace')); | ||
}); | ||
}); | ||
}); | ||
}; | ||
}; |
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,10 @@ | ||
|
||
import del from 'del'; | ||
|
||
export default function clean(gulp) { | ||
return (s_dir, s_task, p_src, p_dest) => { | ||
gulp.task(s_task, () => { | ||
return del.sync([p_dest]); | ||
}); | ||
}; | ||
} |
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,16 @@ | ||
|
||
// module | ||
export default (gulp) => { | ||
|
||
// make develop task | ||
return function develop(s_dir, s_task, p_src) { | ||
|
||
// make build task name | ||
let s_build_task = this.task(this.args[0]); | ||
|
||
// register develop task | ||
gulp.task(s_task, [s_build_task], () => { | ||
gulp.watch(p_src+'/**/*', [s_build_task]); | ||
}); | ||
}; | ||
}; |
Oops, something went wrong.