Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import rdf from 'rdf-ext'
import { parse } from 'shaclc-parse'

async function parseJsonld (jsonld, context = {}) {
try {
Expand All @@ -23,7 +24,16 @@ async function parseTurtle (turtle, prefixes = '') {
}
}

async function parseShaclc (shaclc, prefixes = '') {
try {
return rdf.dataset(parse(`${prefixes}\n${shaclc}`))
} catch (err) {
return null
}
}

export {
parseJsonld,
parseTurtle
parseTurtle,
parseShaclc
}
130 changes: 129 additions & 1 deletion scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"commander": "^13.1.0",
"jsdom": "^26.1.0",
"mkdirp": "^3.0.1",
"rdf-ext": "^2.5.2"
"rdf-ext": "^2.5.2",
"shaclc-parse": "^1.4.3",
"shaclc-write": "^1.5.0"
},
"devDependencies": {
"stricter-standard": "^0.3.1"
Expand Down
Loading