diff --git a/package-lock.json b/package-lock.json index 52de27d..944901c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { "name": "@comake/skl-js-engine", - "version": "0.26.0", + "version": "0.32.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@comake/skl-js-engine", - "version": "0.26.0", + "version": "0.32.0", + "hasInstallScript": true, "license": "BSD-4-Clause", "dependencies": { "@comake/openapi-operation-executor": "^0.13.0", @@ -19,6 +20,7 @@ "memory-level": "^1.0.0", "mime-types": "^2.1.35", "n3": "^1.17.2", + "patch-package": "^8.0.0", "quadstore": "13.1.1", "quadstore-comunica": "^4.3.0", "rdf-data-factory": "^1.1.2", @@ -4309,6 +4311,12 @@ "node": ">=10.0.0" } }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "license": "BSD-2-Clause" + }, "node_modules/@zazuko/node-fetch": { "version": "2.6.6", "resolved": "https://registry.npmjs.org/@zazuko/node-fetch/-/node-fetch-2.6.6.tgz", @@ -4653,6 +4661,15 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", @@ -4752,13 +4769,11 @@ "peerDependencies": { "@babel/core": "^7.0.0" } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-js": { "version": "1.5.1", @@ -4791,7 +4806,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4801,7 +4815,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -4916,13 +4929,47 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5001,7 +5048,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5023,10 +5069,19 @@ } }, "node_modules/ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } }, "node_modules/cjs-module-lexer": { "version": "1.2.2", @@ -5208,8 +5263,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -5410,7 +5464,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5554,6 +5607,23 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", @@ -5704,6 +5774,20 @@ "node": ">=8" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.219", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.219.tgz", @@ -5811,6 +5895,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.1.tgz", + "integrity": "sha512-BPOBuyUF9QIVhuNLhbToCLHP6+0MHwZ7xLBkPPCZqK4JmpJgGnv10035STzzQwFpqdzNFMB3irvDI63IagvDwA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -7231,7 +7345,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7255,6 +7368,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -7354,8 +7476,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.2", @@ -7371,10 +7492,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -7426,14 +7550,24 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7448,6 +7582,19 @@ "node": ">=8.0.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -7508,7 +7655,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7583,11 +7729,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/grapheme-splitter": { "version": "1.0.4", @@ -7653,28 +7810,27 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7706,6 +7862,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -7925,7 +8093,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -8066,6 +8233,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -8120,7 +8302,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -8257,6 +8438,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -8265,8 +8458,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -9367,12 +9559,37 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "node_modules/json-stable-stringify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", + "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/json-stable-stringify/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -9389,7 +9606,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, "dependencies": { "universalify": "^2.0.0" }, @@ -9397,6 +9613,15 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonld": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.1.1.tgz", @@ -9564,6 +9789,15 @@ "node": ">=0.10.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -9805,6 +10039,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/memory-level": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", @@ -9919,7 +10162,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -9974,7 +10216,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10180,7 +10421,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -10295,6 +10535,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -10312,6 +10568,15 @@ "node": ">= 0.8.0" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -10381,6 +10646,97 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/patch-package/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/patch-package/node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -10394,7 +10750,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -10403,7 +10758,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -10433,7 +10787,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -11460,6 +11813,23 @@ "readable-stream": "^3.6.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -11488,7 +11858,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -11500,7 +11869,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -11977,7 +12345,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -12069,6 +12436,18 @@ "readable-stream": "2 || 3" } }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -12088,7 +12467,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -12421,7 +12799,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, "engines": { "node": ">= 10.0.0" } @@ -12633,7 +13010,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -16628,6 +17004,11 @@ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.2.tgz", "integrity": "sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ==" }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==" + }, "@zazuko/node-fetch": { "version": "2.6.6", "resolved": "https://registry.npmjs.org/@zazuko/node-fetch/-/node-fetch-2.6.6.tgz", @@ -16891,6 +17272,11 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" + }, "axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", @@ -16973,8 +17359,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-js": { "version": "1.5.1", @@ -16990,7 +17375,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -17000,7 +17384,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -17070,13 +17453,32 @@ } }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" } }, "call-me-maybe": { @@ -17127,7 +17529,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -17140,10 +17541,9 @@ "dev": true }, "ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==" }, "cjs-module-lexer": { "version": "1.2.2", @@ -17306,8 +17706,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "concat-stream": { "version": "1.6.2", @@ -17476,7 +17875,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -17589,6 +17987,16 @@ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", @@ -17691,6 +18099,16 @@ "is-obj": "^2.0.0" } }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "electron-to-chromium": { "version": "1.4.219", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.219.tgz", @@ -17777,6 +18195,24 @@ "unbox-primitive": "^1.0.2" } }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es-object-atoms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.1.tgz", + "integrity": "sha512-BPOBuyUF9QIVhuNLhbToCLHP6+0MHwZ7xLBkPPCZqK4JmpJgGnv10035STzzQwFpqdzNFMB3irvDI63IagvDwA==", + "requires": { + "es-errors": "^1.3.0" + } + }, "es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -18832,7 +19268,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -18847,6 +19282,14 @@ "path-exists": "^4.0.0" } }, + "find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "requires": { + "micromatch": "^4.0.2" + } + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -18920,8 +19363,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { "version": "2.3.2", @@ -18930,10 +19372,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "function.prototype.name": { "version": "1.1.5", @@ -18970,14 +19411,20 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" } }, "get-package-type": { @@ -18986,6 +19433,15 @@ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -19030,7 +19486,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -19081,11 +19536,15 @@ "slash": "^3.0.0" } }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "grapheme-splitter": { "version": "1.0.4", @@ -19135,23 +19594,20 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "requires": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" } }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "has-tostringtag": { "version": "1.0.0", @@ -19171,6 +19627,14 @@ "minimalistic-assert": "^1.0.1" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, "hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -19313,7 +19777,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -19404,6 +19867,11 @@ "has-tostringtag": "^1.0.0" } }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -19439,8 +19907,7 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-number-object": { "version": "1.0.7", @@ -19529,6 +19996,14 @@ "call-bind": "^1.0.2" } }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "requires": { + "is-docker": "^2.0.0" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -19537,8 +20012,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -20386,6 +20860,25 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "json-stable-stringify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", + "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + } + } + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -20402,12 +20895,16 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" } }, + "jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==" + }, "jsonld": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.1.1.tgz", @@ -20545,6 +21042,14 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "requires": { + "graceful-fs": "^4.1.11" + } + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -20719,6 +21224,11 @@ "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" + }, "memory-level": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", @@ -20809,7 +21319,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -20849,7 +21358,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -21006,8 +21514,7 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, "object.assign": { "version": "4.1.3", @@ -21089,6 +21596,15 @@ "mimic-fn": "^2.1.0" } }, + "open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -21103,6 +21619,11 @@ "word-wrap": "^1.2.3" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -21148,6 +21669,64 @@ "lines-and-columns": "^1.1.6" } }, + "patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "dependencies": { + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" + }, + "yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==" + } + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -21157,14 +21736,12 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", @@ -21187,8 +21764,7 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pirates": { "version": "4.0.5", @@ -21983,6 +22559,19 @@ "readable-stream": "^3.6.0" } }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -22011,7 +22600,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -22019,8 +22607,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "side-channel": { "version": "1.0.4", @@ -22420,7 +23007,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -22494,6 +23080,14 @@ "readable-stream": "2 || 3" } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -22510,7 +23104,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -22738,8 +23331,7 @@ "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "update-browserslist-db": { "version": "1.0.5", @@ -22902,7 +23494,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index 3931936..28e48a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comake/skl-js-engine", - "version": "0.26.0", + "version": "0.32.0", "description": "Standard Knowledge Language Javascript Engine", "keywords": [ "skl", @@ -29,7 +29,8 @@ "test:integration": "jest --coverageReporters text-summary -- test/integration", "test:unit": "jest --config=./jest.coverage.config.js test/unit", "test:package": "chmod +x test/deploy/validate-package.sh && test/deploy/validate-package.sh", - "prepare": "husky && npm run build" + "prepare": "husky && npm run build", + "postinstall": "patch-package" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -52,6 +53,7 @@ "memory-level": "^1.0.0", "mime-types": "^2.1.35", "n3": "^1.17.2", + "patch-package": "^8.0.0", "quadstore": "13.1.1", "quadstore-comunica": "^4.3.0", "rdf-data-factory": "^1.1.2", diff --git a/patches/sparqljs+3.7.1.patch b/patches/sparqljs+3.7.1.patch new file mode 100644 index 0000000..cce6260 --- /dev/null +++ b/patches/sparqljs+3.7.1.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/sparqljs/lib/SparqlGenerator.js b/node_modules/sparqljs/lib/SparqlGenerator.js +index 527f0e9..43121b9 100644 +--- a/node_modules/sparqljs/lib/SparqlGenerator.js ++++ b/node_modules/sparqljs/lib/SparqlGenerator.js +@@ -220,7 +220,7 @@ Generator.prototype.toExpression = function (expr) { + '(' + (expr.distinct ? 'DISTINCT ' : '') + this.toExpression(expr.expression) + + (typeof expr.separator === 'string' ? '; SEPARATOR = ' + '"' + expr.separator.replace(escape, escapeReplacer) + '"' : '') + ')'; + case 'functioncall': +- return this.toEntity(expr.function) + '(' + mapJoin(expr.args, ', ', this.toExpression, this) + ')'; ++ return expr.function + '(' + mapJoin(expr.args, ', ', this.toExpression, this) + ')'; + case 'operation': + var operator = expr.operator.toUpperCase(), args = expr.args || []; + switch (expr.operator.toLowerCase()) { diff --git a/src/index.ts b/src/index.ts index ba52e45..5e89593 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ export * from './storage/operator/LessThan'; export * from './storage/operator/LessThanOrEqual'; export * from './storage/operator/Not'; export * from './storage/operator/OneOrMorePath'; +export * from './storage/operator/Sequence'; export * from './storage/operator/SequencePath'; export * from './storage/operator/ZeroOrMorePath'; diff --git a/src/storage/FindOperator.ts b/src/storage/FindOperator.ts index 641ca54..2b091b0 100644 --- a/src/storage/FindOperator.ts +++ b/src/storage/FindOperator.ts @@ -1,3 +1,5 @@ +import { Variable } from "rdf-data-factory"; + export type FindOperatorType = | 'in' | 'not' @@ -14,21 +16,27 @@ export type FindOperatorType = | 'zeroOrMorePath' | 'inversePath' | 'oneOrMorePath' -| 'contains'; +| 'contains' +| 'sequence'; export interface FindOperatorArgs { operator: TType; value?: T | FindOperator; + subject?: Variable; + isOptional?: boolean; } export class FindOperator { public readonly type = 'operator'; public readonly operator: TType; + public readonly subject?: Variable; public readonly value?: T | FindOperator; - + public readonly isOptional?: boolean; public constructor(args: FindOperatorArgs) { this.operator = args.operator; this.value = args.value; + this.subject = args.subject; + this.isOptional = args.isOptional; } public static isFindOperator(value: any): boolean { diff --git a/src/storage/FindOptionsTypes.ts b/src/storage/FindOptionsTypes.ts index 00da288..06f40de 100644 --- a/src/storage/FindOptionsTypes.ts +++ b/src/storage/FindOptionsTypes.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import type { Variable } from 'sparqljs'; +import type { Expression, Variable } from 'sparqljs'; import type { OrArray, JSONArray, JSONObject } from '../util/Types'; import type { FindOperator } from './FindOperator'; import type { InverseRelationOperatorValue } from './operator/InverseRelation'; @@ -59,7 +59,8 @@ export type FindOptionsWhereField = | OrArray | ValueWhereFieldObject | FindOptionsWhere -| OrArray>; +| OrArray> +| BindPattern[]; export type IdFindOptionsWhereField = | string @@ -69,10 +70,16 @@ export type TypeFindOptionsWhereField = | string | FindOperator; +export interface BindPattern { + expression: Expression; + variable: Variable; +} + export interface FindOptionsWhere { type?: TypeFindOptionsWhereField; id?: IdFindOptionsWhereField; - [k: string]: FindOptionsWhereField | undefined; + binds?: BindPattern[]; + [k: string]: FindOptionsWhereField | BindPattern[] | undefined; } // Add these new types diff --git a/src/storage/operator/InverseRelation.ts b/src/storage/operator/InverseRelation.ts index 5276baa..f45f5f8 100644 --- a/src/storage/operator/InverseRelation.ts +++ b/src/storage/operator/InverseRelation.ts @@ -4,6 +4,7 @@ import type { FindOptionsRelations } from '../FindOptionsTypes'; export interface InverseRelationOperatorValue { resolvedName: string; relations?: FindOptionsRelations; + [key: string]: any; } // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/src/storage/operator/Sequence.ts b/src/storage/operator/Sequence.ts new file mode 100644 index 0000000..716e686 --- /dev/null +++ b/src/storage/operator/Sequence.ts @@ -0,0 +1,11 @@ +import { FindOperator } from '../FindOperator'; + +// eslint-disable-next-line @typescript-eslint/naming-convention +export function Sequence( + value: T | FindOperator, +): FindOperator { + return new FindOperator({ + operator: 'sequence', + value, + }); +} diff --git a/src/storage/query-adapter/sparql/SparqlQueryAdapter.ts b/src/storage/query-adapter/sparql/SparqlQueryAdapter.ts index 115436d..8e8ba47 100644 --- a/src/storage/query-adapter/sparql/SparqlQueryAdapter.ts +++ b/src/storage/query-adapter/sparql/SparqlQueryAdapter.ts @@ -114,10 +114,12 @@ export class SparqlQueryAdapter implements QueryAdapter { if (entityOrder && entityOrder.length === 0) { return []; } + const queryData = queryBuilder.buildEntitySelectPatternsFromOptions(entityVariable, options); const query = queryBuilder.buildConstructFromEntitySelectQuery( where, selectionTriples, options?.select, + queryData.selectVariables, ); return await this.executeEntitySelectQuery(query, options, entityOrder); } @@ -129,10 +131,15 @@ export class SparqlQueryAdapter implements QueryAdapter { const queryData = queryBuilder.buildEntitySelectPatternsFromOptions(entityVariable, options); const entitySelectQuery = queryData.where.length > 0 ? createSparqlSelectQuery( - options?.entitySelectVariable ?? entityVariable, + [ + options?.entitySelectVariable ?? entityVariable, + ...(queryData.selectVariables?.map(({ variable, expression }) => ({ + variable, + expression, + })) ?? []), + ], queryData.where, queryData.orders, - // FIXME: This will not work if queryData.group is defined, figure out what can make it defined. queryData.group ?? options?.group, options?.limit, options?.offset, diff --git a/src/storage/query-adapter/sparql/SparqlQueryBuilder.ts b/src/storage/query-adapter/sparql/SparqlQueryBuilder.ts index 1a86cdc..71aebe9 100644 --- a/src/storage/query-adapter/sparql/SparqlQueryBuilder.ts +++ b/src/storage/query-adapter/sparql/SparqlQueryBuilder.ts @@ -65,6 +65,7 @@ import type { SubQuery, TypeFindOptionsWhereField, ValueWhereFieldObject, + BindPattern, } from '../../FindOptionsTypes'; import type { InverseRelationOperatorValue } from '../../operator/InverseRelation'; import type { InverseRelationOrderValue } from '../../operator/InverseRelationOrder'; @@ -75,6 +76,8 @@ export interface NonGraphWhereQueryData { values: ValuesPattern[]; triples: Triple[]; filters: OperationExpression[]; + patterns?: Pattern[]; + binds?: Pattern[]; } export interface WhereQueryData extends NonGraphWhereQueryData { @@ -94,6 +97,7 @@ export interface OrderQueryData { filters: OperationExpression[]; orders: Ordering[]; groupByParent?: boolean; + patterns?: Pattern[]; } export interface EntitySelectQueryData { @@ -102,6 +106,7 @@ export interface EntitySelectQueryData { graphWhere: Pattern[]; graphSelectionTriples: Triple[]; group?: Variable; + selectVariables: { variable: Variable; expression: Expression }[]; } export interface SparqlQueryBuilderOptions { @@ -130,23 +135,22 @@ export class SparqlQueryBuilder { // Handle subqueries if (options?.subQueries && options.subQueries.length > 0) { const subQueryPatterns = this.createSubQueryPatterns(options.subQueries); - whereQueryData.values.unshift(...subQueryPatterns as ValuesPattern[]); + whereQueryData.values.unshift(...(subQueryPatterns as ValuesPattern[])); } const patterns: Pattern[] = whereQueryData.values; - if (whereQueryData.triples.length === 0 && ( - whereQueryData.filters.length > 0 || - orderQueryData.triples.length > 0 || - ( - whereQueryData.values.length === 0 && - whereQueryData.graphValues.length === 0 && - whereQueryData.graphTriples.length === 0 - ) - )) { + if ( + whereQueryData.triples.length === 0 && + (whereQueryData.filters.length > 0 || + orderQueryData.triples.length > 0 || + (whereQueryData.values.length === 0 && + whereQueryData.graphValues.length === 0 && + whereQueryData.graphTriples.length === 0)) + ) { const entityGraphFilterPattern = this.createEntityGraphFilterPattern(subject); patterns.push(entityGraphFilterPattern); } else if (!options?.where?.id) { const entityGraphFilterPattern = this.createEntityGraphFilterPattern(subject); - const entityIsGraphFilter = createSparqlExistsOperation([ entityGraphFilterPattern ]); + const entityIsGraphFilter = createSparqlExistsOperation([entityGraphFilterPattern]); whereQueryData.filters.push(entityIsGraphFilter); } @@ -156,6 +160,9 @@ export class SparqlQueryBuilder { whereQueryData.filters, orderQueryData.triples, orderQueryData.filters, + whereQueryData.patterns ?? [], + undefined, + whereQueryData.binds, ); const graphWherePatterns = this.createWherePatternsFromQueryData( whereQueryData.graphValues, @@ -165,13 +172,38 @@ export class SparqlQueryBuilder { undefined, relationsQueryData.patterns, ); - return { + + // Create variables for each order expression and update the orders to use them + const selectVariables = orderQueryData.orders.map(order => { + const variable = this.createVariable(); + return { + variable, + expression: order.expression, + }; + }); + + const orders = selectVariables.map((selectVar, index) => ({ + expression: selectVar.variable, + descending: orderQueryData.orders[index].descending, + })); + + if (orders.length) { + orders.push({ + expression: entityVariable, + } as any); + } + + const returnData: any = { where: wherePatterns, - orders: orderQueryData.orders, + orders: orders, group: orderQueryData.groupByParent ? subject : undefined, graphWhere: graphWherePatterns, graphSelectionTriples: relationsQueryData.selectionTriples, }; + if (selectVariables.length > 0) { + returnData.selectVariables = selectVariables; + } + return returnData; } private createSubQueryPatterns(subQueries: SubQuery[]): Pattern[] { @@ -193,56 +225,58 @@ export class SparqlQueryBuilder { subQueryWhere.values, subQueryWhere.triples, subQueryWhere.filters, + undefined, + undefined, + subQueryWhere.patterns ?? [], ), group: queryGroup.length > 0 ? queryGroup : undefined, having: subQuery.having ? this.createWhereQueryData(entityVariable, subQuery.having).filters : undefined, prefixes: {}, }; - return createSparqlSelectGroup([ selectQuery ]); + return createSparqlSelectGroup([selectQuery]); }); } private createEntityGraphFilterPattern(subject: Variable): GraphPattern { const entityFilterTriple = { subject, predicate: this.createVariable(), object: this.createVariable() }; - return createSparqlGraphPattern( - subject, - [ createSparqlBasicGraphPattern([ entityFilterTriple ]) ], - ); + return createSparqlGraphPattern(subject, [createSparqlBasicGraphPattern([entityFilterTriple])]); } public buildConstructFromEntitySelectQuery( graphWhere: Pattern[], graphSelectionTriples: Triple[], select?: FindOptionsSelect, + selectVariables?: { variable: Variable; expression: Expression }[], ): ConstructQuery { let triples: Triple[]; let where: Pattern[] = []; if (select) { triples = this.createSelectPattern(select, entityVariable); - where = [ - createSparqlOptional([ - createSparqlBasicGraphPattern(triples), - ]), - ...graphWhere, - ]; + where = [createSparqlOptional([createSparqlBasicGraphPattern(triples)]), ...graphWhere]; } else { - triples = [ entityGraphTriple, ...graphSelectionTriples ]; + triples = [entityGraphTriple, ...graphSelectionTriples]; where = [ ...graphWhere, - createSparqlGraphPattern( - entityVariable, - [ createSparqlBasicGraphPattern([ entityGraphTriple ]) ], - ), + createSparqlGraphPattern(entityVariable, [createSparqlBasicGraphPattern([entityGraphTriple])]), ]; } + + // // Add select variables to the query + // if (selectVariables?.length) { + // where = [ + // ...where, + // ...selectVariables.map(({ variable, expression }) => ({ + // type: 'bind' as const, + // expression, + // variable, + // })), + // ]; + // } + return createSparqlConstructQuery(triples, where); } - private createWhereQueryData( - subject: Variable, - where?: FindOptionsWhere, - isTopLevel = false, - ): WhereQueryData { + private createWhereQueryData(subject: Variable, where?: FindOptionsWhere, isTopLevel = false): WhereQueryData { if (isTopLevel && Object.keys(where ?? {}).length === 1 && 'id' in where!) { const { values, filters, triples } = this.createWhereQueryDataForIdValue(subject, where.id!); return { @@ -252,22 +286,44 @@ export class SparqlQueryBuilder { graphValues: values, graphFilters: filters, graphTriples: triples, + binds: [], }; } - const whereQueryData = Object.entries(where ?? {}) - .reduce((obj: NonGraphWhereQueryData, [ key, value ]): NonGraphWhereQueryData => { + + // Handle binds if specified in where options + const binds: Pattern[] = []; + if (where?.binds) { + binds.push(...where.binds.map(bind => ({ + type: 'bind' as const, + expression: bind.expression, + variable: bind.variable + }))); + // Delete binds from where as it's a special key + const { binds: _, ...restWhere } = where; + where = restWhere; + } + + const whereQueryData = Object.entries(where ?? {}).reduce( + (obj: NonGraphWhereQueryData, [key, value]): NonGraphWhereQueryData => { const whereQueryDataForField = this.createWhereQueryDataForField(subject, key, value!); return { - values: [ ...obj.values, ...whereQueryDataForField.values ], - triples: [ ...obj.triples, ...whereQueryDataForField.triples ], - filters: [ ...obj.filters, ...whereQueryDataForField.filters ], + values: [...obj.values, ...whereQueryDataForField.values], + triples: [...obj.triples, ...whereQueryDataForField.triples], + filters: [...obj.filters, ...whereQueryDataForField.filters], + patterns: [...(obj.patterns ?? []), ...(whereQueryDataForField.patterns ?? [])], + binds: [...(obj.binds ?? []), ...(whereQueryDataForField.binds ?? [])], }; - }, { values: [], triples: [], filters: []}); + }, + { values: [], triples: [], filters: [], patterns: [], binds } + ); + return { ...whereQueryData, graphValues: [], graphFilters: [], graphTriples: [], + patterns: whereQueryData.patterns ?? [], + binds: whereQueryData.binds ?? [], }; } @@ -277,10 +333,7 @@ export class SparqlQueryBuilder { value: IdFindOptionsWhereField | TypeFindOptionsWhereField | FindOptionsWhereField, ): NonGraphWhereQueryData { if (field === 'id') { - return this.createWhereQueryDataForIdValue( - subject, - value as FindOperator, - ); + return this.createWhereQueryDataForIdValue(subject, value as FindOperator); } if (field === 'type') { return this.createWhereQueryDataForType(subject, value as FindOperator); @@ -289,23 +342,26 @@ export class SparqlQueryBuilder { return this.createWhereQueryDataFromKeyValue(subject, predicate, value); } - private createWhereQueryDataForIdValue( - term: Variable, - value: IdFindOptionsWhereField, - ): NonGraphWhereQueryData { + private createWhereQueryDataForIdValue(term: Variable, value: IdFindOptionsWhereField): NonGraphWhereQueryData { let filters: OperationExpression[] = []; let values: ValuesPattern[] = []; let triples: Triple[] = []; if (FindOperator.isFindOperator(value)) { - ({ filters, values, triples } = - this.resolveFindOperatorAsExpressionForId(term, value as FindOperator)); + ({ filters, values, triples } = this.resolveFindOperatorAsExpressionForId( + term, + value as FindOperator, + )); } else { - values = [{ - type: 'values', - values: [{ - [`?${term.value}`]: DataFactory.namedNode(value as string), - }], - }]; + values = [ + { + type: 'values', + values: [ + { + [`?${term.value}`]: DataFactory.namedNode(value as string), + }, + ], + }, + ]; } return { values, @@ -314,13 +370,10 @@ export class SparqlQueryBuilder { }; } - private createWhereQueryDataForType( - subject: Variable, - value: TypeFindOptionsWhereField, - ): NonGraphWhereQueryData { + private createWhereQueryDataForType(subject: Variable, value: TypeFindOptionsWhereField): NonGraphWhereQueryData { if (FindOperator.isFindOperator(value)) { if ((value as FindOperator).operator === 'inverse') { - const inversePredicate = createSparqlInversePredicate([ allTypesAndSuperTypesPath ]); + const inversePredicate = createSparqlInversePredicate([allTypesAndSuperTypesPath]); const inverseWhereQueryData = this.createWhereQueryDataFromKeyValue( subject, inversePredicate, @@ -332,6 +385,14 @@ export class SparqlQueryBuilder { triples: inverseWhereQueryData.triples, }; } + if ((value as FindOperator).operator === 'sequence') { + const sequencePredicate = createSparqlSequencePredicate([allTypesAndSuperTypesPath]); + return this.createWhereQueryDataFromKeyValue( + subject, + sequencePredicate, + (value as FindOperator).value, + ); + } const variable = this.createVariable(); const triple = { subject, predicate: allTypesAndSuperTypesPath, object: variable }; @@ -341,19 +402,21 @@ export class SparqlQueryBuilder { triple, ); return { - values: valuePattern ? [ valuePattern ] : [], - filters: filter ? [ filter ] : [], - triples: tripleInFilter ? [] : [ triple ], + values: valuePattern ? [valuePattern] : [], + filters: filter ? [filter] : [], + triples: tripleInFilter ? [] : [triple], }; } return { values: [], filters: [], - triples: [{ - subject, - predicate: allTypesAndSuperTypesPath, - object: DataFactory.namedNode(value as string), - }], + triples: [ + { + subject, + predicate: allTypesAndSuperTypesPath, + object: DataFactory.namedNode(value as string), + }, + ], }; } @@ -369,19 +432,26 @@ export class SparqlQueryBuilder { return this.createWhereQueryDataForFindOperator(subject, predicate, value as FindOperator); } if (Array.isArray(value)) { - return (value as FieldPrimitiveValue[]) - .reduce((obj: NonGraphWhereQueryData, valueItem): NonGraphWhereQueryData => { + return (value as FieldPrimitiveValue[]).reduce( + (obj: NonGraphWhereQueryData, valueItem): NonGraphWhereQueryData => { const valueWhereQueryData = this.createWhereQueryDataFromKeyValue(subject, predicate, valueItem); return { - values: [ ...obj.values, ...valueWhereQueryData.values ], - filters: [ ...obj.filters, ...valueWhereQueryData.filters ], - triples: [ ...obj.triples, ...valueWhereQueryData.triples ], + values: [...obj.values, ...valueWhereQueryData.values], + filters: [...obj.filters, ...valueWhereQueryData.filters], + triples: [...obj.triples, ...valueWhereQueryData.triples], + patterns: [...(obj.patterns ?? []), ...(valueWhereQueryData.patterns ?? [])], }; - }, { values: [], filters: [], triples: []}); + }, + { values: [], filters: [], triples: [], patterns: [] }, + ); } if (typeof value === 'object') { if ('@value' in value) { - return this.createWhereQueryDataForValueObject(subject, predicate, value as ValueWhereFieldObject); + return this.createWhereQueryDataForValueObject( + 'subject' in value ? (value.subject as unknown as Variable) : subject, + predicate, + value as ValueWhereFieldObject, + ); } return this.createWhereQueryDataForNestedWhere(subject, predicate, value as FindOptionsWhere); } @@ -399,15 +469,20 @@ export class SparqlQueryBuilder { operator: FindOperator, ): NonGraphWhereQueryData { if (operator.operator === 'inverse') { - const inversePredicate = createSparqlInversePredicate([ predicate ]); - return this.createWhereQueryDataFromKeyValue(subject, inversePredicate, operator.value); + const inversePredicate = createSparqlInversePredicate([predicate]); + return this.createWhereQueryDataFromKeyValue(operator.subject ? operator.subject: subject, inversePredicate, operator.value); + } + if (operator.operator === 'sequence') { + const sequencePredicate = createSparqlSequencePredicate([predicate]); + return this.createWhereQueryDataFromKeyValue( + operator.subject ? operator.subject : subject, + sequencePredicate, + operator.value, + ); } if (FindOperator.isPathOperator(operator)) { const pathPredicate = this.pathOperatorToPropertyPath(operator); - const combinedPredicate = createSparqlSequencePredicate([ - predicate, - pathPredicate, - ]); + const combinedPredicate = createSparqlSequencePredicate([predicate, pathPredicate]); return this.createWhereQueryDataFromKeyValue(subject, combinedPredicate, operator.value.value); } const variable = this.createVariable(); @@ -418,9 +493,9 @@ export class SparqlQueryBuilder { triple, ); return { - values: valuePattern ? [ valuePattern ] : [], - filters: filter ? [ filter ] : [], - triples: tripleInFilter ? [] : [ triple ], + values: valuePattern ? [valuePattern] : [], + filters: filter ? [filter] : [], + triples: tripleInFilter ? [] : [triple], }; } @@ -435,17 +510,16 @@ export class SparqlQueryBuilder { } else { subPredicate = this.pathOperatorToPropertyPath(subPath); } - return createSparqlInversePredicate([ subPredicate ]); + return createSparqlInversePredicate([subPredicate]); } if (operator.operator === 'sequencePath') { const { subPath } = operator.value; - const subPredicates = subPath - .map((sequencePart: string | FindOperator): IriTerm | PropertyPath => { - if (typeof sequencePart === 'string') { - return DataFactory.namedNode(sequencePart); - } - return this.pathOperatorToPropertyPath(sequencePart); - }); + const subPredicates = subPath.map((sequencePart: string | FindOperator): IriTerm | PropertyPath => { + if (typeof sequencePart === 'string') { + return DataFactory.namedNode(sequencePart); + } + return this.pathOperatorToPropertyPath(sequencePart); + }); return createSparqlSequencePredicate(subPredicates); } if (operator.operator === 'zeroOrMorePath') { @@ -456,7 +530,7 @@ export class SparqlQueryBuilder { } else { subPredicate = this.pathOperatorToPropertyPath(subPath); } - return createSparqlZeroOrMorePredicate([ subPredicate ]); + return createSparqlZeroOrMorePredicate([subPredicate]); } if (operator.operator === 'oneOrMorePath') { const { subPath } = operator.value; @@ -466,7 +540,7 @@ export class SparqlQueryBuilder { } else { subPredicate = this.pathOperatorToPropertyPath(subPath); } - return createSparqlOneOrMorePredicate([ subPredicate ]); + return createSparqlOneOrMorePredicate([subPredicate]); } throw new Error(`Operator ${operator.operator} not supported`); } @@ -481,7 +555,7 @@ export class SparqlQueryBuilder { const whereQueryData = { values: [], filters: [], - triples: [ triple ], + triples: [triple], }; return operators.reduce((obj: NonGraphWhereQueryData, operator): NonGraphWhereQueryData => { const { filter, valuePattern } = this.resolveFindOperatorAsExpressionWithMultipleValues( @@ -507,12 +581,10 @@ export class SparqlQueryBuilder { const subNodeVariable = this.createVariable(); const subWhereQueryData = this.createWhereQueryData(subNodeVariable, where); return { - values: [ ...subWhereQueryData.values, ...subWhereQueryData.graphValues ], + values: [...subWhereQueryData.values, ...subWhereQueryData.graphValues], filters: subWhereQueryData.filters, - triples: [ - { subject, predicate, object: subNodeVariable }, - ...subWhereQueryData.triples, - ], + triples: [{ subject, predicate, object: subNodeVariable }, ...subWhereQueryData.triples], + patterns: [...(subWhereQueryData.patterns ?? [])], }; } @@ -522,6 +594,14 @@ export class SparqlQueryBuilder { valueObject: ValueWhereFieldObject, ): NonGraphWhereQueryData { const term = this.valueObjectToTerm(valueObject); + if ((valueObject as any).isOptional) { + return { + values: [], + filters: [], + triples: [], + patterns: [createSparqlOptional([createSparqlBasicGraphPattern([{ subject, predicate, object: term }])])], + }; + } return { values: [], filters: [], @@ -529,7 +609,7 @@ export class SparqlQueryBuilder { }; } - private valueObjectToTerm(valueObject: ValueWhereFieldObject): Literal { + private valueObjectToTerm(valueObject: ValueWhereFieldObject): Literal | Variable { let typeOrLanguage: string; let value: string; if ('@type' in valueObject && valueObject['@type'] === '@json') { @@ -539,7 +619,7 @@ export class SparqlQueryBuilder { typeOrLanguage = ('@type' in valueObject ? valueObject['@type'] : valueObject['@language'])!; value = (valueObject['@value'] as FieldPrimitiveValue).toString(); } - return DataFactory.literal(value, typeOrLanguage); + return valueToLiteral(value, typeOrLanguage); } private resolveFindOperatorAsExpressionWithMultipleValues( @@ -571,9 +651,7 @@ export class SparqlQueryBuilder { } if (operator.operator === 'exists') { return { - filter: createSparqlExistsOperation([ - createSparqlBasicGraphPattern([ triple ]), - ]), + filter: createSparqlExistsOperation([createSparqlBasicGraphPattern([triple])]), tripleInFilter: true, }; } @@ -620,12 +698,15 @@ export class SparqlQueryBuilder { return { triples: [], filters: [], - values: [{ - type: 'values', - values: resolvedValue.map((value): ValuePatternRow => ({ [`?${leftSide.value}`]: value })), - }], + values: [ + { + type: 'values', + values: resolvedValue.map((value): ValuePatternRow => ({ [`?${leftSide.value}`]: value })), + }, + ], }; - } case 'not': + } + case 'not': return { triples: [], values: [], @@ -640,12 +721,7 @@ export class SparqlQueryBuilder { return { triples: [], values: [], - filters: [ - createSparqlEqualOperation( - leftSide, - this.resolveValueToExpression(operator.value) as Expression, - ), - ], + filters: [createSparqlEqualOperation(leftSide, this.resolveValueToExpression(operator.value) as Expression)], }; default: throw new Error(`Unsupported operator "${operator.operator}"`); @@ -672,9 +748,7 @@ export class SparqlQueryBuilder { let filterExpression: FilterPattern; const isFindOperator = FindOperator.isFindOperator(rightSide); if (isFindOperator && (rightSide as FindOperator).operator === 'exists') { - return createSparqlNotExistsOperation([ - createSparqlBasicGraphPattern([ triple ]), - ]); + return createSparqlNotExistsOperation([createSparqlBasicGraphPattern([triple])]); } if (isFindOperator) { let expression: OperationExpression | undefined; @@ -695,10 +769,7 @@ export class SparqlQueryBuilder { ); } return createSparqlNotExistsOperation([ - createSparqlSelectGroup([ - createSparqlBasicGraphPattern([ triple ]), - filterExpression, - ]), + createSparqlSelectGroup([createSparqlBasicGraphPattern([triple]), filterExpression]), ]); } @@ -722,10 +793,7 @@ export class SparqlQueryBuilder { private resolveValueToTerm(value: FieldPrimitiveValue | ValueWhereFieldObject): NamedNode | Literal | Variable { if (typeof value === 'object' && '@value' in value) { - return valueToLiteral( - (value as ValueWhereFieldObject)['@value'], - '@type' in value ? value['@type'] : undefined, - ); + return valueToLiteral((value as ValueWhereFieldObject)['@value'], '@type' in value ? value['@type'] : undefined); } if (isUrl(value)) { return DataFactory.namedNode(value as string); @@ -739,16 +807,19 @@ export class SparqlQueryBuilder { isNested = false, ): OrderQueryData { if (!order) { - return { triples: [], orders: [], filters: []}; + return { triples: [], orders: [], filters: [] }; } - return Object.entries(order).reduce((obj: OrderQueryData, [ property, orderValue ]): OrderQueryData => { - const orderQueryData = this.createOrderQueryDataForProperty(subject, property, orderValue, isNested); - obj.orders = [ ...obj.orders, ...orderQueryData.orders ]; - obj.triples = [ ...obj.triples, ...orderQueryData.triples ]; - obj.filters = [ ...obj.filters, ...orderQueryData.filters ]; - obj.groupByParent = obj.groupByParent ?? orderQueryData.groupByParent; - return obj; - }, { triples: [], orders: [], filters: []}); + return Object.entries(order).reduce( + (obj: OrderQueryData, [property, orderValue]): OrderQueryData => { + const orderQueryData = this.createOrderQueryDataForProperty(subject, property, orderValue, isNested); + obj.orders = [...obj.orders, ...orderQueryData.orders]; + obj.triples = [...obj.triples, ...orderQueryData.triples]; + obj.filters = [...obj.filters, ...orderQueryData.filters]; + obj.groupByParent = obj.groupByParent ?? orderQueryData.groupByParent; + return obj; + }, + { triples: [], orders: [], filters: [] }, + ); } private createOrderQueryDataForProperty( @@ -762,37 +833,54 @@ export class SparqlQueryBuilder { const variable = this.createVariable(); const inverseRelationTriple = { subject, - predicate: createSparqlInversePredicate([ predicate ]), + predicate: createSparqlInversePredicate([predicate]), object: variable, }; - const subRelationOperatorValue = ( - orderValue as FindOperator - ).value as InverseRelationOrderValue; - const subRelationOrderQueryData = this.createOrderQueryData( - variable, - subRelationOperatorValue.order, - true, - ); + const subRelationOperatorValue = (orderValue as FindOperator) + .value as InverseRelationOrderValue; + const subRelationOrderQueryData = this.createOrderQueryData(variable, subRelationOperatorValue.order, true); const subRelationWhereQueryData = this.createWhereQueryData(variable, subRelationOperatorValue.where); + + // Create aggregate expressions for each order, but don't nest aggregates + const aggregateOrders = subRelationOrderQueryData.orders.map(order => { + const baseExpression = 'type' in order.expression && (order.expression as any).type === 'aggregate' + ? (order.expression as any).expression + : order.expression; + + // Create the aggregate expression first + const aggregateExpression = { + type: 'aggregate', + expression: baseExpression, + aggregation: order.descending ? 'max' : 'min', + } as Expression; + + return { + expression: aggregateExpression, + descending: order.descending, + }; + }); + return { - triples: [ - inverseRelationTriple, - ...subRelationOrderQueryData.triples, - ...subRelationWhereQueryData.triples, - ], + triples: [inverseRelationTriple, ...subRelationOrderQueryData.triples, ...subRelationWhereQueryData.triples], filters: subRelationWhereQueryData.filters, - orders: subRelationOrderQueryData.orders, + orders: aggregateOrders, groupByParent: true, + patterns: [ + ...subRelationWhereQueryData.patterns ?? [], + ...subRelationOrderQueryData.patterns ?? [], + ], }; } if (property === 'id') { return { triples: [], filters: [], - orders: [{ - expression: subject, - descending: orderValue === 'DESC' || orderValue === 'desc', - }], + orders: [ + { + expression: subject, + descending: orderValue === 'DESC' || orderValue === 'desc', + }, + ], }; } const variable = this.createVariable(); @@ -800,28 +888,27 @@ export class SparqlQueryBuilder { return { triples: [{ subject, predicate, object: variable }], filters: [], - orders: [{ - expression: isNested - ? { - type: 'aggregate', - expression: variable, - aggregation: isDescending ? 'max' : 'min', - } - : variable, - descending: isDescending, - }], + orders: [ + { + expression: isNested + ? { + type: 'aggregate', + expression: variable, + aggregation: isDescending ? 'max' : 'min', + } + : variable, + descending: isDescending, + }, + ], }; } - private createRelationsQueryData( - subject: Variable, - relations?: FindOptionsRelations, - ): RelationsQueryData { + private createRelationsQueryData(subject: Variable, relations?: FindOptionsRelations): RelationsQueryData { if (!relations) { - return { patterns: [], selectionTriples: []}; + return { patterns: [], selectionTriples: [] }; } - return Object.entries(relations) - .reduce((obj: RelationsQueryData, [ property, relationsValue ]): RelationsQueryData => { + return Object.entries(relations).reduce( + (obj: RelationsQueryData, [property, relationsValue]): RelationsQueryData => { const predicate = DataFactory.namedNode(property); if (typeof relationsValue === 'object') { if (FindOperator.isFindOperator(relationsValue)) { @@ -831,8 +918,8 @@ export class SparqlQueryBuilder { relationsValue as FindOperator, ); return { - patterns: [ ...obj.patterns, ...patterns ], - selectionTriples: [ ...obj.selectionTriples, ...selectionTriples ], + patterns: [...obj.patterns, ...patterns], + selectionTriples: [...obj.selectionTriples, ...selectionTriples], }; } const { patterns, selectionTriples } = this.createRelationsQueryDataForNestedRelation( @@ -841,8 +928,8 @@ export class SparqlQueryBuilder { relationsValue as FindOptionsRelations, ); return { - patterns: [ ...obj.patterns, ...patterns ], - selectionTriples: [ ...obj.selectionTriples, ...selectionTriples ], + patterns: [...obj.patterns, ...patterns], + selectionTriples: [...obj.selectionTriples, ...selectionTriples], }; } const variable = this.createVariable(); @@ -853,16 +940,15 @@ export class SparqlQueryBuilder { }; const relationPattern = createSparqlOptional([ createSparqlBasicGraphPattern([{ subject, predicate, object: variable }]), - createSparqlGraphPattern( - variable, - [ createSparqlBasicGraphPattern([ graphTriple ]) ], - ), + createSparqlGraphPattern(variable, [createSparqlBasicGraphPattern([graphTriple])]), ]); return { - patterns: [ ...obj.patterns, relationPattern ], - selectionTriples: [ ...obj.selectionTriples, graphTriple ], + patterns: [...obj.patterns, relationPattern], + selectionTriples: [...obj.selectionTriples, graphTriple], }; - }, { patterns: [], selectionTriples: []}); + }, + { patterns: [], selectionTriples: [] }, + ); } private createRelationsQueryDataForInverseRelation( @@ -878,39 +964,31 @@ export class SparqlQueryBuilder { }; const inverseRelationTriple = { subject, - predicate: createSparqlInversePredicate([ predicate ]), + predicate: createSparqlInversePredicate([predicate]), object: variable, }; - if (typeof relationsValue.value === 'object' && - (relationsValue.value as InverseRelationOperatorValue).relations - ) { + if (typeof relationsValue.value === 'object' && (relationsValue.value as InverseRelationOperatorValue).relations) { const subRelationsQueryData = this.createRelationsQueryData( variable, (relationsValue.value as InverseRelationOperatorValue).relations, ); const relationPattern = createSparqlOptional([ - createSparqlBasicGraphPattern([ inverseRelationTriple ]), - createSparqlGraphPattern( - variable, - [ createSparqlBasicGraphPattern([ graphTriple ]) ], - ), + createSparqlBasicGraphPattern([inverseRelationTriple]), + createSparqlGraphPattern(variable, [createSparqlBasicGraphPattern([graphTriple])]), ...subRelationsQueryData.patterns, ]); return { - patterns: [ relationPattern ], - selectionTriples: [ graphTriple, ...subRelationsQueryData.selectionTriples ], + patterns: [relationPattern], + selectionTriples: [graphTriple, ...subRelationsQueryData.selectionTriples], }; } const relationPattern = createSparqlOptional([ - createSparqlBasicGraphPattern([ inverseRelationTriple ]), - createSparqlGraphPattern( - variable, - [ createSparqlBasicGraphPattern([ graphTriple ]) ], - ), + createSparqlBasicGraphPattern([inverseRelationTriple]), + createSparqlGraphPattern(variable, [createSparqlBasicGraphPattern([graphTriple])]), ]); return { - patterns: [ relationPattern ], - selectionTriples: [ graphTriple ], + patterns: [relationPattern], + selectionTriples: [graphTriple], }; } @@ -926,21 +1004,15 @@ export class SparqlQueryBuilder { object: this.createVariable(), }; const relationTriple = { subject, predicate, object: variable }; - const subRelationsQueryData = this.createRelationsQueryData( - variable, - relationsValue, - ); + const subRelationsQueryData = this.createRelationsQueryData(variable, relationsValue); const relationPattern = createSparqlOptional([ - createSparqlBasicGraphPattern([ relationTriple ]), - createSparqlGraphPattern( - variable, - [ createSparqlBasicGraphPattern([ graphTriple ]) ], - ), + createSparqlBasicGraphPattern([relationTriple]), + createSparqlGraphPattern(variable, [createSparqlBasicGraphPattern([graphTriple])]), ...subRelationsQueryData.patterns, ]); return { - patterns: [ relationPattern ], - selectionTriples: [ graphTriple, ...subRelationsQueryData.selectionTriples ], + patterns: [relationPattern], + selectionTriples: [graphTriple, ...subRelationsQueryData.selectionTriples], }; } @@ -950,17 +1022,19 @@ export class SparqlQueryBuilder { private createSelectPattern(select: FindOptionsSelect, subject: Variable): Triple[] { if (Array.isArray(select)) { - return select.map((selectPredicate): Triple => ({ - subject, - predicate: DataFactory.namedNode(selectPredicate), - object: this.createVariable(), - })); + return select.map( + (selectPredicate): Triple => ({ + subject, + predicate: DataFactory.namedNode(selectPredicate), + object: this.createVariable(), + }), + ); } - return Object.entries(select).reduce((arr: Triple[], [ key, value ]): Triple[] => { + return Object.entries(select).reduce((arr: Triple[], [key, value]): Triple[] => { const variable = this.createVariable(); arr.push({ subject, predicate: DataFactory.namedNode(key), object: variable }); if (typeof value === 'object') { - arr = [ ...arr, ...this.createSelectPattern(value, variable) ]; + arr = [...arr, ...this.createSelectPattern(value, variable)]; } return arr; }, []); @@ -974,13 +1048,20 @@ export class SparqlQueryBuilder { orderFilters?: OperationExpression[], additionalPatterns?: Pattern[], serviceTriples?: Record, + binds?: Pattern[], ): Pattern[] { let patterns = initialPatterns; + + // Add binds at the beginning if they exist + if (binds && binds.length > 0) { + patterns = [...patterns, ...binds]; + } + if (triples.length > 0) { patterns.push(createSparqlBasicGraphPattern(triples)); } if (orderTriples && orderTriples.length > 0) { - const optionalPatterns: Pattern[] = [ createSparqlBasicGraphPattern(orderTriples) ]; + const optionalPatterns: Pattern[] = [createSparqlBasicGraphPattern(orderTriples)]; if (orderFilters && orderFilters.length > 0) { optionalPatterns.push(createFilterPatternFromFilters(orderFilters)); } @@ -990,34 +1071,39 @@ export class SparqlQueryBuilder { patterns.push(createFilterPatternFromFilters(filters)); } if (serviceTriples) { - for (const [ service, sTriples ] of Object.entries(serviceTriples)) { + for (const [service, sTriples] of Object.entries(serviceTriples)) { patterns.unshift(createSparqlServicePattern(service, sTriples)); } } if (additionalPatterns) { - patterns = [ ...patterns, ...additionalPatterns ]; + patterns = [...patterns, ...additionalPatterns]; } return patterns; } - private createGroupPatternForPath(entityVariable: Variable, path: string): { - variable: Variable; + private createGroupPatternForPath( + entityVariable: Variable, + path: string, + ): { + variable: Variable; patterns: Pattern[]; } { const segments = path.split('~'); let currentSubject = entityVariable; const patterns: Pattern[] = []; - + // Create a chain of patterns for each segment segments.forEach((predicate, index) => { const object = this.createVariable(); patterns.push({ type: 'bgp', - triples: [{ - subject: currentSubject, - predicate: DataFactory.namedNode(predicate), - object: object - }] + triples: [ + { + subject: currentSubject, + predicate: DataFactory.namedNode(predicate), + object: object, + }, + ], }); currentSubject = object; }); @@ -1025,24 +1111,23 @@ export class SparqlQueryBuilder { // Return the final variable (last object) and all patterns return { variable: currentSubject, - patterns + patterns, }; } - public async buildGroupByQuery(options: GroupByOptions): Promise<{ query: SelectQuery; variableMapping: Record }> { + public async buildGroupByQuery( + options: GroupByOptions, + ): Promise<{ query: SelectQuery; variableMapping: Record }> { const entityVariable = DataFactory.variable('entity'); - const queryData = this.buildEntitySelectPatternsFromOptions( - entityVariable, - { - where: options.where || {}, - } - ); - + const queryData = this.buildEntitySelectPatternsFromOptions(entityVariable, { + where: options.where || {}, + }); + // Add group variables and patterns with mapping const groupVariables: Variable[] = []; const groupPatterns: Pattern[] = []; const variableMapping: Record = {}; - + if (options.groupBy) { options.groupBy.forEach((path) => { const { variable: groupVar, patterns } = this.createGroupPatternForPath(entityVariable, path); @@ -1051,21 +1136,23 @@ export class SparqlQueryBuilder { groupPatterns.push(...patterns); }); } - + // Add date handling if specified if (options.dateRange) { const dateVar = this.createVariable(); variableMapping[dateVar.value] = 'date'; - - const datePattern:Pattern = { + + const datePattern: Pattern = { type: 'bgp', - triples: [{ - subject: entityVariable, - predicate: DataFactory.namedNode('http://purl.org/dc/terms/created'), - object: dateVar - }] + triples: [ + { + subject: entityVariable, + predicate: DataFactory.namedNode('http://purl.org/dc/terms/created'), + object: dateVar, + }, + ], }; - + const dateFilter: FilterPattern = { type: 'filter', expression: { @@ -1075,41 +1162,41 @@ export class SparqlQueryBuilder { { type: 'operation', operator: '>=', - args: [dateVar, DataFactory.literal(options.dateRange.start, 'http://www.w3.org/2001/XMLSchema#dateTime')] + args: [ + dateVar, + DataFactory.literal(options.dateRange.start, 'http://www.w3.org/2001/XMLSchema#dateTime'), + ], }, { type: 'operation', operator: '<=', - args: [dateVar, DataFactory.literal(options.dateRange.end, 'http://www.w3.org/2001/XMLSchema#dateTime')] - } - ] - } + args: [dateVar, DataFactory.literal(options.dateRange.end, 'http://www.w3.org/2001/XMLSchema#dateTime')], + }, + ], + }, }; - + groupPatterns.push(datePattern, dateFilter); - + if (options.dateGrouping) { const dateGroupVar = this.createVariable(); groupVariables.push(dateGroupVar); variableMapping[dateGroupVar.value] = 'dateGroup'; - + const dateGroupBind = this.createDateGroupingBind(dateVar, dateGroupVar, options.dateGrouping); groupPatterns.push(dateGroupBind); } } - + // Create count and entityIds variables const countVar = this.createVariable(); const entityIdsVar = this.createVariable(); variableMapping[countVar.value] = 'count'; variableMapping[entityIdsVar.value] = 'entityIds'; - + // Combine all patterns - const combinedWhere = [ - ...queryData.where, - ...groupPatterns - ]; - + const combinedWhere = [...queryData.where, ...groupPatterns]; + // Create select query with aggregations const selectQuery = createSparqlSelectQuery( [ @@ -1119,9 +1206,9 @@ export class SparqlQueryBuilder { type: 'aggregate', aggregation: 'count', distinct: true, - expression: entityVariable + expression: entityVariable, }, - variable: countVar + variable: countVar, }, { expression: { @@ -1129,27 +1216,23 @@ export class SparqlQueryBuilder { aggregation: 'group_concat', distinct: true, separator: ' ', - expression: entityVariable + expression: entityVariable, }, - variable: entityIdsVar - } + variable: entityIdsVar, + }, ], combinedWhere, [], // orders groupVariables.length > 0 ? groupVariables : undefined, // group by options.limit, - options.offset + options.offset, ); return { query: selectQuery, variableMapping }; } // Helper function for date grouping - private createDateGroupingBind( - dateVar: Variable, - dateGroupVar: Variable, - grouping: 'month' | 'day' - ): Pattern { + private createDateGroupingBind(dateVar: Variable, dateGroupVar: Variable, grouping: 'month' | 'day'): Pattern { return { type: 'bind', expression: { @@ -1159,10 +1242,10 @@ export class SparqlQueryBuilder { this.createYearExpression(dateVar), DataFactory.literal('-'), this.createMonthExpression(dateVar), - ...this.createDayExpressionParts(dateVar, grouping) - ] + ...this.createDayExpressionParts(dateVar, grouping), + ], }, - variable: dateGroupVar + variable: dateGroupVar, }; } @@ -1170,11 +1253,13 @@ export class SparqlQueryBuilder { return { type: 'operation', operator: 'STR', - args: [{ - type: 'operation', - operator: 'YEAR', - args: [dateVar] - }] + args: [ + { + type: 'operation', + operator: 'YEAR', + args: [dateVar], + }, + ], }; } @@ -1187,16 +1272,19 @@ export class SparqlQueryBuilder { } private createPaddedDatePartExpression(dateVar: Variable, datePart: 'MONTH' | 'DAY'): Expression { - const comparisonValue = DataFactory.literal('10', DataFactory.namedNode('http://www.w3.org/2001/XMLSchema#integer')); - + const comparisonValue = DataFactory.literal( + '10', + DataFactory.namedNode('http://www.w3.org/2001/XMLSchema#integer'), + ); + return { type: 'operation', operator: 'IF', args: [ this.createLessThanComparison(dateVar, datePart, comparisonValue), this.createPaddedStringExpression(dateVar, datePart), - this.createUnpaddedStringExpression(dateVar, datePart) - ] + this.createUnpaddedStringExpression(dateVar, datePart), + ], }; } @@ -1208,10 +1296,10 @@ export class SparqlQueryBuilder { { type: 'operation', operator: datePart, - args: [dateVar] + args: [dateVar], } as Expression, - comparisonValue as Expression - ] + comparisonValue as Expression, + ], }; } @@ -1219,10 +1307,7 @@ export class SparqlQueryBuilder { return { type: 'operation', operator: 'CONCAT', - args: [ - DataFactory.literal('0'), - this.createUnpaddedStringExpression(dateVar, datePart) - ] + args: [DataFactory.literal('0'), this.createUnpaddedStringExpression(dateVar, datePart)], }; } @@ -1230,20 +1315,19 @@ export class SparqlQueryBuilder { return { type: 'operation', operator: 'STR', - args: [{ - type: 'operation', - operator: datePart, - args: [dateVar] - }] + args: [ + { + type: 'operation', + operator: datePart, + args: [dateVar], + }, + ], }; } private createDayExpressionParts(dateVar: Variable, grouping: 'month' | 'day'): Expression[] { if (grouping === 'day') { - return [ - DataFactory.literal('-'), - this.createDayExpression(dateVar) - ]; + return [DataFactory.literal('-'), this.createDayExpression(dateVar)]; } return [DataFactory.literal('')]; } diff --git a/src/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.ts b/src/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.ts index 7df8787..25fb938 100644 --- a/src/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.ts +++ b/src/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.ts @@ -8,6 +8,7 @@ import type { ConstructQuery, } from 'sparqljs'; import { Generator } from 'sparqljs'; +import { Logger } from '../../../../logger'; import type { QueryExecutor, SelectVariableQueryResult } from './SparqlQueryExecutor'; export interface SparqlEndpointQueryExecutorOptions { diff --git a/src/util/SparqlUtil.ts b/src/util/SparqlUtil.ts index 335d4e7..a96fe1f 100644 --- a/src/util/SparqlUtil.ts +++ b/src/util/SparqlUtil.ts @@ -288,6 +288,14 @@ export function createFilterPatternFromFilters(filters: Expression[]): FilterPat return createSparqlFilterWithExpression(filters[0]); } +export function createSparqlBindPattern(expression: Expression, variable: Variable): BindPattern { + return { + type: 'bind', + expression, + variable, + }; +} + export function createSparqlEqualOperation(leftSide: Expression, rightSide: Expression): OperationExpression { return { type: 'operation', diff --git a/test/unit/storage/query-adapter/sparql/SparqlQueryAdapter.test.ts b/test/unit/storage/query-adapter/sparql/SparqlQueryAdapter.test.ts index ae563f9..8bd1d70 100644 --- a/test/unit/storage/query-adapter/sparql/SparqlQueryAdapter.test.ts +++ b/test/unit/storage/query-adapter/sparql/SparqlQueryAdapter.test.ts @@ -607,11 +607,11 @@ describe('a SparqlQueryAdapter', (): void => { ]); expect(select).toHaveBeenCalledTimes(2); expect(select.mock.calls[0][0].split('\n')).toEqual([ - 'SELECT DISTINCT ?entity WHERE {', + 'SELECT DISTINCT ?entity (?c1 AS ?c4) WHERE {', ' GRAPH ?entity { ?entity ?c2 ?c3. }', ' OPTIONAL { ?entity ?c1. }', '}', - 'ORDER BY (?c1)', + 'ORDER BY (?c4) (?entity)', ]); expect(select.mock.calls[1][0].split('\n')).toEqual([ 'CONSTRUCT { ?subject ?predicate ?object. }', @@ -625,6 +625,53 @@ describe('a SparqlQueryAdapter', (): void => { ]); }); + // it('xxx', + // async(): Promise => { + // select.mockImplementationOnce( + // async(): Promise => streamFrom([{ entity: data1 }, { entity: data2 }]), + // ); + // await expect( + // adapter.findAll({ + // "where": { + // "type": "https://schema.org/Article" + // }, + // "order": { + // "https://skl.so/item2": { + // "type": "operator", + // "operator": "inverseRelationOrder", + // "value": { + // "order": { + // "https://skl.so/score": "desc" + // }, + // "where": { + // "https://skl.so/item1": "https://acvb.standard.storage/data/db59e892-9fb0-4f7d-9535-cd3f047cf018" + // } + // } + // } + // }, + // "limit": 10 + // }), + // ) + // expect(select).toHaveBeenCalledTimes(2); + // expect(select.mock.calls[0][0].split('\n')).toEqual([ + // 'SELECT DISTINCT ?entity (?c1 AS ?c4) WHERE {', + // ' GRAPH ?entity { ?entity ?c2 ?c3. }', + // ' OPTIONAL { ?entity ?c1. }', + // '}', + // 'ORDER BY (?c4) (?entity)', + // ]); + // expect(select.mock.calls[1][0].split('\n')).toEqual([ + // 'CONSTRUCT { ?subject ?predicate ?object. }', + // 'WHERE {', + // ' VALUES ?entity {', + // ' ', + // ' ', + // ' }', + // ' GRAPH ?entity { ?subject ?predicate ?object. }', + // '}', + // ]); + // }); + it('executes an entity selection query then returns en empty array if there are no selected entity results.', async(): Promise => { select.mockImplementationOnce( @@ -639,11 +686,11 @@ describe('a SparqlQueryAdapter', (): void => { ).resolves.toEqual([]); expect(select).toHaveBeenCalledTimes(1); expect(select.mock.calls[0][0].split('\n')).toEqual([ - 'SELECT DISTINCT ?entity WHERE {', + 'SELECT DISTINCT ?entity (?c1 AS ?c4) WHERE {', ' GRAPH ?entity { ?entity ?c2 ?c3. }', ' OPTIONAL { ?entity ?c1. }', '}', - 'ORDER BY (?c1)', + 'ORDER BY (?c4) (?entity)', ]); }); diff --git a/test/unit/storage/query-adapter/sparql/SparqlQueryBuilder.test.ts b/test/unit/storage/query-adapter/sparql/SparqlQueryBuilder.test.ts index 0780984..6181616 100644 --- a/test/unit/storage/query-adapter/sparql/SparqlQueryBuilder.test.ts +++ b/test/unit/storage/query-adapter/sparql/SparqlQueryBuilder.test.ts @@ -351,6 +351,7 @@ describe('A SparqlQueryBuilder', (): void => { }, )).toEqual({ graphSelectionTriples: [], + group: undefined, where: [ { type: 'bgp', @@ -1829,6 +1830,15 @@ describe('A SparqlQueryBuilder', (): void => { }, )).toEqual({ graphSelectionTriples: [], + group: undefined, + selectVariables: [ + { + variable: c4, + expression: { + value: 'c1' + }, + }, + ], where: [ { type: 'graph', @@ -1859,8 +1869,11 @@ describe('A SparqlQueryBuilder', (): void => { }, ], orders: [{ - expression: c1, + expression: c4, descending: true, + }, + { + expression: entityVariable, }], graphWhere: [], }); @@ -1891,9 +1904,19 @@ describe('A SparqlQueryBuilder', (): void => { }, ], orders: [{ - expression: entityVariable, + expression: c3, descending: true, + }, + { + expression: entityVariable, }], + group: undefined, + selectVariables: [ + { + variable: c3, + expression: entityVariable, + }, + ], graphWhere: [], }); }); @@ -1991,14 +2014,21 @@ describe('A SparqlQueryBuilder', (): void => { ], group: entityVariable, orders: [{ + descending: true, + expression: c6, + }, + { + expression: entityVariable, + }], + graphWhere: [], + selectVariables: [{ expression: { type: 'aggregate', expression: c2, aggregation: 'max', }, - descending: true, + variable: c6, }], - graphWhere: [], }); });