@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 @@
|
|
|
1
|
+
{"version":3,"file":"QueryBuilder-BLK9Vfbz.mjs","names":["Term.isTerm","Xsd.fromJs","Term.variable","Ast.isPath","Ast.pathPattern","Ast.triplePattern","Ast.link","Ast.inverse","Ast.sequence","Ast.alternative","Ast.zeroOrMore","Ast.oneOrMore","Ast.zeroOrOne","Ast.negated","Ast.bgp","Ast.group","Ast.optional","Ast.minus","Ast.union","Ast.graph","Ast.filter","Ast.bind","Ast.values","Ast.operation","Ast.functionCall","Ast.exists","Ast.aggregate","Generator.print","Ast.projection","Ast.select","Ast.ask","Ast.construct","Ast.describe","Engine.SparqlEngine","B.toRecord"],"sources":["../src/sparql/QueryBuilder.ts"],"sourcesContent":["/**\n * A strongly-typed, immutable query builder. Builders produce the SPARQL AST\n * (`build()`), print as SPARQL text (`toString()`) and can be executed with\n * the `SparqlEngine`, yielding rows whose type is derived from the selected\n * variables:\n *\n * ```ts\n * import { QueryBuilder as Q } from '@thomasfosterau/effect-rdf/sparql'\n * const v = Q.vars('person', 'name', 'email')\n *\n * const query = Q.select('person', 'name', Q.maybe('email'))\n * .where(Q.triple(v.person, foaf.name, v.name))\n * .optional(Q.triple(v.person, foaf.mbox, v.email))\n * .orderBy(v.name)\n * .limit(10)\n *\n * // Stream<{ readonly person: GroundTerm; readonly name: GroundTerm; readonly email?: GroundTerm }>\n * const rows = Q.execute(query)\n * // Stream<{ name: string; email?: string }>, decoded with TermSchema\n * const people = Q.decode(query, Schema.Struct({ name: TermSchema.string, email: Schema.optional(TermSchema.iri) }))\n * ```\n *\n * @since 0.1.0\n */\nimport * as Arr from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Match from 'effect/Match';\nimport { pipeArguments, type Pipeable } from 'effect/Pipeable';\nimport * as Record from 'effect/Record';\nimport * as Schema from 'effect/Schema';\nimport * as Stream from 'effect/Stream';\nimport type { Simplify } from 'effect/Types';\nimport * as Term from '../Term.ts';\nimport * as Xsd from '../Xsd.ts';\nimport * as Ast from './Ast.ts';\nimport * as B from './Bindings.ts';\nimport * as Engine from './Engine.ts';\nimport * as Generator from './Generator.ts';\nimport * as Predicate from 'effect/Predicate';\n\n// -----------------------------------------------------------------------------\n// Inputs\n// -----------------------------------------------------------------------------\n\n/**\n * A JavaScript value usable as a literal.\n *\n * @since 0.1.0\n * @category models\n */\nexport type JsValue = string | number | bigint | boolean | Date;\n\n/**\n * An expression, or a JS value (converted to a literal).\n *\n * @since 0.1.0\n * @category models\n */\nexport type ExpressionInput = Ast.Expression | JsValue;\n\n/**\n * An object position input: a term pattern or a JS value (literal).\n *\n * @since 0.1.0\n * @category models\n */\nexport type ObjectInput = Ast.TermPattern | JsValue;\n\n/**\n * Anything accepted as (part of) a group graph pattern.\n *\n * @since 0.1.0\n * @category models\n */\nexport type PatternInput =\n | Ast.TriplePattern\n | Ast.PathPattern\n | Ast.Pattern\n | ReadonlyArray<PatternInput>;\n\nconst isJsValue = (\n u: ExpressionInput | Alias<string, boolean> | Ast.OrderCondition,\n): u is JsValue =>\n Predicate.isString(u) ||\n Predicate.isNumber(u) ||\n Predicate.isBigInt(u) ||\n Predicate.isBoolean(u) ||\n Predicate.isDate(u);\n\nconst isTerm = <T extends Term.Term>(u: T | JsValue): u is T => Term.isTerm(u);\n\nconst isAlias = (u: ExpressionInput | Alias<string, boolean>): u is Alias<string, boolean> =>\n !isJsValue(u) && Predicate.isTagged(u, 'Alias');\n\nconst isOrderCondition = (u: ExpressionInput | Ast.OrderCondition): u is Ast.OrderCondition =>\n !isJsValue(u) && 'descending' in u;\n\n/**\n * Converts a JS value to a literal (terms and expressions are returned\n * unchanged).\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const toExpression = (input: ExpressionInput): Ast.Expression =>\n isJsValue(input) ? Xsd.fromJs(input) : input;\n\nconst toObject = (input: ObjectInput): Ast.TermPattern =>\n isTerm(input) ? input : Xsd.fromJs(input);\n\n// -----------------------------------------------------------------------------\n// Variables\n// -----------------------------------------------------------------------------\n\n/**\n * Creates a variable.\n *\n * @since 0.1.0\n * @category variables\n */\nexport const variable = <const N extends string>(name: N): Term.Variable<N> => Term.variable(name);\n\n/**\n * Variables by name, as `v` provides them.\n *\n * @since 0.1.0\n * @category variables\n */\nexport interface Variables {\n readonly [name: string]: Term.Variable;\n}\n\n/**\n * A proxy creating variables by property access: `v.name` is `?name`.\n *\n * @since 0.1.0\n * @category variables\n */\nexport const v: Variables = new Proxy<Variables>(\n {},\n { get: (_, name) => (Predicate.isString(name) ? Term.variable(name) : undefined) },\n);\n\n/**\n * Creates several variables at once, typed by name:\n * `const { s, name } = vars('s', 'name')`.\n *\n * @since 0.1.0\n * @category variables\n */\nexport const vars = <const N extends ReadonlyArray<string>>(\n ...names: N\n): { readonly [K in N[number]]: Term.Variable<K> } =>\n // SAFETY: one entry per name in `names`, each the variable of that name.\n Record.fromEntries(names.map((n) => [n, Term.variable(n)])) as {\n readonly [K in N[number]]: Term.Variable<K>;\n };\n\n/**\n * The `as` constructor: an alias that is required unless marked optional.\n *\n * @since 0.1.0\n * @category projection\n */\nexport interface AsAlias {\n <const N extends string>(expression: ExpressionInput, name: N): Alias<N>;\n <const N extends string>(\n expression: ExpressionInput,\n name: N,\n options: { readonly optional: true },\n ): Alias<N, true>;\n}\n\n/**\n * Marks a selected variable as possibly unbound (e.g. bound in an\n * `OPTIONAL`): its row field becomes optional.\n *\n * @since 0.1.0\n * @category projection\n */\nexport interface MaybeVariable<N extends string> {\n readonly _tag: 'Maybe';\n readonly name: N;\n}\n\n/**\n * @since 0.1.0\n * @category projection\n */\nexport const maybe = <const N extends string>(name: N): MaybeVariable<N> => ({\n _tag: 'Maybe',\n name,\n});\n\n/**\n * A projected expression `(expr AS ?name)`.\n *\n * @since 0.1.0\n * @category projection\n */\nexport interface Alias<N extends string, Optional extends boolean = false> {\n readonly _tag: 'Alias';\n readonly name: N;\n readonly expression: Ast.Expression;\n readonly optional: Optional;\n}\n\n/**\n * Projects an expression as a variable. Pass `{ optional: true }` when the\n * expression may fail (leaving the variable unbound).\n *\n * @since 0.1.0\n * @category projection\n */\nexport const as: AsAlias = (\n expression: ExpressionInput,\n name: string,\n options?: { readonly optional: true },\n): any => ({\n _tag: 'Alias',\n name,\n expression: toExpression(expression),\n optional: options?.optional ?? false,\n});\n\n/**\n * An item of a `SELECT` list.\n *\n * @since 0.1.0\n * @category projection\n */\nexport type SelectItem = string | Term.Variable | MaybeVariable<string> | Alias<string, boolean>;\n\ntype RequiredOf<I> = I extends string\n ? I\n : I extends Term.Variable<infer N>\n ? N\n : I extends Alias<infer N>\n ? N\n : never;\n\ntype OptionalOf<I> =\n I extends MaybeVariable<infer N> ? N : I extends Alias<infer N, true> ? N : never;\n\n/**\n * The row type of a `SELECT` query with required variables `R` and\n * possibly-unbound variables `O`.\n *\n * @since 0.1.0\n * @category models\n */\nexport type Row<R extends string, O extends string> = Simplify<\n { readonly [K in R]: Term.GroundTerm } & { readonly [K in O]?: Term.GroundTerm | undefined }\n>;\n\n// -----------------------------------------------------------------------------\n// Patterns\n// -----------------------------------------------------------------------------\n\n/**\n * A triple pattern. The predicate may be a property path; the object may be\n * a JS value.\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const triple = (\n subject: Ast.TermPattern,\n predicate: Ast.VarOrIri | Ast.Path,\n object: ObjectInput,\n): Ast.TriplePattern | Ast.PathPattern =>\n Ast.isPath(predicate)\n ? Ast.pathPattern(subject, predicate, toObject(object))\n : Ast.triplePattern(subject, predicate, toObject(object));\n\n/**\n * Property path constructors.\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const path = {\n link: (iri: Term.NamedNode): Ast.Path => Ast.link(iri),\n inverse: (p: Ast.Path | Term.NamedNode): Ast.Path => Ast.inverse(toPath(p)),\n sequence: (...ps: ReadonlyArray<Ast.Path | Term.NamedNode>): Ast.Path =>\n Ast.sequence(...ps.map(toPath)),\n alternative: (...ps: ReadonlyArray<Ast.Path | Term.NamedNode>): Ast.Path =>\n Ast.alternative(...ps.map(toPath)),\n zeroOrMore: (p: Ast.Path | Term.NamedNode): Ast.Path => Ast.zeroOrMore(toPath(p)),\n oneOrMore: (p: Ast.Path | Term.NamedNode): Ast.Path => Ast.oneOrMore(toPath(p)),\n zeroOrOne: (p: Ast.Path | Term.NamedNode): Ast.Path => Ast.zeroOrOne(toPath(p)),\n negated: (\n iris: ReadonlyArray<Term.NamedNode>,\n inverse: ReadonlyArray<Term.NamedNode> = [],\n ): Ast.Path => Ast.negated(iris, inverse),\n} as const;\n\nconst toPath = (p: Ast.Path | Term.NamedNode): Ast.Path => (Ast.isPath(p) ? p : Ast.link(p));\n\n/** Whether a pattern input is the list form (`Array.isArray` cannot narrow a `ReadonlyArray`). */\nconst isPatternList = (input: PatternInput): input is ReadonlyArray<PatternInput> =>\n Array.isArray(input);\n\nconst isTriplePattern = (\n p: Ast.TriplePattern | Ast.PathPattern | Ast.Pattern,\n): p is Ast.TriplePattern | Ast.PathPattern =>\n Predicate.isTagged(p, 'TriplePattern') || Predicate.isTagged(p, 'PathPattern');\n\nconst flatten = (inputs: ReadonlyArray<PatternInput>): Array<Ast.Pattern> => {\n const out: Array<Ast.Pattern> = [];\n const go = (input: PatternInput): void => {\n if (isPatternList(input)) {\n input.forEach(go);\n return;\n }\n if (isTriplePattern(input)) {\n const last = out[out.length - 1];\n if (Predicate.isTagged(last, 'Bgp')) {\n out[out.length - 1] = Ast.bgp([...last.triples, input]);\n } else out.push(Ast.bgp([input]));\n } else out.push(input);\n };\n inputs.forEach(go);\n return out;\n};\n\n/**\n * A group graph pattern `{ … }`.\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const group = (...patterns: ReadonlyArray<PatternInput>): Ast.GroupPattern =>\n Ast.group(flatten(patterns));\n\n/**\n * `OPTIONAL { … }`\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const optional = (...patterns: ReadonlyArray<PatternInput>): Ast.OptionalPattern =>\n Ast.optional(group(...patterns));\n\n/**\n * `MINUS { … }`\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const minus = (...patterns: ReadonlyArray<PatternInput>): Ast.MinusPattern =>\n Ast.minus(group(...patterns));\n\n/**\n * `{ … } UNION { … }`; each argument is one alternative.\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const union = (...alternatives: ReadonlyArray<PatternInput>): Ast.UnionPattern =>\n Ast.union(alternatives.map((a) => group(a)));\n\n/**\n * `GRAPH name { … }`\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const graph = (\n name: Ast.VarOrIri,\n ...patterns: ReadonlyArray<PatternInput>\n): Ast.GraphPattern => Ast.graph(name, group(...patterns));\n\n/**\n * `FILTER(expr)`\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const filter = (expression: ExpressionInput): Ast.FilterPattern =>\n Ast.filter(toExpression(expression));\n\n/**\n * `BIND(expr AS ?name)`\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const bind = (expression: ExpressionInput, name: string | Term.Variable): Ast.BindPattern =>\n Ast.bind(toExpression(expression), Predicate.isString(name) ? Term.variable(name) : name);\n\n/**\n * Inline data from records: `values([{ x: ex.a, y: 1 }, { x: ex.b }])`.\n * Missing or `undefined` values are `UNDEF`.\n *\n * @since 0.1.0\n * @category patterns\n */\nexport const values = (\n rows: ReadonlyArray<Readonly<Record<string, Term.GroundTerm | JsValue | undefined>>>,\n): Ast.ValuesPattern => {\n const names = Arr.dedupe(rows.flatMap((r) => Record.keys(r)));\n return Ast.values(\n names.map((n) => Term.variable(n)),\n rows.map((r) =>\n names.map((n) => {\n const x = r[n];\n return x === undefined ? undefined : isTerm(x) ? x : Xsd.fromJs(x);\n }),\n ),\n );\n};\n\n// -----------------------------------------------------------------------------\n// Expressions\n// -----------------------------------------------------------------------------\n\nconst op =\n (operator: Ast.Operator) =>\n (...args: ReadonlyArray<ExpressionInput>): Ast.Expression =>\n Ast.operation(operator, ...args.map(toExpression));\n\nconst binary =\n (operator: Ast.Operator) =>\n (a: ExpressionInput, b: ExpressionInput): Ast.Expression =>\n Ast.operation(operator, toExpression(a), toExpression(b));\n\nconst unary =\n (operator: Ast.Operator) =>\n (a: ExpressionInput): Ast.Expression =>\n Ast.operation(operator, toExpression(a));\n\n/** @since 0.1.0 @category expressions */\nexport const eq = binary('=');\n/** @since 0.1.0 @category expressions */\nexport const ne = binary('!=');\n/** @since 0.1.0 @category expressions */\nexport const lt = binary('<');\n/** @since 0.1.0 @category expressions */\nexport const le = binary('<=');\n/** @since 0.1.0 @category expressions */\nexport const gt = binary('>');\n/** @since 0.1.0 @category expressions */\nexport const ge = binary('>=');\n/** @since 0.1.0 @category expressions */\nexport const add = binary('+');\n/** @since 0.1.0 @category expressions */\nexport const subtract = binary('-');\n/** @since 0.1.0 @category expressions */\nexport const multiply = binary('*');\n/** @since 0.1.0 @category expressions */\nexport const divide = binary('/');\n/** @since 0.1.0 @category expressions */\nexport const negate = unary('UMINUS');\n/** @since 0.1.0 @category expressions */\nexport const not = unary('!');\n\n/**\n * Logical conjunction of any number of conditions.\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const and = (...args: ReadonlyArray<ExpressionInput>): Ast.Expression =>\n args.map(toExpression).reduce((a, b) => Ast.operation('&&', a, b));\n\n/**\n * Logical disjunction of any number of conditions.\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const or = (...args: ReadonlyArray<ExpressionInput>): Ast.Expression =>\n args.map(toExpression).reduce((a, b) => Ast.operation('||', a, b));\n\n/**\n * `expr IN (…)`\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const isIn = (\n expression: ExpressionInput,\n list: ReadonlyArray<ExpressionInput>,\n): Ast.Expression => Ast.operation('IN', toExpression(expression), ...list.map(toExpression));\n\n/**\n * `expr NOT IN (…)`\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const notIn = (\n expression: ExpressionInput,\n list: ReadonlyArray<ExpressionInput>,\n): Ast.Expression => Ast.operation('NOT IN', toExpression(expression), ...list.map(toExpression));\n\n/**\n * Calls any built-in function by name, e.g. `fn('STRLEN', v.name)`.\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const fn = (\n name: Ast.BuiltInName,\n ...args: ReadonlyArray<ExpressionInput>\n): Ast.Expression => Ast.operation(name, ...args.map(toExpression));\n\n/**\n * Calls an extension function (or XSD cast) by IRI.\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const call = (\n iri: Term.NamedNode,\n ...args: ReadonlyArray<ExpressionInput>\n): Ast.Expression => Ast.functionCall(iri, args.map(toExpression));\n\n/** @since 0.1.0 @category expressions */\nexport const bound = (variable: Term.Variable): Ast.Expression => Ast.operation('BOUND', variable);\n/** @since 0.1.0 @category expressions */\nexport const str = op('STR');\n/** @since 0.1.0 @category expressions */\nexport const lang = op('LANG');\n/** @since 0.1.0 @category expressions */\nexport const langMatches = op('LANGMATCHES');\n/** @since 0.1.0 @category expressions */\nexport const datatype = op('DATATYPE');\n/** @since 0.1.0 @category expressions */\nexport const iri = op('IRI');\n/** @since 0.1.0 @category expressions */\nexport const regex = op('REGEX');\n/** @since 0.1.0 @category expressions */\nexport const contains = op('CONTAINS');\n/** @since 0.1.0 @category expressions */\nexport const strStarts = op('STRSTARTS');\n/** @since 0.1.0 @category expressions */\nexport const strEnds = op('STRENDS');\n/** @since 0.1.0 @category expressions */\nexport const strlen = op('STRLEN');\n/** @since 0.1.0 @category expressions */\nexport const ucase = op('UCASE');\n/** @since 0.1.0 @category expressions */\nexport const lcase = op('LCASE');\n/** @since 0.1.0 @category expressions */\nexport const concat = op('CONCAT');\n/** @since 0.1.0 @category expressions */\nexport const substr = op('SUBSTR');\n/** @since 0.1.0 @category expressions */\nexport const replace = op('REPLACE');\n/** @since 0.1.0 @category expressions */\nexport const coalesce = op('COALESCE');\n/** @since 0.1.0 @category expressions */\nexport const ifThenElse = op('IF');\n/** @since 0.1.0 @category expressions */\nexport const isIri = op('ISIRI');\n/** @since 0.1.0 @category expressions */\nexport const isBlank = op('ISBLANK');\n/** @since 0.1.0 @category expressions */\nexport const isLiteral = op('ISLITERAL');\n/** @since 0.1.0 @category expressions */\nexport const isNumeric = op('ISNUMERIC');\n/** @since 0.1.0 @category expressions */\nexport const sameTerm = op('SAMETERM');\n\n/**\n * `EXISTS { … }`\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const exists = (...patterns: ReadonlyArray<PatternInput>): Ast.Expression =>\n Ast.exists(group(...patterns));\n\n/**\n * `NOT EXISTS { … }`\n *\n * @since 0.1.0\n * @category expressions\n */\nexport const notExists = (...patterns: ReadonlyArray<PatternInput>): Ast.Expression =>\n Ast.exists(group(...patterns), true);\n\nconst aggregate =\n (name: Ast.AggregateName) =>\n (expression: ExpressionInput, options?: { readonly distinct?: boolean }): Ast.Expression =>\n Ast.aggregate(name, toExpression(expression), options);\n\n/**\n * `COUNT(*)` (no argument) or `COUNT(expr)`.\n *\n * @since 0.1.0\n * @category aggregates\n */\nexport const count = (\n expression?: ExpressionInput,\n options?: { readonly distinct?: boolean },\n): Ast.Expression =>\n Ast.aggregate('COUNT', expression === undefined ? '*' : toExpression(expression), options);\n/** @since 0.1.0 @category aggregates */\nexport const sum = aggregate('SUM');\n/** @since 0.1.0 @category aggregates */\nexport const avg = aggregate('AVG');\n/** @since 0.1.0 @category aggregates */\nexport const min = aggregate('MIN');\n/** @since 0.1.0 @category aggregates */\nexport const max = aggregate('MAX');\n/** @since 0.1.0 @category aggregates */\nexport const sample = aggregate('SAMPLE');\n\n/**\n * `GROUP_CONCAT(expr; SEPARATOR = sep)`\n *\n * @since 0.1.0\n * @category aggregates\n */\nexport const groupConcat = (\n expression: ExpressionInput,\n options?: { readonly distinct?: boolean; readonly separator?: string },\n): Ast.Expression => Ast.aggregate('GROUP_CONCAT', toExpression(expression), options);\n\n/**\n * A descending `ORDER BY` condition.\n *\n * @since 0.1.0\n * @category modifiers\n */\nexport const desc = (expression: ExpressionInput): Ast.OrderCondition => ({\n expression: toExpression(expression),\n descending: true,\n});\n\n/**\n * An ascending `ORDER BY` condition.\n *\n * @since 0.1.0\n * @category modifiers\n */\nexport const asc = (expression: ExpressionInput): Ast.OrderCondition => ({\n expression: toExpression(expression),\n descending: false,\n});\n\n// -----------------------------------------------------------------------------\n// Builders\n// -----------------------------------------------------------------------------\n\ntype Kind = Ast.Query['_tag'];\n\ntype QueryOf<K extends Kind> = Extract<Ast.Query, { readonly _tag: K }>;\n\n/**\n * An immutable query builder. `K` is the query form; `R` and `O` are the\n * required and optional variables of `SELECT` rows.\n *\n * @since 0.1.0\n * @category models\n */\nexport class Builder<\n K extends Kind,\n R extends string = never,\n O extends string = never,\n> implements Pipeable {\n /** @internal */\n readonly query: QueryOf<K>;\n constructor(query: QueryOf<K>) {\n this.query = query;\n }\n\n private with(\n patch: Partial<Ast.QueryBase> & Partial<Pick<Ast.SelectQuery, 'distinct' | 'reduced'>>,\n ): Builder<K, R, O> {\n // SAFETY: patching fields of a query keeps its kind `K`; the spread only loses the\n // discriminant's narrowing.\n return new Builder({ ...this.query, ...patch } as QueryOf<K>);\n }\n\n private append(patterns: ReadonlyArray<Ast.Pattern>): Builder<K, R, O> {\n return this.with({ where: group(this.query.where.patterns, patterns) });\n }\n\n /** Adds patterns to the `WHERE` clause. */\n where(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O> {\n return this.append(flatten(patterns));\n }\n\n /** Adds an `OPTIONAL { … }` block. */\n optional(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O> {\n return this.append([optional(...patterns)]);\n }\n\n /** Adds a `MINUS { … }` block. */\n minus(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O> {\n return this.append([minus(...patterns)]);\n }\n\n /** Adds a `UNION` of alternatives. */\n union(...alternatives: ReadonlyArray<PatternInput>): Builder<K, R, O> {\n return this.append([union(...alternatives)]);\n }\n\n /** Adds a `FILTER`. */\n filter(expression: ExpressionInput): Builder<K, R, O> {\n return this.append([filter(expression)]);\n }\n\n /** Adds a `BIND`. */\n bind(expression: ExpressionInput, name: string | Term.Variable): Builder<K, R, O> {\n return this.append([bind(expression, name)]);\n }\n\n /** Adds a `GRAPH` block. */\n graph(name: Ast.VarOrIri, ...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O> {\n return this.append([graph(name, ...patterns)]);\n }\n\n /** Adds inline data. */\n values(rows: Parameters<typeof values>[0]): Builder<K, R, O> {\n return this.append([values(rows)]);\n }\n\n /** Adds `GROUP BY` conditions (expressions or `as(expr, name)`). */\n groupBy(\n ...conditions: ReadonlyArray<ExpressionInput | Alias<string, boolean>>\n ): Builder<K, R, O> {\n return this.with({\n groupBy: [\n ...this.query.groupBy,\n ...conditions.map((c): Ast.GroupCondition =>\n isAlias(c)\n ? { expression: c.expression, variable: Term.variable(c.name) }\n : { expression: toExpression(c) },\n ),\n ],\n });\n }\n\n /** Adds `HAVING` conditions. */\n having(...conditions: ReadonlyArray<ExpressionInput>): Builder<K, R, O> {\n return this.with({ having: [...this.query.having, ...conditions.map(toExpression)] });\n }\n\n /** Adds `ORDER BY` conditions (ascending unless wrapped with `desc`). */\n orderBy(...conditions: ReadonlyArray<ExpressionInput | Ast.OrderCondition>): Builder<K, R, O> {\n return this.with({\n orderBy: [\n ...this.query.orderBy,\n ...conditions.map((c) => (isOrderCondition(c) ? c : asc(c))),\n ],\n });\n }\n\n /** Sets `LIMIT`. */\n limit(limit: number): Builder<K, R, O> {\n return this.with({ limit });\n }\n\n /** Sets `OFFSET`. */\n offset(offset: number): Builder<K, R, O> {\n return this.with({ offset });\n }\n\n /** Makes a `SELECT` query `DISTINCT`. */\n distinct(): Builder<K, R, O> {\n return this.with({ distinct: true, reduced: false });\n }\n\n /** Makes a `SELECT` query `REDUCED`. */\n reduced(): Builder<K, R, O> {\n return this.with({ reduced: true, distinct: false });\n }\n\n /** Adds `FROM` graphs. */\n from(...graphs: ReadonlyArray<Term.NamedNode>): Builder<K, R, O> {\n const d = this.query.dataset ?? { default: [], named: [] };\n return this.with({ dataset: { default: [...d.default, ...graphs], named: d.named } });\n }\n\n /** Adds `FROM NAMED` graphs. */\n fromNamed(...graphs: ReadonlyArray<Term.NamedNode>): Builder<K, R, O> {\n const d = this.query.dataset ?? { default: [], named: [] };\n return this.with({ dataset: { default: d.default, named: [...d.named, ...graphs] } });\n }\n\n /** Declares prefixes (used when printing). */\n prefixes(prefixes: Readonly<Record<string, string>>): Builder<K, R, O> {\n return this.with({\n prologue: {\n ...this.query.prologue,\n prefixes: { ...this.query.prologue.prefixes, ...prefixes },\n },\n });\n }\n\n /** The query AST. */\n build(): QueryOf<K> {\n return this.query;\n }\n\n /** The query as SPARQL text. */\n toString(): string {\n return Generator.print(this.query);\n }\n\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n\nconst empty = Ast.group([]);\n\nconst projectionItem = (item: SelectItem): Term.Variable | Ast.Projection => {\n if (Predicate.isString(item)) return Term.variable(item);\n return Match.value(item).pipe(\n Match.tag('Variable', (x): Term.Variable | Ast.Projection => x),\n Match.tag('Maybe', (m) => Term.variable(m.name)),\n Match.tag('Alias', (a) => Ast.projection(a.expression, Term.variable(a.name))),\n Match.exhaustive,\n );\n};\n\n/**\n * Starts a `SELECT` query. With no arguments, `SELECT *` (rows are then\n * untyped records).\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const select = <const Items extends ReadonlyArray<SelectItem>>(\n ...items: Items\n): Builder<'Select', RequiredOf<Items[number]>, OptionalOf<Items[number]>> =>\n new Builder(\n Ast.select({\n where: empty,\n projection: Arr.isReadonlyArrayEmpty(items) ? '*' : items.map(projectionItem),\n }),\n );\n\n/**\n * Starts an `ASK` query.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const ask = (): Builder<'Ask'> => new Builder(Ast.ask({ where: empty }));\n\n/**\n * Starts a `CONSTRUCT` query with a template.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const construct = (\n ...template: ReadonlyArray<Ast.TriplePattern | Ast.PathPattern>\n): Builder<'Construct'> =>\n new Builder(\n Ast.construct({\n where: empty,\n template: template.filter((t): t is Ast.TriplePattern =>\n Predicate.isTagged(t, 'TriplePattern'),\n ),\n }),\n );\n\n/**\n * Starts a `DESCRIBE` query.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const describe = (...terms: ReadonlyArray<Ast.VarOrIri>): Builder<'Describe'> =>\n new Builder(Ast.describe({ terms: Arr.isReadonlyArrayEmpty(terms) ? '*' : terms }));\n\n// -----------------------------------------------------------------------------\n// Execution\n// -----------------------------------------------------------------------------\n\n/**\n * Executes a `SELECT` builder, streaming typed rows.\n *\n * @since 0.1.0\n * @category execution\n */\nexport const execute = <R extends string, O extends string>(\n builder: Builder<'Select', R, O>,\n options?: Engine.RequestOptions,\n): Stream.Stream<Row<R, O>, Engine.SparqlError, Engine.SparqlEngine> =>\n Stream.unwrap(\n Effect.gen(function* () {\n const engine = yield* Engine.SparqlEngine;\n const result = yield* engine.select(builder.build(), options);\n // SAFETY: the builder's type parameters track the projected variables, so a row has exactly\n // `R` and optional `O` keys.\n return Stream.map(result.bindings, (b) => B.toRecord(b) as Row<R, O>);\n }),\n );\n\n/**\n * Executes a `SELECT` builder and collects all rows.\n *\n * @since 0.1.0\n * @category execution\n */\nexport const executeAll = <R extends string, O extends string>(\n builder: Builder<'Select', R, O>,\n options?: Engine.RequestOptions,\n): Effect.Effect<ReadonlyArray<Row<R, O>>, Engine.SparqlError, Engine.SparqlEngine> =>\n Stream.runCollect(execute(builder, options));\n\n/**\n * Executes a `SELECT` builder and decodes each row with a schema (whose\n * fields are typically `TermSchema` codecs).\n *\n * @since 0.1.0\n * @category execution\n */\nexport const decode = <R extends string, O extends string, A, RD>(\n builder: Builder<'Select', R, O>,\n schema: Schema.Decoder<A, RD>,\n options?: Engine.RequestOptions,\n): Stream.Stream<A, Engine.SparqlError | Schema.SchemaError, Engine.SparqlEngine | RD> =>\n Stream.mapEffect(execute(builder, options), (row) => Schema.decodeUnknownEffect(schema)(row));\n\n/**\n * Executes an `ASK` builder.\n *\n * @since 0.1.0\n * @category execution\n */\nexport const executeAsk = (\n builder: Builder<'Ask'>,\n options?: Engine.RequestOptions,\n): Effect.Effect<boolean, Engine.SparqlError, Engine.SparqlEngine> =>\n Effect.flatMap(Effect.service(Engine.SparqlEngine), (engine) =>\n engine.ask(builder.build(), options),\n );\n\n/**\n * Executes a `CONSTRUCT` or `DESCRIBE` builder, streaming triples.\n *\n * @since 0.1.0\n * @category execution\n */\nexport const executeGraph = (\n builder: Builder<'Construct'> | Builder<'Describe'>,\n options?: Engine.RequestOptions,\n): Stream.Stream<Term.Quad, Engine.SparqlError, Engine.SparqlEngine> =>\n Stream.unwrap(\n Effect.flatMap(Effect.service(Engine.SparqlEngine), (engine) =>\n engine.construct(builder.build(), options),\n ),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAM,aACJ,MAEA,UAAU,SAAS,CAAC,KACpB,UAAU,SAAS,CAAC,KACpB,UAAU,SAAS,CAAC,KACpB,UAAU,UAAU,CAAC,KACrB,UAAU,OAAO,CAAC;AAEpB,MAAM,UAA+B,MAA2BA,SAAY,CAAC;AAE7E,MAAM,WAAW,MACf,CAAC,UAAU,CAAC,KAAK,UAAU,SAAS,GAAG,OAAO;AAEhD,MAAM,oBAAoB,MACxB,CAAC,UAAU,CAAC,KAAK,gBAAgB;;;;;;;;AASnC,MAAa,gBAAgB,UAC3B,UAAU,KAAK,IAAIC,OAAW,KAAK,IAAI;AAEzC,MAAM,YAAY,UAChB,OAAO,KAAK,IAAI,QAAQA,OAAW,KAAK;;;;;;;AAY1C,MAAa,YAAoC,SAA8BC,WAAc,IAAI;;;;;;;AAkBjG,MAAa,IAAe,IAAI,MAC9B,CAAC,GACD,EAAE,MAAM,GAAG,SAAU,UAAU,SAAS,IAAI,IAAIA,WAAc,IAAI,IAAI,KAAA,EAAW,CACnF;;;;;;;;AASA,MAAa,QACX,GAAG,UAGH,OAAO,YAAY,MAAM,KAAK,MAAM,CAAC,GAAGA,WAAc,CAAC,CAAC,CAAC,CAAC;;;;;AAmC5D,MAAa,SAAiC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WAAW,MAAMC,SAAW,CAAC,CAAc;AACtE,CAAC,CACH;;;;;;;AAQF,MAAa,cACX,SACA,YAEA,OAAO,WAAW,QAAQ,SAAS,OAAO,CAAC;;;;;;;;AAS7C,MAAa,UACX,SACA,QACA,YAEA,OAAO,UAAU,QAAQ,SAAS,OAAO,IAAI,QAAQ,OAAO,oBAAoB,MAAM,CAAC,CAAC,GAAG,CAAC;;;;;;;AAQ9F,MAAa,cACX,SACA,YAEA,OAAO,QAAQ,OAAO,QAAQD,YAAmB,IAAI,WACnD,OAAO,IAAI,QAAQ,MAAM,GAAG,OAAO,CACrC;;;;;;;AAQF,MAAa,gBACX,SACA,YAEA,OAAO,OACL,OAAO,QAAQ,OAAO,QAAQA,YAAmB,IAAI,WACnD,OAAO,UAAU,QAAQ,MAAM,GAAG,OAAO,CAC3C,CACF"}
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import { _ as Quad, d as NamedNode, j as Variable, s as GroundTerm } from "./Term-B_4ezyXq.mjs";
|
|
2
|
+
import { D as MinusPattern, M as OrderCondition, N as Path, Q as TermPattern, U as Pattern, _ as Expression, at as VarOrIri, et as TriplePattern, it as ValuesPattern, j as OptionalPattern, o as BindPattern, q as Query, s as BuiltInName, tt as UnionPattern, v as FilterPattern, w as GroupPattern, x as GraphPattern, z as PathPattern } from "./Ast-vcw2W-lf.mjs";
|
|
3
|
+
import { c as SparqlError, i as RequestOptions, o as SparqlEngine } from "./Engine-CYPB3g4h.mjs";
|
|
4
|
+
import { Pipeable } from "effect/Pipeable";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Stream from "effect/Stream";
|
|
8
|
+
import { Simplify } from "effect/Types";
|
|
9
|
+
declare namespace QueryBuilder_d_exports {
|
|
10
|
+
export { Alias, AsAlias, Builder, ExpressionInput, JsValue, MaybeVariable, ObjectInput, PatternInput, Row, SelectItem, Variables, add, and, as, asc, ask, avg, bind, bound, call, coalesce, concat, construct, contains, count, datatype, decode, desc, describe, divide, eq, execute, executeAll, executeAsk, executeGraph, exists, filter, fn, ge, graph, group, groupConcat, gt, ifThenElse, iri, isBlank, isIn, isIri, isLiteral, isNumeric, lang, langMatches, lcase, le, lt, max, maybe, min, minus, multiply, ne, negate, not, notExists, notIn, optional, or, path, regex, replace, sameTerm, sample, select, str, strEnds, strStarts, strlen, substr, subtract, sum, toExpression, triple, ucase, union, v, values, variable, vars };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A JavaScript value usable as a literal.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.1.0
|
|
16
|
+
* @category models
|
|
17
|
+
*/
|
|
18
|
+
type JsValue = string | number | bigint | boolean | Date;
|
|
19
|
+
/**
|
|
20
|
+
* An expression, or a JS value (converted to a literal).
|
|
21
|
+
*
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
* @category models
|
|
24
|
+
*/
|
|
25
|
+
type ExpressionInput = Expression | JsValue;
|
|
26
|
+
/**
|
|
27
|
+
* An object position input: a term pattern or a JS value (literal).
|
|
28
|
+
*
|
|
29
|
+
* @since 0.1.0
|
|
30
|
+
* @category models
|
|
31
|
+
*/
|
|
32
|
+
type ObjectInput = TermPattern | JsValue;
|
|
33
|
+
/**
|
|
34
|
+
* Anything accepted as (part of) a group graph pattern.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
* @category models
|
|
38
|
+
*/
|
|
39
|
+
type PatternInput = TriplePattern | PathPattern | Pattern | ReadonlyArray<PatternInput>;
|
|
40
|
+
/**
|
|
41
|
+
* Converts a JS value to a literal (terms and expressions are returned
|
|
42
|
+
* unchanged).
|
|
43
|
+
*
|
|
44
|
+
* @since 0.1.0
|
|
45
|
+
* @category constructors
|
|
46
|
+
*/
|
|
47
|
+
declare const toExpression: (input: ExpressionInput) => Expression;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a variable.
|
|
50
|
+
*
|
|
51
|
+
* @since 0.1.0
|
|
52
|
+
* @category variables
|
|
53
|
+
*/
|
|
54
|
+
declare const variable: <const N extends string>(name: N) => Variable<N>;
|
|
55
|
+
/**
|
|
56
|
+
* Variables by name, as `v` provides them.
|
|
57
|
+
*
|
|
58
|
+
* @since 0.1.0
|
|
59
|
+
* @category variables
|
|
60
|
+
*/
|
|
61
|
+
interface Variables {
|
|
62
|
+
readonly [name: string]: Variable;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A proxy creating variables by property access: `v.name` is `?name`.
|
|
66
|
+
*
|
|
67
|
+
* @since 0.1.0
|
|
68
|
+
* @category variables
|
|
69
|
+
*/
|
|
70
|
+
declare const v: Variables;
|
|
71
|
+
/**
|
|
72
|
+
* Creates several variables at once, typed by name:
|
|
73
|
+
* `const { s, name } = vars('s', 'name')`.
|
|
74
|
+
*
|
|
75
|
+
* @since 0.1.0
|
|
76
|
+
* @category variables
|
|
77
|
+
*/
|
|
78
|
+
declare const vars: <const N extends ReadonlyArray<string>>(...names: N) => { readonly [K in N[number]]: Variable<K>; };
|
|
79
|
+
/**
|
|
80
|
+
* The `as` constructor: an alias that is required unless marked optional.
|
|
81
|
+
*
|
|
82
|
+
* @since 0.1.0
|
|
83
|
+
* @category projection
|
|
84
|
+
*/
|
|
85
|
+
interface AsAlias {
|
|
86
|
+
<const N extends string>(expression: ExpressionInput, name: N): Alias<N>;
|
|
87
|
+
<const N extends string>(expression: ExpressionInput, name: N, options: {
|
|
88
|
+
readonly optional: true;
|
|
89
|
+
}): Alias<N, true>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Marks a selected variable as possibly unbound (e.g. bound in an
|
|
93
|
+
* `OPTIONAL`): its row field becomes optional.
|
|
94
|
+
*
|
|
95
|
+
* @since 0.1.0
|
|
96
|
+
* @category projection
|
|
97
|
+
*/
|
|
98
|
+
interface MaybeVariable<N extends string> {
|
|
99
|
+
readonly _tag: 'Maybe';
|
|
100
|
+
readonly name: N;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @since 0.1.0
|
|
104
|
+
* @category projection
|
|
105
|
+
*/
|
|
106
|
+
declare const maybe: <const N extends string>(name: N) => MaybeVariable<N>;
|
|
107
|
+
/**
|
|
108
|
+
* A projected expression `(expr AS ?name)`.
|
|
109
|
+
*
|
|
110
|
+
* @since 0.1.0
|
|
111
|
+
* @category projection
|
|
112
|
+
*/
|
|
113
|
+
interface Alias<N extends string, Optional extends boolean = false> {
|
|
114
|
+
readonly _tag: 'Alias';
|
|
115
|
+
readonly name: N;
|
|
116
|
+
readonly expression: Expression;
|
|
117
|
+
readonly optional: Optional;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Projects an expression as a variable. Pass `{ optional: true }` when the
|
|
121
|
+
* expression may fail (leaving the variable unbound).
|
|
122
|
+
*
|
|
123
|
+
* @since 0.1.0
|
|
124
|
+
* @category projection
|
|
125
|
+
*/
|
|
126
|
+
declare const as: AsAlias;
|
|
127
|
+
/**
|
|
128
|
+
* An item of a `SELECT` list.
|
|
129
|
+
*
|
|
130
|
+
* @since 0.1.0
|
|
131
|
+
* @category projection
|
|
132
|
+
*/
|
|
133
|
+
type SelectItem = string | Variable | MaybeVariable<string> | Alias<string, boolean>;
|
|
134
|
+
type RequiredOf<I> = I extends string ? I : I extends Variable<infer N> ? N : I extends Alias<infer N> ? N : never;
|
|
135
|
+
type OptionalOf<I> = I extends MaybeVariable<infer N> ? N : I extends Alias<infer N, true> ? N : never;
|
|
136
|
+
/**
|
|
137
|
+
* The row type of a `SELECT` query with required variables `R` and
|
|
138
|
+
* possibly-unbound variables `O`.
|
|
139
|
+
*
|
|
140
|
+
* @since 0.1.0
|
|
141
|
+
* @category models
|
|
142
|
+
*/
|
|
143
|
+
type Row<R extends string, O extends string> = Simplify<{ readonly [K in R]: GroundTerm; } & { readonly [K in O]?: GroundTerm | undefined; }>;
|
|
144
|
+
/**
|
|
145
|
+
* A triple pattern. The predicate may be a property path; the object may be
|
|
146
|
+
* a JS value.
|
|
147
|
+
*
|
|
148
|
+
* @since 0.1.0
|
|
149
|
+
* @category patterns
|
|
150
|
+
*/
|
|
151
|
+
declare const triple: (subject: TermPattern, predicate: VarOrIri | Path, object: ObjectInput) => TriplePattern | PathPattern;
|
|
152
|
+
/**
|
|
153
|
+
* Property path constructors.
|
|
154
|
+
*
|
|
155
|
+
* @since 0.1.0
|
|
156
|
+
* @category patterns
|
|
157
|
+
*/
|
|
158
|
+
declare const path: {
|
|
159
|
+
readonly link: (iri: NamedNode) => Path;
|
|
160
|
+
readonly inverse: (p: Path | NamedNode) => Path;
|
|
161
|
+
readonly sequence: (...ps: ReadonlyArray<Path | NamedNode>) => Path;
|
|
162
|
+
readonly alternative: (...ps: ReadonlyArray<Path | NamedNode>) => Path;
|
|
163
|
+
readonly zeroOrMore: (p: Path | NamedNode) => Path;
|
|
164
|
+
readonly oneOrMore: (p: Path | NamedNode) => Path;
|
|
165
|
+
readonly zeroOrOne: (p: Path | NamedNode) => Path;
|
|
166
|
+
readonly negated: (iris: ReadonlyArray<NamedNode>, inverse?: ReadonlyArray<NamedNode>) => Path;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* A group graph pattern `{ … }`.
|
|
170
|
+
*
|
|
171
|
+
* @since 0.1.0
|
|
172
|
+
* @category patterns
|
|
173
|
+
*/
|
|
174
|
+
declare const group: (...patterns: ReadonlyArray<PatternInput>) => GroupPattern;
|
|
175
|
+
/**
|
|
176
|
+
* `OPTIONAL { … }`
|
|
177
|
+
*
|
|
178
|
+
* @since 0.1.0
|
|
179
|
+
* @category patterns
|
|
180
|
+
*/
|
|
181
|
+
declare const optional: (...patterns: ReadonlyArray<PatternInput>) => OptionalPattern;
|
|
182
|
+
/**
|
|
183
|
+
* `MINUS { … }`
|
|
184
|
+
*
|
|
185
|
+
* @since 0.1.0
|
|
186
|
+
* @category patterns
|
|
187
|
+
*/
|
|
188
|
+
declare const minus: (...patterns: ReadonlyArray<PatternInput>) => MinusPattern;
|
|
189
|
+
/**
|
|
190
|
+
* `{ … } UNION { … }`; each argument is one alternative.
|
|
191
|
+
*
|
|
192
|
+
* @since 0.1.0
|
|
193
|
+
* @category patterns
|
|
194
|
+
*/
|
|
195
|
+
declare const union: (...alternatives: ReadonlyArray<PatternInput>) => UnionPattern;
|
|
196
|
+
/**
|
|
197
|
+
* `GRAPH name { … }`
|
|
198
|
+
*
|
|
199
|
+
* @since 0.1.0
|
|
200
|
+
* @category patterns
|
|
201
|
+
*/
|
|
202
|
+
declare const graph: (name: VarOrIri, ...patterns: ReadonlyArray<PatternInput>) => GraphPattern;
|
|
203
|
+
/**
|
|
204
|
+
* `FILTER(expr)`
|
|
205
|
+
*
|
|
206
|
+
* @since 0.1.0
|
|
207
|
+
* @category patterns
|
|
208
|
+
*/
|
|
209
|
+
declare const filter: (expression: ExpressionInput) => FilterPattern;
|
|
210
|
+
/**
|
|
211
|
+
* `BIND(expr AS ?name)`
|
|
212
|
+
*
|
|
213
|
+
* @since 0.1.0
|
|
214
|
+
* @category patterns
|
|
215
|
+
*/
|
|
216
|
+
declare const bind: (expression: ExpressionInput, name: string | Variable) => BindPattern;
|
|
217
|
+
/**
|
|
218
|
+
* Inline data from records: `values([{ x: ex.a, y: 1 }, { x: ex.b }])`.
|
|
219
|
+
* Missing or `undefined` values are `UNDEF`.
|
|
220
|
+
*
|
|
221
|
+
* @since 0.1.0
|
|
222
|
+
* @category patterns
|
|
223
|
+
*/
|
|
224
|
+
declare const values: (rows: ReadonlyArray<Readonly<Record<string, GroundTerm | JsValue | undefined>>>) => ValuesPattern;
|
|
225
|
+
/** @since 0.1.0 @category expressions */
|
|
226
|
+
declare const eq: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
227
|
+
/** @since 0.1.0 @category expressions */
|
|
228
|
+
declare const ne: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
229
|
+
/** @since 0.1.0 @category expressions */
|
|
230
|
+
declare const lt: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
231
|
+
/** @since 0.1.0 @category expressions */
|
|
232
|
+
declare const le: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
233
|
+
/** @since 0.1.0 @category expressions */
|
|
234
|
+
declare const gt: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
235
|
+
/** @since 0.1.0 @category expressions */
|
|
236
|
+
declare const ge: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
237
|
+
/** @since 0.1.0 @category expressions */
|
|
238
|
+
declare const add: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
239
|
+
/** @since 0.1.0 @category expressions */
|
|
240
|
+
declare const subtract: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
241
|
+
/** @since 0.1.0 @category expressions */
|
|
242
|
+
declare const multiply: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
243
|
+
/** @since 0.1.0 @category expressions */
|
|
244
|
+
declare const divide: (a: ExpressionInput, b: ExpressionInput) => Expression;
|
|
245
|
+
/** @since 0.1.0 @category expressions */
|
|
246
|
+
declare const negate: (a: ExpressionInput) => Expression;
|
|
247
|
+
/** @since 0.1.0 @category expressions */
|
|
248
|
+
declare const not: (a: ExpressionInput) => Expression;
|
|
249
|
+
/**
|
|
250
|
+
* Logical conjunction of any number of conditions.
|
|
251
|
+
*
|
|
252
|
+
* @since 0.1.0
|
|
253
|
+
* @category expressions
|
|
254
|
+
*/
|
|
255
|
+
declare const and: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
256
|
+
/**
|
|
257
|
+
* Logical disjunction of any number of conditions.
|
|
258
|
+
*
|
|
259
|
+
* @since 0.1.0
|
|
260
|
+
* @category expressions
|
|
261
|
+
*/
|
|
262
|
+
declare const or: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
263
|
+
/**
|
|
264
|
+
* `expr IN (…)`
|
|
265
|
+
*
|
|
266
|
+
* @since 0.1.0
|
|
267
|
+
* @category expressions
|
|
268
|
+
*/
|
|
269
|
+
declare const isIn: (expression: ExpressionInput, list: ReadonlyArray<ExpressionInput>) => Expression;
|
|
270
|
+
/**
|
|
271
|
+
* `expr NOT IN (…)`
|
|
272
|
+
*
|
|
273
|
+
* @since 0.1.0
|
|
274
|
+
* @category expressions
|
|
275
|
+
*/
|
|
276
|
+
declare const notIn: (expression: ExpressionInput, list: ReadonlyArray<ExpressionInput>) => Expression;
|
|
277
|
+
/**
|
|
278
|
+
* Calls any built-in function by name, e.g. `fn('STRLEN', v.name)`.
|
|
279
|
+
*
|
|
280
|
+
* @since 0.1.0
|
|
281
|
+
* @category expressions
|
|
282
|
+
*/
|
|
283
|
+
declare const fn: (name: BuiltInName, ...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
284
|
+
/**
|
|
285
|
+
* Calls an extension function (or XSD cast) by IRI.
|
|
286
|
+
*
|
|
287
|
+
* @since 0.1.0
|
|
288
|
+
* @category expressions
|
|
289
|
+
*/
|
|
290
|
+
declare const call: (iri: NamedNode, ...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
291
|
+
/** @since 0.1.0 @category expressions */
|
|
292
|
+
declare const bound: (variable: Variable) => Expression;
|
|
293
|
+
/** @since 0.1.0 @category expressions */
|
|
294
|
+
declare const str: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
295
|
+
/** @since 0.1.0 @category expressions */
|
|
296
|
+
declare const lang: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
297
|
+
/** @since 0.1.0 @category expressions */
|
|
298
|
+
declare const langMatches: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
299
|
+
/** @since 0.1.0 @category expressions */
|
|
300
|
+
declare const datatype: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
301
|
+
/** @since 0.1.0 @category expressions */
|
|
302
|
+
declare const iri: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
303
|
+
/** @since 0.1.0 @category expressions */
|
|
304
|
+
declare const regex: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
305
|
+
/** @since 0.1.0 @category expressions */
|
|
306
|
+
declare const contains: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
307
|
+
/** @since 0.1.0 @category expressions */
|
|
308
|
+
declare const strStarts: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
309
|
+
/** @since 0.1.0 @category expressions */
|
|
310
|
+
declare const strEnds: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
311
|
+
/** @since 0.1.0 @category expressions */
|
|
312
|
+
declare const strlen: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
313
|
+
/** @since 0.1.0 @category expressions */
|
|
314
|
+
declare const ucase: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
315
|
+
/** @since 0.1.0 @category expressions */
|
|
316
|
+
declare const lcase: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
317
|
+
/** @since 0.1.0 @category expressions */
|
|
318
|
+
declare const concat: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
319
|
+
/** @since 0.1.0 @category expressions */
|
|
320
|
+
declare const substr: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
321
|
+
/** @since 0.1.0 @category expressions */
|
|
322
|
+
declare const replace: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
323
|
+
/** @since 0.1.0 @category expressions */
|
|
324
|
+
declare const coalesce: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
325
|
+
/** @since 0.1.0 @category expressions */
|
|
326
|
+
declare const ifThenElse: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
327
|
+
/** @since 0.1.0 @category expressions */
|
|
328
|
+
declare const isIri: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
329
|
+
/** @since 0.1.0 @category expressions */
|
|
330
|
+
declare const isBlank: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
331
|
+
/** @since 0.1.0 @category expressions */
|
|
332
|
+
declare const isLiteral: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
333
|
+
/** @since 0.1.0 @category expressions */
|
|
334
|
+
declare const isNumeric: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
335
|
+
/** @since 0.1.0 @category expressions */
|
|
336
|
+
declare const sameTerm: (...args: ReadonlyArray<ExpressionInput>) => Expression;
|
|
337
|
+
/**
|
|
338
|
+
* `EXISTS { … }`
|
|
339
|
+
*
|
|
340
|
+
* @since 0.1.0
|
|
341
|
+
* @category expressions
|
|
342
|
+
*/
|
|
343
|
+
declare const exists: (...patterns: ReadonlyArray<PatternInput>) => Expression;
|
|
344
|
+
/**
|
|
345
|
+
* `NOT EXISTS { … }`
|
|
346
|
+
*
|
|
347
|
+
* @since 0.1.0
|
|
348
|
+
* @category expressions
|
|
349
|
+
*/
|
|
350
|
+
declare const notExists: (...patterns: ReadonlyArray<PatternInput>) => Expression;
|
|
351
|
+
/**
|
|
352
|
+
* `COUNT(*)` (no argument) or `COUNT(expr)`.
|
|
353
|
+
*
|
|
354
|
+
* @since 0.1.0
|
|
355
|
+
* @category aggregates
|
|
356
|
+
*/
|
|
357
|
+
declare const count: (expression?: ExpressionInput, options?: {
|
|
358
|
+
readonly distinct?: boolean;
|
|
359
|
+
}) => Expression;
|
|
360
|
+
/** @since 0.1.0 @category aggregates */
|
|
361
|
+
declare const sum: (expression: ExpressionInput, options?: {
|
|
362
|
+
readonly distinct?: boolean;
|
|
363
|
+
}) => Expression;
|
|
364
|
+
/** @since 0.1.0 @category aggregates */
|
|
365
|
+
declare const avg: (expression: ExpressionInput, options?: {
|
|
366
|
+
readonly distinct?: boolean;
|
|
367
|
+
}) => Expression;
|
|
368
|
+
/** @since 0.1.0 @category aggregates */
|
|
369
|
+
declare const min: (expression: ExpressionInput, options?: {
|
|
370
|
+
readonly distinct?: boolean;
|
|
371
|
+
}) => Expression;
|
|
372
|
+
/** @since 0.1.0 @category aggregates */
|
|
373
|
+
declare const max: (expression: ExpressionInput, options?: {
|
|
374
|
+
readonly distinct?: boolean;
|
|
375
|
+
}) => Expression;
|
|
376
|
+
/** @since 0.1.0 @category aggregates */
|
|
377
|
+
declare const sample: (expression: ExpressionInput, options?: {
|
|
378
|
+
readonly distinct?: boolean;
|
|
379
|
+
}) => Expression;
|
|
380
|
+
/**
|
|
381
|
+
* `GROUP_CONCAT(expr; SEPARATOR = sep)`
|
|
382
|
+
*
|
|
383
|
+
* @since 0.1.0
|
|
384
|
+
* @category aggregates
|
|
385
|
+
*/
|
|
386
|
+
declare const groupConcat: (expression: ExpressionInput, options?: {
|
|
387
|
+
readonly distinct?: boolean;
|
|
388
|
+
readonly separator?: string;
|
|
389
|
+
}) => Expression;
|
|
390
|
+
/**
|
|
391
|
+
* A descending `ORDER BY` condition.
|
|
392
|
+
*
|
|
393
|
+
* @since 0.1.0
|
|
394
|
+
* @category modifiers
|
|
395
|
+
*/
|
|
396
|
+
declare const desc: (expression: ExpressionInput) => OrderCondition;
|
|
397
|
+
/**
|
|
398
|
+
* An ascending `ORDER BY` condition.
|
|
399
|
+
*
|
|
400
|
+
* @since 0.1.0
|
|
401
|
+
* @category modifiers
|
|
402
|
+
*/
|
|
403
|
+
declare const asc: (expression: ExpressionInput) => OrderCondition;
|
|
404
|
+
type Kind = Query['_tag'];
|
|
405
|
+
type QueryOf<K extends Kind> = Extract<Query, {
|
|
406
|
+
readonly _tag: K;
|
|
407
|
+
}>;
|
|
408
|
+
/**
|
|
409
|
+
* An immutable query builder. `K` is the query form; `R` and `O` are the
|
|
410
|
+
* required and optional variables of `SELECT` rows.
|
|
411
|
+
*
|
|
412
|
+
* @since 0.1.0
|
|
413
|
+
* @category models
|
|
414
|
+
*/
|
|
415
|
+
declare class Builder<K extends Kind, R extends string = never, O extends string = never> implements Pipeable {
|
|
416
|
+
/** @internal */
|
|
417
|
+
readonly query: QueryOf<K>;
|
|
418
|
+
constructor(query: QueryOf<K>);
|
|
419
|
+
private with;
|
|
420
|
+
private append;
|
|
421
|
+
/** Adds patterns to the `WHERE` clause. */
|
|
422
|
+
where(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O>;
|
|
423
|
+
/** Adds an `OPTIONAL { … }` block. */
|
|
424
|
+
optional(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O>;
|
|
425
|
+
/** Adds a `MINUS { … }` block. */
|
|
426
|
+
minus(...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O>;
|
|
427
|
+
/** Adds a `UNION` of alternatives. */
|
|
428
|
+
union(...alternatives: ReadonlyArray<PatternInput>): Builder<K, R, O>;
|
|
429
|
+
/** Adds a `FILTER`. */
|
|
430
|
+
filter(expression: ExpressionInput): Builder<K, R, O>;
|
|
431
|
+
/** Adds a `BIND`. */
|
|
432
|
+
bind(expression: ExpressionInput, name: string | Variable): Builder<K, R, O>;
|
|
433
|
+
/** Adds a `GRAPH` block. */
|
|
434
|
+
graph(name: VarOrIri, ...patterns: ReadonlyArray<PatternInput>): Builder<K, R, O>;
|
|
435
|
+
/** Adds inline data. */
|
|
436
|
+
values(rows: Parameters<typeof values>[0]): Builder<K, R, O>;
|
|
437
|
+
/** Adds `GROUP BY` conditions (expressions or `as(expr, name)`). */
|
|
438
|
+
groupBy(...conditions: ReadonlyArray<ExpressionInput | Alias<string, boolean>>): Builder<K, R, O>;
|
|
439
|
+
/** Adds `HAVING` conditions. */
|
|
440
|
+
having(...conditions: ReadonlyArray<ExpressionInput>): Builder<K, R, O>;
|
|
441
|
+
/** Adds `ORDER BY` conditions (ascending unless wrapped with `desc`). */
|
|
442
|
+
orderBy(...conditions: ReadonlyArray<ExpressionInput | OrderCondition>): Builder<K, R, O>;
|
|
443
|
+
/** Sets `LIMIT`. */
|
|
444
|
+
limit(limit: number): Builder<K, R, O>;
|
|
445
|
+
/** Sets `OFFSET`. */
|
|
446
|
+
offset(offset: number): Builder<K, R, O>;
|
|
447
|
+
/** Makes a `SELECT` query `DISTINCT`. */
|
|
448
|
+
distinct(): Builder<K, R, O>;
|
|
449
|
+
/** Makes a `SELECT` query `REDUCED`. */
|
|
450
|
+
reduced(): Builder<K, R, O>;
|
|
451
|
+
/** Adds `FROM` graphs. */
|
|
452
|
+
from(...graphs: ReadonlyArray<NamedNode>): Builder<K, R, O>;
|
|
453
|
+
/** Adds `FROM NAMED` graphs. */
|
|
454
|
+
fromNamed(...graphs: ReadonlyArray<NamedNode>): Builder<K, R, O>;
|
|
455
|
+
/** Declares prefixes (used when printing). */
|
|
456
|
+
prefixes(prefixes: Readonly<Record<string, string>>): Builder<K, R, O>;
|
|
457
|
+
/** The query AST. */
|
|
458
|
+
build(): QueryOf<K>;
|
|
459
|
+
/** The query as SPARQL text. */
|
|
460
|
+
toString(): string;
|
|
461
|
+
pipe(): unknown;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Starts a `SELECT` query. With no arguments, `SELECT *` (rows are then
|
|
465
|
+
* untyped records).
|
|
466
|
+
*
|
|
467
|
+
* @since 0.1.0
|
|
468
|
+
* @category constructors
|
|
469
|
+
*/
|
|
470
|
+
declare const select: <const Items extends ReadonlyArray<SelectItem>>(...items: Items) => Builder<"Select", RequiredOf<Items[number]>, OptionalOf<Items[number]>>;
|
|
471
|
+
/**
|
|
472
|
+
* Starts an `ASK` query.
|
|
473
|
+
*
|
|
474
|
+
* @since 0.1.0
|
|
475
|
+
* @category constructors
|
|
476
|
+
*/
|
|
477
|
+
declare const ask: () => Builder<"Ask">;
|
|
478
|
+
/**
|
|
479
|
+
* Starts a `CONSTRUCT` query with a template.
|
|
480
|
+
*
|
|
481
|
+
* @since 0.1.0
|
|
482
|
+
* @category constructors
|
|
483
|
+
*/
|
|
484
|
+
declare const construct: (...template: ReadonlyArray<TriplePattern | PathPattern>) => Builder<"Construct">;
|
|
485
|
+
/**
|
|
486
|
+
* Starts a `DESCRIBE` query.
|
|
487
|
+
*
|
|
488
|
+
* @since 0.1.0
|
|
489
|
+
* @category constructors
|
|
490
|
+
*/
|
|
491
|
+
declare const describe: (...terms: ReadonlyArray<VarOrIri>) => Builder<"Describe">;
|
|
492
|
+
/**
|
|
493
|
+
* Executes a `SELECT` builder, streaming typed rows.
|
|
494
|
+
*
|
|
495
|
+
* @since 0.1.0
|
|
496
|
+
* @category execution
|
|
497
|
+
*/
|
|
498
|
+
declare const execute: <R extends string, O extends string>(builder: Builder<"Select", R, O>, options?: RequestOptions) => Stream.Stream<Row<R, O>, SparqlError, SparqlEngine>;
|
|
499
|
+
/**
|
|
500
|
+
* Executes a `SELECT` builder and collects all rows.
|
|
501
|
+
*
|
|
502
|
+
* @since 0.1.0
|
|
503
|
+
* @category execution
|
|
504
|
+
*/
|
|
505
|
+
declare const executeAll: <R extends string, O extends string>(builder: Builder<"Select", R, O>, options?: RequestOptions) => Effect.Effect<ReadonlyArray<Row<R, O>>, SparqlError, SparqlEngine>;
|
|
506
|
+
/**
|
|
507
|
+
* Executes a `SELECT` builder and decodes each row with a schema (whose
|
|
508
|
+
* fields are typically `TermSchema` codecs).
|
|
509
|
+
*
|
|
510
|
+
* @since 0.1.0
|
|
511
|
+
* @category execution
|
|
512
|
+
*/
|
|
513
|
+
declare const decode: <R extends string, O extends string, A, RD>(builder: Builder<"Select", R, O>, schema: Schema.Decoder<A, RD>, options?: RequestOptions) => Stream.Stream<A, SparqlError | Schema.SchemaError, SparqlEngine | RD>;
|
|
514
|
+
/**
|
|
515
|
+
* Executes an `ASK` builder.
|
|
516
|
+
*
|
|
517
|
+
* @since 0.1.0
|
|
518
|
+
* @category execution
|
|
519
|
+
*/
|
|
520
|
+
declare const executeAsk: (builder: Builder<"Ask">, options?: RequestOptions) => Effect.Effect<boolean, SparqlError, SparqlEngine>;
|
|
521
|
+
/**
|
|
522
|
+
* Executes a `CONSTRUCT` or `DESCRIBE` builder, streaming triples.
|
|
523
|
+
*
|
|
524
|
+
* @since 0.1.0
|
|
525
|
+
* @category execution
|
|
526
|
+
*/
|
|
527
|
+
declare const executeGraph: (builder: Builder<"Construct"> | Builder<"Describe">, options?: RequestOptions) => Stream.Stream<Quad, SparqlError, SparqlEngine>;
|
|
528
|
+
export { langMatches as $, describe as A, ucase as At, ge as B, concat as C, strStarts as Ct, datatype as D, sum as Dt, count as E, subtract as Et, executeAsk as F, vars as Ft, ifThenElse as G, group as H, executeGraph as I, isIn as J, iri as K, exists as L, eq as M, v as Mt, execute as N, values as Nt, decode as O, toExpression as Ot, executeAll as P, variable as Pt, lang as Q, filter as R, coalesce as S, strEnds as St, contains as T, substr as Tt, groupConcat as U, graph as V, gt as W, isLiteral as X, isIri as Y, isNumeric as Z, ask as _, replace as _t, JsValue as a, min as at, bound as b, select as bt, PatternInput as c, ne as ct, SelectItem as d, notExists as dt, lcase as et, Variables as f, notIn as ft, asc as g, regex as gt, as as h, path as ht, ExpressionInput as i, maybe as it, divide as j, union as jt, desc as k, triple as kt, QueryBuilder_d_exports as l, negate as lt, and as m, or as mt, AsAlias as n, lt as nt, MaybeVariable as o, minus as ot, add as p, optional as pt, isBlank as q, Builder as r, max as rt, ObjectInput as s, multiply as st, Alias as t, le as tt, Row as u, not as ut, avg as v, sameTerm as vt, construct as w, strlen as wt, call as x, str as xt, bind as y, sample as yt, fn as z };
|
|
529
|
+
//# sourceMappingURL=QueryBuilder-DUqh4ECe.d.mts.map
|