@thomasfosterau/effect-rdf 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2251 -2
- package/dist/Algebra-CGG4oae3.mjs +433 -0
- package/dist/Algebra-CGG4oae3.mjs.map +1 -0
- package/dist/Algebra-uGsIEOUA.d.mts +446 -0
- package/dist/Ast-CPRZmBvk.mjs +552 -0
- package/dist/Ast-CPRZmBvk.mjs.map +1 -0
- package/dist/Ast-vcw2W-lf.d.mts +827 -0
- package/dist/Bindings-Ck3m7JRC.mjs +249 -0
- package/dist/Bindings-Ck3m7JRC.mjs.map +1 -0
- package/dist/Bindings-DiKpBd7f.d.mts +153 -0
- package/dist/ClientErrors-CpXdFX5u.mjs +128 -0
- package/dist/ClientErrors-CpXdFX5u.mjs.map +1 -0
- package/dist/ClientErrors-D4IZHUM-.d.mts +101 -0
- package/dist/ClientFormats-CXomkXLV.mjs +73 -0
- package/dist/ClientFormats-CXomkXLV.mjs.map +1 -0
- package/dist/ClientFormats-Dm57ZPwR.d.mts +36 -0
- package/dist/Csv2Json-DynEcwCh.mjs +194 -0
- package/dist/Csv2Json-DynEcwCh.mjs.map +1 -0
- package/dist/Csv2Json-aXNVDoXQ.d.mts +40 -0
- package/dist/Csv2Rdf-8maXP6mt.d.mts +41 -0
- package/dist/Csv2Rdf-DuSEkaKE.mjs +161 -0
- package/dist/Csv2Rdf-DuSEkaKE.mjs.map +1 -0
- package/dist/Dataset-BlmlcI7J.mjs +782 -0
- package/dist/Dataset-BlmlcI7J.mjs.map +1 -0
- package/dist/Dataset-DS3ESOcO.d.mts +426 -0
- package/dist/Dataset.d.mts +2 -0
- package/dist/Dataset.mjs +1 -0
- package/dist/Datatype-CxMpamHC.d.mts +212 -0
- package/dist/Datatype-DQvkNkiH.mjs +1001 -0
- package/dist/Datatype-DQvkNkiH.mjs.map +1 -0
- package/dist/Dialect-8ChFj5EX.d.mts +113 -0
- package/dist/Dialect-CzVH38uo.mjs +165 -0
- package/dist/Dialect-CzVH38uo.mjs.map +1 -0
- package/dist/DocumentLoader-D3lZREnB.mjs +346 -0
- package/dist/DocumentLoader-D3lZREnB.mjs.map +1 -0
- package/dist/DocumentLoader-ZUCEVrW5.d.mts +178 -0
- package/dist/DublinCore-AnwqxRx6.mjs +137 -0
- package/dist/DublinCore-AnwqxRx6.mjs.map +1 -0
- package/dist/DublinCore-Dq-tVA5d.d.mts +119 -0
- package/dist/Engine-CYPB3g4h.d.mts +144 -0
- package/dist/Engine-DF8PN7g-.mjs +872 -0
- package/dist/Engine-DF8PN7g-.mjs.map +1 -0
- package/dist/Errors-CMdV1RhU.mjs +37 -0
- package/dist/Errors-CMdV1RhU.mjs.map +1 -0
- package/dist/Errors-u2bDjUeM.d.mts +30 -0
- package/dist/Evaluator-DEsU4d1o.d.mts +50 -0
- package/dist/Evaluator-DOY2-guC.mjs +281 -0
- package/dist/Evaluator-DOY2-guC.mjs.map +1 -0
- package/dist/Exif-CpqniYQd.d.mts +78 -0
- package/dist/Exif-DjkCfEB-.mjs +89 -0
- package/dist/Exif-DjkCfEB-.mjs.map +1 -0
- package/dist/Expression-BIMMvduQ.mjs +230 -0
- package/dist/Expression-BIMMvduQ.mjs.map +1 -0
- package/dist/Expression-W8A9cyX7.d.mts +89 -0
- package/dist/Extract-Bop85jES.mjs +220 -0
- package/dist/Extract-Bop85jES.mjs.map +1 -0
- package/dist/Extract-C_pCvuTC.d.mts +88 -0
- package/dist/Federation-BcNrozc1.d.mts +52 -0
- package/dist/Federation-CHScBkaK.mjs +130 -0
- package/dist/Federation-CHScBkaK.mjs.map +1 -0
- package/dist/Functions-AvjNcId_.mjs +1346 -0
- package/dist/Functions-AvjNcId_.mjs.map +1 -0
- package/dist/Functions-OQJZP-F6.d.mts +111 -0
- package/dist/Generator-C52mmq01.d.mts +50 -0
- package/dist/Generator-D3utCJC7.mjs +205 -0
- package/dist/Generator-D3utCJC7.mjs.map +1 -0
- package/dist/Grammar-CPlSxGH6.mjs +200 -0
- package/dist/Grammar-CPlSxGH6.mjs.map +1 -0
- package/dist/Grammar-CRhnRoCu.d.mts +148 -0
- package/dist/Grammar-D6jZdJQ3.d.mts +169 -0
- package/dist/Grammar-mQ8CgE1M.mjs +258 -0
- package/dist/Grammar-mQ8CgE1M.mjs.map +1 -0
- package/dist/GraphStore-DhUa4nFO.d.mts +45 -0
- package/dist/GraphStore-DvbqwKy1.mjs +212 -0
- package/dist/GraphStore-DvbqwKy1.mjs.map +1 -0
- package/dist/Iri-BB8Ks-BF.d.mts +84 -0
- package/dist/Iri-Cr92gsQV.mjs +232 -0
- package/dist/Iri-Cr92gsQV.mjs.map +1 -0
- package/dist/Iri.d.mts +2 -0
- package/dist/Iri.mjs +1 -0
- package/dist/Isomorphism-B6qTY-xy.d.mts +28 -0
- package/dist/Isomorphism-BmqxhKyJ.mjs +232 -0
- package/dist/Isomorphism-BmqxhKyJ.mjs.map +1 -0
- package/dist/Isomorphism-DInKnWIy.mjs +390 -0
- package/dist/Isomorphism-DInKnWIy.mjs.map +1 -0
- package/dist/Isomorphism-DvSfZXLR.d.mts +37 -0
- package/dist/Isomorphism.d.mts +2 -0
- package/dist/Isomorphism.mjs +1 -0
- package/dist/JsonLd-DOwS2FHg.mjs +2836 -0
- package/dist/JsonLd-DOwS2FHg.mjs.map +1 -0
- package/dist/JsonLd-DobFrQNa.d.mts +242 -0
- package/dist/JsonLdError-C9J-BxfG.mjs +106 -0
- package/dist/JsonLdError-C9J-BxfG.mjs.map +1 -0
- package/dist/JsonLdError-DSOfHkOy.d.mts +43 -0
- package/dist/LanguageTag-BCu8rcmX.d.mts +38 -0
- package/dist/LanguageTag-BcOpMGZ4.mjs +89 -0
- package/dist/LanguageTag-BcOpMGZ4.mjs.map +1 -0
- package/dist/LanguageTag.d.mts +2 -0
- package/dist/LanguageTag.mjs +1 -0
- package/dist/Lexical-Cg0JHrf6.mjs +243 -0
- package/dist/Lexical-Cg0JHrf6.mjs.map +1 -0
- package/dist/Lexical-D3zySYVS.d.mts +163 -0
- package/dist/Manifest-B6xf6mUc.mjs +148 -0
- package/dist/Manifest-B6xf6mUc.mjs.map +1 -0
- package/dist/Manifest-DQUMRBFr.d.mts +98 -0
- package/dist/Mapping-BgG74x3U.d.mts +63 -0
- package/dist/Mapping-Dc1ZGirk.mjs +259 -0
- package/dist/Mapping-Dc1ZGirk.mjs.map +1 -0
- package/dist/Mcp-1DwTTKOK.mjs +48 -0
- package/dist/Mcp-1DwTTKOK.mjs.map +1 -0
- package/dist/Mcp-d-pX9erx.d.mts +25 -0
- package/dist/Message-CK_DGQuu.mjs +95 -0
- package/dist/Message-CK_DGQuu.mjs.map +1 -0
- package/dist/Message-fIvTJSXM.d.mts +49 -0
- package/dist/Metadata-BbffwGDZ.mjs +445 -0
- package/dist/Metadata-BbffwGDZ.mjs.map +1 -0
- package/dist/Metadata-CEt3yc1-.d.mts +901 -0
- package/dist/Metadata-D4HsQNXr.mjs +1273 -0
- package/dist/Metadata-D4HsQNXr.mjs.map +1 -0
- package/dist/Metadata-nzS7QKRj.d.mts +350 -0
- package/dist/Model-DaMmxurZ.d.mts +293 -0
- package/dist/Model-DlPzRYhF.mjs +528 -0
- package/dist/Model-DlPzRYhF.mjs.map +1 -0
- package/dist/N3-BzyV-KIH.mjs +974 -0
- package/dist/N3-BzyV-KIH.mjs.map +1 -0
- package/dist/N3-DSLnonDn.d.mts +100 -0
- package/dist/NQuads-C1VBOJ3-.mjs +117 -0
- package/dist/NQuads-C1VBOJ3-.mjs.map +1 -0
- package/dist/NQuads-FjFZikFg.d.mts +76 -0
- package/dist/NTriples-D-kLSEAf.mjs +120 -0
- package/dist/NTriples-D-kLSEAf.mjs.map +1 -0
- package/dist/NTriples-D34OspfW.d.mts +76 -0
- package/dist/Namespace-ClTUO_ya.d.mts +42 -0
- package/dist/Namespace-DHFIsORd.mjs +75 -0
- package/dist/Namespace-DHFIsORd.mjs.map +1 -0
- package/dist/Namespace.d.mts +2 -0
- package/dist/Namespace.mjs +1 -0
- package/dist/Namespaces-Bz85vpjW.mjs +235 -0
- package/dist/Namespaces-Bz85vpjW.mjs.map +1 -0
- package/dist/Namespaces-C1jW6EDo.d.mts +178 -0
- package/dist/Optimizer-BWWQRQPY.mjs +168 -0
- package/dist/Optimizer-BWWQRQPY.mjs.map +1 -0
- package/dist/Optimizer-DUpUow6k.d.mts +26 -0
- package/dist/Options-BLBGL4HE.mjs +72 -0
- package/dist/Options-BLBGL4HE.mjs.map +1 -0
- package/dist/Options-BommQwP9.d.mts +127 -0
- package/dist/Packet-CA76wVX3.mjs +197 -0
- package/dist/Packet-CA76wVX3.mjs.map +1 -0
- package/dist/Packet-Cy5g6XuW.d.mts +130 -0
- package/dist/Parser-p1Gyr0QN.d.mts +85 -0
- package/dist/Parser-xARsOWXk.mjs +1317 -0
- package/dist/Parser-xARsOWXk.mjs.map +1 -0
- package/dist/Path-B20Yp8KE.mjs +284 -0
- package/dist/Path-B20Yp8KE.mjs.map +1 -0
- package/dist/Path-DRB8e-Zn.d.mts +181 -0
- package/dist/Pdf-B9RZn--8.d.mts +77 -0
- package/dist/Pdf-CKK6dkZn.mjs +89 -0
- package/dist/Pdf-CKK6dkZn.mjs.map +1 -0
- package/dist/PdfA-CUjSuntT.d.mts +109 -0
- package/dist/PdfA-CleOhuL6.mjs +124 -0
- package/dist/PdfA-CleOhuL6.mjs.map +1 -0
- package/dist/Photoshop-CiHo80qV.mjs +233 -0
- package/dist/Photoshop-CiHo80qV.mjs.map +1 -0
- package/dist/Photoshop-udKZ0I3N.d.mts +204 -0
- package/dist/PrefixMap-BHFPDLO-.mjs +103 -0
- package/dist/PrefixMap-BHFPDLO-.mjs.map +1 -0
- package/dist/PrefixMap-BMlXrWNd.d.mts +64 -0
- package/dist/PrefixMap.d.mts +2 -0
- package/dist/PrefixMap.mjs +1 -0
- package/dist/Processor-CMmecFsb.mjs +198 -0
- package/dist/Processor-CMmecFsb.mjs.map +1 -0
- package/dist/Processor-FJPvO0CB.d.mts +435 -0
- package/dist/Protocol-BA7OkNgp.mjs +202 -0
- package/dist/Protocol-BA7OkNgp.mjs.map +1 -0
- package/dist/Protocol-DlSoiIKB.d.mts +108 -0
- package/dist/ProtocolErrors-Ckfejnl6.d.mts +84 -0
- package/dist/ProtocolErrors-czDPVcX5.mjs +129 -0
- package/dist/ProtocolErrors-czDPVcX5.mjs.map +1 -0
- package/dist/Query-D9A6LOpP.mjs +364 -0
- package/dist/Query-D9A6LOpP.mjs.map +1 -0
- package/dist/Query-KqSkTYyG.d.mts +96 -0
- package/dist/QueryBuilder-BLK9Vfbz.mjs +674 -0
- package/dist/QueryBuilder-BLK9Vfbz.mjs.map +1 -0
- package/dist/QueryBuilder-DUqh4ECe.d.mts +529 -0
- package/dist/RdfJs-D6-49XB5.mjs +86 -0
- package/dist/RdfJs-D6-49XB5.mjs.map +1 -0
- package/dist/RdfJs-DXFqdWrd.d.mts +76 -0
- package/dist/RdfJs.d.mts +2 -0
- package/dist/RdfJs.mjs +1 -0
- package/dist/RdfJson-5aKPDlPS.d.mts +297 -0
- package/dist/RdfJson-BNocgW4f.mjs +548 -0
- package/dist/RdfJson-BNocgW4f.mjs.map +1 -0
- package/dist/RdfXml-DJ9G4gOq.mjs +1014 -0
- package/dist/RdfXml-DJ9G4gOq.mjs.map +1 -0
- package/dist/RdfXml-_N7yxWEp.d.mts +149 -0
- package/dist/Rdfs-BRVPsAjc.d.mts +84 -0
- package/dist/Rdfs-CyY2wVHI.mjs +167 -0
- package/dist/Rdfs-CyY2wVHI.mjs.map +1 -0
- package/dist/Rdfs.d.mts +2 -0
- package/dist/Rdfs.mjs +1 -0
- package/dist/Reasoner-BxYhx9s7.d.mts +94 -0
- package/dist/Reasoner-Cw90zrjv.mjs +798 -0
- package/dist/Reasoner-Cw90zrjv.mjs.map +1 -0
- package/dist/Reification-BmN4EfnM.d.mts +40 -0
- package/dist/Reification-dpqQvjDE.mjs +82 -0
- package/dist/Reification-dpqQvjDE.mjs.map +1 -0
- package/dist/Reification.d.mts +2 -0
- package/dist/Reification.mjs +1 -0
- package/dist/Report-XHs8htzK.mjs +121 -0
- package/dist/Report-XHs8htzK.mjs.map +1 -0
- package/dist/Report-hcXsc_19.d.mts +115 -0
- package/dist/Resource-B1cI8FyJ.d.mts +218 -0
- package/dist/Resource-sIEeNh15.mjs +374 -0
- package/dist/Resource-sIEeNh15.mjs.map +1 -0
- package/dist/Resource.d.mts +2 -0
- package/dist/Resource.mjs +1 -0
- package/dist/Results-BVNEC-Wt.d.mts +277 -0
- package/dist/Results-peJjGA2V.mjs +621 -0
- package/dist/Results-peJjGA2V.mjs.map +1 -0
- package/dist/ResultsStream-BhF0OcNn.mjs +639 -0
- package/dist/ResultsStream-BhF0OcNn.mjs.map +1 -0
- package/dist/ResultsStream-toYMXrOe.d.mts +100 -0
- package/dist/SemAct-CDchtk49.d.mts +96 -0
- package/dist/SemAct-CmyT4yI8.mjs +118 -0
- package/dist/SemAct-CmyT4yI8.mjs.map +1 -0
- package/dist/Serialization-DP9H5bYQ.mjs +514 -0
- package/dist/Serialization-DP9H5bYQ.mjs.map +1 -0
- package/dist/Serialization-Df8iVauT.d.mts +392 -0
- package/dist/Serialization.d.mts +2 -0
- package/dist/Serialization.mjs +1 -0
- package/dist/ServerFormats-CrRnjjf6.mjs +64 -0
- package/dist/ServerFormats-CrRnjjf6.mjs.map +1 -0
- package/dist/ServerFormats-DjC9NsO_.d.mts +36 -0
- package/dist/ServiceDescription-BERsvg-k.d.mts +54 -0
- package/dist/ServiceDescription-Dq5hxeGy.mjs +97 -0
- package/dist/ServiceDescription-Dq5hxeGy.mjs.map +1 -0
- package/dist/ShExC-Ctf-06CL.d.mts +67 -0
- package/dist/ShExC-DJbB19i3.mjs +1181 -0
- package/dist/ShExC-DJbB19i3.mjs.map +1 -0
- package/dist/ShExError-BeYFD9rv.d.mts +61 -0
- package/dist/ShExError-CVtq2NnM.mjs +64 -0
- package/dist/ShExError-CVtq2NnM.mjs.map +1 -0
- package/dist/ShExJ-C1u_wgyD.d.mts +531 -0
- package/dist/ShExJ-COiPd9Xw.mjs +532 -0
- package/dist/ShExJ-COiPd9Xw.mjs.map +1 -0
- package/dist/ShExR-ByR4mCh-.mjs +480 -0
- package/dist/ShExR-ByR4mCh-.mjs.map +1 -0
- package/dist/ShExR-CqONNNBz.d.mts +40 -0
- package/dist/ShapeMap-C422pxKl.d.mts +140 -0
- package/dist/ShapeMap-CsgKxB2G.mjs +181 -0
- package/dist/ShapeMap-CsgKxB2G.mjs.map +1 -0
- package/dist/Shapes-18GjfyBV.mjs +597 -0
- package/dist/Shapes-18GjfyBV.mjs.map +1 -0
- package/dist/Shapes-BQFDFc4Q.d.mts +306 -0
- package/dist/Sparql-BiYFMSpl.mjs +29 -0
- package/dist/Sparql-BiYFMSpl.mjs.map +1 -0
- package/dist/Sparql-DecpWTPh.d.mts +97 -0
- package/dist/SparqlClient-C_CjXbwj.mjs +333 -0
- package/dist/SparqlClient-C_CjXbwj.mjs.map +1 -0
- package/dist/SparqlClient-UPc88SHy.d.mts +290 -0
- package/dist/SparqlServer-CbUW-pVj.d.mts +71 -0
- package/dist/SparqlServer-Db7w7Cll.mjs +308 -0
- package/dist/SparqlServer-Db7w7Cll.mjs.map +1 -0
- package/dist/SqlStore-BBqFx-Wl.mjs +684 -0
- package/dist/SqlStore-BBqFx-Wl.mjs.map +1 -0
- package/dist/SqlStore-CCJo5I-e.d.mts +117 -0
- package/dist/Store-D0jmVfb3.d.mts +166 -0
- package/dist/Store-DH3Ow1GO.mjs +162 -0
- package/dist/Store-DH3Ow1GO.mjs.map +1 -0
- package/dist/Structure-BjMo4Bkc.mjs +334 -0
- package/dist/Structure-BjMo4Bkc.mjs.map +1 -0
- package/dist/Structure-n4CmDiab.d.mts +63 -0
- package/dist/Table-BGgm9nbM.mjs +538 -0
- package/dist/Table-BGgm9nbM.mjs.map +1 -0
- package/dist/Table-C3reiVrb.d.mts +261 -0
- package/dist/Term-B_4ezyXq.d.mts +619 -0
- package/dist/Term-CFLG1qu4.mjs +991 -0
- package/dist/Term-CFLG1qu4.mjs.map +1 -0
- package/dist/Term.d.mts +2 -0
- package/dist/Term.mjs +1 -0
- package/dist/TermCodec-CDZiEztW.mjs +397 -0
- package/dist/TermCodec-CDZiEztW.mjs.map +1 -0
- package/dist/TermCodec-_03bDXr0.d.mts +209 -0
- package/dist/TermCodec.d.mts +2 -0
- package/dist/TermCodec.mjs +1 -0
- package/dist/TermJson-BOPe0yve.d.mts +232 -0
- package/dist/TermJson-FAg3lvjl.mjs +142 -0
- package/dist/TermJson-FAg3lvjl.mjs.map +1 -0
- package/dist/TermJson.d.mts +2 -0
- package/dist/TermJson.mjs +1 -0
- package/dist/TermSchema-Bn9CoaYA.mjs +30 -0
- package/dist/TermSchema-Bn9CoaYA.mjs.map +1 -0
- package/dist/TermSchema-DBO6MroX.d.mts +6 -0
- package/dist/Testing-B-aPCpmu.mjs +63 -0
- package/dist/Testing-B-aPCpmu.mjs.map +1 -0
- package/dist/Testing-CF6s8P3O.d.mts +53 -0
- package/dist/Tiff-CR-2QeSI.d.mts +148 -0
- package/dist/Tiff-DlsOlZPM.mjs +169 -0
- package/dist/Tiff-DlsOlZPM.mjs.map +1 -0
- package/dist/Tools-7MdRKccr.d.mts +583 -0
- package/dist/Tools-ryxphZbI.mjs +329 -0
- package/dist/Tools-ryxphZbI.mjs.map +1 -0
- package/dist/Translate-B0YKKANS.d.mts +37 -0
- package/dist/Translate-gzWPq0Ia.mjs +308 -0
- package/dist/Translate-gzWPq0Ia.mjs.map +1 -0
- package/dist/Translation-DC9rLm2y.mjs +1535 -0
- package/dist/Translation-DC9rLm2y.mjs.map +1 -0
- package/dist/Translation-K4L9XBqX.d.mts +103 -0
- package/dist/TriG-BkqtqZ6Y.mjs +125 -0
- package/dist/TriG-BkqtqZ6Y.mjs.map +1 -0
- package/dist/TriG-xDjdDatp.d.mts +86 -0
- package/dist/Turtle-Bv1_bisW.d.mts +85 -0
- package/dist/Turtle-CZVUOtwl.mjs +133 -0
- package/dist/Turtle-CZVUOtwl.mjs.map +1 -0
- package/dist/ValidationReport-DBdJshW5.mjs +285 -0
- package/dist/ValidationReport-DBdJshW5.mjs.map +1 -0
- package/dist/ValidationReport-Dx3WxY0h.d.mts +192 -0
- package/dist/Validator-227ff9Rn.d.mts +179 -0
- package/dist/Validator-BzXMKDeJ.mjs +1162 -0
- package/dist/Validator-BzXMKDeJ.mjs.map +1 -0
- package/dist/Validator-Dl8cih5V.d.mts +207 -0
- package/dist/Validator-DmUfMbpL.mjs +568 -0
- package/dist/Validator-DmUfMbpL.mjs.map +1 -0
- package/dist/Vocab-DceKywpq.mjs +168 -0
- package/dist/Vocab-DceKywpq.mjs.map +1 -0
- package/dist/Vocab-Df-L-IwZ.d.mts +46 -0
- package/dist/Vocab-Do56UgBX.d.mts +81 -0
- package/dist/Vocab-TfpWG1Ne.mjs +118 -0
- package/dist/Vocab-TfpWG1Ne.mjs.map +1 -0
- package/dist/Vocab.d.mts +2 -0
- package/dist/Vocab.mjs +1 -0
- package/dist/Vocabulary-C6-GPOy4.d.mts +22 -0
- package/dist/Vocabulary-CnQl-_Z4.mjs +179 -0
- package/dist/Vocabulary-CnQl-_Z4.mjs.map +1 -0
- package/dist/Xml-B7iihYCS.mjs +976 -0
- package/dist/Xml-B7iihYCS.mjs.map +1 -0
- package/dist/Xml-CmfHS7SW.d.mts +267 -0
- package/dist/Xmp-D7CKA7MZ.d.mts +111 -0
- package/dist/Xmp-DCGN9pOD.mjs +307 -0
- package/dist/Xmp-DCGN9pOD.mjs.map +1 -0
- package/dist/XmpBasic-CP38jpR_.mjs +73 -0
- package/dist/XmpBasic-CP38jpR_.mjs.map +1 -0
- package/dist/XmpBasic-Cmbe53rQ.d.mts +64 -0
- package/dist/XmpMM-BfL_TgJF.mjs +73 -0
- package/dist/XmpMM-BfL_TgJF.mjs.map +1 -0
- package/dist/XmpMM-Dqm3IX8p.d.mts +63 -0
- package/dist/XmpRights-BKPtoI5L.mjs +73 -0
- package/dist/XmpRights-BKPtoI5L.mjs.map +1 -0
- package/dist/XmpRights-CaALZQz2.d.mts +63 -0
- package/dist/Xsd-Cdgx5zRB.mjs +405 -0
- package/dist/Xsd-Cdgx5zRB.mjs.map +1 -0
- package/dist/Xsd-D2elNhSm.d.mts +187 -0
- package/dist/Xsd.d.mts +2 -0
- package/dist/Xsd.mjs +1 -0
- package/dist/accessors-CEjaojuQ.mjs +28 -0
- package/dist/accessors-CEjaojuQ.mjs.map +1 -0
- package/dist/codec-Lb2T96rv.d.mts +20 -0
- package/dist/codec-QNo7IdJF.mjs +389 -0
- package/dist/codec-QNo7IdJF.mjs.map +1 -0
- package/dist/csvw/Csv2Json.d.mts +2 -0
- package/dist/csvw/Csv2Json.mjs +1 -0
- package/dist/csvw/Csv2Rdf.d.mts +2 -0
- package/dist/csvw/Csv2Rdf.mjs +1 -0
- package/dist/csvw/Datatype.d.mts +2 -0
- package/dist/csvw/Datatype.mjs +1 -0
- package/dist/csvw/Metadata.d.mts +2 -0
- package/dist/csvw/Metadata.mjs +1 -0
- package/dist/csvw/Processor.d.mts +2 -0
- package/dist/csvw/Processor.mjs +1 -0
- package/dist/csvw/Report.d.mts +2 -0
- package/dist/csvw/Report.mjs +1 -0
- package/dist/csvw/Table.d.mts +2 -0
- package/dist/csvw/Table.mjs +1 -0
- package/dist/csvw/index.d.mts +8 -0
- package/dist/csvw/index.mjs +8 -0
- package/dist/index-Cms2TYfC.d.mts +16 -0
- package/dist/index-Ct8xFmRs.d.mts +7 -0
- package/dist/index-D4QFwOjm.d.mts +28 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.mjs +17 -0
- package/dist/jsonld/DocumentLoader.d.mts +2 -0
- package/dist/jsonld/DocumentLoader.mjs +1 -0
- package/dist/jsonld/JsonLd.d.mts +2 -0
- package/dist/jsonld/JsonLd.mjs +1 -0
- package/dist/jsonld/JsonLdError.d.mts +2 -0
- package/dist/jsonld/JsonLdError.mjs +1 -0
- package/dist/jsonld/index.d.mts +4 -0
- package/dist/jsonld/index.mjs +4 -0
- package/dist/lists-D-OpQ0Ir.mjs +77 -0
- package/dist/lists-D-OpQ0Ir.mjs.map +1 -0
- package/dist/loop-D5-gNx9K.mjs +21 -0
- package/dist/loop-D5-gNx9K.mjs.map +1 -0
- package/dist/loop-DZ2hXlr_.mjs +21 -0
- package/dist/loop-DZ2hXlr_.mjs.map +1 -0
- package/dist/n3/Isomorphism.d.mts +2 -0
- package/dist/n3/Isomorphism.mjs +1 -0
- package/dist/n3/Mapping.d.mts +2 -0
- package/dist/n3/Mapping.mjs +1 -0
- package/dist/n3/Model.d.mts +2 -0
- package/dist/n3/Model.mjs +1 -0
- package/dist/n3/N3.d.mts +2 -0
- package/dist/n3/N3.mjs +1 -0
- package/dist/n3/Reasoner.d.mts +2 -0
- package/dist/n3/Reasoner.mjs +2 -0
- package/dist/n3/Vocab.d.mts +2 -0
- package/dist/n3/Vocab.mjs +1 -0
- package/dist/n3/index.d.mts +7 -0
- package/dist/n3/index.mjs +7 -0
- package/dist/ntriples/Grammar.d.mts +2 -0
- package/dist/ntriples/Grammar.mjs +1 -0
- package/dist/ntriples/Lexical.d.mts +2 -0
- package/dist/ntriples/Lexical.mjs +1 -0
- package/dist/ntriples/NQuads.d.mts +2 -0
- package/dist/ntriples/NQuads.mjs +1 -0
- package/dist/ntriples/NTriples.d.mts +2 -0
- package/dist/ntriples/NTriples.mjs +1 -0
- package/dist/ntriples/index.d.mts +5 -0
- package/dist/ntriples/index.mjs +5 -0
- package/dist/rdfjson/RdfJson.d.mts +2 -0
- package/dist/rdfjson/RdfJson.mjs +1 -0
- package/dist/rdfjson/index.d.mts +2 -0
- package/dist/rdfjson/index.mjs +1 -0
- package/dist/rdfxml/RdfXml.d.mts +2 -0
- package/dist/rdfxml/RdfXml.mjs +1 -0
- package/dist/rdfxml/Xml.d.mts +2 -0
- package/dist/rdfxml/Xml.mjs +1 -0
- package/dist/rdfxml/index.d.mts +3 -0
- package/dist/rdfxml/index.mjs +3 -0
- package/dist/rolldown-runtime-D8jQpDG7.mjs +12 -0
- package/dist/serialize-96KBvKaf.mjs +1463 -0
- package/dist/serialize-96KBvKaf.mjs.map +1 -0
- package/dist/serialize-DsoXdM6n.d.mts +37 -0
- package/dist/shacl/Message.d.mts +2 -0
- package/dist/shacl/Message.mjs +1 -0
- package/dist/shacl/Path.d.mts +2 -0
- package/dist/shacl/Path.mjs +1 -0
- package/dist/shacl/Shapes.d.mts +2 -0
- package/dist/shacl/Shapes.mjs +1 -0
- package/dist/shacl/Sparql.d.mts +2 -0
- package/dist/shacl/Sparql.mjs +1 -0
- package/dist/shacl/ValidationReport.d.mts +2 -0
- package/dist/shacl/ValidationReport.mjs +1 -0
- package/dist/shacl/Validator.d.mts +2 -0
- package/dist/shacl/Validator.mjs +1 -0
- package/dist/shacl/Vocabulary.d.mts +2 -0
- package/dist/shacl/Vocabulary.mjs +1 -0
- package/dist/shacl/index.d.mts +9 -0
- package/dist/shacl/index.mjs +8 -0
- package/dist/shex/SemAct.d.mts +2 -0
- package/dist/shex/SemAct.mjs +1 -0
- package/dist/shex/ShExC.d.mts +2 -0
- package/dist/shex/ShExC.mjs +1 -0
- package/dist/shex/ShExError.d.mts +2 -0
- package/dist/shex/ShExError.mjs +1 -0
- package/dist/shex/ShExJ.d.mts +2 -0
- package/dist/shex/ShExJ.mjs +2 -0
- package/dist/shex/ShExR.d.mts +2 -0
- package/dist/shex/ShExR.mjs +1 -0
- package/dist/shex/ShapeMap.d.mts +2 -0
- package/dist/shex/ShapeMap.mjs +1 -0
- package/dist/shex/Structure.d.mts +2 -0
- package/dist/shex/Structure.mjs +2 -0
- package/dist/shex/Validator.d.mts +2 -0
- package/dist/shex/Validator.mjs +4 -0
- package/dist/shex/index.d.mts +9 -0
- package/dist/shex/index.mjs +9 -0
- package/dist/sparql/Algebra.d.mts +2 -0
- package/dist/sparql/Algebra.mjs +1 -0
- package/dist/sparql/Ast.d.mts +2 -0
- package/dist/sparql/Ast.mjs +1 -0
- package/dist/sparql/Bindings.d.mts +2 -0
- package/dist/sparql/Bindings.mjs +1 -0
- package/dist/sparql/ClientErrors.d.mts +2 -0
- package/dist/sparql/ClientErrors.mjs +1 -0
- package/dist/sparql/ClientFormats.d.mts +2 -0
- package/dist/sparql/ClientFormats.mjs +1 -0
- package/dist/sparql/Engine.d.mts +2 -0
- package/dist/sparql/Engine.mjs +1 -0
- package/dist/sparql/Errors.d.mts +2 -0
- package/dist/sparql/Errors.mjs +1 -0
- package/dist/sparql/Expression.d.mts +2 -0
- package/dist/sparql/Expression.mjs +1 -0
- package/dist/sparql/Federation.d.mts +2 -0
- package/dist/sparql/Federation.mjs +1 -0
- package/dist/sparql/Functions.d.mts +2 -0
- package/dist/sparql/Functions.mjs +1 -0
- package/dist/sparql/Generator.d.mts +2 -0
- package/dist/sparql/Generator.mjs +1 -0
- package/dist/sparql/GraphStore.d.mts +2 -0
- package/dist/sparql/GraphStore.mjs +1 -0
- package/dist/sparql/Optimizer.d.mts +2 -0
- package/dist/sparql/Optimizer.mjs +1 -0
- package/dist/sparql/Options.d.mts +2 -0
- package/dist/sparql/Options.mjs +1 -0
- package/dist/sparql/Parser.d.mts +2 -0
- package/dist/sparql/Parser.mjs +1 -0
- package/dist/sparql/Protocol.d.mts +2 -0
- package/dist/sparql/Protocol.mjs +1 -0
- package/dist/sparql/ProtocolErrors.d.mts +2 -0
- package/dist/sparql/ProtocolErrors.mjs +1 -0
- package/dist/sparql/QueryBuilder.d.mts +2 -0
- package/dist/sparql/QueryBuilder.mjs +1 -0
- package/dist/sparql/Results.d.mts +2 -0
- package/dist/sparql/Results.mjs +1 -0
- package/dist/sparql/ResultsStream.d.mts +2 -0
- package/dist/sparql/ResultsStream.mjs +1 -0
- package/dist/sparql/ServerFormats.d.mts +2 -0
- package/dist/sparql/ServerFormats.mjs +1 -0
- package/dist/sparql/ServiceDescription.d.mts +2 -0
- package/dist/sparql/ServiceDescription.mjs +1 -0
- package/dist/sparql/SparqlClient.d.mts +2 -0
- package/dist/sparql/SparqlClient.mjs +1 -0
- package/dist/sparql/SparqlServer.d.mts +2 -0
- package/dist/sparql/SparqlServer.mjs +1 -0
- package/dist/sparql/Store.d.mts +2 -0
- package/dist/sparql/Store.mjs +1 -0
- package/dist/sparql/TermSchema.d.mts +3 -0
- package/dist/sparql/TermSchema.mjs +2 -0
- package/dist/sparql/Testing.d.mts +2 -0
- package/dist/sparql/Testing.mjs +1 -0
- package/dist/sparql/Translate.d.mts +2 -0
- package/dist/sparql/Translate.mjs +1 -0
- package/dist/sparql/ai/Mcp.d.mts +2 -0
- package/dist/sparql/ai/Mcp.mjs +1 -0
- package/dist/sparql/ai/Tools.d.mts +2 -0
- package/dist/sparql/ai/Tools.mjs +1 -0
- package/dist/sparql/ai/index.d.mts +3 -0
- package/dist/sparql/ai/index.mjs +3 -0
- package/dist/sparql/index.d.mts +30 -0
- package/dist/sparql/index.mjs +29 -0
- package/dist/sparql/shacl/Evaluator.d.mts +2 -0
- package/dist/sparql/shacl/Evaluator.mjs +1 -0
- package/dist/sparql/shacl/Query.d.mts +2 -0
- package/dist/sparql/shacl/Query.mjs +1 -0
- package/dist/sparql/shacl/index.d.mts +3 -0
- package/dist/sparql/shacl/index.mjs +3 -0
- package/dist/sparql/sql/Dialect.d.mts +2 -0
- package/dist/sparql/sql/Dialect.mjs +1 -0
- package/dist/sparql/sql/SqlStore.d.mts +2 -0
- package/dist/sparql/sql/SqlStore.mjs +1 -0
- package/dist/sparql/sql/Translation.d.mts +2 -0
- package/dist/sparql/sql/Translation.mjs +1 -0
- package/dist/sparql/sql/index.d.mts +4 -0
- package/dist/sparql/sql/index.mjs +4 -0
- package/dist/stringMap-D5YIpYtR.mjs +38 -0
- package/dist/stringMap-D5YIpYtR.mjs.map +1 -0
- package/dist/tokens-C6BzeodQ.mjs +24 -0
- package/dist/tokens-C6BzeodQ.mjs.map +1 -0
- package/dist/turtle/Grammar.d.mts +3 -0
- package/dist/turtle/Grammar.mjs +3 -0
- package/dist/turtle/Manifest.d.mts +2 -0
- package/dist/turtle/Manifest.mjs +1 -0
- package/dist/turtle/TriG.d.mts +2 -0
- package/dist/turtle/TriG.mjs +1 -0
- package/dist/turtle/Turtle.d.mts +2 -0
- package/dist/turtle/Turtle.mjs +1 -0
- package/dist/turtle/index.d.mts +5 -0
- package/dist/turtle/index.mjs +5 -0
- package/dist/xmp/DublinCore.d.mts +2 -0
- package/dist/xmp/DublinCore.mjs +1 -0
- package/dist/xmp/Exif.d.mts +2 -0
- package/dist/xmp/Exif.mjs +1 -0
- package/dist/xmp/Extract.d.mts +2 -0
- package/dist/xmp/Extract.mjs +1 -0
- package/dist/xmp/Metadata.d.mts +2 -0
- package/dist/xmp/Metadata.mjs +1 -0
- package/dist/xmp/Namespaces.d.mts +2 -0
- package/dist/xmp/Namespaces.mjs +1 -0
- package/dist/xmp/Packet.d.mts +2 -0
- package/dist/xmp/Packet.mjs +1 -0
- package/dist/xmp/Pdf.d.mts +2 -0
- package/dist/xmp/Pdf.mjs +1 -0
- package/dist/xmp/PdfA.d.mts +2 -0
- package/dist/xmp/PdfA.mjs +1 -0
- package/dist/xmp/Photoshop.d.mts +2 -0
- package/dist/xmp/Photoshop.mjs +1 -0
- package/dist/xmp/Tiff.d.mts +2 -0
- package/dist/xmp/Tiff.mjs +1 -0
- package/dist/xmp/Xmp.d.mts +2 -0
- package/dist/xmp/Xmp.mjs +3 -0
- package/dist/xmp/XmpBasic.d.mts +2 -0
- package/dist/xmp/XmpBasic.mjs +1 -0
- package/dist/xmp/XmpMM.d.mts +2 -0
- package/dist/xmp/XmpMM.mjs +1 -0
- package/dist/xmp/XmpRights.d.mts +2 -0
- package/dist/xmp/XmpRights.mjs +1 -0
- package/dist/xmp/index.d.mts +15 -0
- package/dist/xmp/index.mjs +15 -0
- package/package.json +195 -3
- package/src/Dataset.ts +1085 -0
- package/src/Iri.ts +322 -0
- package/src/Isomorphism.ts +319 -0
- package/src/LanguageTag.ts +98 -0
- package/src/Namespace.ts +100 -0
- package/src/PrefixMap.ts +117 -0
- package/src/RdfJs.ts +146 -0
- package/src/Rdfs.ts +241 -0
- package/src/Reification.ts +103 -0
- package/src/Resource.ts +873 -0
- package/src/Serialization.ts +775 -0
- package/src/Term.ts +1300 -0
- package/src/TermCodec.ts +505 -0
- package/src/TermJson.ts +313 -0
- package/src/Vocab.ts +161 -0
- package/src/Xsd.ts +573 -0
- package/src/csvw/Csv2Json.ts +265 -0
- package/src/csvw/Csv2Rdf.ts +268 -0
- package/src/csvw/Datatype.ts +589 -0
- package/src/csvw/Metadata.ts +1523 -0
- package/src/csvw/Processor.ts +276 -0
- package/src/csvw/Report.ts +135 -0
- package/src/csvw/Table.ts +759 -0
- package/src/csvw/index.ts +22 -0
- package/src/csvw/internal/dateFormat.ts +202 -0
- package/src/csvw/internal/json.ts +104 -0
- package/src/csvw/internal/numberFormat.ts +369 -0
- package/src/csvw/internal/object.ts +23 -0
- package/src/csvw/internal/uriTemplate.ts +130 -0
- package/src/csvw/internal/url.ts +93 -0
- package/src/csvw/internal/vocab.ts +282 -0
- package/src/index.ts +40 -0
- package/src/internal/arbitrary.ts +148 -0
- package/src/internal/loop.ts +24 -0
- package/src/internal/pending.ts +20 -0
- package/src/internal/textDecoder.ts +183 -0
- package/src/jsonld/DocumentLoader.ts +512 -0
- package/src/jsonld/JsonLd.ts +847 -0
- package/src/jsonld/JsonLdError.ts +105 -0
- package/src/jsonld/index.ts +13 -0
- package/src/jsonld/internal/compact.ts +852 -0
- package/src/jsonld/internal/context.ts +781 -0
- package/src/jsonld/internal/expand.ts +614 -0
- package/src/jsonld/internal/flatten.ts +243 -0
- package/src/jsonld/internal/frame.ts +559 -0
- package/src/jsonld/internal/iri.ts +52 -0
- package/src/jsonld/internal/json.ts +19 -0
- package/src/jsonld/internal/linkHeader.ts +60 -0
- package/src/jsonld/internal/rdf.ts +481 -0
- package/src/jsonld/internal/util.ts +367 -0
- package/src/n3/Isomorphism.ts +476 -0
- package/src/n3/Mapping.ts +332 -0
- package/src/n3/Model.ts +696 -0
- package/src/n3/N3.ts +237 -0
- package/src/n3/Reasoner.ts +568 -0
- package/src/n3/Vocab.ts +111 -0
- package/src/n3/index.ts +21 -0
- package/src/n3/internal/builtins.ts +668 -0
- package/src/n3/internal/guards.ts +23 -0
- package/src/n3/internal/lists.ts +106 -0
- package/src/n3/internal/loop.ts +28 -0
- package/src/n3/internal/parser.ts +1032 -0
- package/src/n3/internal/writer.ts +344 -0
- package/src/ntriples/Grammar.ts +317 -0
- package/src/ntriples/Lexical.ts +321 -0
- package/src/ntriples/NQuads.ts +140 -0
- package/src/ntriples/NTriples.ts +143 -0
- package/src/ntriples/index.ts +14 -0
- package/src/ntriples/internal/codec.ts +229 -0
- package/src/ntriples/internal/lineParser.ts +326 -0
- package/src/ntriples/internal/loop.ts +14 -0
- package/src/rdfjson/RdfJson.ts +806 -0
- package/src/rdfjson/index.ts +9 -0
- package/src/rdfjson/internal/json.ts +19 -0
- package/src/rdfxml/RdfXml.ts +1408 -0
- package/src/rdfxml/Xml.ts +419 -0
- package/src/rdfxml/index.ts +11 -0
- package/src/rdfxml/internal/chars.ts +73 -0
- package/src/rdfxml/internal/loop.ts +24 -0
- package/src/rdfxml/internal/parser.ts +1265 -0
- package/src/shacl/Message.ts +102 -0
- package/src/shacl/Path.ts +483 -0
- package/src/shacl/Shapes.ts +913 -0
- package/src/shacl/Sparql.ts +128 -0
- package/src/shacl/ValidationReport.ts +438 -0
- package/src/shacl/Validator.ts +1156 -0
- package/src/shacl/Vocabulary.ts +180 -0
- package/src/shacl/index.ts +22 -0
- package/src/shacl/internal/compare.ts +128 -0
- package/src/shacl/internal/regex.ts +56 -0
- package/src/shex/SemAct.ts +197 -0
- package/src/shex/ShExC.ts +415 -0
- package/src/shex/ShExError.ts +71 -0
- package/src/shex/ShExJ.ts +893 -0
- package/src/shex/ShExR.ts +640 -0
- package/src/shex/ShapeMap.ts +385 -0
- package/src/shex/Structure.ts +467 -0
- package/src/shex/Validator.ts +395 -0
- package/src/shex/index.ts +24 -0
- package/src/shex/internal/engine.ts +682 -0
- package/src/shex/internal/iterate.ts +14 -0
- package/src/shex/internal/json.ts +12 -0
- package/src/shex/internal/lexer.ts +56 -0
- package/src/shex/internal/nodeConstraint.ts +368 -0
- package/src/shex/internal/shexcLexer.ts +387 -0
- package/src/shex/internal/shexcParser.ts +1312 -0
- package/src/shex/internal/tokens.ts +41 -0
- package/src/shex/internal/xpathRegex.ts +290 -0
- package/src/sparql/Algebra.ts +914 -0
- package/src/sparql/Ast.ts +1344 -0
- package/src/sparql/Bindings.ts +272 -0
- package/src/sparql/ClientErrors.ts +156 -0
- package/src/sparql/ClientFormats.ts +70 -0
- package/src/sparql/Engine.ts +699 -0
- package/src/sparql/Errors.ts +30 -0
- package/src/sparql/Expression.ts +360 -0
- package/src/sparql/Federation.ts +187 -0
- package/src/sparql/Functions.ts +689 -0
- package/src/sparql/Generator.ts +426 -0
- package/src/sparql/GraphStore.ts +341 -0
- package/src/sparql/Optimizer.ts +230 -0
- package/src/sparql/Options.ts +191 -0
- package/src/sparql/Parser.ts +173 -0
- package/src/sparql/Protocol.ts +342 -0
- package/src/sparql/ProtocolErrors.ts +113 -0
- package/src/sparql/QueryBuilder.ts +953 -0
- package/src/sparql/Results.ts +844 -0
- package/src/sparql/ResultsStream.ts +771 -0
- package/src/sparql/ServerFormats.ts +75 -0
- package/src/sparql/ServiceDescription.ts +130 -0
- package/src/sparql/SparqlClient.ts +947 -0
- package/src/sparql/SparqlServer.ts +528 -0
- package/src/sparql/Store.ts +311 -0
- package/src/sparql/TermSchema.ts +20 -0
- package/src/sparql/Testing.ts +114 -0
- package/src/sparql/Translate.ts +407 -0
- package/src/sparql/ai/Mcp.ts +43 -0
- package/src/sparql/ai/Tools.ts +481 -0
- package/src/sparql/ai/index.ts +11 -0
- package/src/sparql/index.ts +64 -0
- package/src/sparql/internal/evaluator.ts +947 -0
- package/src/sparql/internal/hash.ts +418 -0
- package/src/sparql/internal/json.ts +12 -0
- package/src/sparql/internal/lexer.ts +488 -0
- package/src/sparql/internal/loop.ts +24 -0
- package/src/sparql/internal/parser.ts +2215 -0
- package/src/sparql/internal/prefetch.ts +46 -0
- package/src/sparql/internal/stringMap.ts +39 -0
- package/src/sparql/internal/textResults.ts +226 -0
- package/src/sparql/internal/values.ts +550 -0
- package/src/sparql/shacl/Evaluator.ts +478 -0
- package/src/sparql/shacl/Query.ts +574 -0
- package/src/sparql/shacl/index.ts +12 -0
- package/src/sparql/sql/Dialect.ts +246 -0
- package/src/sparql/sql/SqlStore.ts +1080 -0
- package/src/sparql/sql/Translation.ts +1898 -0
- package/src/sparql/sql/index.ts +17 -0
- package/src/sparql/sql/internal/encoding.ts +313 -0
- package/src/turtle/Grammar.ts +286 -0
- package/src/turtle/Manifest.ts +215 -0
- package/src/turtle/TriG.ts +158 -0
- package/src/turtle/Turtle.ts +166 -0
- package/src/turtle/index.ts +14 -0
- package/src/turtle/internal/loop.ts +23 -0
- package/src/turtle/internal/parse.ts +112 -0
- package/src/turtle/internal/parser.ts +1303 -0
- package/src/turtle/internal/serialize.ts +79 -0
- package/src/turtle/internal/streamWriter.ts +128 -0
- package/src/turtle/internal/writer.ts +898 -0
- package/src/xmp/DublinCore.ts +147 -0
- package/src/xmp/Exif.ts +109 -0
- package/src/xmp/Extract.ts +351 -0
- package/src/xmp/Metadata.ts +703 -0
- package/src/xmp/Namespaces.ts +228 -0
- package/src/xmp/Packet.ts +297 -0
- package/src/xmp/Pdf.ts +99 -0
- package/src/xmp/PdfA.ts +280 -0
- package/src/xmp/Photoshop.ts +275 -0
- package/src/xmp/Tiff.ts +196 -0
- package/src/xmp/Xmp.ts +430 -0
- package/src/xmp/XmpBasic.ts +90 -0
- package/src/xmp/XmpMM.ts +82 -0
- package/src/xmp/XmpRights.ts +83 -0
- package/src/xmp/index.ts +36 -0
- package/src/xmp/internal/accessors.ts +72 -0
- package/src/xmp/internal/xml.ts +63 -0
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { B as isNamedNode, K as isTriple, O as defaultGraph, P as isDefaultGraph, Z as namedNode, d as Quad, o as Literal, rt as triple, z as isLiteral } from "./Term-CFLG1qu4.mjs";
|
|
3
|
+
import { o as fromEntries } from "./Bindings-Ck3m7JRC.mjs";
|
|
4
|
+
import { n as StoreError, t as QuadStore } from "./Store-DH3Ow1GO.mjs";
|
|
5
|
+
import { o as tables, r as fromClient } from "./Dialect-CzVH38uo.mjs";
|
|
6
|
+
import { c as isComponentIds, i as isRisky, l as rowKey, n as compile, o as decode, r as constants, s as encode } from "./Translation-DC9rLm2y.mjs";
|
|
7
|
+
import * as Arr from "effect/Array";
|
|
8
|
+
import * as MutableHashMap from "effect/MutableHashMap";
|
|
9
|
+
import * as MutableHashSet from "effect/MutableHashSet";
|
|
10
|
+
import * as Option from "effect/Option";
|
|
11
|
+
import * as Predicate from "effect/Predicate";
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Order from "effect/Order";
|
|
14
|
+
import * as Context from "effect/Context";
|
|
15
|
+
import * as Layer from "effect/Layer";
|
|
16
|
+
import * as Stream from "effect/Stream";
|
|
17
|
+
import * as Result from "effect/Result";
|
|
18
|
+
import * as Migrator from "effect/sql/Migrator";
|
|
19
|
+
import * as SqlClient from "effect/sql/SqlClient";
|
|
20
|
+
import * as SqlError from "effect/sql/SqlError";
|
|
21
|
+
// src/sparql/sql/SqlStore.ts
|
|
22
|
+
/**
|
|
23
|
+
* A SQL storage backend for the SPARQL engine, built on Effect's SQL
|
|
24
|
+
* abstraction (`effect/sql`).
|
|
25
|
+
*
|
|
26
|
+
* The store keeps a dictionary of interned terms (RDF 1.2 triple terms
|
|
27
|
+
* included, referencing their components) and a table of quads of term ids
|
|
28
|
+
* indexed in four orders (`spog`, `posg`, `ospg`, `gspo`). It implements the
|
|
29
|
+
* `QuadStore` service of `@thomasfosterau/effect-rdf/sparql` — streaming pattern
|
|
30
|
+
* matching, statistics, updates, named graph management and transactions
|
|
31
|
+
* (mapped to `SqlClient.withTransaction`) — and a `QueryCapability` that
|
|
32
|
+
* translates SPARQL algebra to SQL (see `Translation`), so that the engine
|
|
33
|
+
* runs whole queries (or the largest translatable subtrees) in the database.
|
|
34
|
+
*
|
|
35
|
+
* The store is driver-agnostic: `layer` runs over whichever `SqlClient`
|
|
36
|
+
* the context provides, in the SQLite (3.35 or later) or PostgreSQL dialect
|
|
37
|
+
* (`Dialect.fromClient`). A backend for one driver (a ready store layer that
|
|
38
|
+
* also provides that driver's `SqlClient`) is a package of its own,
|
|
39
|
+
* `@thomasfosterau/effect-sparql-<driver>`.
|
|
40
|
+
*
|
|
41
|
+
* @since 0.1.0
|
|
42
|
+
*/
|
|
43
|
+
var SqlStore_exports = /* @__PURE__ */ __exportAll({
|
|
44
|
+
SqlStore: () => SqlStore,
|
|
45
|
+
layer: () => layer,
|
|
46
|
+
make: () => make,
|
|
47
|
+
migrate: () => migrate,
|
|
48
|
+
migrations: () => migrations
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* The SQL store service.
|
|
52
|
+
*
|
|
53
|
+
* @since 0.1.0
|
|
54
|
+
* @category services
|
|
55
|
+
*/
|
|
56
|
+
var SqlStore = class extends Context.Service()("@thomasfosterau/effect-rdf/sparql/sql/SqlStore") {};
|
|
57
|
+
const storeError = (message) => (cause) => cause instanceof StoreError ? cause : new StoreError({
|
|
58
|
+
message: `${message}: ${Predicate.isError(cause) ? cause.message : String(cause)}`,
|
|
59
|
+
cause
|
|
60
|
+
});
|
|
61
|
+
const chunks = (items, size) => Array.from({ length: Math.ceil(items.length / size) }, (_, i) => items.slice(i * size, (i + 1) * size));
|
|
62
|
+
/** The distinct values of `items`, in order of first occurrence. */
|
|
63
|
+
const distinct = (items) => Arr.fromIterable(MutableHashSet.fromIterable(items));
|
|
64
|
+
const num = (v) => Predicate.isNumber(v) ? v : Number(v);
|
|
65
|
+
const str = (v) => Predicate.isString(v) ? v : Predicate.isNumber(v) || Predicate.isBigInt(v) || Predicate.isBoolean(v) ? `${v}` : "";
|
|
66
|
+
const depth = (t) => isTriple(t) ? 1 + Math.max(depth(t.subject), depth(t.predicate), depth(t.object)) : 0;
|
|
67
|
+
const CACHE_LIMIT = 2e5;
|
|
68
|
+
const DEFAULT_DATASET = {
|
|
69
|
+
defaultGraph: "default",
|
|
70
|
+
namedGraphs: "all"
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The schema migrations of the store (for `effect/sql/Migrator`): a record of
|
|
74
|
+
* `<id>_<name>` to migration effect.
|
|
75
|
+
*
|
|
76
|
+
* @since 0.1.0
|
|
77
|
+
* @category schema
|
|
78
|
+
*/
|
|
79
|
+
const migrations = (dialect, tables) => ({ "1_create_rdf_store": Effect.gen(function* () {
|
|
80
|
+
const sql = yield* SqlClient.SqlClient;
|
|
81
|
+
yield* Effect.forEach(dialect.schema(tables), (statement) => sql.unsafe(statement), {
|
|
82
|
+
concurrency: 1,
|
|
83
|
+
discard: true
|
|
84
|
+
});
|
|
85
|
+
}) });
|
|
86
|
+
/**
|
|
87
|
+
* Creates or migrates the store's schema.
|
|
88
|
+
*
|
|
89
|
+
* @since 0.1.0
|
|
90
|
+
* @category schema
|
|
91
|
+
*/
|
|
92
|
+
const migrate = (options = {}) => Effect.gen(function* () {
|
|
93
|
+
const sql = yield* SqlClient.SqlClient;
|
|
94
|
+
const dialect = options.dialect ?? (yield* fromClient(sql));
|
|
95
|
+
const tables$2 = tables(options.tablePrefix);
|
|
96
|
+
yield* Migrator.make({})({
|
|
97
|
+
loader: Migrator.fromRecord(migrations(dialect, tables$2)),
|
|
98
|
+
table: tables$2.migrations
|
|
99
|
+
});
|
|
100
|
+
}).pipe(Effect.mapError(storeError("Migration failed")));
|
|
101
|
+
/**
|
|
102
|
+
* The term with id `id` of a decode state that `complete` has filled: every
|
|
103
|
+
* id is known, so a missing one is a defect.
|
|
104
|
+
*/
|
|
105
|
+
const termOf = (state, id) => {
|
|
106
|
+
const known = MutableHashMap.get(state.known, id);
|
|
107
|
+
if (Option.isSome(known)) return known.value;
|
|
108
|
+
const comps = MutableHashMap.get(state.triples, id);
|
|
109
|
+
if (Option.isNone(comps)) throw new StoreError({ message: `Unknown term id ${id}` });
|
|
110
|
+
const [s, p, o] = comps.value;
|
|
111
|
+
const t = triple(termAs(state, s, isSubject, "subject"), termAs(state, p, isNamedNode, "predicate"), termOf(state, o));
|
|
112
|
+
MutableHashMap.set(state.known, id, t);
|
|
113
|
+
return t;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The term with id `id`, which the store only ever wrote in a position of
|
|
117
|
+
* kind `T` (so another kind is a defect).
|
|
118
|
+
*/
|
|
119
|
+
const termAs = (state, id, is, position) => {
|
|
120
|
+
const t = termOf(state, id);
|
|
121
|
+
if (is(t)) return t;
|
|
122
|
+
throw new StoreError({ message: `Term id ${id} cannot be a ${position}` });
|
|
123
|
+
};
|
|
124
|
+
const isSubject = (t) => !isLiteral(t);
|
|
125
|
+
const isGraphName = (t) => !isLiteral(t) && !isTriple(t);
|
|
126
|
+
/** The dictionary key of a `id, kind, value, datatype, lang, dir` result row. */
|
|
127
|
+
const rowKeyOf = (r) => rowKey({
|
|
128
|
+
kind: num(r[1]),
|
|
129
|
+
value: str(r[2]),
|
|
130
|
+
datatype: str(r[3]),
|
|
131
|
+
lang: str(r[4]),
|
|
132
|
+
dir: str(r[5])
|
|
133
|
+
});
|
|
134
|
+
const withKey = (term, row) => ({
|
|
135
|
+
term,
|
|
136
|
+
row,
|
|
137
|
+
key: rowKey(row)
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* The dictionary rows of one depth level of terms; a triple term whose
|
|
141
|
+
* components have no id yet is left out.
|
|
142
|
+
*/
|
|
143
|
+
const encodeLevel = (level, ids) => Arr.filterMap(MutableHashMap.values(level), (t) => {
|
|
144
|
+
if (!isTriple(t)) return Result.succeed(withKey(t, encode(t)));
|
|
145
|
+
const s = MutableHashMap.get(ids, t.subject.key);
|
|
146
|
+
const p = MutableHashMap.get(ids, t.predicate.key);
|
|
147
|
+
const o = MutableHashMap.get(ids, t.object.key);
|
|
148
|
+
return Option.isSome(s) && Option.isSome(p) && Option.isSome(o) ? Result.succeed(withKey(t, encode(t, [
|
|
149
|
+
s.value,
|
|
150
|
+
p.value,
|
|
151
|
+
o.value
|
|
152
|
+
]))) : Result.failVoid;
|
|
153
|
+
});
|
|
154
|
+
const newState = () => ({
|
|
155
|
+
known: MutableHashMap.empty(),
|
|
156
|
+
triples: MutableHashMap.empty()
|
|
157
|
+
});
|
|
158
|
+
const isResolved = (state, c) => Option.isSome(MutableHashMap.get(state.known, c)) || Option.isSome(MutableHashMap.get(state.triples, c));
|
|
159
|
+
/** The id of a term or graph (`0` for the default graph), if it has one. */
|
|
160
|
+
const idIn = (ids, t) => isDefaultGraph(t) ? Option.some(0) : MutableHashMap.get(ids, t.key);
|
|
161
|
+
/** The `s, p, o, g` ids of a quad, if all its terms have one. */
|
|
162
|
+
const quadRow = (ids, q) => {
|
|
163
|
+
const s = MutableHashMap.get(ids, q.subject.key);
|
|
164
|
+
const p = MutableHashMap.get(ids, q.predicate.key);
|
|
165
|
+
const o = MutableHashMap.get(ids, q.object.key);
|
|
166
|
+
const g = idIn(ids, q.graph);
|
|
167
|
+
return Option.isSome(s) && Option.isSome(p) && Option.isSome(o) && Option.isSome(g) ? Result.succeed([
|
|
168
|
+
s.value,
|
|
169
|
+
p.value,
|
|
170
|
+
o.value,
|
|
171
|
+
g.value
|
|
172
|
+
]) : Result.failVoid;
|
|
173
|
+
};
|
|
174
|
+
const INDEXES = [
|
|
175
|
+
[
|
|
176
|
+
"s",
|
|
177
|
+
"p",
|
|
178
|
+
"o",
|
|
179
|
+
"g"
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
"p",
|
|
183
|
+
"o",
|
|
184
|
+
"s",
|
|
185
|
+
"g"
|
|
186
|
+
],
|
|
187
|
+
[
|
|
188
|
+
"o",
|
|
189
|
+
"s",
|
|
190
|
+
"p",
|
|
191
|
+
"g"
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
"g",
|
|
195
|
+
"s",
|
|
196
|
+
"p",
|
|
197
|
+
"o"
|
|
198
|
+
]
|
|
199
|
+
];
|
|
200
|
+
/** The number of leading columns of an index that are bound. */
|
|
201
|
+
const boundPrefix = (idx, bound) => {
|
|
202
|
+
const i = idx.findIndex((c) => !MutableHashSet.has(bound, c));
|
|
203
|
+
return i < 0 ? idx.length : i;
|
|
204
|
+
};
|
|
205
|
+
const indexFor = (bound) => {
|
|
206
|
+
const first = {
|
|
207
|
+
best: INDEXES[0],
|
|
208
|
+
prefix: -1
|
|
209
|
+
};
|
|
210
|
+
return Arr.reduce(INDEXES, first, (acc, idx) => {
|
|
211
|
+
const n = boundPrefix(idx, bound);
|
|
212
|
+
return n > acc.prefix ? {
|
|
213
|
+
best: idx,
|
|
214
|
+
prefix: n
|
|
215
|
+
} : acc;
|
|
216
|
+
}).best;
|
|
217
|
+
};
|
|
218
|
+
const columnLayout = (columns) => Arr.mapAccum(columns, 0, (at, column) => [at + (column.type === "int" ? 1 : 6), {
|
|
219
|
+
column,
|
|
220
|
+
at
|
|
221
|
+
}])[1];
|
|
222
|
+
/**
|
|
223
|
+
* Creates a SQL store over the `SqlClient` service.
|
|
224
|
+
*
|
|
225
|
+
* @since 0.1.0
|
|
226
|
+
* @category constructors
|
|
227
|
+
*/
|
|
228
|
+
const make = (options = {}) => Effect.gen(function* () {
|
|
229
|
+
const sql = yield* SqlClient.SqlClient;
|
|
230
|
+
const dialect = options.dialect ?? (yield* Effect.mapError(fromClient(sql), storeError("Unsupported database")));
|
|
231
|
+
const tables$1 = tables(options.tablePrefix);
|
|
232
|
+
if (options.migrate !== false) yield* migrate({
|
|
233
|
+
dialect,
|
|
234
|
+
tablePrefix: options.tablePrefix
|
|
235
|
+
});
|
|
236
|
+
const T = tables$1.terms;
|
|
237
|
+
const Qt = tables$1.quads;
|
|
238
|
+
const Gt = tables$1.graphs;
|
|
239
|
+
const batchSize = Math.max(1, Math.min(options.batchSize ?? 500, 1e3));
|
|
240
|
+
const pageSize = Math.max(1, options.pageSize ?? 5e3);
|
|
241
|
+
const onQuery = options.onQuery;
|
|
242
|
+
const ph = dialect.placeholder;
|
|
243
|
+
const idCache = MutableHashMap.empty();
|
|
244
|
+
const termCache = MutableHashMap.empty();
|
|
245
|
+
const inTransaction = Effect.map(Effect.serviceOption(sql.transactionService), Option.isSome);
|
|
246
|
+
const run = (text, params = []) => sql.unsafe(text, params).values;
|
|
247
|
+
const exec = (text, params = []) => Effect.asVoid(sql.unsafe(text, params).raw);
|
|
248
|
+
const lookupRows = (rows) => {
|
|
249
|
+
const found = MutableHashMap.empty();
|
|
250
|
+
const values = distinct(rows.map((r) => r.row.value));
|
|
251
|
+
return Effect.as(Effect.forEach(chunks(values, 500), (chunk) => {
|
|
252
|
+
const list = chunk.map((_, i) => dialect.valueKey(dialect.castText(ph(i + 1)))).join(", ");
|
|
253
|
+
return Effect.map(run(`SELECT id, kind, value, datatype, lang, dir FROM ${T} WHERE ${dialect.valueKey("value")} IN (${list})`, chunk), (result) => result.forEach((r) => {
|
|
254
|
+
MutableHashMap.set(found, rowKeyOf(r), num(r[0]));
|
|
255
|
+
}));
|
|
256
|
+
}, {
|
|
257
|
+
concurrency: 1,
|
|
258
|
+
discard: true
|
|
259
|
+
}), found);
|
|
260
|
+
};
|
|
261
|
+
/** Inserts dictionary rows; returns the ids of the rows that were new. */
|
|
262
|
+
const insertRows = (rows) => Effect.gen(function* () {
|
|
263
|
+
const inserted = MutableHashMap.empty();
|
|
264
|
+
yield* Effect.forEach(chunks(rows, 500), Effect.fnUntraced(function* (chunk) {
|
|
265
|
+
const params = [];
|
|
266
|
+
const tuples = chunk.map(({ row: r }) => {
|
|
267
|
+
const base = params.length;
|
|
268
|
+
params.push(r.kind, r.value, r.datatype, r.lang, r.dir, Option.getOrNull(r.sub), Option.getOrNull(r.pre), Option.getOrNull(r.obj), r.cls, Option.getOrNull(r.num));
|
|
269
|
+
return `(${Array.from({ length: 10 }, (_, i) => {
|
|
270
|
+
const p = ph(base + i + 1);
|
|
271
|
+
return i >= 1 && i <= 4 ? dialect.castText(p) : i === 9 ? dialect.castDouble(p) : dialect.castId(p);
|
|
272
|
+
}).join(", ")})`;
|
|
273
|
+
});
|
|
274
|
+
(yield* run(`INSERT INTO ${T} (kind, value, datatype, lang, dir, sub, pre, obj, cls, num) VALUES ${tuples.join(", ")} ON CONFLICT DO NOTHING RETURNING id, kind, value, datatype, lang, dir`, params)).forEach((r) => {
|
|
275
|
+
MutableHashMap.set(inserted, rowKeyOf(r), num(r[0]));
|
|
276
|
+
});
|
|
277
|
+
}), {
|
|
278
|
+
concurrency: 1,
|
|
279
|
+
discard: true
|
|
280
|
+
});
|
|
281
|
+
const classes = distinct(rows.map((r) => r.row.cls));
|
|
282
|
+
if (Arr.isReadonlyArrayNonEmpty(classes)) yield* exec(`INSERT INTO ${tables$1.classes} (cls) VALUES ${classes.map((c) => `(${c})`).join(", ")} ON CONFLICT DO NOTHING`);
|
|
283
|
+
return inserted;
|
|
284
|
+
});
|
|
285
|
+
/**
|
|
286
|
+
* The ids of dictionary rows (none for a row not in the dictionary). With
|
|
287
|
+
* `create`, rows are inserted first (new rows come back with their ids) and
|
|
288
|
+
* the rest looked up.
|
|
289
|
+
*/
|
|
290
|
+
const findIds = (rows, create) => Effect.gen(function* () {
|
|
291
|
+
if (!create) {
|
|
292
|
+
const found = yield* lookupRows(rows);
|
|
293
|
+
return rows.map((encoded) => ({
|
|
294
|
+
encoded,
|
|
295
|
+
id: MutableHashMap.get(found, encoded.key)
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
const inserted = yield* insertRows(rows);
|
|
299
|
+
const first = rows.map((encoded) => ({
|
|
300
|
+
encoded,
|
|
301
|
+
id: MutableHashMap.get(inserted, encoded.key)
|
|
302
|
+
}));
|
|
303
|
+
const existing = first.filter(({ id }) => Option.isNone(id)).map(({ encoded }) => encoded);
|
|
304
|
+
if (Arr.isReadonlyArrayEmpty(existing)) return first;
|
|
305
|
+
const more = yield* lookupRows(existing);
|
|
306
|
+
return first.map((f) => Option.isSome(f.id) ? f : {
|
|
307
|
+
encoded: f.encoded,
|
|
308
|
+
id: MutableHashMap.get(more, f.encoded.key)
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
/**
|
|
312
|
+
* The dictionary ids of terms (by key). With `create`, missing terms are
|
|
313
|
+
* interned; otherwise they are absent from the result.
|
|
314
|
+
*/
|
|
315
|
+
const resolveTerms = (terms, create) => Effect.gen(function* () {
|
|
316
|
+
const cacheable = !(yield* inTransaction);
|
|
317
|
+
const result = MutableHashMap.empty();
|
|
318
|
+
const levels = MutableHashMap.empty();
|
|
319
|
+
const levelAt = (d) => {
|
|
320
|
+
const found = MutableHashMap.get(levels, d);
|
|
321
|
+
if (Option.isSome(found)) return found.value;
|
|
322
|
+
const level = MutableHashMap.empty();
|
|
323
|
+
MutableHashMap.set(levels, d, level);
|
|
324
|
+
return level;
|
|
325
|
+
};
|
|
326
|
+
const add = (t) => {
|
|
327
|
+
if (Option.isSome(MutableHashMap.get(result, t.key))) return;
|
|
328
|
+
const cached = MutableHashMap.get(idCache, t.key);
|
|
329
|
+
if (Option.isSome(cached)) {
|
|
330
|
+
MutableHashMap.set(result, t.key, cached.value);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const level = levelAt(depth(t));
|
|
334
|
+
if (Option.isSome(MutableHashMap.get(level, t.key))) return;
|
|
335
|
+
MutableHashMap.set(level, t.key, t);
|
|
336
|
+
if (isTriple(t)) {
|
|
337
|
+
add(t.subject);
|
|
338
|
+
add(t.predicate);
|
|
339
|
+
add(t.object);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
Arr.fromIterable(terms).forEach((t) => add(t));
|
|
343
|
+
const depths = Arr.sort(MutableHashMap.keys(levels), Order.Number);
|
|
344
|
+
yield* Effect.forEach(depths, Effect.fnUntraced(function* (d) {
|
|
345
|
+
const rows = encodeLevel(levelAt(d), result);
|
|
346
|
+
if (Arr.isReadonlyArrayEmpty(rows)) return;
|
|
347
|
+
(yield* findIds(rows, create)).forEach(({ encoded: { term }, id }) => {
|
|
348
|
+
if (Option.isNone(id)) return;
|
|
349
|
+
MutableHashMap.set(result, term.key, id.value);
|
|
350
|
+
if (cacheable) {
|
|
351
|
+
if (MutableHashMap.size(idCache) >= CACHE_LIMIT) MutableHashMap.clear(idCache);
|
|
352
|
+
MutableHashMap.set(idCache, term.key, id.value);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
}), {
|
|
356
|
+
concurrency: 1,
|
|
357
|
+
discard: true
|
|
358
|
+
});
|
|
359
|
+
return result;
|
|
360
|
+
});
|
|
361
|
+
/**
|
|
362
|
+
* Records the term with id `id` whose `kind, value, datatype, lang, dir`
|
|
363
|
+
* columns start at `row[at]` (`kind` is SQL `NULL` for an id with no term
|
|
364
|
+
* row).
|
|
365
|
+
*/
|
|
366
|
+
const addRow = (state, id, row, at) => {
|
|
367
|
+
if (isResolved(state, id)) return;
|
|
368
|
+
const cached = MutableHashMap.get(termCache, id);
|
|
369
|
+
if (Option.isSome(cached)) {
|
|
370
|
+
MutableHashMap.set(state.known, id, cached.value);
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const kind = row[at];
|
|
374
|
+
if (Predicate.isNullish(kind)) return;
|
|
375
|
+
const t = decode(num(kind), str(row[at + 1]), str(row[at + 2]), str(row[at + 3]), str(row[at + 4]));
|
|
376
|
+
if (isComponentIds(t)) MutableHashMap.set(state.triples, id, t);
|
|
377
|
+
else MutableHashMap.set(state.known, id, t);
|
|
378
|
+
};
|
|
379
|
+
/** Reads the dictionary rows of `ids` (one chunk) into a decode state. */
|
|
380
|
+
const fetchTerms = (state, ids) => Effect.map(run(`SELECT id, kind, value, datatype, lang, dir FROM ${T} WHERE id IN (${ids.join(", ")})`), (rows) => rows.forEach((r) => {
|
|
381
|
+
addRow(state, num(r[0]), r, 1);
|
|
382
|
+
}));
|
|
383
|
+
/** Fetches the components of the triple terms of a decode state, until none is missing. */
|
|
384
|
+
const complete = (state) => Effect.suspend(() => {
|
|
385
|
+
const missing = MutableHashSet.empty();
|
|
386
|
+
MutableHashMap.forEach(state.triples, (comps) => comps.forEach((c) => {
|
|
387
|
+
if (!isResolved(state, c)) MutableHashSet.add(missing, c);
|
|
388
|
+
}));
|
|
389
|
+
const unknown = Arr.filter(Arr.fromIterable(missing), (c) => Option.match(MutableHashMap.get(termCache, c), {
|
|
390
|
+
onNone: () => true,
|
|
391
|
+
onSome: (cached) => {
|
|
392
|
+
MutableHashMap.set(state.known, c, cached);
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
}));
|
|
396
|
+
if (Arr.isReadonlyArrayEmpty(unknown)) return Effect.void;
|
|
397
|
+
return Effect.forEach(chunks(unknown, 500), (chunk) => Effect.flatMap(fetchTerms(state, chunk), () => Option.match(Arr.findFirst(chunk, (c) => !isResolved(state, c)), {
|
|
398
|
+
onNone: () => Effect.void,
|
|
399
|
+
onSome: (c) => Effect.fail(new StoreError({ message: `Unknown term id ${c}` }))
|
|
400
|
+
})), {
|
|
401
|
+
concurrency: 1,
|
|
402
|
+
discard: true
|
|
403
|
+
}).pipe(Effect.flatMap(() => complete(state)));
|
|
404
|
+
});
|
|
405
|
+
const remember = (state) => Effect.map(inTransaction, (inTx) => {
|
|
406
|
+
if (inTx) return;
|
|
407
|
+
if (MutableHashMap.size(termCache) + MutableHashMap.size(state.known) > CACHE_LIMIT) MutableHashMap.clear(termCache);
|
|
408
|
+
MutableHashMap.forEach(state.known, (t, id) => {
|
|
409
|
+
MutableHashMap.set(termCache, id, t);
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
const patternConditions = (pattern) => Effect.gen(function* () {
|
|
413
|
+
const positions = [
|
|
414
|
+
["s", pattern.subject],
|
|
415
|
+
["p", pattern.predicate],
|
|
416
|
+
["o", pattern.object],
|
|
417
|
+
["g", pattern.graph]
|
|
418
|
+
];
|
|
419
|
+
const present = Arr.filterMap(positions, ([column, t]) => t === void 0 ? Result.failVoid : Result.succeed({
|
|
420
|
+
column,
|
|
421
|
+
t
|
|
422
|
+
}));
|
|
423
|
+
const ids = yield* resolveTerms(Arr.filterMap(present, ({ t }) => isDefaultGraph(t) ? Result.failVoid : Result.succeed(t)), false);
|
|
424
|
+
return Option.all(present.map(({ column, t }) => Option.map(idIn(ids, t), (id) => [column, id])));
|
|
425
|
+
});
|
|
426
|
+
const decodeQuads = (rows) => Effect.gen(function* () {
|
|
427
|
+
const state = newState();
|
|
428
|
+
rows.forEach((r) => {
|
|
429
|
+
addRow(state, num(r[0]), r, 4);
|
|
430
|
+
addRow(state, num(r[1]), r, 9);
|
|
431
|
+
addRow(state, num(r[2]), r, 14);
|
|
432
|
+
const g = num(r[3]);
|
|
433
|
+
if (g !== 0) addRow(state, g, r, 19);
|
|
434
|
+
});
|
|
435
|
+
yield* complete(state);
|
|
436
|
+
yield* remember(state);
|
|
437
|
+
return rows.map((r) => {
|
|
438
|
+
const g = num(r[3]);
|
|
439
|
+
return new Quad(termAs(state, num(r[0]), isSubject, "subject"), termAs(state, num(r[1]), isNamedNode, "predicate"), termOf(state, num(r[2])), g === 0 ? defaultGraph : termAs(state, g, isGraphName, "graph name"));
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
const match = (pattern) => Stream.unwrap(Effect.gen(function* () {
|
|
443
|
+
const conds = yield* patternConditions(pattern);
|
|
444
|
+
if (Option.isNone(conds)) return Stream.empty;
|
|
445
|
+
const bound = MutableHashSet.fromIterable(conds.value.map(([c]) => c));
|
|
446
|
+
const order = indexFor(bound);
|
|
447
|
+
const where = conds.value.map(([c, id]) => `${c} = ${id}`);
|
|
448
|
+
const attrs = [
|
|
449
|
+
"s",
|
|
450
|
+
"p",
|
|
451
|
+
"o",
|
|
452
|
+
"g"
|
|
453
|
+
].map((c) => `m${c}.kind, m${c}.value, m${c}.datatype, m${c}.lang, m${c}.dir`).join(", ");
|
|
454
|
+
const joins = [
|
|
455
|
+
"s",
|
|
456
|
+
"p",
|
|
457
|
+
"o",
|
|
458
|
+
"g"
|
|
459
|
+
].map((c) => ` LEFT JOIN ${T} m${c} ON m${c}.id = q.${c}`).join("");
|
|
460
|
+
const page = (after) => {
|
|
461
|
+
const w = Option.match(after, {
|
|
462
|
+
onNone: () => where,
|
|
463
|
+
onSome: (cursor) => [...where, `(${order.join(", ")}) > (${cursor.join(", ")})`]
|
|
464
|
+
});
|
|
465
|
+
return `SELECT q.s, q.p, q.o, q.g, ${attrs} FROM (SELECT s, p, o, g FROM ${Qt}${Arr.isReadonlyArrayNonEmpty(w) ? ` WHERE ${w.join(" AND ")}` : ""} ORDER BY ${order.join(", ")} LIMIT ${pageSize}) q${joins}`;
|
|
466
|
+
};
|
|
467
|
+
return Stream.paginate(Option.none(), (after) => Effect.gen(function* () {
|
|
468
|
+
const rows = yield* run(page(after));
|
|
469
|
+
return [yield* decodeQuads(rows), rows.length < pageSize ? Option.none() : Option.map(Arr.last(rows), (last) => Option.some(order.map((c) => num(last[[
|
|
470
|
+
"s",
|
|
471
|
+
"p",
|
|
472
|
+
"o",
|
|
473
|
+
"g"
|
|
474
|
+
].indexOf(c)]))))];
|
|
475
|
+
}));
|
|
476
|
+
})).pipe(Stream.mapError(storeError("match failed")));
|
|
477
|
+
const countWhere = (pattern, limit) => Effect.gen(function* () {
|
|
478
|
+
const conds = yield* patternConditions(pattern);
|
|
479
|
+
if (Option.isNone(conds)) return 0;
|
|
480
|
+
const where = conds.value.map(([c, id]) => `${c} = ${id}`);
|
|
481
|
+
const filter = Arr.isReadonlyArrayNonEmpty(where) ? ` WHERE ${where.join(" AND ")}` : "";
|
|
482
|
+
const rows = yield* run(Option.match(limit, {
|
|
483
|
+
onNone: () => `SELECT COUNT(*) FROM ${Qt}${filter}`,
|
|
484
|
+
onSome: (n) => `SELECT COUNT(*) FROM (SELECT 1 FROM ${Qt}${filter} LIMIT ${n}) x`
|
|
485
|
+
}));
|
|
486
|
+
return num(rows[0]?.[0] ?? 0);
|
|
487
|
+
}).pipe(Effect.mapError(storeError("count failed")));
|
|
488
|
+
const quadIds = (quads, create) => Effect.gen(function* () {
|
|
489
|
+
const list = Arr.fromIterable(quads);
|
|
490
|
+
const terms = [];
|
|
491
|
+
list.forEach((q) => {
|
|
492
|
+
terms.push(q.subject, q.predicate, q.object);
|
|
493
|
+
if (!isDefaultGraph(q.graph)) terms.push(q.graph);
|
|
494
|
+
});
|
|
495
|
+
const ids = yield* resolveTerms(terms, create);
|
|
496
|
+
return Arr.filterMap(list, (q) => quadRow(ids, q));
|
|
497
|
+
});
|
|
498
|
+
const tuples = (rows) => {
|
|
499
|
+
const params = [];
|
|
500
|
+
return {
|
|
501
|
+
text: rows.map((r) => {
|
|
502
|
+
const base = params.length;
|
|
503
|
+
params.push(...r);
|
|
504
|
+
return `(${r.map((_, i) => dialect.castId(ph(base + i + 1))).join(", ")})`;
|
|
505
|
+
}).join(", "),
|
|
506
|
+
params
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
/** Runs one statement per `batchSize` quad-id rows, `statement` building it from the tuples. */
|
|
510
|
+
const execBatches = (rows, statement) => Effect.forEach(chunks(rows, batchSize), (chunk) => {
|
|
511
|
+
const { text, params } = tuples(chunk);
|
|
512
|
+
return exec(statement(text), params);
|
|
513
|
+
}, {
|
|
514
|
+
concurrency: 1,
|
|
515
|
+
discard: true
|
|
516
|
+
});
|
|
517
|
+
const insert = (quads) => sql.withTransaction(Effect.gen(function* () {
|
|
518
|
+
const list = Array.from(quads);
|
|
519
|
+
yield* Effect.forEach(chunks(list, batchSize * 4), (batch) => Effect.flatMap(quadIds(batch, true), (rows) => execBatches(rows, (text) => `INSERT INTO ${Qt} (s, p, o, g) VALUES ${text} ON CONFLICT DO NOTHING`)), {
|
|
520
|
+
concurrency: 1,
|
|
521
|
+
discard: true
|
|
522
|
+
});
|
|
523
|
+
})).pipe(Effect.mapError(storeError("insert failed")));
|
|
524
|
+
const del = (quads) => sql.withTransaction(Effect.gen(function* () {
|
|
525
|
+
const rows = yield* quadIds(quads, false);
|
|
526
|
+
yield* execBatches(rows, (text) => `DELETE FROM ${Qt} WHERE (s, p, o, g) IN (VALUES ${text})`);
|
|
527
|
+
})).pipe(Effect.mapError(storeError("delete failed")));
|
|
528
|
+
const decodeIds = (ids) => Effect.gen(function* () {
|
|
529
|
+
const state = newState();
|
|
530
|
+
yield* Effect.forEach(chunks(ids, 500), (chunk) => fetchTerms(state, chunk), {
|
|
531
|
+
concurrency: 1,
|
|
532
|
+
discard: true
|
|
533
|
+
});
|
|
534
|
+
yield* complete(state);
|
|
535
|
+
yield* remember(state);
|
|
536
|
+
return ids.map((id) => termAs(state, id, isGraphName, "graph name"));
|
|
537
|
+
});
|
|
538
|
+
const graphs = Stream.unwrap(Effect.gen(function* () {
|
|
539
|
+
const rows = yield* run(`SELECT id FROM ${Gt} UNION SELECT DISTINCT g FROM ${Qt} WHERE g <> 0`);
|
|
540
|
+
return Stream.fromArray(yield* decodeIds(rows.map((r) => num(r[0]))));
|
|
541
|
+
})).pipe(Stream.mapError(storeError("graphs failed")));
|
|
542
|
+
const graphIdOf = (graph, create) => Effect.map(resolveTerms([graph], create), (ids) => MutableHashMap.get(ids, graph.key));
|
|
543
|
+
const hasGraph = (graph) => Effect.gen(function* () {
|
|
544
|
+
const found = yield* graphIdOf(graph, false);
|
|
545
|
+
if (Option.isNone(found)) return false;
|
|
546
|
+
const id = found.value;
|
|
547
|
+
const rows = yield* run(`SELECT 1 WHERE EXISTS (SELECT 1 FROM ${Gt} WHERE id = ${id}) OR EXISTS (SELECT 1 FROM ${Qt} WHERE g = ${id})`);
|
|
548
|
+
return Arr.isReadonlyArrayNonEmpty(rows);
|
|
549
|
+
}).pipe(Effect.mapError(storeError("hasGraph failed")));
|
|
550
|
+
const createGraph = (graph) => sql.withTransaction(Effect.gen(function* () {
|
|
551
|
+
const id = yield* graphIdOf(graph, true);
|
|
552
|
+
if (Option.isNone(id)) return;
|
|
553
|
+
yield* exec(`INSERT INTO ${Gt} (id) VALUES (${id.value}) ON CONFLICT DO NOTHING`);
|
|
554
|
+
})).pipe(Effect.mapError(storeError("createGraph failed")));
|
|
555
|
+
const dropGraph = (graph) => sql.withTransaction(Effect.gen(function* () {
|
|
556
|
+
const id = yield* graphIdOf(graph, false);
|
|
557
|
+
if (Option.isNone(id)) return;
|
|
558
|
+
yield* exec(`DELETE FROM ${Qt} WHERE g = ${id.value}`);
|
|
559
|
+
yield* exec(`DELETE FROM ${Gt} WHERE id = ${id.value}`);
|
|
560
|
+
})).pipe(Effect.mapError(storeError("dropGraph failed")));
|
|
561
|
+
const clear = (graph) => Effect.gen(function* () {
|
|
562
|
+
const id = isDefaultGraph(graph) ? Option.some(0) : yield* graphIdOf(graph, false);
|
|
563
|
+
if (Option.isNone(id)) return;
|
|
564
|
+
yield* exec(`DELETE FROM ${Qt} WHERE g = ${id.value}`);
|
|
565
|
+
}).pipe(Effect.mapError(storeError("clear failed")));
|
|
566
|
+
const transaction = (effect) => sql.withTransaction(effect).pipe(Effect.mapError((e) => SqlError.isSqlError(e) ? storeError("transaction failed")(e) : e));
|
|
567
|
+
const storeClasses = Effect.map(run(`SELECT cls FROM ${tables$1.classes}`), (rows) => new Set(rows.map((r) => num(r[0]))));
|
|
568
|
+
const translationContext = (context) => ({
|
|
569
|
+
dialect,
|
|
570
|
+
tables: tables$1,
|
|
571
|
+
dataset: context?.dataset ?? DEFAULT_DATASET,
|
|
572
|
+
activeGraph: context?.activeGraph ?? { _tag: "DefaultGraph" }
|
|
573
|
+
});
|
|
574
|
+
const compile$1 = (op, context) => Effect.gen(function* () {
|
|
575
|
+
const ctx = translationContext(context);
|
|
576
|
+
const ids = yield* resolveTerms(constants(op, ctx), false);
|
|
577
|
+
return compile(op, ctx, resolveIn(ids));
|
|
578
|
+
}).pipe(Effect.mapError(storeError("compile failed")));
|
|
579
|
+
const decodeSolutions = (compiled, rows) => Effect.gen(function* () {
|
|
580
|
+
const layout = columnLayout(compiled.columns);
|
|
581
|
+
const terms = layout.filter(({ column }) => column.type === "id");
|
|
582
|
+
const state = newState();
|
|
583
|
+
compiled.locals.forEach((t, id) => {
|
|
584
|
+
MutableHashMap.set(state.known, id, t);
|
|
585
|
+
});
|
|
586
|
+
rows.forEach((r) => terms.forEach(({ at }) => {
|
|
587
|
+
const v = r[at];
|
|
588
|
+
if (Predicate.isNullish(v)) return;
|
|
589
|
+
const id = num(v);
|
|
590
|
+
if (id > 0) addRow(state, id, r, at + 1);
|
|
591
|
+
}));
|
|
592
|
+
yield* complete(state);
|
|
593
|
+
compiled.locals.forEach((_, id) => {
|
|
594
|
+
MutableHashMap.remove(state.known, id);
|
|
595
|
+
});
|
|
596
|
+
yield* remember(state);
|
|
597
|
+
compiled.locals.forEach((t, id) => {
|
|
598
|
+
MutableHashMap.set(state.known, id, t);
|
|
599
|
+
});
|
|
600
|
+
return rows.map((r) => fromEntries(Arr.filterMap(layout, ({ column, at }) => {
|
|
601
|
+
const v = r[at];
|
|
602
|
+
if (Predicate.isNullish(v)) return Result.failVoid;
|
|
603
|
+
const term = column.type === "int" ? new Literal(str(v), INTEGER) : termOf(state, num(v));
|
|
604
|
+
return Result.succeed([column.variable, term]);
|
|
605
|
+
})));
|
|
606
|
+
});
|
|
607
|
+
const declined = /* @__PURE__ */ new WeakSet();
|
|
608
|
+
const capability = { evaluate: (op, context) => {
|
|
609
|
+
if (options.translate === false) return Option.none();
|
|
610
|
+
if (declined.has(op)) {
|
|
611
|
+
declined.delete(op);
|
|
612
|
+
return Option.none();
|
|
613
|
+
}
|
|
614
|
+
const ctx = translationContext(context);
|
|
615
|
+
const check = compile(op, ctx, () => void 0);
|
|
616
|
+
if (Result.isFailure(check)) {
|
|
617
|
+
onQuery?.({
|
|
618
|
+
_tag: "Declined",
|
|
619
|
+
operation: op,
|
|
620
|
+
reason: check.failure
|
|
621
|
+
});
|
|
622
|
+
return Option.none();
|
|
623
|
+
}
|
|
624
|
+
const stream = Stream.unwrap(Effect.gen(function* () {
|
|
625
|
+
const ids = yield* resolveTerms(constants(op, ctx), false);
|
|
626
|
+
const compiled = compile(op, ctx, resolveIn(ids));
|
|
627
|
+
if (Result.isFailure(compiled)) return yield* new StoreError({ message: compiled.failure });
|
|
628
|
+
const q = compiled.success;
|
|
629
|
+
if (Arr.isReadonlyArrayNonEmpty(q.risks) && isRisky(q, yield* storeClasses)) {
|
|
630
|
+
onQuery?.({
|
|
631
|
+
_tag: "Declined",
|
|
632
|
+
operation: op,
|
|
633
|
+
reason: "The data contains values SQL cannot compare exactly"
|
|
634
|
+
});
|
|
635
|
+
declined.add(op);
|
|
636
|
+
return Stream.mapError(context.evaluate(op), storeError("evaluation failed"));
|
|
637
|
+
}
|
|
638
|
+
const rows = yield* run(q.sql, q.params).pipe(Effect.withSpan("SqlStore.query", { attributes: { "db.query.text": q.sql } }));
|
|
639
|
+
onQuery?.({
|
|
640
|
+
_tag: "Executed",
|
|
641
|
+
operation: op,
|
|
642
|
+
sql: q.sql,
|
|
643
|
+
params: q.params,
|
|
644
|
+
rows: rows.length
|
|
645
|
+
});
|
|
646
|
+
return Stream.fromArray(yield* decodeSolutions(q, rows));
|
|
647
|
+
}).pipe(Effect.mapError(storeError("SQL query failed"))));
|
|
648
|
+
return Option.some(stream);
|
|
649
|
+
} };
|
|
650
|
+
return {
|
|
651
|
+
dialect,
|
|
652
|
+
tables: tables$1,
|
|
653
|
+
capability,
|
|
654
|
+
compile: compile$1,
|
|
655
|
+
termCount: Effect.map(run(`SELECT COUNT(*) FROM ${T}`), (rows) => num(rows[0]?.[0] ?? 0)).pipe(Effect.mapError(storeError("termCount failed"))),
|
|
656
|
+
match,
|
|
657
|
+
estimate: (pattern) => countWhere(pattern, Option.some(1e4)),
|
|
658
|
+
count: (pattern) => countWhere(pattern, Option.none()),
|
|
659
|
+
graphs,
|
|
660
|
+
hasGraph,
|
|
661
|
+
insert,
|
|
662
|
+
delete: del,
|
|
663
|
+
createGraph,
|
|
664
|
+
dropGraph,
|
|
665
|
+
clear,
|
|
666
|
+
transaction,
|
|
667
|
+
query: capability
|
|
668
|
+
};
|
|
669
|
+
});
|
|
670
|
+
/** The `resolve` of `Translation.compile` over resolved term ids. */
|
|
671
|
+
const resolveIn = (ids) => (t) => Option.getOrUndefined(MutableHashMap.get(ids, t.key));
|
|
672
|
+
const INTEGER = namedNode("http://www.w3.org/2001/XMLSchema#integer");
|
|
673
|
+
/**
|
|
674
|
+
* A layer providing the SQL store as both `SqlStore` and the engine's
|
|
675
|
+
* `QuadStore` (whose `query` is the SPARQL-to-SQL `QueryCapability`), over
|
|
676
|
+
* the `SqlClient` service.
|
|
677
|
+
*
|
|
678
|
+
* @since 0.1.0
|
|
679
|
+
* @category layers
|
|
680
|
+
*/
|
|
681
|
+
const layer = (options = {}) => Layer.effectContext(Effect.map(make(options), (store) => Context.make(SqlStore, store).pipe(Context.add(QuadStore, store))));
|
|
682
|
+
export { migrate as a, make as i, SqlStore_exports as n, migrations as o, layer as r, SqlStore as t };
|
|
683
|
+
|
|
684
|
+
//# sourceMappingURL=SqlStore-BBqFx-Wl.mjs.map
|