@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,1001 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { Y as literal$1, Z as namedNode } from "./Term-CFLG1qu4.mjs";
|
|
3
|
+
import { S as toValue, _ as isValidLexical } from "./Xsd-Cdgx5zRB.mjs";
|
|
4
|
+
import * as Arr from "effect/Array";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
6
|
+
import * as Predicate from "effect/Predicate";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import * as Match from "effect/Match";
|
|
9
|
+
import * as Order from "effect/Order";
|
|
10
|
+
import * as Record from "effect/Record";
|
|
11
|
+
import * as Result from "effect/Result";
|
|
12
|
+
import * as BigDecimal from "effect/BigDecimal";
|
|
13
|
+
// src/csvw/internal/dateFormat.ts
|
|
14
|
+
/**
|
|
15
|
+
* Date and time formats (Tabular Data Model §Formats for dates and times):
|
|
16
|
+
* the UAX 35 date field symbols the specification requires (`yyyy`, `MM`,
|
|
17
|
+
* `M`, `dd`, `d`, `HH`, `mm`, `ss`, `S…`, `X…`, `x…`), compiled to a matcher
|
|
18
|
+
* that yields the XML Schema lexical form.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
/** Timezone offsets by marker length (`x`, `xx`, `xxx`); `X…` also allows `Z`. */
|
|
23
|
+
const TZ_OFFSETS = [
|
|
24
|
+
"[+-]\\d{2}(?:\\d{2})?",
|
|
25
|
+
"[+-]\\d{4}",
|
|
26
|
+
"[+-]\\d{2}:\\d{2}"
|
|
27
|
+
];
|
|
28
|
+
const field = (f, source) => Option.some({
|
|
29
|
+
field: Option.some(f),
|
|
30
|
+
source: `(${source})`
|
|
31
|
+
});
|
|
32
|
+
const tzOffset = (n, allowZ) => Option.flatMap(Arr.get(TZ_OFFSETS, n - 1), (offset) => field("tz", allowZ ? `Z|${offset}` : offset));
|
|
33
|
+
const tokenize = (pattern) => pattern.match(/(.)\1*/gu) ?? [];
|
|
34
|
+
/** A field symbol of exactly `n` letters (`yyyy`, `HH`, …). */
|
|
35
|
+
const exactly = (n, f, source) => (length) => length === n ? field(f, source) : Option.none();
|
|
36
|
+
/** A one- or two-letter numeric field (`M` / `MM`, `d` / `dd`). */
|
|
37
|
+
const oneOrTwo = (f) => (length) => length > 2 ? Option.none() : field(f, length === 2 ? "\\d{2}" : "\\d{1,2}");
|
|
38
|
+
/** The field symbols this implementation recognises, by letter. */
|
|
39
|
+
const symbols = {
|
|
40
|
+
y: exactly(4, "year", "\\d{4}"),
|
|
41
|
+
M: oneOrTwo("month"),
|
|
42
|
+
d: oneOrTwo("day"),
|
|
43
|
+
H: exactly(2, "hour", "\\d{2}"),
|
|
44
|
+
m: exactly(2, "minute", "\\d{2}"),
|
|
45
|
+
s: exactly(2, "second", "\\d{2}"),
|
|
46
|
+
S: (length) => field("fraction", `\\d{1,${length}}`),
|
|
47
|
+
X: (length) => tzOffset(length, true),
|
|
48
|
+
x: (length) => tzOffset(length, false)
|
|
49
|
+
};
|
|
50
|
+
const literal = (run) => /^[-/.: T]+$/.test(run) ? Option.some({
|
|
51
|
+
field: Option.none(),
|
|
52
|
+
source: run.replace(/[.]/g, "\\.")
|
|
53
|
+
}) : Option.none();
|
|
54
|
+
const compileToken = (run) => Option.match(Record.get(symbols, run.charAt(0)), {
|
|
55
|
+
onNone: () => literal(run),
|
|
56
|
+
onSome: (symbol) => symbol(run.length)
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Compiles a date/time pattern; `None` when it uses a symbol this
|
|
60
|
+
* implementation does not recognise.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
const compile = (pattern) => {
|
|
65
|
+
const tokens = Arr.map(tokenize(pattern), compileToken);
|
|
66
|
+
if (!Arr.every(tokens, Option.isSome) || !Arr.isReadonlyArrayNonEmpty(tokens)) return Option.none();
|
|
67
|
+
const compiled = Arr.getSomes(tokens);
|
|
68
|
+
const fields = Arr.getSomes(Arr.map(compiled, (t) => t.field));
|
|
69
|
+
const has = (f) => Arr.contains(fields, f);
|
|
70
|
+
const hasDate = has("year") || has("month") || has("day");
|
|
71
|
+
const hasTime = has("hour") || has("minute") || has("second");
|
|
72
|
+
if (Arr.length(Arr.dedupe(fields)) !== Arr.length(fields)) return Option.none();
|
|
73
|
+
if (has("fraction") && !has("second")) return Option.none();
|
|
74
|
+
return Option.some({
|
|
75
|
+
regex: new RegExp(`^${Arr.join(Arr.map(compiled, (t) => t.source), "")}$`, "u"),
|
|
76
|
+
fields,
|
|
77
|
+
hasDate,
|
|
78
|
+
hasTime
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const pad = (s, n) => s.padStart(n, "0");
|
|
82
|
+
const timezone = (tz) => {
|
|
83
|
+
if (tz === "Z") return "Z";
|
|
84
|
+
const sign = tz.charAt(0);
|
|
85
|
+
const digits = tz.slice(1).replace(":", "");
|
|
86
|
+
return `${sign}${digits.slice(0, 2)}:${digits.length > 2 ? digits.slice(2, 4) : "00"}`;
|
|
87
|
+
};
|
|
88
|
+
const daysInMonth = (year, month) => month === 2 ? year % 4 === 0 && year % 100 !== 0 || year % 400 === 0 ? 29 : 28 : [
|
|
89
|
+
4,
|
|
90
|
+
6,
|
|
91
|
+
9,
|
|
92
|
+
11
|
|
93
|
+
].includes(month) ? 30 : 31;
|
|
94
|
+
const fieldsOf = (m, pattern) => {
|
|
95
|
+
const values = Arr.map(pattern.fields, (f, i) => [f, m[i + 1] ?? ""]);
|
|
96
|
+
const get = (f, otherwise) => Option.getOrElse(Option.map(Arr.findFirst(values, ([g]) => g === f), ([, v]) => v), () => otherwise);
|
|
97
|
+
const fraction = get("fraction", "");
|
|
98
|
+
const tz = get("tz", "");
|
|
99
|
+
return {
|
|
100
|
+
date: `${get("year", "")}-${pad(get("month", ""), 2)}-${pad(get("day", ""), 2)}`,
|
|
101
|
+
time: `${get("hour", "00")}:${get("minute", "00")}:${get("second", "00")}${fraction === "" ? "" : `.${fraction}`}`,
|
|
102
|
+
tz: tz === "" ? "" : timezone(tz)
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const validDate = (date) => {
|
|
106
|
+
const [y = 0, mo = 0, d = 0] = Arr.map(date.split("-"), Number);
|
|
107
|
+
return mo >= 1 && mo <= 12 && d >= 1 && d <= daysInMonth(y, mo);
|
|
108
|
+
};
|
|
109
|
+
const validTime = (time) => {
|
|
110
|
+
const [h = 0, mi = 0, s = 0] = Arr.map(time.split(":"), Number);
|
|
111
|
+
return h <= 23 && mi <= 59 && s < 60;
|
|
112
|
+
};
|
|
113
|
+
const lexicalFor = (fields, pattern, base) => {
|
|
114
|
+
if (base === "date") return pattern.hasDate ? Result.succeed(fields.date + fields.tz) : Result.fail("has no date");
|
|
115
|
+
if (base === "time") return pattern.hasTime ? Result.succeed(fields.time + fields.tz) : Result.fail("has no time");
|
|
116
|
+
if (!pattern.hasDate) return Result.fail("has no date");
|
|
117
|
+
if (base === "dateTimeStamp" && fields.tz === "") return Result.fail("has no timezone");
|
|
118
|
+
return Result.succeed(`${fields.date}T${fields.time}${fields.tz}`);
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Matches a cell string against a compiled pattern and returns the XML Schema
|
|
122
|
+
* lexical form for the base datatype (`date`, `time`, `dateTime` or
|
|
123
|
+
* `dateTimeStamp`).
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
const parse$2 = (text, pattern, base) => Option.match(Option.fromNullishOr(pattern.regex.exec(text)), {
|
|
128
|
+
onNone: () => Result.fail("does not match the format"),
|
|
129
|
+
onSome: (m) => {
|
|
130
|
+
const fields = fieldsOf(m, pattern);
|
|
131
|
+
if (pattern.hasDate && !validDate(fields.date)) return Result.fail("is not a valid date");
|
|
132
|
+
if (pattern.hasTime && !validTime(fields.time)) return Result.fail("is not a valid time");
|
|
133
|
+
return lexicalFor(fields, pattern, base);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
// src/csvw/internal/numberFormat.ts
|
|
137
|
+
/**
|
|
138
|
+
* Numeric formats (Tabular Data Model §Formats for numeric types): the UAX 35
|
|
139
|
+
* number-pattern subset (`0`, `#`, the decimal and group characters, `E`,
|
|
140
|
+
* `+`, `-`, `%` and `‰`), the pattern-less grouped form, and the decimal
|
|
141
|
+
* arithmetic that applies percent and per-mille signs.
|
|
142
|
+
*
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
const escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
146
|
+
const count = (s, c) => Arr.length(Arr.filter(Array.from(s), (x) => x === c));
|
|
147
|
+
/** Primary and secondary grouping sizes of a grouped integer pattern (`#,##,#00` → 3, 2). */
|
|
148
|
+
const integerGrouping = (segments) => Arr.match(Arr.reverse(segments), {
|
|
149
|
+
onEmpty: () => Option.some(Option.none()),
|
|
150
|
+
onNonEmpty: ([primary, ...rest]) => Arr.match(rest, {
|
|
151
|
+
onEmpty: () => Option.some(Option.none()),
|
|
152
|
+
onNonEmpty: ([secondary, ...others]) => {
|
|
153
|
+
const size = Arr.isReadonlyArrayNonEmpty(others) ? secondary.length : primary.length;
|
|
154
|
+
return primary === "" || size === 0 ? Option.none() : Option.some(Option.some([primary.length, size]));
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
/** The grouping size of a grouped fraction pattern (`0.0#,#` → 2). */
|
|
159
|
+
const fractionGrouping = (segments) => Arr.match(segments, {
|
|
160
|
+
onEmpty: () => Option.some(Option.none()),
|
|
161
|
+
onNonEmpty: ([first, ...rest]) => !Arr.isReadonlyArrayNonEmpty(rest) ? Option.some(Option.none()) : first === "" ? Option.none() : Option.some(Option.some(first.length))
|
|
162
|
+
});
|
|
163
|
+
/** Whether `#`s precede the `0`s of the integer part and follow those of the fraction. */
|
|
164
|
+
const wellOrdered = (int, frac) => !/0[^0]*#/.test(int) && !/#[^#]*0/.test(frac);
|
|
165
|
+
/**
|
|
166
|
+
* Parses a number format pattern; `None` when it uses anything this
|
|
167
|
+
* implementation does not recognise.
|
|
168
|
+
*
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
const parsePattern = (pattern, decimalChar, groupChar) => {
|
|
172
|
+
const g = escape(groupChar);
|
|
173
|
+
const re = new RegExp(`^([+\\-%‰]*)([#0${g}]*[#0])(?:${escape(decimalChar)}([#0${g}]*))?(?:E(\\+?)([#0]+))?([%‰]*)$`, "u");
|
|
174
|
+
return Option.flatMap(Option.fromNullishOr(re.exec(pattern)), (m) => {
|
|
175
|
+
const int = m[2] ?? "";
|
|
176
|
+
const frac = Option.fromNullishOr(m[3]);
|
|
177
|
+
const fracText = Option.getOrElse(frac, () => "");
|
|
178
|
+
const fracDigits = digitsOf(fracText, groupChar);
|
|
179
|
+
const affixes = (m[1] ?? "") + (m[6] ?? "");
|
|
180
|
+
if (!wellOrdered(digitsOf(int, groupChar), fracDigits)) return Option.none();
|
|
181
|
+
if (count(affixes, "%") + count(affixes, "‰") > 1) return Option.none();
|
|
182
|
+
return Option.map(Option.all([integerGrouping(int.split(groupChar)), fractionGrouping(Option.isSome(frac) ? fracText.split(groupChar) : [])]), ([grouping, fracGrouping]) => ({
|
|
183
|
+
prefix: m[1] ?? "",
|
|
184
|
+
suffix: m[6] ?? "",
|
|
185
|
+
minInt: count(int, "0"),
|
|
186
|
+
grouping,
|
|
187
|
+
minFrac: count(fracDigits, "0"),
|
|
188
|
+
maxFrac: fracDigits.length,
|
|
189
|
+
fracGrouping,
|
|
190
|
+
hasDecimal: Option.isSome(frac),
|
|
191
|
+
exponent: Option.map(Option.fromNullishOr(m[5]), (e) => count(e, "0"))
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
const checkIntegerGrouping = (int, groupChar, grouping) => {
|
|
196
|
+
const groups = int.split(groupChar);
|
|
197
|
+
const ungrouped = !int.includes(groupChar);
|
|
198
|
+
return Option.match(grouping, {
|
|
199
|
+
onNone: () => ungrouped,
|
|
200
|
+
onSome: ([primary, secondary]) => {
|
|
201
|
+
if (ungrouped) return int.length <= primary;
|
|
202
|
+
const reversed = Arr.reverse(groups);
|
|
203
|
+
const last = Arr.length(reversed) - 1;
|
|
204
|
+
return Arr.every(reversed, (group, i) => {
|
|
205
|
+
const size = i === 0 ? primary : secondary;
|
|
206
|
+
return i === last ? group !== "" && group.length <= size : group.length === size;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
const checkFractionGrouping = (frac, groupChar, grouping) => {
|
|
212
|
+
const groups = frac.split(groupChar);
|
|
213
|
+
return Option.match(grouping, {
|
|
214
|
+
onNone: () => !frac.includes(groupChar),
|
|
215
|
+
onSome: (size) => Arr.every(groups, (group, i) => i === Arr.length(groups) - 1 ? group !== "" && group.length <= size : group.length === size)
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
const digitsOf = (s, groupChar) => s.split(groupChar).join("");
|
|
219
|
+
/**
|
|
220
|
+
* Shifts the decimal point of a decimal lexical form `places` to the left
|
|
221
|
+
* (dividing by 10^places), returning a canonical decimal.
|
|
222
|
+
*
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
const shiftDecimal = (lexical, places) => {
|
|
226
|
+
const negative = lexical.startsWith("-");
|
|
227
|
+
const [int = "", frac = ""] = lexical.replace(/^[+-]/, "").split(".");
|
|
228
|
+
const padded = int.padStart(places + 1, "0");
|
|
229
|
+
const newInt = padded.slice(0, padded.length - places).replace(/^0+(?=\d)/, "");
|
|
230
|
+
const newFrac = (padded.slice(padded.length - places) + frac).replace(/0+$/, "");
|
|
231
|
+
const body = newFrac === "" ? newInt : `${newInt}.${newFrac}`;
|
|
232
|
+
return negative && /[1-9]/.test(body) ? `-${body}` : body;
|
|
233
|
+
};
|
|
234
|
+
const SPECIAL = /^(?:NaN|INF|-INF)$/;
|
|
235
|
+
/** The checks a number read with a pattern must pass, each failing with a reason. */
|
|
236
|
+
const patternChecks = [
|
|
237
|
+
({ int, frac }) => int === "" && Option.isNone(frac) ? Option.some("does not match the pattern") : Option.none(),
|
|
238
|
+
({ int }, _, g) => int.endsWith(g) || int.includes(g + g) ? Option.some("does not match the pattern") : Option.none(),
|
|
239
|
+
({ int }, pattern, g) => checkIntegerGrouping(int, g, pattern.grouping) ? Option.none() : Option.some("does not match the grouping of the pattern"),
|
|
240
|
+
({ int }, pattern, g) => digitsOf(int, g).length < pattern.minInt ? Option.some("has fewer integer digits than the pattern") : Option.none(),
|
|
241
|
+
({ frac }, pattern) => Option.isSome(frac) && !pattern.hasDecimal ? Option.some("has a fraction the pattern does not allow") : Option.none(),
|
|
242
|
+
({ frac }, pattern, g) => Option.exists(frac, (f) => digitsOf(f, g).length > pattern.maxFrac || !checkFractionGrouping(f, g, pattern.fracGrouping)) ? Option.some("does not match the fraction of the pattern") : Option.none(),
|
|
243
|
+
({ frac }, pattern, g) => digitsOf(Option.getOrElse(frac, () => ""), g).length < pattern.minFrac ? Option.some("has fewer fraction digits than the pattern") : Option.none(),
|
|
244
|
+
({ exp }, pattern) => Option.match(pattern.exponent, {
|
|
245
|
+
onNone: () => Option.isSome(exp) ? Option.some("has an exponent the pattern does not allow") : Option.none(),
|
|
246
|
+
onSome: (min) => Option.exists(exp, (e) => e.replace(/^[+-]/, "").length >= min) ? Option.none() : Option.some("does not have the exponent digits of the pattern")
|
|
247
|
+
})
|
|
248
|
+
];
|
|
249
|
+
const partsOf = (body, format, g) => {
|
|
250
|
+
const re = new RegExp(`^([+-]?)(\\d[\\d${escape(g)}]*)?(?:${escape(format.decimalChar)}([\\d${escape(g)}]*))?(?:E([+-]?\\d+))?$`, "u");
|
|
251
|
+
return Option.map(Option.fromNullishOr(re.exec(body)), (m) => ({
|
|
252
|
+
sign: m[1] ?? "",
|
|
253
|
+
int: m[2] ?? "",
|
|
254
|
+
frac: Option.fromNullishOr(m[3]),
|
|
255
|
+
exp: Option.fromNullishOr(m[4])
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
258
|
+
const parseWithPattern = (text, format, pattern) => {
|
|
259
|
+
const g = Option.getOrElse(format.groupChar, () => ",");
|
|
260
|
+
const prefix = pattern.prefix.replace(/[+-]/g, "");
|
|
261
|
+
const suffix = pattern.suffix;
|
|
262
|
+
const parts = text.startsWith(prefix) && text.endsWith(suffix) ? partsOf(text.slice(prefix.length, text.length - suffix.length), format, g) : Option.none();
|
|
263
|
+
return Option.match(parts, {
|
|
264
|
+
onNone: () => Result.fail("does not match the pattern"),
|
|
265
|
+
onSome: (p) => Option.match(Arr.findFirst(patternChecks, (check) => Option.isSome(check(p, pattern, g))).pipe(Option.flatMap((check) => check(p, pattern, g))), {
|
|
266
|
+
onSome: Result.fail,
|
|
267
|
+
onNone: () => Result.succeed(finish(p.sign, digitsOf(p.int, g), Option.map(p.frac, (f) => digitsOf(f, g)), p.exp, text))
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
const finish = (sign, int, frac, exp, text) => {
|
|
272
|
+
const mantissa = `${sign}${int === "" ? "0" : int}${Option.match(frac, {
|
|
273
|
+
onNone: () => "",
|
|
274
|
+
onSome: (f) => `.${f}`
|
|
275
|
+
})}`;
|
|
276
|
+
const plain = Option.match(exp, {
|
|
277
|
+
onNone: () => mantissa,
|
|
278
|
+
onSome: (e) => `${mantissa}e${e}`
|
|
279
|
+
});
|
|
280
|
+
const percent = text.includes("%");
|
|
281
|
+
const permille = text.includes("‰");
|
|
282
|
+
return {
|
|
283
|
+
lexical: percent || permille ? Option.isNone(exp) ? shiftDecimal(mantissa, percent ? 2 : 3) : String(Number(plain) / (percent ? 100 : 1e3)) : plain,
|
|
284
|
+
hasDecimal: Option.isSome(frac),
|
|
285
|
+
hasExponent: Option.isSome(exp),
|
|
286
|
+
special: false
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
const parseWithoutPattern = (text, format) => {
|
|
290
|
+
if (SPECIAL.test(text)) return Result.succeed({
|
|
291
|
+
lexical: text,
|
|
292
|
+
hasDecimal: false,
|
|
293
|
+
hasExponent: false,
|
|
294
|
+
special: true
|
|
295
|
+
});
|
|
296
|
+
const g = Option.getOrUndefined(format.groupChar);
|
|
297
|
+
const d = format.decimalChar;
|
|
298
|
+
const groupClass = g === void 0 ? "" : escape(g);
|
|
299
|
+
const m = new RegExp(`^([+-]?)(\\d(?:\\d|${g === void 0 ? "(?!)" : groupClass})*)?(?:${escape(d)}(\\d+))?(?:[Ee]([+-]?\\d+))?([%‰]?)$`, "u").exec(text);
|
|
300
|
+
if (m === null || m[2] === void 0 && m[3] === void 0) return Result.fail("is not a number");
|
|
301
|
+
const int = m[2] ?? "";
|
|
302
|
+
if (g !== void 0 && (int.includes(g + g) || int.endsWith(g))) return Result.fail("contains consecutive group characters");
|
|
303
|
+
return Result.succeed(finish(m[1] ?? "", g === void 0 ? int : digitsOf(int, g), Option.fromNullishOr(m[3]), Option.fromNullishOr(m[4]), text));
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Parses a cell string with a numeric format.
|
|
307
|
+
*
|
|
308
|
+
* @internal
|
|
309
|
+
*/
|
|
310
|
+
const parse$1 = (text, format) => Option.match(format.pattern, {
|
|
311
|
+
onNone: () => parseWithoutPattern(text, format),
|
|
312
|
+
onSome: (pattern) => SPECIAL.test(text) ? Result.succeed({
|
|
313
|
+
lexical: text,
|
|
314
|
+
hasDecimal: false,
|
|
315
|
+
hasExponent: false,
|
|
316
|
+
special: true
|
|
317
|
+
}) : parseWithPattern(text, format, pattern)
|
|
318
|
+
});
|
|
319
|
+
// src/csvw/internal/vocab.ts
|
|
320
|
+
/**
|
|
321
|
+
* The fixed CSVW JSON-LD context (`http://www.w3.org/ns/csvw`): its prefixes
|
|
322
|
+
* (the RDFa 1.1 initial context plus `csvw`), its terms, prefixed-name
|
|
323
|
+
* expansion and URL compaction (Metadata Vocabulary §URL Compaction).
|
|
324
|
+
*
|
|
325
|
+
* @internal
|
|
326
|
+
*/
|
|
327
|
+
/** @internal */
|
|
328
|
+
const CSVW = "http://www.w3.org/ns/csvw#";
|
|
329
|
+
/** @internal */
|
|
330
|
+
const XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
331
|
+
/** @internal */
|
|
332
|
+
const RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
333
|
+
/**
|
|
334
|
+
* The prefixes of the CSVW context, which metadata MUST NOT override.
|
|
335
|
+
*
|
|
336
|
+
* @internal
|
|
337
|
+
*/
|
|
338
|
+
const prefixes = {
|
|
339
|
+
as: "https://www.w3.org/ns/activitystreams#",
|
|
340
|
+
cc: "http://creativecommons.org/ns#",
|
|
341
|
+
csvw: CSVW,
|
|
342
|
+
ctag: "http://commontag.org/ns#",
|
|
343
|
+
dc: "http://purl.org/dc/terms/",
|
|
344
|
+
dc11: "http://purl.org/dc/elements/1.1/",
|
|
345
|
+
dcat: "http://www.w3.org/ns/dcat#",
|
|
346
|
+
dcterms: "http://purl.org/dc/terms/",
|
|
347
|
+
dctypes: "http://purl.org/dc/dcmitype/",
|
|
348
|
+
dqv: "http://www.w3.org/ns/dqv#",
|
|
349
|
+
duv: "https://www.w3.org/TR/vocab-duv#",
|
|
350
|
+
foaf: "http://xmlns.com/foaf/0.1/",
|
|
351
|
+
gr: "http://purl.org/goodrelations/v1#",
|
|
352
|
+
grddl: "http://www.w3.org/2003/g/data-view#",
|
|
353
|
+
ical: "http://www.w3.org/2002/12/cal/icaltzd#",
|
|
354
|
+
ldp: "http://www.w3.org/ns/ldp#",
|
|
355
|
+
ma: "http://www.w3.org/ns/ma-ont#",
|
|
356
|
+
oa: "http://www.w3.org/ns/oa#",
|
|
357
|
+
og: "http://ogp.me/ns#",
|
|
358
|
+
org: "http://www.w3.org/ns/org#",
|
|
359
|
+
owl: "http://www.w3.org/2002/07/owl#",
|
|
360
|
+
prov: "http://www.w3.org/ns/prov#",
|
|
361
|
+
qb: "http://purl.org/linked-data/cube#",
|
|
362
|
+
rdf: RDF,
|
|
363
|
+
rdfa: "http://www.w3.org/ns/rdfa#",
|
|
364
|
+
rdfs: "http://www.w3.org/2000/01/rdf-schema#",
|
|
365
|
+
rev: "http://purl.org/stuff/rev#",
|
|
366
|
+
rif: "http://www.w3.org/2007/rif#",
|
|
367
|
+
rr: "http://www.w3.org/ns/r2rml#",
|
|
368
|
+
schema: "http://schema.org/",
|
|
369
|
+
sd: "http://www.w3.org/ns/sparql-service-description#",
|
|
370
|
+
sioc: "http://rdfs.org/sioc/ns#",
|
|
371
|
+
skos: "http://www.w3.org/2004/02/skos/core#",
|
|
372
|
+
skosxl: "http://www.w3.org/2008/05/skos-xl#",
|
|
373
|
+
v: "http://rdf.data-vocabulary.org/#",
|
|
374
|
+
vcard: "http://www.w3.org/2006/vcard/ns#",
|
|
375
|
+
void: "http://rdfs.org/ns/void#",
|
|
376
|
+
wdr: "http://www.w3.org/2007/05/powder#",
|
|
377
|
+
wrds: "http://www.w3.org/2007/05/powder-s#",
|
|
378
|
+
xhv: "http://www.w3.org/1999/xhtml/vocab#",
|
|
379
|
+
xsd: XSD
|
|
380
|
+
};
|
|
381
|
+
const xsdTerms = [
|
|
382
|
+
"anyURI",
|
|
383
|
+
"base64Binary",
|
|
384
|
+
"boolean",
|
|
385
|
+
"byte",
|
|
386
|
+
"date",
|
|
387
|
+
"dateTime",
|
|
388
|
+
"dayTimeDuration",
|
|
389
|
+
"dateTimeStamp",
|
|
390
|
+
"decimal",
|
|
391
|
+
"double",
|
|
392
|
+
"duration",
|
|
393
|
+
"float",
|
|
394
|
+
"gDay",
|
|
395
|
+
"gMonth",
|
|
396
|
+
"gMonthDay",
|
|
397
|
+
"gYear",
|
|
398
|
+
"gYearMonth",
|
|
399
|
+
"hexBinary",
|
|
400
|
+
"int",
|
|
401
|
+
"integer",
|
|
402
|
+
"language",
|
|
403
|
+
"long",
|
|
404
|
+
"Name",
|
|
405
|
+
"NCName",
|
|
406
|
+
"NMTOKEN",
|
|
407
|
+
"negativeInteger",
|
|
408
|
+
"nonNegativeInteger",
|
|
409
|
+
"nonPositiveInteger",
|
|
410
|
+
"normalizedString",
|
|
411
|
+
"positiveInteger",
|
|
412
|
+
"QName",
|
|
413
|
+
"short",
|
|
414
|
+
"string",
|
|
415
|
+
"time",
|
|
416
|
+
"token",
|
|
417
|
+
"unsignedByte",
|
|
418
|
+
"unsignedInt",
|
|
419
|
+
"unsignedLong",
|
|
420
|
+
"unsignedShort",
|
|
421
|
+
"yearMonthDuration"
|
|
422
|
+
];
|
|
423
|
+
const csvwClasses = [
|
|
424
|
+
"Cell",
|
|
425
|
+
"Column",
|
|
426
|
+
"Datatype",
|
|
427
|
+
"Dialect",
|
|
428
|
+
"Direction",
|
|
429
|
+
"ForeignKey",
|
|
430
|
+
"NumericFormat",
|
|
431
|
+
"Row",
|
|
432
|
+
"Schema",
|
|
433
|
+
"Table",
|
|
434
|
+
"TableGroup",
|
|
435
|
+
"TableReference",
|
|
436
|
+
"Transformation",
|
|
437
|
+
"JSON",
|
|
438
|
+
"uriTemplate"
|
|
439
|
+
];
|
|
440
|
+
const csvwProperties = {
|
|
441
|
+
aboutUrl: "aboutUrl",
|
|
442
|
+
base: "base",
|
|
443
|
+
columnReference: "columnReference",
|
|
444
|
+
columns: "column",
|
|
445
|
+
commentPrefix: "commentPrefix",
|
|
446
|
+
datatype: "datatype",
|
|
447
|
+
decimalChar: "decimalChar",
|
|
448
|
+
default: "default",
|
|
449
|
+
describes: "describes",
|
|
450
|
+
delimiter: "delimiter",
|
|
451
|
+
dialect: "dialect",
|
|
452
|
+
doubleQuote: "doubleQuote",
|
|
453
|
+
encoding: "encoding",
|
|
454
|
+
foreignKeys: "foreignKey",
|
|
455
|
+
format: "format",
|
|
456
|
+
groupChar: "groupChar",
|
|
457
|
+
header: "header",
|
|
458
|
+
headerRowCount: "headerRowCount",
|
|
459
|
+
lang: "lang",
|
|
460
|
+
length: "length",
|
|
461
|
+
lineTerminators: "lineTerminators",
|
|
462
|
+
maxExclusive: "maxExclusive",
|
|
463
|
+
maxInclusive: "maxInclusive",
|
|
464
|
+
maxLength: "maxLength",
|
|
465
|
+
minExclusive: "minExclusive",
|
|
466
|
+
minInclusive: "minInclusive",
|
|
467
|
+
minLength: "minLength",
|
|
468
|
+
name: "name",
|
|
469
|
+
notes: "note",
|
|
470
|
+
null: "null",
|
|
471
|
+
ordered: "ordered",
|
|
472
|
+
pattern: "pattern",
|
|
473
|
+
primaryKey: "primaryKey",
|
|
474
|
+
propertyUrl: "propertyUrl",
|
|
475
|
+
quoteChar: "quoteChar",
|
|
476
|
+
reference: "reference",
|
|
477
|
+
referencedRows: "referencedRow",
|
|
478
|
+
required: "required",
|
|
479
|
+
resource: "resource",
|
|
480
|
+
row: "row",
|
|
481
|
+
rowTitles: "rowTitle",
|
|
482
|
+
rownum: "rownum",
|
|
483
|
+
scriptFormat: "scriptFormat",
|
|
484
|
+
schemaReference: "schemaReference",
|
|
485
|
+
separator: "separator",
|
|
486
|
+
skipBlankRows: "skipBlankRows",
|
|
487
|
+
skipColumns: "skipColumns",
|
|
488
|
+
skipInitialSpace: "skipInitialSpace",
|
|
489
|
+
skipRows: "skipRows",
|
|
490
|
+
source: "source",
|
|
491
|
+
suppressOutput: "suppressOutput",
|
|
492
|
+
tables: "table",
|
|
493
|
+
tableDirection: "tableDirection",
|
|
494
|
+
tableSchema: "tableSchema",
|
|
495
|
+
targetFormat: "targetFormat",
|
|
496
|
+
transformations: "transformations",
|
|
497
|
+
textDirection: "textDirection",
|
|
498
|
+
titles: "title",
|
|
499
|
+
trim: "trim",
|
|
500
|
+
url: "url",
|
|
501
|
+
valueUrl: "valueUrl",
|
|
502
|
+
virtual: "virtual"
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
505
|
+
* Every term of the CSVW context mapped to its absolute IRI.
|
|
506
|
+
*
|
|
507
|
+
* @internal
|
|
508
|
+
*/
|
|
509
|
+
const terms = {
|
|
510
|
+
...Record.map(prefixes, (iri) => iri),
|
|
511
|
+
xml: `${RDF}XMLLiteral`,
|
|
512
|
+
html: `${RDF}HTML`,
|
|
513
|
+
json: `${CSVW}JSON`,
|
|
514
|
+
any: `${XSD}anyAtomicType`,
|
|
515
|
+
anyAtomicType: `${XSD}anyAtomicType`,
|
|
516
|
+
binary: `${XSD}base64Binary`,
|
|
517
|
+
datetime: `${XSD}dateTime`,
|
|
518
|
+
number: `${XSD}double`,
|
|
519
|
+
describedby: "http://www.w3.org/2007/05/powder-s#describedby",
|
|
520
|
+
license: "http://www.w3.org/1999/xhtml/vocab#license",
|
|
521
|
+
role: "http://www.w3.org/1999/xhtml/vocab#role",
|
|
522
|
+
maximum: `${CSVW}maxInclusive`,
|
|
523
|
+
minimum: `${CSVW}minInclusive`,
|
|
524
|
+
...Record.fromEntries(Arr.map(xsdTerms, (t) => [t, `${XSD}${t}`])),
|
|
525
|
+
...Record.fromEntries(Arr.map(csvwClasses, (t) => [t, `${CSVW}${t}`])),
|
|
526
|
+
...Record.map(csvwProperties, (local) => `${CSVW}${local}`)
|
|
527
|
+
};
|
|
528
|
+
const PREFIXED = /^([A-Za-z][\w.-]*):(.*)$/;
|
|
529
|
+
/**
|
|
530
|
+
* The expansion of `value` if it is a prefixed name with a CSVW prefix.
|
|
531
|
+
*
|
|
532
|
+
* @internal
|
|
533
|
+
*/
|
|
534
|
+
const expandPrefixed = (value) => Option.flatMap(Option.fromNullishOr(PREFIXED.exec(value)), (m) => Option.map(Record.get(prefixes, m[1] ?? ""), (ns) => ns + (m[2] ?? "")));
|
|
535
|
+
/**
|
|
536
|
+
* Expands a term or prefixed name of the CSVW context; anything else is
|
|
537
|
+
* returned unchanged.
|
|
538
|
+
*
|
|
539
|
+
* @internal
|
|
540
|
+
*/
|
|
541
|
+
const expand = (value) => Option.getOrElse(Record.get(terms, value), () => Option.getOrElse(expandPrefixed(value), () => value));
|
|
542
|
+
/**
|
|
543
|
+
* Whether `value` is an absolute URL (has a scheme).
|
|
544
|
+
*
|
|
545
|
+
* @internal
|
|
546
|
+
*/
|
|
547
|
+
const isAbsoluteUrl = (value) => /^[A-Za-z][A-Za-z0-9+.-]*:/.test(value);
|
|
548
|
+
const compactable = Arr.sort(Arr.filter(Record.toEntries(prefixes), ([prefix]) => prefix !== "dcterms"), Order.mapInput(Order.Number, ([, ns]) => -ns.length));
|
|
549
|
+
const termOf = Record.fromEntries(Arr.map(Arr.filter(Record.toEntries(terms), ([term]) => !Record.has(prefixes, term)), ([term, iri]) => [iri, term]));
|
|
550
|
+
/**
|
|
551
|
+
* URL compaction (Metadata Vocabulary §URL Compaction): an absolute URL to a
|
|
552
|
+
* term or prefixed name of the CSVW context; `rdf:type` becomes `@type`.
|
|
553
|
+
*
|
|
554
|
+
* @internal
|
|
555
|
+
*/
|
|
556
|
+
const compact = (url) => url === `http://www.w3.org/1999/02/22-rdf-syntax-ns#type` ? "@type" : Option.getOrElse(Record.get(termOf, url), () => Option.getOrElse(Option.map(Arr.findFirst(compactable, ([, ns]) => url.startsWith(ns) && url.length > ns.length), ([prefix, ns]) => `${prefix}:${url.slice(ns.length)}`), () => url));
|
|
557
|
+
// src/csvw/Datatype.ts
|
|
558
|
+
/**
|
|
559
|
+
* CSVW datatypes (Metadata Vocabulary §Datatypes, Tabular Data Model §Parsing
|
|
560
|
+
* Cells): the built-in datatypes, datatype descriptions, and parsing a cell's
|
|
561
|
+
* string value into a typed value with its `format`, length and value
|
|
562
|
+
* constraints.
|
|
563
|
+
*
|
|
564
|
+
* @since 0.1.0
|
|
565
|
+
*/
|
|
566
|
+
var Datatype_exports = /* @__PURE__ */ __exportAll({
|
|
567
|
+
Bound: () => Bound,
|
|
568
|
+
Datatype: () => Datatype,
|
|
569
|
+
NumericFormat: () => NumericFormat,
|
|
570
|
+
boundKey: () => boundKey,
|
|
571
|
+
builtIn: () => builtIn,
|
|
572
|
+
canonicalName: () => canonicalName,
|
|
573
|
+
checkFormat: () => checkFormat,
|
|
574
|
+
datatypeIri: () => datatypeIri,
|
|
575
|
+
fromIri: () => fromIri,
|
|
576
|
+
iri: () => iri,
|
|
577
|
+
isBinary: () => isBinary,
|
|
578
|
+
isBuiltIn: () => isBuiltIn,
|
|
579
|
+
isDateTime: () => isDateTime,
|
|
580
|
+
isDecimal: () => isDecimal,
|
|
581
|
+
isDuration: () => isDuration,
|
|
582
|
+
isInteger: () => isInteger,
|
|
583
|
+
isNumeric: () => isNumeric,
|
|
584
|
+
isString: () => isString$1,
|
|
585
|
+
parse: () => parse,
|
|
586
|
+
string: () => string,
|
|
587
|
+
stringValue: () => stringValue
|
|
588
|
+
});
|
|
589
|
+
/**
|
|
590
|
+
* The names of the built-in datatypes, including the CSVW aliases (`number`,
|
|
591
|
+
* `binary`, `datetime`, `any`, `xml`, `html`, `json`).
|
|
592
|
+
*
|
|
593
|
+
* @since 0.1.0
|
|
594
|
+
* @category datatypes
|
|
595
|
+
*/
|
|
596
|
+
const builtIn = [
|
|
597
|
+
"anyAtomicType",
|
|
598
|
+
"anyURI",
|
|
599
|
+
"base64Binary",
|
|
600
|
+
"boolean",
|
|
601
|
+
"date",
|
|
602
|
+
"dateTime",
|
|
603
|
+
"dateTimeStamp",
|
|
604
|
+
"decimal",
|
|
605
|
+
"integer",
|
|
606
|
+
"long",
|
|
607
|
+
"int",
|
|
608
|
+
"short",
|
|
609
|
+
"byte",
|
|
610
|
+
"nonNegativeInteger",
|
|
611
|
+
"positiveInteger",
|
|
612
|
+
"unsignedLong",
|
|
613
|
+
"unsignedInt",
|
|
614
|
+
"unsignedShort",
|
|
615
|
+
"unsignedByte",
|
|
616
|
+
"nonPositiveInteger",
|
|
617
|
+
"negativeInteger",
|
|
618
|
+
"double",
|
|
619
|
+
"duration",
|
|
620
|
+
"dayTimeDuration",
|
|
621
|
+
"yearMonthDuration",
|
|
622
|
+
"float",
|
|
623
|
+
"gDay",
|
|
624
|
+
"gMonth",
|
|
625
|
+
"gMonthDay",
|
|
626
|
+
"gYear",
|
|
627
|
+
"gYearMonth",
|
|
628
|
+
"hexBinary",
|
|
629
|
+
"QName",
|
|
630
|
+
"string",
|
|
631
|
+
"normalizedString",
|
|
632
|
+
"token",
|
|
633
|
+
"language",
|
|
634
|
+
"Name",
|
|
635
|
+
"NMTOKEN",
|
|
636
|
+
"xml",
|
|
637
|
+
"html",
|
|
638
|
+
"json",
|
|
639
|
+
"time",
|
|
640
|
+
"number",
|
|
641
|
+
"binary",
|
|
642
|
+
"datetime",
|
|
643
|
+
"any"
|
|
644
|
+
];
|
|
645
|
+
const aliases = {
|
|
646
|
+
number: "double",
|
|
647
|
+
binary: "base64Binary",
|
|
648
|
+
datetime: "dateTime",
|
|
649
|
+
any: "anyAtomicType"
|
|
650
|
+
};
|
|
651
|
+
/**
|
|
652
|
+
* Whether `name` names a built-in datatype.
|
|
653
|
+
*
|
|
654
|
+
* @since 0.1.0
|
|
655
|
+
* @category datatypes
|
|
656
|
+
*/
|
|
657
|
+
const isBuiltIn = (name) => Arr.contains(builtIn, name);
|
|
658
|
+
/**
|
|
659
|
+
* The XML Schema name of a built-in datatype (`number` is `double`, …).
|
|
660
|
+
*
|
|
661
|
+
* @since 0.1.0
|
|
662
|
+
* @category datatypes
|
|
663
|
+
*/
|
|
664
|
+
const canonicalName = (name) => Option.getOrElse(Record.get(aliases, name), () => name);
|
|
665
|
+
/**
|
|
666
|
+
* The IRI of a built-in datatype.
|
|
667
|
+
*
|
|
668
|
+
* @since 0.1.0
|
|
669
|
+
* @category datatypes
|
|
670
|
+
*/
|
|
671
|
+
const iri = (name) => Match.value(canonicalName(name)).pipe(Match.when("xml", () => `${RDF}XMLLiteral`), Match.when("html", () => `${RDF}HTML`), Match.when("json", () => `${CSVW}JSON`), Match.orElse((n) => `${XSD}${n}`));
|
|
672
|
+
/**
|
|
673
|
+
* The built-in datatype an IRI identifies, if any.
|
|
674
|
+
*
|
|
675
|
+
* @since 0.1.0
|
|
676
|
+
* @category datatypes
|
|
677
|
+
*/
|
|
678
|
+
const fromIri = (url) => Arr.findFirst(builtIn, (name) => !Record.has(aliases, name) && iri(name) === url);
|
|
679
|
+
const integerTypes = [
|
|
680
|
+
"integer",
|
|
681
|
+
"long",
|
|
682
|
+
"int",
|
|
683
|
+
"short",
|
|
684
|
+
"byte",
|
|
685
|
+
"nonNegativeInteger",
|
|
686
|
+
"positiveInteger",
|
|
687
|
+
"unsignedLong",
|
|
688
|
+
"unsignedInt",
|
|
689
|
+
"unsignedShort",
|
|
690
|
+
"unsignedByte",
|
|
691
|
+
"nonPositiveInteger",
|
|
692
|
+
"negativeInteger"
|
|
693
|
+
];
|
|
694
|
+
const dateTypes = [
|
|
695
|
+
"date",
|
|
696
|
+
"dateTime",
|
|
697
|
+
"dateTimeStamp",
|
|
698
|
+
"time",
|
|
699
|
+
"gDay",
|
|
700
|
+
"gMonth",
|
|
701
|
+
"gMonthDay",
|
|
702
|
+
"gYear",
|
|
703
|
+
"gYearMonth"
|
|
704
|
+
];
|
|
705
|
+
const durationTypes = [
|
|
706
|
+
"duration",
|
|
707
|
+
"dayTimeDuration",
|
|
708
|
+
"yearMonthDuration"
|
|
709
|
+
];
|
|
710
|
+
const stringTypes = [
|
|
711
|
+
"string",
|
|
712
|
+
"normalizedString",
|
|
713
|
+
"token",
|
|
714
|
+
"language",
|
|
715
|
+
"Name",
|
|
716
|
+
"NMTOKEN",
|
|
717
|
+
"xml",
|
|
718
|
+
"html",
|
|
719
|
+
"json"
|
|
720
|
+
];
|
|
721
|
+
/**
|
|
722
|
+
* Whether a built-in datatype is an integer type.
|
|
723
|
+
*
|
|
724
|
+
* @since 0.1.0
|
|
725
|
+
* @category datatypes
|
|
726
|
+
*/
|
|
727
|
+
const isInteger = (name) => Arr.contains(integerTypes, canonicalName(name));
|
|
728
|
+
/**
|
|
729
|
+
* Whether a built-in datatype is `decimal` or one of its subtypes.
|
|
730
|
+
*
|
|
731
|
+
* @since 0.1.0
|
|
732
|
+
* @category datatypes
|
|
733
|
+
*/
|
|
734
|
+
const isDecimal = (name) => canonicalName(name) === "decimal" || isInteger(name);
|
|
735
|
+
/**
|
|
736
|
+
* Whether a built-in datatype is numeric.
|
|
737
|
+
*
|
|
738
|
+
* @since 0.1.0
|
|
739
|
+
* @category datatypes
|
|
740
|
+
*/
|
|
741
|
+
const isNumeric = (name) => isDecimal(name) || canonicalName(name) === "double" || canonicalName(name) === "float";
|
|
742
|
+
/**
|
|
743
|
+
* Whether a built-in datatype is a date or time type.
|
|
744
|
+
*
|
|
745
|
+
* @since 0.1.0
|
|
746
|
+
* @category datatypes
|
|
747
|
+
*/
|
|
748
|
+
const isDateTime = (name) => Arr.contains(dateTypes, canonicalName(name));
|
|
749
|
+
/**
|
|
750
|
+
* Whether a built-in datatype is a duration type.
|
|
751
|
+
*
|
|
752
|
+
* @since 0.1.0
|
|
753
|
+
* @category datatypes
|
|
754
|
+
*/
|
|
755
|
+
const isDuration = (name) => Arr.contains(durationTypes, canonicalName(name));
|
|
756
|
+
/**
|
|
757
|
+
* Whether a built-in datatype is `string` or one of its subtypes.
|
|
758
|
+
*
|
|
759
|
+
* @since 0.1.0
|
|
760
|
+
* @category datatypes
|
|
761
|
+
*/
|
|
762
|
+
const isString$1 = (name) => Arr.contains(stringTypes, canonicalName(name));
|
|
763
|
+
/**
|
|
764
|
+
* Whether a built-in datatype is a binary type.
|
|
765
|
+
*
|
|
766
|
+
* @since 0.1.0
|
|
767
|
+
* @category datatypes
|
|
768
|
+
*/
|
|
769
|
+
const isBinary = (name) => canonicalName(name) === "base64Binary" || canonicalName(name) === "hexBinary";
|
|
770
|
+
/**
|
|
771
|
+
* A numeric format object (`decimalChar`, `groupChar`, `pattern`).
|
|
772
|
+
*
|
|
773
|
+
* @since 0.1.0
|
|
774
|
+
* @category models
|
|
775
|
+
*/
|
|
776
|
+
const NumericFormat = Schema.Struct({
|
|
777
|
+
decimalChar: Schema.optional(Schema.String),
|
|
778
|
+
groupChar: Schema.optional(Schema.String),
|
|
779
|
+
pattern: Schema.optional(Schema.String)
|
|
780
|
+
});
|
|
781
|
+
/**
|
|
782
|
+
* A bound of a value constraint, as written in the metadata.
|
|
783
|
+
*
|
|
784
|
+
* @since 0.1.0
|
|
785
|
+
* @category models
|
|
786
|
+
*/
|
|
787
|
+
const Bound = Schema.Union([Schema.String, Schema.Finite]);
|
|
788
|
+
/**
|
|
789
|
+
* A normalized datatype description: a built-in `base`, an optional `@id`,
|
|
790
|
+
* a `format`, and length and value constraints.
|
|
791
|
+
*
|
|
792
|
+
* @since 0.1.0
|
|
793
|
+
* @category models
|
|
794
|
+
*/
|
|
795
|
+
const Datatype = Schema.Struct({
|
|
796
|
+
base: Schema.String,
|
|
797
|
+
id: Schema.optional(Schema.String),
|
|
798
|
+
format: Schema.optional(Schema.Union([Schema.String, NumericFormat])),
|
|
799
|
+
length: Schema.optional(Schema.Int),
|
|
800
|
+
minLength: Schema.optional(Schema.Int),
|
|
801
|
+
maxLength: Schema.optional(Schema.Int),
|
|
802
|
+
minInclusive: Schema.optional(Bound),
|
|
803
|
+
maxInclusive: Schema.optional(Bound),
|
|
804
|
+
minExclusive: Schema.optional(Bound),
|
|
805
|
+
maxExclusive: Schema.optional(Bound),
|
|
806
|
+
common: Schema.Record(Schema.String, Schema.Json)
|
|
807
|
+
});
|
|
808
|
+
/**
|
|
809
|
+
* The `string` datatype.
|
|
810
|
+
*
|
|
811
|
+
* @since 0.1.0
|
|
812
|
+
* @category constructors
|
|
813
|
+
*/
|
|
814
|
+
const string = {
|
|
815
|
+
base: "string",
|
|
816
|
+
common: {}
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* The IRI a value of the datatype has in RDF: its `@id`, or its base's IRI.
|
|
820
|
+
*
|
|
821
|
+
* @since 0.1.0
|
|
822
|
+
* @category datatypes
|
|
823
|
+
*/
|
|
824
|
+
const datatypeIri = (datatype) => datatype.id ?? iri(datatype.base);
|
|
825
|
+
const quote = (s) => `"${s}"`;
|
|
826
|
+
const isValidRegex = (source) => Result.isSuccess(regexOf(source));
|
|
827
|
+
const regexOf = (source) => Result.try({
|
|
828
|
+
try: () => new RegExp(`^(?:${source})$`, "u"),
|
|
829
|
+
catch: (e) => String(e)
|
|
830
|
+
});
|
|
831
|
+
/**
|
|
832
|
+
* Checks a datatype's `format` against its base, returning a warning when the
|
|
833
|
+
* format is unusable (it is then ignored).
|
|
834
|
+
*
|
|
835
|
+
* @since 0.1.0
|
|
836
|
+
* @category validation
|
|
837
|
+
*/
|
|
838
|
+
const checkFormat = (base, format) => {
|
|
839
|
+
if (isNumeric(base)) return checkNumberFormat(format);
|
|
840
|
+
if (!Predicate.isString(format)) return Option.some(`format for a ${base} datatype must be a string`);
|
|
841
|
+
return Arr.contains([
|
|
842
|
+
"date",
|
|
843
|
+
"dateTime",
|
|
844
|
+
"dateTimeStamp",
|
|
845
|
+
"time"
|
|
846
|
+
], canonicalName(base)) ? invalidUnless(Option.isSome(compile(format)), `invalid date/time format ${quote(format)}`) : canonicalName(base) === "boolean" ? invalidUnless(/^[^|]+\|[^|]+$/.test(format), `invalid boolean format ${quote(format)}`) : invalidUnless(isValidRegex(format), `invalid regular expression format ${quote(format)}`);
|
|
847
|
+
};
|
|
848
|
+
const invalidUnless = (valid, message) => valid ? Option.none() : Option.some(message);
|
|
849
|
+
const checkNumberFormat = (format) => {
|
|
850
|
+
const { pattern, decimalChar, groupChar } = Predicate.isString(format) ? {
|
|
851
|
+
pattern: format,
|
|
852
|
+
decimalChar: ".",
|
|
853
|
+
groupChar: ","
|
|
854
|
+
} : {
|
|
855
|
+
pattern: format.pattern,
|
|
856
|
+
decimalChar: format.decimalChar ?? ".",
|
|
857
|
+
groupChar: format.groupChar ?? ","
|
|
858
|
+
};
|
|
859
|
+
return Option.flatMap(Option.fromNullishOr(pattern), (p) => invalidUnless(Option.isSome(parsePattern(p, decimalChar, groupChar)), `invalid number format pattern ${quote(p)}`));
|
|
860
|
+
};
|
|
861
|
+
const numberFormatOf = (format) => {
|
|
862
|
+
if (format === void 0) return {
|
|
863
|
+
pattern: Option.none(),
|
|
864
|
+
decimalChar: ".",
|
|
865
|
+
groupChar: Option.none()
|
|
866
|
+
};
|
|
867
|
+
const decimalChar = Predicate.isString(format) ? "." : format.decimalChar ?? ".";
|
|
868
|
+
const groupChar = Predicate.isString(format) ? void 0 : format.groupChar;
|
|
869
|
+
const pattern = Predicate.isString(format) ? format : format.pattern;
|
|
870
|
+
return {
|
|
871
|
+
decimalChar,
|
|
872
|
+
groupChar: Option.fromNullishOr(groupChar),
|
|
873
|
+
pattern: Option.flatMap(Option.fromNullishOr(pattern), (p) => parsePattern(p, decimalChar, groupChar ?? ","))
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
const xsdValid = (base, lexical) => isValidLexical(`${XSD}${canonicalName(base)}`, lexical);
|
|
877
|
+
const parseNumber = (text, datatype) => {
|
|
878
|
+
const base = datatype.base;
|
|
879
|
+
if (datatype.format === void 0) return xsdValid(base, text) ? Result.succeed(text) : Result.fail(`${quote(text)} is not a valid ${base}`);
|
|
880
|
+
return Result.flatMap(Result.mapError(parse$1(text, numberFormatOf(datatype.format)), (reason) => `${quote(text)} ${reason}`), (parsed) => {
|
|
881
|
+
if (isInteger(base) && parsed.hasDecimal) return Result.fail(`${quote(text)} has a decimal part but ${base} is an integer`);
|
|
882
|
+
if (isDecimal(base) && (parsed.hasExponent || parsed.special)) return Result.fail(`${quote(text)} is not a valid ${base}`);
|
|
883
|
+
return xsdValid(base, parsed.lexical) ? Result.succeed(parsed.lexical) : Result.fail(`${quote(text)} is not a valid ${base}`);
|
|
884
|
+
});
|
|
885
|
+
};
|
|
886
|
+
const parseBoolean = (text, datatype) => {
|
|
887
|
+
const format = datatype.format;
|
|
888
|
+
if (Predicate.isString(format)) {
|
|
889
|
+
const [yes, no] = format.split("|");
|
|
890
|
+
if (text === yes) return Result.succeed("true");
|
|
891
|
+
if (text === no) return Result.succeed("false");
|
|
892
|
+
return Result.fail(`${quote(text)} does not match the format ${format}`);
|
|
893
|
+
}
|
|
894
|
+
if (text === "true" || text === "1") return Result.succeed("true");
|
|
895
|
+
if (text === "false" || text === "0") return Result.succeed("false");
|
|
896
|
+
return Result.fail(`${quote(text)} is not a valid boolean`);
|
|
897
|
+
};
|
|
898
|
+
const parseDateTime = (text, datatype) => {
|
|
899
|
+
const base = canonicalName(datatype.base);
|
|
900
|
+
const pattern = Predicate.isString(datatype.format) ? compile(datatype.format) : Option.none();
|
|
901
|
+
return Option.match(pattern, {
|
|
902
|
+
onNone: () => xsdValid(base, text) ? Result.succeed(text) : Result.fail(`${quote(text)} is not a valid ${base}`),
|
|
903
|
+
onSome: (p) => Result.flatMap(Result.mapError(parse$2(text, p, base), (r) => `${quote(text)} ${r}`), (lexical) => xsdValid(base, lexical) ? Result.succeed(lexical) : Result.fail(`${quote(text)} is not a valid ${base}`))
|
|
904
|
+
});
|
|
905
|
+
};
|
|
906
|
+
const parseOther = (text, datatype) => {
|
|
907
|
+
const base = canonicalName(datatype.base);
|
|
908
|
+
const format = datatype.format;
|
|
909
|
+
if (!(Predicate.isString(format) ? Result.match(regexOf(format), {
|
|
910
|
+
onFailure: () => true,
|
|
911
|
+
onSuccess: (re) => re.test(text)
|
|
912
|
+
}) : true)) return Result.fail(`${quote(text)} does not match its format`);
|
|
913
|
+
if (base === "json" || base === "xml" || base === "html" || base === "anyAtomicType") return Result.succeed(text);
|
|
914
|
+
return base === "string" || xsdValid(base, text) ? Result.succeed(text) : Result.fail(`${quote(text)} is not a valid ${base}`);
|
|
915
|
+
};
|
|
916
|
+
const lengthOf = (lexical, base) => {
|
|
917
|
+
if (canonicalName(base) === "hexBinary") return lexical.length / 2;
|
|
918
|
+
if (canonicalName(base) === "base64Binary") {
|
|
919
|
+
const clean = lexical.replace(/\s/g, "");
|
|
920
|
+
return clean.length * 3 / 4 - (clean.match(/=+$/)?.[0].length ?? 0);
|
|
921
|
+
}
|
|
922
|
+
return Array.from(lexical).length;
|
|
923
|
+
};
|
|
924
|
+
const orderKey = (lexical, datatype) => {
|
|
925
|
+
const value = toValue(literal$1(lexical, namedNode(datatype)));
|
|
926
|
+
return Match.valueTags(value, {
|
|
927
|
+
Integer: ({ value: n }) => Option.some(Number(n)),
|
|
928
|
+
Decimal: ({ value: d }) => Option.some(BigDecimal.toNumberUnsafe(d)),
|
|
929
|
+
Float: ({ value: f }) => Option.some(f),
|
|
930
|
+
Double: ({ value: f }) => Option.some(f),
|
|
931
|
+
DateTime: ({ epochMillis }) => Option.some(epochMillis),
|
|
932
|
+
Duration: ({ months, seconds }) => Option.some(months * 2629746 + seconds),
|
|
933
|
+
String: () => Option.none(),
|
|
934
|
+
Boolean: () => Option.none(),
|
|
935
|
+
Other: () => Option.none()
|
|
936
|
+
});
|
|
937
|
+
};
|
|
938
|
+
/**
|
|
939
|
+
* The order key of a constraint bound for a base datatype, if it is a valid
|
|
940
|
+
* value of that datatype.
|
|
941
|
+
*
|
|
942
|
+
* @since 0.1.0
|
|
943
|
+
* @category validation
|
|
944
|
+
*/
|
|
945
|
+
const boundKey = (bound, base) => Predicate.isNumber(bound) ? Option.some(bound) : xsdValid(base, bound) ? orderKey(bound, iri(base)) : Option.none();
|
|
946
|
+
const checkConstraints = (value, datatype) => {
|
|
947
|
+
const length = lengthOf(value.lexical, datatype.base);
|
|
948
|
+
const lengthErrors = Arr.getSomes([
|
|
949
|
+
datatype.length !== void 0 && length !== datatype.length ? Option.some(`length ${length} is not ${datatype.length}`) : Option.none(),
|
|
950
|
+
datatype.minLength !== void 0 && length < datatype.minLength ? Option.some(`length ${length} is less than minLength ${datatype.minLength}`) : Option.none(),
|
|
951
|
+
datatype.maxLength !== void 0 && length > datatype.maxLength ? Option.some(`length ${length} is greater than maxLength ${datatype.maxLength}`) : Option.none()
|
|
952
|
+
]);
|
|
953
|
+
const key = orderKey(value.lexical, iri(datatype.base));
|
|
954
|
+
const bound = (b, ok, name) => Option.flatMap(b, (limit) => Option.flatMap(Option.all([key, boundKey(limit, datatype.base)]), ([v, l]) => ok(v, l) ? Option.none() : Option.some(`value violates ${name} ${limit}`)));
|
|
955
|
+
const of = Option.fromNullishOr;
|
|
956
|
+
return [...lengthErrors, ...Arr.getSomes([
|
|
957
|
+
bound(of(datatype.minInclusive), (v, l) => v >= l, "minimum"),
|
|
958
|
+
bound(of(datatype.maxInclusive), (v, l) => v <= l, "maximum"),
|
|
959
|
+
bound(of(datatype.minExclusive), (v, l) => v > l, "minExclusive"),
|
|
960
|
+
bound(of(datatype.maxExclusive), (v, l) => v < l, "maxExclusive")
|
|
961
|
+
])];
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* Parses a (non-empty, non-null) cell string with a datatype: the value, or
|
|
965
|
+
* the errors that make the cell invalid.
|
|
966
|
+
*
|
|
967
|
+
* @since 0.1.0
|
|
968
|
+
* @category parsing
|
|
969
|
+
*/
|
|
970
|
+
const parse = (text, datatype, language) => {
|
|
971
|
+
const base = canonicalName(datatype.base);
|
|
972
|
+
const lexical = isNumeric(base) ? parseNumber(text, datatype) : base === "boolean" ? parseBoolean(text, datatype) : isDateTime(base) || isDuration(base) ? isDuration(base) ? parseOther(text, datatype) : parseDateTime(text, datatype) : parseOther(text, datatype);
|
|
973
|
+
return Result.match(lexical, {
|
|
974
|
+
onFailure: (e) => Result.fail([e]),
|
|
975
|
+
onSuccess: (l) => {
|
|
976
|
+
const value = {
|
|
977
|
+
lexical: l,
|
|
978
|
+
base: datatype.base,
|
|
979
|
+
datatype: datatypeIri(datatype),
|
|
980
|
+
language: base === "string" && datatype.id === void 0 ? language : Option.none()
|
|
981
|
+
};
|
|
982
|
+
const errors = checkConstraints(value, datatype);
|
|
983
|
+
return Arr.isReadonlyArrayNonEmpty(errors) ? Result.fail(errors) : Result.succeed(value);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* A plain string value, as an invalid cell's value.
|
|
989
|
+
*
|
|
990
|
+
* @since 0.1.0
|
|
991
|
+
* @category constructors
|
|
992
|
+
*/
|
|
993
|
+
const stringValue = (text, language) => ({
|
|
994
|
+
lexical: text,
|
|
995
|
+
base: "string",
|
|
996
|
+
datatype: `${XSD}string`,
|
|
997
|
+
language
|
|
998
|
+
});
|
|
999
|
+
export { terms as A, CSVW as C, expand as D, compact as E, expandPrefixed as O, stringValue as S, XSD as T, isInteger as _, boundKey as a, parse as b, checkFormat as c, iri as d, isBinary as f, isDuration as g, isDecimal as h, NumericFormat as i, isAbsoluteUrl as k, datatypeIri as l, isDateTime as m, Datatype as n, builtIn as o, isBuiltIn as p, Datatype_exports as r, canonicalName as s, Bound as t, fromIri as u, isNumeric as v, RDF as w, string as x, isString$1 as y };
|
|
1000
|
+
|
|
1001
|
+
//# sourceMappingURL=Datatype-DQvkNkiH.mjs.map
|