Skip to content

Instantly share code, notes, and snippets.

View ericprud's full-sized avatar

Eric Prud'hommeaux ericprud

View GitHub Profile
@ericprud
ericprud / n3-js-forced-index-test.js
Created September 25, 2017 20:47
test of N3.js utility to find bug dependent on the order of hashes in the Store object.
var n3 = require('n3')
function describe (dlabel, d) {
d(it, xit)
function it (ilabel, i) {
try {
i()
++passing
} catch (e) {
@ericprud
ericprud / index.js.patch
Created October 30, 2017 12:35
add Event support to file-fetch
--- /home/eric/checkouts/linkeddata/rabel/node_modules/file-fetch/index-orig.js 2017-10-30 06:33:39.254504474 -0400
+++ /home/eric/checkouts/linkeddata/rabel/node_modules/file-fetch/index.js 2017-10-30 08:20:25.020709986 -0400
@@ -57,6 +57,30 @@
}
}
+const util = require('util')
+const EventEmitter = require('events')
+function send (options) {
+ if (!(this instanceof send))
{
"@context": {
"steps": "act:steps",
"score": "act:score",
"distance": "act:distance",
"date": "act:date",
"calories": "act:calories",
"act": "http://shapes.pub/shapes/activity.shex#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
{
"@context": {
"fitsense": "https://shapes.pub/shapes/activity.shex#",
"calories": "fitsense:calories",
"date": "fitsense:date",
"distance": "fitsense:distance",
"score": "fitsense:score",
"steps": "fitsense:steps"
}
}
@ericprud
ericprud / initClass.js
Last active June 9, 2020 12:15
function vs. class constructor for a library
module.exports = class {
constructor (foo) {
class A {
constructor (a) {
this.a = foo(a);
}
}
class B {
constructor (b) {
PREFIX : <http://example.org/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX og: <http://ogp.me/ns#>
BASE <http://schema.org/shex>
<#BasicUrlSh> ((IRI OR LITERAL) AND CLOSED {} AND /^(https?|gopher|ftps?):/)
<#SchemaText> LITERAL OR xsd:string
diff --git a/packages/eval-simple-1err/eval-simple-1err.js b/packages/eval-simple-1err/eval-simple-1err.js
index 2cd9144..6c44bf0 100644
--- a/packages/eval-simple-1err/eval-simple-1err.js
+++ b/packages/eval-simple-1err/eval-simple-1err.js
@@ -62,6 +62,13 @@ var EvalSimple1Err = (function () {
// maybeAddRept(s, [s]);
}
+ else if (expr.type === "NestedShape") {
+ s = State_make(expr, []);
@ericprud
ericprud / surprise-me.shex
Last active May 12, 2021 16:54
Schema.org to ShExR to ShExJ to ShExC
BASE <http://localhost/checkouts/shexSpec/shex.js/packages/shex-webapp/doc/shex-simple.html>
<S1> {
<http://schema.org/url> . +
%<https://example.org/extension/dummy>{console.log('some url checking code here')%}
} AND {
<http://schema.org/datePublished> . ?
} AND {
<http://schema.org/claimReviewed> .
} AND {
<http://schema.org/itemReviewed> {
@ericprud
ericprud / -ShEx Validation Manifest.md
Last active July 1, 2022 22:28
shex validation manifest
@ericprud
ericprud / -ShExMap Manifest.md
Last active July 1, 2022 21:36
ShExMap manifest