Skip to content

Commit

Permalink
Expose two util functions to window in bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminaaron committed Apr 25, 2024
1 parent 985e614 commit e341069
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 7 additions & 2 deletions global.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ import {
validateUserProfile,
validateOne,
validateAll,
dev
} from "./src/index.js"

import {
rdfStringsToStore,
runSparqlSelectQueryOnStore
} from "./src/utils.js";

window.MatchingEngine = {
ValidationResult,
validateUserProfile,
validateOne,
validateAll,
dev
rdfStringsToStore,
runSparqlSelectQueryOnStore
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@foerderfunke/matching-engine",
"version": "0.3.1",
"version": "0.3.2",
"description": "Checks eligibilities by validating a user profile against requirement profiles",
"author": "@foerderfunke",
"license": "MIT",
Expand Down
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,3 @@ function collectViolations(report, skipMinCountAndNode) {
}
return violations
}

export function dev() {
return "foo"
}
8 changes: 8 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import Validator from "shacl-engine/Validator.js"
import rdf from "rdf-ext"
import { QueryEngine } from "@comunica/query-sparql-rdfjs"

export async function rdfStringsToStore(rdfStrings) {
let store = new Store()
for (let rdfString of rdfStrings) {
await addRdfStringToStore(rdfString, store)
}
return store
}

export function rdfStringToStore(rdfStr) {
let store = new Store()
return addRdfStringToStore(rdfStr, store)
Expand Down

0 comments on commit e341069

Please sign in to comment.