@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,98 @@
|
|
|
1
|
+
import { w as Subject } from "./Term-B_4ezyXq.mjs";
|
|
2
|
+
import { n as Dataset } from "./Dataset-DS3ESOcO.mjs";
|
|
3
|
+
import { r as Vocabulary, t as Namespace } from "./Namespace-ClTUO_ya.mjs";
|
|
4
|
+
import { l as RdfParseError } from "./Serialization-Df8iVauT.mjs";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
declare namespace Manifest_d_exports {
|
|
8
|
+
export { Entry, Manifest, fileReader, load, mf, parse, rdft, toPath };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The W3C test manifest vocabulary.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
* @category vocabularies
|
|
15
|
+
*/
|
|
16
|
+
declare const mf: Vocabulary<"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", "name" | "entries" | "Manifest" | "include" | "action" | "result" | "assumedTestBase">;
|
|
17
|
+
/**
|
|
18
|
+
* The RDF test vocabulary.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @category vocabularies
|
|
22
|
+
*/
|
|
23
|
+
declare const rdft: Namespace<"http://www.w3.org/ns/rdftest#">;
|
|
24
|
+
/**
|
|
25
|
+
* A single test entry.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.1.0
|
|
28
|
+
* @category models
|
|
29
|
+
*/
|
|
30
|
+
interface Entry {
|
|
31
|
+
/** The test IRI (or blank node key). */
|
|
32
|
+
readonly id: string;
|
|
33
|
+
/** The test node itself, for reading further properties from `dataset`. */
|
|
34
|
+
readonly node: Subject;
|
|
35
|
+
/** The IRI of the test's `rdf:type`. */
|
|
36
|
+
readonly type: string;
|
|
37
|
+
/** The local name of the test type, e.g. `TestTurtleEval`. */
|
|
38
|
+
readonly kind: string;
|
|
39
|
+
/** `mf:name` (falls back to the local name of the test IRI). */
|
|
40
|
+
readonly name: string;
|
|
41
|
+
/** `rdfs:comment`, if any. */
|
|
42
|
+
readonly comment: Option.Option<string>;
|
|
43
|
+
/** The `mf:action` IRI, if the action is an IRI. */
|
|
44
|
+
readonly action: Option.Option<string>;
|
|
45
|
+
/** The `mf:result` IRI, if the result is an IRI. */
|
|
46
|
+
readonly result: Option.Option<string>;
|
|
47
|
+
/** The IRI of the manifest that lists this entry. */
|
|
48
|
+
readonly manifest: string;
|
|
49
|
+
/** The parsed manifest document. */
|
|
50
|
+
readonly dataset: Dataset;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A parsed manifest.
|
|
54
|
+
*
|
|
55
|
+
* @since 0.1.0
|
|
56
|
+
* @category models
|
|
57
|
+
*/
|
|
58
|
+
interface Manifest {
|
|
59
|
+
readonly iri: string;
|
|
60
|
+
readonly label: Option.Option<string>;
|
|
61
|
+
readonly assumedTestBase: Option.Option<string>;
|
|
62
|
+
readonly entries: ReadonlyArray<Entry>;
|
|
63
|
+
readonly includes: ReadonlyArray<string>;
|
|
64
|
+
readonly dataset: Dataset;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parses a manifest document. `iri` is the manifest's own IRI, used as the
|
|
68
|
+
* base IRI.
|
|
69
|
+
*
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
* @category parsing
|
|
72
|
+
*/
|
|
73
|
+
declare const parse: (text: string, iri: string) => Effect.Effect<Manifest, RdfParseError>;
|
|
74
|
+
/**
|
|
75
|
+
* Loads a manifest and, recursively, every manifest it includes, returning
|
|
76
|
+
* all entries (each manifest is read at most once).
|
|
77
|
+
*
|
|
78
|
+
* @since 0.1.0
|
|
79
|
+
* @category loading
|
|
80
|
+
*/
|
|
81
|
+
declare const load: <E, R>(iri: string, read: (iri: string) => Effect.Effect<string, E, R>) => Effect.Effect<ReadonlyArray<Entry>, E | RdfParseError, R>;
|
|
82
|
+
/**
|
|
83
|
+
* Builds a `read` function for `load` that maps IRIs under `iriPrefix` to
|
|
84
|
+
* paths under `pathPrefix` and reads them with `readFile`.
|
|
85
|
+
*
|
|
86
|
+
* @since 0.1.0
|
|
87
|
+
* @category loading
|
|
88
|
+
*/
|
|
89
|
+
declare const fileReader: <E, R>(iriPrefix: string, pathPrefix: string, readFile: (path: string) => Effect.Effect<string, E, R>) => (iri: string) => Effect.Effect<string, E, R>;
|
|
90
|
+
/**
|
|
91
|
+
* Maps an IRI under `iriPrefix` to a path under `pathPrefix`.
|
|
92
|
+
*
|
|
93
|
+
* @since 0.1.0
|
|
94
|
+
* @category loading
|
|
95
|
+
*/
|
|
96
|
+
declare const toPath: (iri: string, iriPrefix: string, pathPrefix: string) => string;
|
|
97
|
+
export { load as a, rdft as c, fileReader as i, toPath as l, Manifest as n, mf as o, Manifest_d_exports as r, parse as s, Entry as t };
|
|
98
|
+
//# sourceMappingURL=Manifest-DQUMRBFr.d.mts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { _ as Quad } from "./Term-B_4ezyXq.mjs";
|
|
2
|
+
import { n as Dataset } from "./Dataset-DS3ESOcO.mjs";
|
|
3
|
+
import { i as Formula, r as Document } from "./Model-DaMmxurZ.mjs";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
declare namespace Mapping_d_exports {
|
|
7
|
+
export { ToDatasetOptions, UnrepresentableError, fromDataset, fromQuadsUnsafe, isRdfCompatible, toDataset, toQuadsUnsafe };
|
|
8
|
+
}
|
|
9
|
+
declare const UnrepresentableError_base: Schema.Class<UnrepresentableError, Schema.TaggedStruct<"N3UnrepresentableError", {
|
|
10
|
+
readonly message: Schema.String;
|
|
11
|
+
}>, import("effect/Cause").YieldableError>;
|
|
12
|
+
/**
|
|
13
|
+
* An N3 construct that has no representation in the target model (e.g. a
|
|
14
|
+
* variable in an RDF dataset, or an IRI-named graph in N3).
|
|
15
|
+
*
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
* @category errors
|
|
18
|
+
*/
|
|
19
|
+
declare class UnrepresentableError extends UnrepresentableError_base {}
|
|
20
|
+
/**
|
|
21
|
+
* @since 0.1.0
|
|
22
|
+
* @category models
|
|
23
|
+
*/
|
|
24
|
+
interface ToDatasetOptions {
|
|
25
|
+
/** Prefix for the labels of blank nodes generated for formulas and lists. */
|
|
26
|
+
readonly blankNodePrefix?: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Converts a formula (or document) to quads, failing with
|
|
30
|
+
* `UnrepresentableError` for constructs that are not RDF. Throws the
|
|
31
|
+
* internal failure; used by `toDataset` and the parser.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
declare const toQuadsUnsafe: (self: Formula, options?: ToDatasetOptions) => Array<Quad>;
|
|
36
|
+
/**
|
|
37
|
+
* Converts an N3 formula or document to a core RDF `Dataset` (see the
|
|
38
|
+
* module documentation for the mapping).
|
|
39
|
+
*
|
|
40
|
+
* @since 0.1.0
|
|
41
|
+
* @category conversions
|
|
42
|
+
*/
|
|
43
|
+
declare const toDataset: (self: Formula | Document, options?: ToDatasetOptions) => Effect.Effect<Dataset, UnrepresentableError>;
|
|
44
|
+
/**
|
|
45
|
+
* Whether a formula is in the RDF-compatible subset of N3 (no variables, no
|
|
46
|
+
* literal subjects, only IRI predicates).
|
|
47
|
+
*
|
|
48
|
+
* @since 0.1.0
|
|
49
|
+
* @category predicates
|
|
50
|
+
*/
|
|
51
|
+
declare const isRdfCompatible: (self: Formula) => boolean;
|
|
52
|
+
/** @internal */
|
|
53
|
+
declare const fromQuadsUnsafe: (quads: Iterable<Quad>) => Formula;
|
|
54
|
+
/**
|
|
55
|
+
* Converts RDF quads to an N3 formula (see the module documentation for the
|
|
56
|
+
* mapping). Statements are sorted for deterministic output.
|
|
57
|
+
*
|
|
58
|
+
* @since 0.1.0
|
|
59
|
+
* @category conversions
|
|
60
|
+
*/
|
|
61
|
+
declare const fromDataset: (quads: Iterable<Quad>) => Effect.Effect<Formula, UnrepresentableError>;
|
|
62
|
+
export { fromQuadsUnsafe as a, toQuadsUnsafe as c, fromDataset as i, ToDatasetOptions as n, isRdfCompatible as o, UnrepresentableError as r, toDataset as s, Mapping_d_exports as t };
|
|
63
|
+
//# sourceMappingURL=Mapping-BgG74x3U.d.mts.map
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { D as compareQuads, O as defaultGraph, d as Quad, t as BlankNode } from "./Term-CFLG1qu4.mjs";
|
|
3
|
+
import { m as fromIterable } from "./Dataset-BlmlcI7J.mjs";
|
|
4
|
+
import { i as rdf } from "./Vocab-DceKywpq.mjs";
|
|
5
|
+
import { A as isTriple, D as isBlankNode, E as loop, O as isLiteral, d as blankNodes, j as isVariable, k as isNamedNode, r as Formula, s as Statement, t as Collection, v as isFormula } from "./Model-DlPzRYhF.mjs";
|
|
6
|
+
import { a as record, i as increment, n as count, o as single, r as followList, t as append } from "./lists-D-OpQ0Ir.mjs";
|
|
7
|
+
import * as Arr from "effect/Array";
|
|
8
|
+
import * as MutableHashMap from "effect/MutableHashMap";
|
|
9
|
+
import * as MutableHashSet from "effect/MutableHashSet";
|
|
10
|
+
import * as Option from "effect/Option";
|
|
11
|
+
import * as Schema from "effect/Schema";
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Result from "effect/Result";
|
|
14
|
+
// src/n3/Mapping.ts
|
|
15
|
+
/**
|
|
16
|
+
* Mapping between the N3 model and core RDF datasets.
|
|
17
|
+
*
|
|
18
|
+
* ## N3 → RDF (`toDataset`)
|
|
19
|
+
*
|
|
20
|
+
* - Top-level statements become quads in the default graph.
|
|
21
|
+
* - Every occurrence of a formula `{ … }` becomes a fresh blank node `_:g`
|
|
22
|
+
* used in place of the formula, and the formula's statements become quads
|
|
23
|
+
* in the named graph `_:g` (recursively for nested formulas).
|
|
24
|
+
* - Collections become `rdf:first` / `rdf:rest` chains of fresh blank nodes
|
|
25
|
+
* (in the graph where the collection occurs); `()` is `rdf:nil`.
|
|
26
|
+
* - IRIs, blank nodes and literals are kept as they are.
|
|
27
|
+
*
|
|
28
|
+
* Constructs with no RDF counterpart fail with `UnrepresentableError`:
|
|
29
|
+
* variables anywhere, literals as subjects, and anything other than an IRI
|
|
30
|
+
* as a predicate.
|
|
31
|
+
*
|
|
32
|
+
* ## RDF → N3 (`fromDataset`)
|
|
33
|
+
*
|
|
34
|
+
* The inverse mapping: a named graph whose name is a blank node that is also
|
|
35
|
+
* used as a term (subject or object, in any graph) becomes a formula, which
|
|
36
|
+
* replaces every occurrence of that blank node; well-formed `rdf:first` /
|
|
37
|
+
* `rdf:rest` chains of blank nodes become collections. Graphs named by IRIs,
|
|
38
|
+
* blank-node graphs that are never used as terms, cyclic graph references and
|
|
39
|
+
* RDF 1.2 triple terms cannot be represented and fail with
|
|
40
|
+
* `UnrepresentableError`.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
var Mapping_exports = /* @__PURE__ */ __exportAll({
|
|
45
|
+
UnrepresentableError: () => UnrepresentableError,
|
|
46
|
+
fromDataset: () => fromDataset,
|
|
47
|
+
fromQuadsUnsafe: () => fromQuadsUnsafe,
|
|
48
|
+
isRdfCompatible: () => isRdfCompatible,
|
|
49
|
+
toDataset: () => toDataset,
|
|
50
|
+
toQuadsUnsafe: () => toQuadsUnsafe
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* An N3 construct that has no representation in the target model (e.g. a
|
|
54
|
+
* variable in an RDF dataset, or an IRI-named graph in N3).
|
|
55
|
+
*
|
|
56
|
+
* @since 0.1.0
|
|
57
|
+
* @category errors
|
|
58
|
+
*/
|
|
59
|
+
var UnrepresentableError = class extends Schema.TaggedError()("N3UnrepresentableError", { message: Schema.String }) {};
|
|
60
|
+
var Failure = class {
|
|
61
|
+
message;
|
|
62
|
+
constructor(message) {
|
|
63
|
+
this.message = message;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const guard = (f) => Effect.suspend(() => Result.match(Result.try(f), {
|
|
67
|
+
onSuccess: Effect.succeed,
|
|
68
|
+
onFailure: (e) => e instanceof Failure ? Effect.fail(new UnrepresentableError({ message: e.message })) : Effect.die(e)
|
|
69
|
+
}));
|
|
70
|
+
const rdfTerm = (t, graph, conversion) => {
|
|
71
|
+
if (t instanceof Collection) {
|
|
72
|
+
const items = t.items;
|
|
73
|
+
if (!Arr.isReadonlyArrayNonEmpty(items)) return rdf.nil;
|
|
74
|
+
const nodes = Arr.map(items, () => conversion.fresh());
|
|
75
|
+
const head = nodes[0];
|
|
76
|
+
items.forEach((item, i) => {
|
|
77
|
+
const node = nodes[i] ?? head;
|
|
78
|
+
conversion.out.push(new Quad(node, rdf.first, rdfTerm(item, graph, conversion), graph));
|
|
79
|
+
conversion.out.push(new Quad(node, rdf.rest, nodes[i + 1] ?? rdf.nil, graph));
|
|
80
|
+
});
|
|
81
|
+
return head;
|
|
82
|
+
}
|
|
83
|
+
if (t instanceof Formula) {
|
|
84
|
+
const g = conversion.fresh();
|
|
85
|
+
conversion.statements(t, g);
|
|
86
|
+
return g;
|
|
87
|
+
}
|
|
88
|
+
if (isVariable(t)) throw new Failure(`Variable ${t.key} cannot be represented in RDF`);
|
|
89
|
+
return t;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Converts a formula (or document) to quads, failing with
|
|
93
|
+
* `UnrepresentableError` for constructs that are not RDF. Throws the
|
|
94
|
+
* internal failure; used by `toDataset` and the parser.
|
|
95
|
+
*
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
const toQuadsUnsafe = (self, options) => {
|
|
99
|
+
const prefix = options?.blankNodePrefix ?? "";
|
|
100
|
+
const reserved = MutableHashSet.fromIterable(blankNodes(self).map((b) => b.value));
|
|
101
|
+
let counter = 0;
|
|
102
|
+
let label = "";
|
|
103
|
+
const nextLabel = () => {
|
|
104
|
+
label = `${prefix}g${(counter++).toString(36)}`;
|
|
105
|
+
return MutableHashSet.has(reserved, label);
|
|
106
|
+
};
|
|
107
|
+
const fresh = () => {
|
|
108
|
+
loop(nextLabel);
|
|
109
|
+
return new BlankNode(label);
|
|
110
|
+
};
|
|
111
|
+
const out = [];
|
|
112
|
+
const conversion = {
|
|
113
|
+
fresh,
|
|
114
|
+
out,
|
|
115
|
+
statements: (f, g) => statements(f, g)
|
|
116
|
+
};
|
|
117
|
+
const term = (t, graph) => rdfTerm(t, graph, conversion);
|
|
118
|
+
const statements = (f, graph) => {
|
|
119
|
+
f.statements.forEach((s) => {
|
|
120
|
+
const subject = term(s.subject, graph);
|
|
121
|
+
const predicate = term(s.predicate, graph);
|
|
122
|
+
const object = term(s.object, graph);
|
|
123
|
+
if (isLiteral(subject)) throw new Failure(`Literal ${subject.key} cannot be the subject of an RDF triple`);
|
|
124
|
+
if (!isNamedNode(predicate)) throw new Failure(`${predicate.key} cannot be the predicate of an RDF triple`);
|
|
125
|
+
out.push(new Quad(subject, predicate, object, graph));
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
statements(self, defaultGraph);
|
|
129
|
+
return out;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Converts an N3 formula or document to a core RDF `Dataset` (see the
|
|
133
|
+
* module documentation for the mapping).
|
|
134
|
+
*
|
|
135
|
+
* @since 0.1.0
|
|
136
|
+
* @category conversions
|
|
137
|
+
*/
|
|
138
|
+
const toDataset = (self, options) => guard(() => fromIterable(toQuadsUnsafe(isFormula(self) ? self : self.formula, options)));
|
|
139
|
+
/**
|
|
140
|
+
* Whether a formula is in the RDF-compatible subset of N3 (no variables, no
|
|
141
|
+
* literal subjects, only IRI predicates).
|
|
142
|
+
*
|
|
143
|
+
* @since 0.1.0
|
|
144
|
+
* @category predicates
|
|
145
|
+
*/
|
|
146
|
+
const isRdfCompatible = (self) => {
|
|
147
|
+
const result = Result.try(() => toQuadsUnsafe(self));
|
|
148
|
+
if (Result.isSuccess(result)) return true;
|
|
149
|
+
if (result.failure instanceof Failure) return false;
|
|
150
|
+
throw result.failure;
|
|
151
|
+
};
|
|
152
|
+
/** @internal */
|
|
153
|
+
const fromQuadsUnsafe = (quads) => {
|
|
154
|
+
const all = Arr.sort(quads, compareQuads);
|
|
155
|
+
const graphs = MutableHashMap.empty();
|
|
156
|
+
const occurrences = MutableHashMap.empty();
|
|
157
|
+
const note = (t, graph) => {
|
|
158
|
+
if (isTriple(t)) throw new Failure(`Triple term ${t.key} cannot be represented in N3`);
|
|
159
|
+
if (!isBlankNode(t)) return;
|
|
160
|
+
let m = occurrences.backing.get(t.value);
|
|
161
|
+
if (m === void 0) {
|
|
162
|
+
m = MutableHashMap.empty();
|
|
163
|
+
MutableHashMap.set(occurrences, t.value, m);
|
|
164
|
+
}
|
|
165
|
+
increment(m, graph);
|
|
166
|
+
};
|
|
167
|
+
all.forEach((q) => {
|
|
168
|
+
const g = q.graph.key;
|
|
169
|
+
const graph = graphs.backing.get(g);
|
|
170
|
+
if (graph === void 0) MutableHashMap.set(graphs, g, {
|
|
171
|
+
name: q.graph,
|
|
172
|
+
quads: [q]
|
|
173
|
+
});
|
|
174
|
+
else graph.quads.push(q);
|
|
175
|
+
note(q.subject, g);
|
|
176
|
+
note(q.object, g);
|
|
177
|
+
});
|
|
178
|
+
const formulaGraphs = MutableHashSet.empty();
|
|
179
|
+
MutableHashMap.forEach(graphs, ({ name }, key) => {
|
|
180
|
+
if (key === "") return;
|
|
181
|
+
if (!isBlankNode(name) || !MutableHashMap.has(occurrences, name.value)) throw new Failure(`Named graph ${name.key} cannot be represented in N3: only graphs named by blank nodes that are used as terms map to formulas`);
|
|
182
|
+
MutableHashSet.add(formulaGraphs, name.value);
|
|
183
|
+
});
|
|
184
|
+
const formulas = MutableHashMap.empty();
|
|
185
|
+
const building = MutableHashSet.empty();
|
|
186
|
+
const buildGraph = (key) => {
|
|
187
|
+
const graphQuads = graphs.backing.get(key)?.quads ?? [];
|
|
188
|
+
const lists = foldLists(graphQuads, key);
|
|
189
|
+
const term = (t) => {
|
|
190
|
+
if (isTriple(t)) throw new Failure(`Triple term ${t.key} cannot be represented in N3`);
|
|
191
|
+
if (!isBlankNode(t)) return t;
|
|
192
|
+
const list = lists.heads.backing.get(t.value);
|
|
193
|
+
if (list !== void 0) return new Collection(list.map(term));
|
|
194
|
+
if (MutableHashSet.has(formulaGraphs, t.value)) return formulaOf(t.value);
|
|
195
|
+
return t;
|
|
196
|
+
};
|
|
197
|
+
return new Formula(graphQuads.filter((q) => !lists.consumed.has(q)).map((q) => new Statement(term(q.subject), q.predicate, term(q.object))));
|
|
198
|
+
};
|
|
199
|
+
const formulaOf = (label) => {
|
|
200
|
+
const cached = formulas.backing.get(label);
|
|
201
|
+
if (cached !== void 0) return cached;
|
|
202
|
+
if (MutableHashSet.has(building, label)) throw new Failure(`Graph _:${label} contains a reference to itself`);
|
|
203
|
+
MutableHashSet.add(building, label);
|
|
204
|
+
const f = buildGraph(`_:${label}`);
|
|
205
|
+
MutableHashSet.remove(building, label);
|
|
206
|
+
MutableHashMap.set(formulas, label, f);
|
|
207
|
+
return f;
|
|
208
|
+
};
|
|
209
|
+
const foldLists = (graphQuads, graphKey) => {
|
|
210
|
+
const first = MutableHashMap.empty();
|
|
211
|
+
const rest = MutableHashMap.empty();
|
|
212
|
+
const other = MutableHashMap.empty();
|
|
213
|
+
const asObject = MutableHashMap.empty();
|
|
214
|
+
const restTargets = MutableHashSet.empty();
|
|
215
|
+
graphQuads.forEach((q) => {
|
|
216
|
+
if (isBlankNode(q.subject)) {
|
|
217
|
+
const s = q.subject.value;
|
|
218
|
+
if (q.predicate.value === rdf.first.value) append(first, s, q);
|
|
219
|
+
else if (q.predicate.value === rdf.rest.value) append(rest, s, q);
|
|
220
|
+
else increment(other, s);
|
|
221
|
+
}
|
|
222
|
+
if (isBlankNode(q.object)) {
|
|
223
|
+
increment(asObject, q.object.value);
|
|
224
|
+
if (q.predicate.value === rdf.rest.value) MutableHashSet.add(restTargets, q.object.value);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
const local = (label) => {
|
|
228
|
+
const occ = occurrences.backing.get(label);
|
|
229
|
+
return occ !== void 0 && MutableHashMap.size(occ) === 1 && MutableHashMap.has(occ, graphKey) && !MutableHashSet.has(formulaGraphs, label);
|
|
230
|
+
};
|
|
231
|
+
const cellOf = (label, isHead) => !local(label) || !isHead && (count(other, label) > 0 || count(asObject, label) !== 1) ? Option.none() : Option.zipWith(single(first, label), single(rest, label), (f, r) => [f, r]);
|
|
232
|
+
const heads = MutableHashMap.empty();
|
|
233
|
+
const consumed = /* @__PURE__ */ new WeakSet();
|
|
234
|
+
MutableHashMap.forEach(first, (_, label) => {
|
|
235
|
+
if (MutableHashSet.has(restTargets, label) || Option.isNone(cellOf(label, true))) return;
|
|
236
|
+
const otherCount = count(other, label);
|
|
237
|
+
const refs = count(asObject, label);
|
|
238
|
+
if (!(otherCount === 0 ? refs <= 1 : refs === 0)) return;
|
|
239
|
+
const cells = followList(label, cellOf);
|
|
240
|
+
if (Option.isSome(cells)) record(heads, consumed, label, cells.value);
|
|
241
|
+
});
|
|
242
|
+
return {
|
|
243
|
+
heads,
|
|
244
|
+
consumed
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
return buildGraph("");
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Converts RDF quads to an N3 formula (see the module documentation for the
|
|
251
|
+
* mapping). Statements are sorted for deterministic output.
|
|
252
|
+
*
|
|
253
|
+
* @since 0.1.0
|
|
254
|
+
* @category conversions
|
|
255
|
+
*/
|
|
256
|
+
const fromDataset = (quads) => guard(() => fromQuadsUnsafe(quads));
|
|
257
|
+
export { isRdfCompatible as a, fromQuadsUnsafe as i, UnrepresentableError as n, toDataset as o, fromDataset as r, toQuadsUnsafe as s, Mapping_exports as t };
|
|
258
|
+
|
|
259
|
+
//# sourceMappingURL=Mapping-Dc1ZGirk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mapping-Dc1ZGirk.mjs","names":["Model.Collection","Term.Quad","Model.Formula","Guards.isVariable","Model.blankNodes","Term.BlankNode","Guards.isLiteral","Guards.isNamedNode","Term.defaultGraph","Dataset.fromIterable","Model.isFormula","Term.compareQuads","Guards.isTriple","Guards.isBlankNode","Model.Statement","Lists.count","Lists.single","Lists.followList"],"sources":["../src/n3/Mapping.ts"],"sourcesContent":["/**\n * Mapping between the N3 model and core RDF datasets.\n *\n * ## N3 → RDF (`toDataset`)\n *\n * - Top-level statements become quads in the default graph.\n * - Every occurrence of a formula `{ … }` becomes a fresh blank node `_:g`\n * used in place of the formula, and the formula's statements become quads\n * in the named graph `_:g` (recursively for nested formulas).\n * - Collections become `rdf:first` / `rdf:rest` chains of fresh blank nodes\n * (in the graph where the collection occurs); `()` is `rdf:nil`.\n * - IRIs, blank nodes and literals are kept as they are.\n *\n * Constructs with no RDF counterpart fail with `UnrepresentableError`:\n * variables anywhere, literals as subjects, and anything other than an IRI\n * as a predicate.\n *\n * ## RDF → N3 (`fromDataset`)\n *\n * The inverse mapping: a named graph whose name is a blank node that is also\n * used as a term (subject or object, in any graph) becomes a formula, which\n * replaces every occurrence of that blank node; well-formed `rdf:first` /\n * `rdf:rest` chains of blank nodes become collections. Graphs named by IRIs,\n * blank-node graphs that are never used as terms, cyclic graph references and\n * RDF 1.2 triple terms cannot be represented and fail with\n * `UnrepresentableError`.\n *\n * @since 0.1.0\n */\nimport * as Arr from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as MutableHashMap from 'effect/MutableHashMap';\nimport * as MutableHashSet from 'effect/MutableHashSet';\nimport * as Option from 'effect/Option';\nimport * as Result from 'effect/Result';\nimport * as Schema from 'effect/Schema';\nimport * as Dataset from '../Dataset.ts';\nimport * as Term from '../Term.ts';\nimport { rdf } from '../Vocab.ts';\nimport * as Guards from './internal/guards.ts';\nimport * as Lists from './internal/lists.ts';\nimport { loop } from './internal/loop.ts';\nimport * as Model from './Model.ts';\n\n/**\n * An N3 construct that has no representation in the target model (e.g. a\n * variable in an RDF dataset, or an IRI-named graph in N3).\n *\n * @since 0.1.0\n * @category errors\n */\nexport class UnrepresentableError extends Schema.TaggedError<UnrepresentableError>()(\n 'N3UnrepresentableError',\n { message: Schema.String },\n) {}\n\nclass Failure {\n readonly message: string;\n constructor(message: string) {\n this.message = message;\n }\n}\n\nconst guard = <A>(f: () => A): Effect.Effect<A, UnrepresentableError> =>\n Effect.suspend(() =>\n Result.match(Result.try(f), {\n onSuccess: Effect.succeed,\n onFailure: (e) =>\n e instanceof Failure\n ? Effect.fail(new UnrepresentableError({ message: e.message }))\n : Effect.die(e),\n }),\n );\n\n/**\n * @since 0.1.0\n * @category models\n */\nexport interface ToDatasetOptions {\n /** Prefix for the labels of blank nodes generated for formulas and lists. */\n readonly blankNodePrefix?: string | undefined;\n}\n\n/** The state of one `toQuadsUnsafe` conversion, threaded through `rdfTerm`. */\ninterface Conversion {\n readonly fresh: () => Term.BlankNode;\n readonly out: Array<Term.Quad>;\n readonly statements: (f: Model.Formula, graph: Term.Graph) => void;\n}\n\n// Plain refinements rather than `Match`: `toQuadsUnsafe` runs it for every term it converts.\nconst rdfTerm = (\n t: Model.N3Term,\n graph: Term.Graph,\n conversion: Conversion,\n): Term.NamedNode | Term.BlankNode | Term.Literal => {\n if (t instanceof Model.Collection) {\n const items = t.items;\n if (!Arr.isReadonlyArrayNonEmpty(items)) return rdf.nil;\n const nodes = Arr.map(items, () => conversion.fresh());\n const head = nodes[0];\n items.forEach((item, i) => {\n const node = nodes[i] ?? head;\n conversion.out.push(new Term.Quad(node, rdf.first, rdfTerm(item, graph, conversion), graph));\n conversion.out.push(new Term.Quad(node, rdf.rest, nodes[i + 1] ?? rdf.nil, graph));\n });\n return head;\n }\n if (t instanceof Model.Formula) {\n const g = conversion.fresh();\n conversion.statements(t, g);\n return g;\n }\n if (Guards.isVariable(t)) throw new Failure(`Variable ${t.key} cannot be represented in RDF`);\n return t;\n};\n\n/**\n * Converts a formula (or document) to quads, failing with\n * `UnrepresentableError` for constructs that are not RDF. Throws the\n * internal failure; used by `toDataset` and the parser.\n *\n * @internal\n */\nexport const toQuadsUnsafe = (\n self: Model.Formula,\n options?: ToDatasetOptions,\n): Array<Term.Quad> => {\n const prefix = options?.blankNodePrefix ?? '';\n const reserved = MutableHashSet.fromIterable(Model.blankNodes(self).map((b) => b.value));\n let counter = 0;\n let label = '';\n const nextLabel = (): boolean => {\n label = `${prefix}g${(counter++).toString(36)}`;\n return MutableHashSet.has(reserved, label);\n };\n const fresh = (): Term.BlankNode => {\n loop(nextLabel);\n return new Term.BlankNode(label);\n };\n const out: Array<Term.Quad> = [];\n const conversion: Conversion = { fresh, out, statements: (f, g) => statements(f, g) };\n const term = (t: Model.N3Term, graph: Term.Graph) => rdfTerm(t, graph, conversion);\n const statements = (f: Model.Formula, graph: Term.Graph) => {\n f.statements.forEach((s) => {\n const subject = term(s.subject, graph);\n const predicate = term(s.predicate, graph);\n const object = term(s.object, graph);\n if (Guards.isLiteral(subject)) {\n throw new Failure(`Literal ${subject.key} cannot be the subject of an RDF triple`);\n }\n if (!Guards.isNamedNode(predicate)) {\n throw new Failure(`${predicate.key} cannot be the predicate of an RDF triple`);\n }\n out.push(new Term.Quad(subject, predicate, object, graph));\n });\n };\n statements(self, Term.defaultGraph);\n return out;\n};\n\n/**\n * Converts an N3 formula or document to a core RDF `Dataset` (see the\n * module documentation for the mapping).\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const toDataset = (\n self: Model.Formula | Model.Document,\n options?: ToDatasetOptions,\n): Effect.Effect<Dataset.Dataset, UnrepresentableError> =>\n guard(() =>\n Dataset.fromIterable(toQuadsUnsafe(Model.isFormula(self) ? self : self.formula, options)),\n );\n\n/**\n * Whether a formula is in the RDF-compatible subset of N3 (no variables, no\n * literal subjects, only IRI predicates).\n *\n * @since 0.1.0\n * @category predicates\n */\nexport const isRdfCompatible = (self: Model.Formula): boolean => {\n const result = Result.try(() => toQuadsUnsafe(self));\n if (Result.isSuccess(result)) return true;\n if (result.failure instanceof Failure) return false;\n throw result.failure;\n};\n\n// -----------------------------------------------------------------------------\n// RDF → N3\n// -----------------------------------------------------------------------------\n\n/** The quads of one graph, with its name. */\ninterface Graph {\n readonly name: Term.Graph;\n readonly quads: Array<Term.Quad>;\n}\n\n/** @internal */\nexport const fromQuadsUnsafe = (quads: Iterable<Term.Quad>): Model.Formula => {\n const all = Arr.sort(quads, Term.compareQuads);\n const graphs = MutableHashMap.empty<string, Graph>();\n // Occurrences of blank nodes as subject/object, per graph and in total.\n const occurrences = MutableHashMap.empty<string, MutableHashMap.MutableHashMap<string, number>>();\n const note = (t: Term.Term, graph: string) => {\n if (Guards.isTriple(t)) {\n throw new Failure(`Triple term ${t.key} cannot be represented in N3`);\n }\n if (!Guards.isBlankNode(t)) return;\n let m = occurrences.backing.get(t.value);\n if (m === undefined) {\n m = MutableHashMap.empty();\n MutableHashMap.set(occurrences, t.value, m);\n }\n Lists.increment(m, graph);\n };\n all.forEach((q) => {\n const g = q.graph.key;\n const graph = graphs.backing.get(g);\n if (graph === undefined) MutableHashMap.set(graphs, g, { name: q.graph, quads: [q] });\n else graph.quads.push(q);\n note(q.subject, g);\n note(q.object, g);\n });\n const formulaGraphs = MutableHashSet.empty<string>();\n MutableHashMap.forEach(graphs, ({ name }, key) => {\n if (key === '') return;\n if (!Guards.isBlankNode(name) || !MutableHashMap.has(occurrences, name.value)) {\n throw new Failure(\n `Named graph ${name.key} cannot be represented in N3: only graphs named by blank nodes that are used as terms map to formulas`,\n );\n }\n MutableHashSet.add(formulaGraphs, name.value);\n });\n\n const formulas = MutableHashMap.empty<string, Model.Formula>();\n const building = MutableHashSet.empty<string>();\n\n const buildGraph = (key: string): Model.Formula => {\n const graphQuads = graphs.backing.get(key)?.quads ?? [];\n const lists = foldLists(graphQuads, key);\n const term = (t: Term.Subject | Term.Object): Model.N3Term => {\n // `note` has rejected triple terms\n if (Guards.isTriple(t)) throw new Failure(`Triple term ${t.key} cannot be represented in N3`);\n if (!Guards.isBlankNode(t)) return t;\n const list = lists.heads.backing.get(t.value);\n if (list !== undefined) return new Model.Collection(list.map(term));\n if (MutableHashSet.has(formulaGraphs, t.value)) return formulaOf(t.value);\n return t;\n };\n return new Model.Formula(\n graphQuads\n .filter((q) => !lists.consumed.has(q))\n .map((q) => new Model.Statement(term(q.subject), q.predicate, term(q.object))),\n );\n };\n\n const formulaOf = (label: string): Model.Formula => {\n const cached = formulas.backing.get(label);\n if (cached !== undefined) return cached;\n if (MutableHashSet.has(building, label)) {\n throw new Failure(`Graph _:${label} contains a reference to itself`);\n }\n MutableHashSet.add(building, label);\n const f = buildGraph(`_:${label}`);\n MutableHashSet.remove(building, label);\n MutableHashMap.set(formulas, label, f);\n return f;\n };\n\n const foldLists = (graphQuads: ReadonlyArray<Term.Quad>, graphKey: string) => {\n const first = MutableHashMap.empty<string, Array<Term.Quad>>();\n const rest = MutableHashMap.empty<string, Array<Term.Quad>>();\n const other = MutableHashMap.empty<string, number>();\n const asObject = MutableHashMap.empty<string, number>();\n const restTargets = MutableHashSet.empty<string>();\n graphQuads.forEach((q) => {\n if (Guards.isBlankNode(q.subject)) {\n const s = q.subject.value;\n if (q.predicate.value === rdf.first.value) Lists.append(first, s, q);\n else if (q.predicate.value === rdf.rest.value) Lists.append(rest, s, q);\n else Lists.increment(other, s);\n }\n if (Guards.isBlankNode(q.object)) {\n Lists.increment(asObject, q.object.value);\n if (q.predicate.value === rdf.rest.value) MutableHashSet.add(restTargets, q.object.value);\n }\n });\n const local = (label: string) => {\n const occ = occurrences.backing.get(label);\n return (\n occ !== undefined &&\n MutableHashMap.size(occ) === 1 &&\n MutableHashMap.has(occ, graphKey) &&\n !MutableHashSet.has(formulaGraphs, label)\n );\n };\n // A cell: one `rdf:first` and one `rdf:rest`, in this graph only; after the head, referenced\n // only by the list\n const cellOf = (label: string, isHead: boolean): Option.Option<Lists.Cell<Term.Quad>> =>\n !local(label) ||\n (!isHead && (Lists.count(other, label) > 0 || Lists.count(asObject, label) !== 1))\n ? Option.none()\n : Option.zipWith(Lists.single(first, label), Lists.single(rest, label), (f, r) => [f, r]);\n const heads = MutableHashMap.empty<string, Array<Term.Object>>();\n const consumed = new WeakSet<Term.Quad>();\n MutableHashMap.forEach(first, (_, label) => {\n if (MutableHashSet.has(restTargets, label) || Option.isNone(cellOf(label, true))) return;\n const otherCount = Lists.count(other, label);\n const refs = Lists.count(asObject, label);\n if (!(otherCount === 0 ? refs <= 1 : refs === 0)) return;\n const cells = Lists.followList(label, cellOf);\n if (Option.isSome(cells)) Lists.record(heads, consumed, label, cells.value);\n });\n return { heads, consumed };\n };\n\n return buildGraph('');\n};\n\n/**\n * Converts RDF quads to an N3 formula (see the module documentation for the\n * mapping). Statements are sorted for deterministic output.\n *\n * @since 0.1.0\n * @category conversions\n */\nexport const fromDataset = (\n quads: Iterable<Term.Quad>,\n): Effect.Effect<Model.Formula, UnrepresentableError> => guard(() => fromQuadsUnsafe(quads));\n"],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { d as layerWithUpdate$1, f as toolkit, p as toolkitWithUpdate, u as layer$1 } from "./Tools-ryxphZbI.mjs";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { McpServer } from "effect/ai";
|
|
5
|
+
// src/sparql/ai/Mcp.ts
|
|
6
|
+
/**
|
|
7
|
+
* The knowledge-graph tools as an MCP (Model Context Protocol) server
|
|
8
|
+
* registration: provide `Mcp.layer()` together with one of `effect/ai`'s
|
|
9
|
+
* `McpServer` transports (`McpServer.layerStdio`, `McpServer.layerHttp`, …)
|
|
10
|
+
* and a `SparqlEngine`, and any MCP client can call the tools.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { Layer } from 'effect'
|
|
14
|
+
* import { McpServer } from 'effect/ai'
|
|
15
|
+
* import { Engine } from '@thomasfosterau/effect-rdf/sparql'
|
|
16
|
+
* import { Mcp } from '@thomasfosterau/effect-rdf/sparql/ai'
|
|
17
|
+
*
|
|
18
|
+
* const Server = Mcp.layer({ maxRows: 50 }).pipe(
|
|
19
|
+
* Layer.provide(McpServer.layerStdio({ name: 'knowledge-graph', version: '1.0.0', protocols })),
|
|
20
|
+
* Layer.provide(Engine.layerMemory()),
|
|
21
|
+
* )
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @since 0.1.0
|
|
25
|
+
*/
|
|
26
|
+
var Mcp_exports = /* @__PURE__ */ __exportAll({
|
|
27
|
+
layer: () => layer,
|
|
28
|
+
layerWithUpdate: () => layerWithUpdate
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Registers the read-only `Tools.toolkit` with the `McpServer` in context,
|
|
32
|
+
* with its handlers over the `SparqlEngine` in context.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
* @category layers
|
|
36
|
+
*/
|
|
37
|
+
const layer = (options) => McpServer.toolkit(toolkit).pipe(Layer.provide(layer$1(options)));
|
|
38
|
+
/**
|
|
39
|
+
* Registers `Tools.toolkitWithUpdate` (the read-only tools plus
|
|
40
|
+
* `sparql_update`) with the `McpServer` in context.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
* @category layers
|
|
44
|
+
*/
|
|
45
|
+
const layerWithUpdate = (options) => McpServer.toolkit(toolkitWithUpdate).pipe(Layer.provide(layerWithUpdate$1(options)));
|
|
46
|
+
export { layer as n, layerWithUpdate as r, Mcp_exports as t };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=Mcp-1DwTTKOK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mcp-1DwTTKOK.mjs","names":["Tools.toolkit","Tools.layer","Tools.toolkitWithUpdate","Tools.layerWithUpdate"],"sources":["../src/sparql/ai/Mcp.ts"],"sourcesContent":["/**\n * The knowledge-graph tools as an MCP (Model Context Protocol) server\n * registration: provide `Mcp.layer()` together with one of `effect/ai`'s\n * `McpServer` transports (`McpServer.layerStdio`, `McpServer.layerHttp`, …)\n * and a `SparqlEngine`, and any MCP client can call the tools.\n *\n * ```ts\n * import { Layer } from 'effect'\n * import { McpServer } from 'effect/ai'\n * import { Engine } from '@thomasfosterau/effect-rdf/sparql'\n * import { Mcp } from '@thomasfosterau/effect-rdf/sparql/ai'\n *\n * const Server = Mcp.layer({ maxRows: 50 }).pipe(\n * Layer.provide(McpServer.layerStdio({ name: 'knowledge-graph', version: '1.0.0', protocols })),\n * Layer.provide(Engine.layerMemory()),\n * )\n * ```\n *\n * @since 0.1.0\n */\nimport * as Layer from 'effect/Layer';\nimport { McpServer } from 'effect/ai';\nimport * as Tools from './Tools.ts';\n\n/**\n * Registers the read-only `Tools.toolkit` with the `McpServer` in context,\n * with its handlers over the `SparqlEngine` in context.\n *\n * @since 0.1.0\n * @category layers\n */\nexport const layer = (options?: Tools.ToolOptions) =>\n McpServer.toolkit(Tools.toolkit).pipe(Layer.provide(Tools.layer(options)));\n\n/**\n * Registers `Tools.toolkitWithUpdate` (the read-only tools plus\n * `sparql_update`) with the `McpServer` in context.\n *\n * @since 0.1.0\n * @category layers\n */\nexport const layerWithUpdate = (options?: Tools.ToolOptions) =>\n McpServer.toolkit(Tools.toolkitWithUpdate).pipe(Layer.provide(Tools.layerWithUpdate(options)));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,SAAS,YACpB,UAAU,QAAQA,OAAa,CAAC,CAAC,KAAK,MAAM,QAAQC,QAAY,OAAO,CAAC,CAAC;;;;;;;;AAS3E,MAAa,mBAAmB,YAC9B,UAAU,QAAQC,iBAAuB,CAAC,CAAC,KAAK,MAAM,QAAQC,kBAAsB,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { o as SparqlEngine } from "./Engine-CYPB3g4h.mjs";
|
|
2
|
+
import { c as ToolOptions } from "./Tools-7MdRKccr.mjs";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { McpServer } from "effect/ai";
|
|
5
|
+
declare namespace Mcp_d_exports {
|
|
6
|
+
export { layer, layerWithUpdate };
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Registers the read-only `Tools.toolkit` with the `McpServer` in context,
|
|
10
|
+
* with its handlers over the `SparqlEngine` in context.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
* @category layers
|
|
14
|
+
*/
|
|
15
|
+
declare const layer: (options?: ToolOptions) => Layer.Layer<never, never, SparqlEngine | McpServer.McpServer>;
|
|
16
|
+
/**
|
|
17
|
+
* Registers `Tools.toolkitWithUpdate` (the read-only tools plus
|
|
18
|
+
* `sparql_update`) with the `McpServer` in context.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @category layers
|
|
22
|
+
*/
|
|
23
|
+
declare const layerWithUpdate: (options?: ToolOptions) => Layer.Layer<never, never, SparqlEngine | McpServer.McpServer>;
|
|
24
|
+
export { layer as n, layerWithUpdate as r, Mcp_d_exports as t };
|
|
25
|
+
//# sourceMappingURL=Mcp-d-pX9erx.d.mts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
|
|
2
|
+
import { o as Literal } from "./Term-CFLG1qu4.mjs";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as Match from "effect/Match";
|
|
5
|
+
// src/shacl/Message.ts
|
|
6
|
+
/**
|
|
7
|
+
* Message templates: `sh:message` values (and `sh:labelTemplate`s) may refer
|
|
8
|
+
* to variables with `{?name}` or `{$name}`, which are replaced with a string
|
|
9
|
+
* representation of the variable's value when a validation result is
|
|
10
|
+
* produced (SHACL §5.3.2 and §6.2.2).
|
|
11
|
+
*
|
|
12
|
+
* The validator substitutes:
|
|
13
|
+
*
|
|
14
|
+
* - for SPARQL-based constraints, the variables of the result solution
|
|
15
|
+
* (`this`, `value`, `path`, any other projected variable) and, for
|
|
16
|
+
* SPARQL-based constraint components, the parameter values;
|
|
17
|
+
* - for core constraints, `this`, `value`, `path` and the parameters of the
|
|
18
|
+
* constraint component by their local names (`{$minCount}`,
|
|
19
|
+
* `{$datatype}`, `{$pattern}`, …).
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Term } from "@thomasfosterau/effect-rdf"
|
|
23
|
+
* import { Message } from "@thomasfosterau/effect-rdf/shacl"
|
|
24
|
+
*
|
|
25
|
+
* Message.substitute(Term.literal("Expected at least {$minCount} values"), (name) =>
|
|
26
|
+
* name === "minCount" ? Term.literal("2") : undefined,
|
|
27
|
+
* ) // "Expected at least 2 values"
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @since 0.1.0
|
|
31
|
+
*/
|
|
32
|
+
var Message_exports = /* @__PURE__ */ __exportAll({
|
|
33
|
+
display: () => display,
|
|
34
|
+
format: () => format,
|
|
35
|
+
localName: () => localName,
|
|
36
|
+
substitute: () => substitute,
|
|
37
|
+
variables: () => variables
|
|
38
|
+
});
|
|
39
|
+
const placeholder = /\{[?$]([\p{L}\p{N}_\p{M}]+)\}/gu;
|
|
40
|
+
/**
|
|
41
|
+
* A human-readable string for a term inside a message: the lexical form of
|
|
42
|
+
* literals, the IRI of named nodes, `_:label` for blank nodes and the
|
|
43
|
+
* N-Triples-like form of triple terms.
|
|
44
|
+
*
|
|
45
|
+
* @since 0.1.0
|
|
46
|
+
* @category formatting
|
|
47
|
+
*/
|
|
48
|
+
const display = (term) => {
|
|
49
|
+
return Match.value(term).pipe(Match.tag("Literal", "NamedNode", (node) => node.value), Match.tag("BlankNode", (node) => `_:${node.value}`), Match.orElse((node) => node.toString()));
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The variable names referenced by a template, in order of appearance.
|
|
53
|
+
*
|
|
54
|
+
* @since 0.1.0
|
|
55
|
+
* @category queries
|
|
56
|
+
*/
|
|
57
|
+
const variables = (template) => Array.from(template.matchAll(placeholder), (m) => m[1] ?? "");
|
|
58
|
+
/**
|
|
59
|
+
* Replaces the `{?name}` / `{$name}` placeholders of a template string.
|
|
60
|
+
* Placeholders whose variable `lookup` does not know are left unchanged.
|
|
61
|
+
*
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
* @category substitution
|
|
64
|
+
*/
|
|
65
|
+
const format = (template, lookup) => template.replace(placeholder, (match, name) => {
|
|
66
|
+
const value = lookup(name);
|
|
67
|
+
return value === void 0 ? match : display(value);
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Substitutes the placeholders of a message literal, keeping its language
|
|
71
|
+
* tag (or datatype).
|
|
72
|
+
*
|
|
73
|
+
* @since 0.1.0
|
|
74
|
+
* @category substitution
|
|
75
|
+
*/
|
|
76
|
+
const substitute = (message, lookup) => {
|
|
77
|
+
const value = format(message.value, lookup);
|
|
78
|
+
return value === message.value ? message : new Literal(value, message.datatype, message.language, message.direction);
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The local name of an IRI: the longest NCName at its end (SHACL §6.2.1).
|
|
82
|
+
* SPARQL-based constraint components derive their parameter names (and
|
|
83
|
+
* thus the pre-bound variable names) this way. Returns an empty string when
|
|
84
|
+
* the IRI does not end with an NCName.
|
|
85
|
+
*
|
|
86
|
+
* @since 0.1.0
|
|
87
|
+
* @category utils
|
|
88
|
+
*/
|
|
89
|
+
const localName = (iri) => {
|
|
90
|
+
const value = Predicate.isString(iri) ? iri : iri.value;
|
|
91
|
+
return (/[\p{L}\p{N}\p{M}_.-]*$/u.exec(value)?.[0] ?? "").replace(/^[\p{N}\p{M}.-]+/u, "");
|
|
92
|
+
};
|
|
93
|
+
export { substitute as a, localName as i, display as n, variables as o, format as r, Message_exports as t };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=Message-CK_DGQuu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message-CK_DGQuu.mjs","names":["Term.Literal"],"sources":["../src/shacl/Message.ts"],"sourcesContent":["/**\n * Message templates: `sh:message` values (and `sh:labelTemplate`s) may refer\n * to variables with `{?name}` or `{$name}`, which are replaced with a string\n * representation of the variable's value when a validation result is\n * produced (SHACL §5.3.2 and §6.2.2).\n *\n * The validator substitutes:\n *\n * - for SPARQL-based constraints, the variables of the result solution\n * (`this`, `value`, `path`, any other projected variable) and, for\n * SPARQL-based constraint components, the parameter values;\n * - for core constraints, `this`, `value`, `path` and the parameters of the\n * constraint component by their local names (`{$minCount}`,\n * `{$datatype}`, `{$pattern}`, …).\n *\n * ```ts\n * import { Term } from \"@thomasfosterau/effect-rdf\"\n * import { Message } from \"@thomasfosterau/effect-rdf/shacl\"\n *\n * Message.substitute(Term.literal(\"Expected at least {$minCount} values\"), (name) =>\n * name === \"minCount\" ? Term.literal(\"2\") : undefined,\n * ) // \"Expected at least 2 values\"\n * ```\n *\n * @since 0.1.0\n */\nimport { Term } from '../index.ts';\nimport * as Match from 'effect/Match';\nimport * as Predicate from 'effect/Predicate';\n\nconst placeholder = /\\{[?$]([\\p{L}\\p{N}_\\p{M}]+)\\}/gu;\n\n/**\n * A human-readable string for a term inside a message: the lexical form of\n * literals, the IRI of named nodes, `_:label` for blank nodes and the\n * N-Triples-like form of triple terms.\n *\n * @since 0.1.0\n * @category formatting\n */\nexport const display = (term: Term.Term): string => {\n return Match.value(term).pipe(\n Match.tag('Literal', 'NamedNode', (node) => node.value),\n Match.tag('BlankNode', (node) => `_:${node.value}`),\n Match.orElse((node) => node.toString()),\n );\n};\n\n/**\n * The variable names referenced by a template, in order of appearance.\n *\n * @since 0.1.0\n * @category queries\n */\nexport const variables = (template: string): ReadonlyArray<string> =>\n Array.from(template.matchAll(placeholder), (m) => m[1] ?? '');\n\n/**\n * Replaces the `{?name}` / `{$name}` placeholders of a template string.\n * Placeholders whose variable `lookup` does not know are left unchanged.\n *\n * @since 0.1.0\n * @category substitution\n */\nexport const format = (template: string, lookup: (name: string) => Term.Term | undefined): string =>\n template.replace(placeholder, (match, name: string) => {\n const value = lookup(name);\n return value === undefined ? match : display(value);\n });\n\n/**\n * Substitutes the placeholders of a message literal, keeping its language\n * tag (or datatype).\n *\n * @since 0.1.0\n * @category substitution\n */\nexport const substitute = (\n message: Term.Literal,\n lookup: (name: string) => Term.Term | undefined,\n): Term.Literal => {\n const value = format(message.value, lookup);\n return value === message.value\n ? message\n : new Term.Literal(value, message.datatype, message.language, message.direction);\n};\n\n/**\n * The local name of an IRI: the longest NCName at its end (SHACL §6.2.1).\n * SPARQL-based constraint components derive their parameter names (and\n * thus the pre-bound variable names) this way. Returns an empty string when\n * the IRI does not end with an NCName.\n *\n * @since 0.1.0\n * @category utils\n */\nexport const localName = (iri: Term.NamedNode | string): string => {\n const value = Predicate.isString(iri) ? iri : iri.value;\n const match = /[\\p{L}\\p{N}\\p{M}_.-]*$/u.exec(value);\n // An NCName cannot start with a digit, `-` or `.`.\n return (match?.[0] ?? '').replace(/^[\\p{N}\\p{M}.-]+/u, '');\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,cAAc;;;;;;;;;AAUpB,MAAa,WAAW,SAA4B;CAClD,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,KACvB,MAAM,IAAI,WAAW,cAAc,SAAS,KAAK,KAAK,GACtD,MAAM,IAAI,cAAc,SAAS,KAAK,KAAK,OAAO,GAClD,MAAM,QAAQ,SAAS,KAAK,SAAS,CAAC,CACxC;AACF;;;;;;;AAQA,MAAa,aAAa,aACxB,MAAM,KAAK,SAAS,SAAS,WAAW,IAAI,MAAM,EAAE,MAAM,EAAE;;;;;;;;AAS9D,MAAa,UAAU,UAAkB,WACvC,SAAS,QAAQ,cAAc,OAAO,SAAiB;CACrD,MAAM,QAAQ,OAAO,IAAI;CACzB,OAAO,UAAU,KAAA,IAAY,QAAQ,QAAQ,KAAK;AACpD,CAAC;;;;;;;;AASH,MAAa,cACX,SACA,WACiB;CACjB,MAAM,QAAQ,OAAO,QAAQ,OAAO,MAAM;CAC1C,OAAO,UAAU,QAAQ,QACrB,UACA,IAAIA,QAAa,OAAO,QAAQ,UAAU,QAAQ,UAAU,QAAQ,SAAS;AACnF;;;;;;;;;;AAWA,MAAa,aAAa,QAAyC;CACjE,MAAM,QAAQ,UAAU,SAAS,GAAG,IAAI,MAAM,IAAI;CAGlD,QAFc,0BAA0B,KAAK,KAEjC,CAAC,GAAG,MAAM,GAAA,CAAI,QAAQ,qBAAqB,EAAE;AAC3D"}
|