Skip to content

Instantly share code, notes, and snippets.

View ericprud's full-sized avatar

Eric Prud'hommeaux ericprud

View GitHub Profile
@ericprud
ericprud / ldtvm.yaml
Last active September 29, 2022 12:25
# https://shex.io/webapps/packages/extension-map/doc/shexmap-simple?manifestURL=https://gist.githubusercontent.com/ericprud/280675952ab8e7708a35aa33cfcac5f8/raw/907687f15dfa0035672c093255400ab573fb8b83/ldtvm.yaml
---
- schemaLabel: Reducing FOAF to RDFS
schema: |
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX Map: <http://shex.io/extensions/Map/#>
PREFIX x: <http://idunno.example/bindings#>
</DocumentShape> {
{
"resourceType": "Observation",
"id": "blood-pressure",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "85354-9",
"display": "Blood pressure panel with all children optional"
@ericprud
ericprud / -ShExMap Manifest.md
Last active July 1, 2022 21:36
ShExMap manifest
@ericprud
ericprud / -ShEx Validation Manifest.md
Last active July 1, 2022 22:28
shex validation manifest
@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> {
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, []);
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
@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) {