@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,781 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context processing and IRI expansion (JSON-LD 1.1 API §4.1, §4.2, §5.2).
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
import { resolveIri } from './iri.ts';
|
|
7
|
+
import {
|
|
8
|
+
type Json,
|
|
9
|
+
type JsonObject,
|
|
10
|
+
deepEqual,
|
|
11
|
+
mapJsonLdError,
|
|
12
|
+
fail,
|
|
13
|
+
hasKeywordForm,
|
|
14
|
+
isAbsoluteIri,
|
|
15
|
+
isBlankNodeId,
|
|
16
|
+
isKeyword,
|
|
17
|
+
isObject,
|
|
18
|
+
isString,
|
|
19
|
+
hasOwn,
|
|
20
|
+
stringSet,
|
|
21
|
+
} from './util.ts';
|
|
22
|
+
import * as Arr from 'effect/Array';
|
|
23
|
+
import * as Iterable from 'effect/Iterable';
|
|
24
|
+
import * as MutableHashMap from 'effect/MutableHashMap';
|
|
25
|
+
import * as Option from 'effect/Option';
|
|
26
|
+
import * as Predicate from 'effect/Predicate';
|
|
27
|
+
import * as Record from 'effect/Record';
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type ProcessingMode = 'json-ld-1.0' | 'json-ld-1.1';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* What the algorithms read of a loaded document.
|
|
34
|
+
*
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export interface LoadedDocument {
|
|
38
|
+
readonly documentUrl: string;
|
|
39
|
+
readonly document: Json;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** A remote context, as cached by URL. */
|
|
43
|
+
interface LoadedContext {
|
|
44
|
+
readonly context: Json;
|
|
45
|
+
readonly documentUrl: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Synchronous loader used by the pure algorithms. It either returns an
|
|
50
|
+
* already-loaded document, throws a `JsonLdError`, or throws `NeedDocument`
|
|
51
|
+
* to ask the effectful driver to load the document and retry.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export interface Env {
|
|
56
|
+
readonly processingMode: ProcessingMode;
|
|
57
|
+
readonly load: (url: string, profile?: string) => LoadedDocument;
|
|
58
|
+
/** Cache of remote contexts (keyed by URL). */
|
|
59
|
+
readonly contextCache: MutableHashMap.MutableHashMap<string, LoadedContext>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export class NeedDocument {
|
|
64
|
+
readonly url: string;
|
|
65
|
+
constructor(url: string) {
|
|
66
|
+
this.url = url;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export interface DefineState {
|
|
72
|
+
readonly defined: MutableHashMap.MutableHashMap<string, boolean>;
|
|
73
|
+
readonly baseUrl: string | null;
|
|
74
|
+
readonly protected: boolean;
|
|
75
|
+
readonly overrideProtected: boolean;
|
|
76
|
+
readonly remoteContexts: ReadonlyArray<string>;
|
|
77
|
+
readonly validateScoped: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export interface TermDefinition {
|
|
82
|
+
iri: string | null;
|
|
83
|
+
reverse: boolean;
|
|
84
|
+
type?: string;
|
|
85
|
+
/** `undefined` = no language mapping, `null` = explicitly no language. */
|
|
86
|
+
language?: string | null;
|
|
87
|
+
direction?: 'ltr' | 'rtl' | null;
|
|
88
|
+
context?: Json;
|
|
89
|
+
hasContext: boolean;
|
|
90
|
+
baseUrl?: string | null;
|
|
91
|
+
container: Array<string>;
|
|
92
|
+
index?: string;
|
|
93
|
+
nest?: string;
|
|
94
|
+
prefix: boolean;
|
|
95
|
+
protected: boolean;
|
|
96
|
+
/** The term contains a colon (it is a compact IRI or absolute IRI). */
|
|
97
|
+
hasColon: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export interface ActiveContext {
|
|
102
|
+
base: string | null;
|
|
103
|
+
originalBase: string | null;
|
|
104
|
+
vocab?: string;
|
|
105
|
+
language?: string;
|
|
106
|
+
direction?: 'ltr' | 'rtl';
|
|
107
|
+
terms: MutableHashMap.MutableHashMap<string, TermDefinition>;
|
|
108
|
+
previous?: ActiveContext;
|
|
109
|
+
inverse?: InverseContext;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @internal */
|
|
113
|
+
export type InverseContext = MutableHashMap.MutableHashMap<
|
|
114
|
+
string,
|
|
115
|
+
globalThis.Record<string, ContainerEntry>
|
|
116
|
+
>;
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export interface ContainerEntry {
|
|
120
|
+
'@language': globalThis.Record<string, string>;
|
|
121
|
+
'@type': globalThis.Record<string, string>;
|
|
122
|
+
'@any': globalThis.Record<string, string>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const initialContext = (base: string | null): ActiveContext => ({
|
|
127
|
+
base,
|
|
128
|
+
originalBase: base,
|
|
129
|
+
terms: MutableHashMap.empty(),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The definition of `term` in the active context.
|
|
134
|
+
*
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
export const termOf = (active: ActiveContext, term: string): Option.Option<TermDefinition> =>
|
|
138
|
+
// Terms are strings, which a `MutableHashMap` keeps in its `backing` map: one lookup there
|
|
139
|
+
// is the whole of `MutableHashMap.get` for them (this runs for every key expanded).
|
|
140
|
+
Option.fromUndefinedOr(active.terms.backing.get(term));
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The definition of `term`, when it carries a scoped context.
|
|
144
|
+
*
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
export const scopedTermOf = (active: ActiveContext, term: string): Option.Option<TermDefinition> =>
|
|
148
|
+
Option.filter(termOf(active, term), (def) => def.hasContext);
|
|
149
|
+
|
|
150
|
+
const cloneContext = (ctx: ActiveContext): ActiveContext => {
|
|
151
|
+
const out: ActiveContext = {
|
|
152
|
+
base: ctx.base,
|
|
153
|
+
originalBase: ctx.originalBase,
|
|
154
|
+
terms: MutableHashMap.fromIterable(ctx.terms),
|
|
155
|
+
};
|
|
156
|
+
if (ctx.vocab !== undefined) out.vocab = ctx.vocab;
|
|
157
|
+
if (ctx.language !== undefined) out.language = ctx.language;
|
|
158
|
+
if (ctx.direction !== undefined) out.direction = ctx.direction;
|
|
159
|
+
if (ctx.previous !== undefined) out.previous = ctx.previous;
|
|
160
|
+
return out;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const MAX_REMOTE_CONTEXTS = 32;
|
|
164
|
+
|
|
165
|
+
/** Loads a remote context document, failing with `loading remote context failed`. */
|
|
166
|
+
const loadContextDocument = (env: Env, url: string): LoadedDocument =>
|
|
167
|
+
mapJsonLdError(
|
|
168
|
+
() => env.load(url, 'http://www.w3.org/ns/json-ld#context'),
|
|
169
|
+
(e) => fail('loading remote context failed', `${url}: ${e.message}`),
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Applies the type-scoped context of each term (in the given order) that
|
|
174
|
+
* defines one, as expansion step 11 and compaction step 11 do.
|
|
175
|
+
*
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
export const applyTypeScopedContexts = (
|
|
179
|
+
env: Env,
|
|
180
|
+
active: ActiveContext,
|
|
181
|
+
typeScoped: ActiveContext,
|
|
182
|
+
terms: ReadonlyArray<string>,
|
|
183
|
+
): ActiveContext =>
|
|
184
|
+
terms.reduce(
|
|
185
|
+
(result, term) =>
|
|
186
|
+
Option.match(scopedTermOf(typeScoped, term), {
|
|
187
|
+
onNone: () => result,
|
|
188
|
+
onSome: (def) =>
|
|
189
|
+
processContext(env, result, def.context, def.baseUrl ?? null, [], false, false),
|
|
190
|
+
}),
|
|
191
|
+
active,
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
/** Loads a remote context (once per run), failing with `invalid remote context`. */
|
|
195
|
+
const remoteContext = (env: Env, url: string): LoadedContext =>
|
|
196
|
+
Option.getOrElse(MutableHashMap.get(env.contextCache, url), () => {
|
|
197
|
+
const doc = loadContextDocument(env, url);
|
|
198
|
+
if (!isObject(doc.document) || !('@context' in doc.document)) {
|
|
199
|
+
fail('invalid remote context', url);
|
|
200
|
+
}
|
|
201
|
+
const loaded: LoadedContext = {
|
|
202
|
+
context: doc.document['@context'],
|
|
203
|
+
documentUrl: doc.documentUrl,
|
|
204
|
+
};
|
|
205
|
+
MutableHashMap.set(env.contextCache, url, loaded);
|
|
206
|
+
return loaded;
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Context Processing Algorithm.
|
|
211
|
+
*
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
export const processContext = (
|
|
215
|
+
env: Env,
|
|
216
|
+
active: ActiveContext,
|
|
217
|
+
localContext: Json,
|
|
218
|
+
baseUrl: string | null,
|
|
219
|
+
remoteContexts: ReadonlyArray<string> = [],
|
|
220
|
+
overrideProtected = false,
|
|
221
|
+
propagate = true,
|
|
222
|
+
validateScoped = true,
|
|
223
|
+
): ActiveContext => {
|
|
224
|
+
// 1
|
|
225
|
+
let result = cloneContext(active);
|
|
226
|
+
// 2
|
|
227
|
+
if (isObject(localContext) && '@propagate' in localContext) {
|
|
228
|
+
if (!Predicate.isBoolean(localContext['@propagate'])) fail('invalid @propagate value');
|
|
229
|
+
propagate = localContext['@propagate'];
|
|
230
|
+
}
|
|
231
|
+
// 3
|
|
232
|
+
if (!propagate && result.previous === undefined) result.previous = active;
|
|
233
|
+
// 4
|
|
234
|
+
const contexts = Array.isArray(localContext) ? localContext : [localContext];
|
|
235
|
+
// 5
|
|
236
|
+
contexts.forEach((context: Json) => {
|
|
237
|
+
// 5.1
|
|
238
|
+
if (context === null) {
|
|
239
|
+
result = nullified(active, result, overrideProtected, propagate);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
// 5.2
|
|
243
|
+
if (isString(context)) {
|
|
244
|
+
const url = resolveIri(context, baseUrl);
|
|
245
|
+
if (!validateScoped && remoteContexts.includes(url)) return;
|
|
246
|
+
if (remoteContexts.length > MAX_REMOTE_CONTEXTS) fail('context overflow');
|
|
247
|
+
const loaded = remoteContext(env, url);
|
|
248
|
+
result = processContext(
|
|
249
|
+
env,
|
|
250
|
+
result,
|
|
251
|
+
loaded.context,
|
|
252
|
+
loaded.documentUrl,
|
|
253
|
+
[...remoteContexts, url],
|
|
254
|
+
overrideProtected,
|
|
255
|
+
true,
|
|
256
|
+
validateScoped,
|
|
257
|
+
);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
// 5.3 - 5.13
|
|
261
|
+
processLocalContext(
|
|
262
|
+
env,
|
|
263
|
+
result,
|
|
264
|
+
context,
|
|
265
|
+
baseUrl,
|
|
266
|
+
remoteContexts,
|
|
267
|
+
overrideProtected,
|
|
268
|
+
validateScoped,
|
|
269
|
+
);
|
|
270
|
+
});
|
|
271
|
+
return result;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/** Context processing step 5.1: a `null` context resets the active context. */
|
|
275
|
+
const nullified = (
|
|
276
|
+
active: ActiveContext,
|
|
277
|
+
result: ActiveContext,
|
|
278
|
+
overrideProtected: boolean,
|
|
279
|
+
propagate: boolean,
|
|
280
|
+
): ActiveContext => {
|
|
281
|
+
if (
|
|
282
|
+
!overrideProtected &&
|
|
283
|
+
Iterable.some(MutableHashMap.values(result.terms), (def) => def.protected)
|
|
284
|
+
) {
|
|
285
|
+
fail('invalid context nullification');
|
|
286
|
+
}
|
|
287
|
+
const reset = initialContext(active.originalBase);
|
|
288
|
+
if (!propagate) reset.previous = result;
|
|
289
|
+
return reset;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/** Steps 5.3 - 5.13: a context definition (an object) updates `result` in place. */
|
|
293
|
+
const processLocalContext = (
|
|
294
|
+
env: Env,
|
|
295
|
+
result: ActiveContext,
|
|
296
|
+
definition: Json,
|
|
297
|
+
baseUrl: string | null,
|
|
298
|
+
remoteContexts: ReadonlyArray<string>,
|
|
299
|
+
overrideProtected: boolean,
|
|
300
|
+
validateScoped: boolean,
|
|
301
|
+
): void => {
|
|
302
|
+
// 5.3
|
|
303
|
+
if (!isObject(definition)) fail('invalid local context');
|
|
304
|
+
// 5.5
|
|
305
|
+
checkVersion(env, definition);
|
|
306
|
+
// 5.6
|
|
307
|
+
const context = withImport(env, definition, baseUrl);
|
|
308
|
+
// 5.7
|
|
309
|
+
if ('@base' in context && Arr.isReadonlyArrayEmpty(remoteContexts)) {
|
|
310
|
+
setBase(result, context['@base']);
|
|
311
|
+
}
|
|
312
|
+
// 5.8
|
|
313
|
+
if ('@vocab' in context) setVocab(env, result, context['@vocab']);
|
|
314
|
+
// 5.9, 5.10
|
|
315
|
+
setLanguageAndDirection(env, result, context);
|
|
316
|
+
// 5.11
|
|
317
|
+
checkFlags(env, context);
|
|
318
|
+
// 5.12, 5.13
|
|
319
|
+
const state: DefineState = {
|
|
320
|
+
defined: MutableHashMap.empty(),
|
|
321
|
+
baseUrl,
|
|
322
|
+
protected: context['@protected'] === true,
|
|
323
|
+
overrideProtected,
|
|
324
|
+
remoteContexts,
|
|
325
|
+
validateScoped,
|
|
326
|
+
};
|
|
327
|
+
Record.keys(context).forEach((key) => {
|
|
328
|
+
if (!isContextKeyword(key)) createTermDefinition(env, result, context, key, state);
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/** Step 5.5: `@version`. */
|
|
333
|
+
const checkVersion = (env: Env, context: JsonObject): void => {
|
|
334
|
+
if (!('@version' in context)) return;
|
|
335
|
+
if (context['@version'] !== 1.1) fail('invalid @version value');
|
|
336
|
+
if (env.processingMode === 'json-ld-1.0') fail('processing mode conflict');
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
/** Step 5.6: the context merged over the one its `@import` names. */
|
|
340
|
+
const withImport = (env: Env, context: JsonObject, baseUrl: string | null): JsonObject => {
|
|
341
|
+
if (!('@import' in context)) return context;
|
|
342
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid context entry');
|
|
343
|
+
const imp = context['@import'];
|
|
344
|
+
if (!isString(imp)) fail('invalid @import value');
|
|
345
|
+
const url = resolveIri(imp, baseUrl);
|
|
346
|
+
const doc = loadContextDocument(env, url);
|
|
347
|
+
if (!isObject(doc.document) || !isObject(doc.document['@context'])) {
|
|
348
|
+
fail('invalid remote context', url);
|
|
349
|
+
}
|
|
350
|
+
const importContext = doc.document['@context'];
|
|
351
|
+
if ('@import' in importContext) fail('invalid context entry');
|
|
352
|
+
return { ...importContext, ...context };
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
/** Step 5.7: `@base`. */
|
|
356
|
+
const setBase = (result: ActiveContext, value: Json): void => {
|
|
357
|
+
if (value === null) result.base = null;
|
|
358
|
+
else if (!isString(value)) fail('invalid base IRI');
|
|
359
|
+
else if (isAbsoluteIri(value)) result.base = value;
|
|
360
|
+
else if (result.base !== null) result.base = resolveIri(value, result.base);
|
|
361
|
+
else fail('invalid base IRI');
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
/** Step 5.8: `@vocab`. */
|
|
365
|
+
const setVocab = (env: Env, result: ActiveContext, value: Json): void => {
|
|
366
|
+
if (value === null) {
|
|
367
|
+
delete result.vocab;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
if (!isString(value)) fail('invalid vocab mapping');
|
|
371
|
+
if (env.processingMode === 'json-ld-1.0' && !isAbsoluteIri(value) && !isBlankNodeId(value)) {
|
|
372
|
+
fail('invalid vocab mapping');
|
|
373
|
+
}
|
|
374
|
+
const expanded = expandIri(env, result, value, true, true);
|
|
375
|
+
if (expanded === null || isKeyword(expanded)) fail('invalid vocab mapping');
|
|
376
|
+
result.vocab = expanded;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/** Steps 5.9 and 5.10: `@language` and `@direction`. */
|
|
380
|
+
const setLanguageAndDirection = (env: Env, result: ActiveContext, context: JsonObject): void => {
|
|
381
|
+
if ('@language' in context) {
|
|
382
|
+
const value = context['@language'];
|
|
383
|
+
if (value === null) delete result.language;
|
|
384
|
+
else if (!isString(value)) fail('invalid default language');
|
|
385
|
+
else result.language = value;
|
|
386
|
+
}
|
|
387
|
+
if ('@direction' in context) {
|
|
388
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid context entry');
|
|
389
|
+
const value = context['@direction'];
|
|
390
|
+
if (value === null) delete result.direction;
|
|
391
|
+
else if (value !== 'ltr' && value !== 'rtl') fail('invalid base direction');
|
|
392
|
+
else result.direction = value;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
/** Step 5.11, and the `@protected` flag. */
|
|
397
|
+
const checkFlags = (env: Env, context: JsonObject): void => {
|
|
398
|
+
if ('@propagate' in context) {
|
|
399
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid context entry');
|
|
400
|
+
if (!Predicate.isBoolean(context['@propagate'])) fail('invalid @propagate value');
|
|
401
|
+
}
|
|
402
|
+
if ('@protected' in context && !Predicate.isBoolean(context['@protected'])) {
|
|
403
|
+
fail('invalid @protected value');
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const isContextKeyword = stringSet([
|
|
408
|
+
'@base',
|
|
409
|
+
'@direction',
|
|
410
|
+
'@import',
|
|
411
|
+
'@language',
|
|
412
|
+
'@propagate',
|
|
413
|
+
'@protected',
|
|
414
|
+
'@version',
|
|
415
|
+
'@vocab',
|
|
416
|
+
]);
|
|
417
|
+
|
|
418
|
+
const isTermKey = stringSet([
|
|
419
|
+
'@id',
|
|
420
|
+
'@reverse',
|
|
421
|
+
'@container',
|
|
422
|
+
'@context',
|
|
423
|
+
'@direction',
|
|
424
|
+
'@index',
|
|
425
|
+
'@language',
|
|
426
|
+
'@nest',
|
|
427
|
+
'@prefix',
|
|
428
|
+
'@protected',
|
|
429
|
+
'@type',
|
|
430
|
+
]);
|
|
431
|
+
|
|
432
|
+
const GEN_DELIMS = /[:/?#[\]@]$/;
|
|
433
|
+
|
|
434
|
+
const isContainerKeyword = stringSet([
|
|
435
|
+
'@graph',
|
|
436
|
+
'@id',
|
|
437
|
+
'@index',
|
|
438
|
+
'@language',
|
|
439
|
+
'@list',
|
|
440
|
+
'@set',
|
|
441
|
+
'@type',
|
|
442
|
+
]);
|
|
443
|
+
|
|
444
|
+
const validContainer = (env: Env, value: Json): boolean => {
|
|
445
|
+
if (env.processingMode === 'json-ld-1.0') {
|
|
446
|
+
return isString(value) && ['@list', '@set', '@index', '@language'].includes(value);
|
|
447
|
+
}
|
|
448
|
+
const c = Array.isArray(value) ? value : [value];
|
|
449
|
+
if (Arr.isReadonlyArrayEmpty(c)) return false;
|
|
450
|
+
if (!c.every((x) => isString(x) && isContainerKeyword(x))) return false;
|
|
451
|
+
if (c.some((x, i) => c.indexOf(x) !== i)) return false;
|
|
452
|
+
if (c.includes('@list')) return c.length === 1;
|
|
453
|
+
if (c.includes('@graph')) {
|
|
454
|
+
if (c.includes('@id') && c.includes('@index')) return false;
|
|
455
|
+
return c.every((x) => x === '@graph' || x === '@id' || x === '@index' || x === '@set');
|
|
456
|
+
}
|
|
457
|
+
if (c.length === 1) return true;
|
|
458
|
+
return c.length === 2 && c.includes('@set');
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Create Term Definition algorithm.
|
|
463
|
+
*
|
|
464
|
+
* @internal
|
|
465
|
+
*/
|
|
466
|
+
export const createTermDefinition = (
|
|
467
|
+
env: Env,
|
|
468
|
+
active: ActiveContext,
|
|
469
|
+
local: JsonObject,
|
|
470
|
+
term: string,
|
|
471
|
+
state: DefineState,
|
|
472
|
+
): void => {
|
|
473
|
+
const { defined, baseUrl, overrideProtected, remoteContexts } = state;
|
|
474
|
+
// 1
|
|
475
|
+
const status = MutableHashMap.get(defined, term);
|
|
476
|
+
if (Option.isSome(status)) {
|
|
477
|
+
if (status.value) return;
|
|
478
|
+
fail('cyclic IRI mapping', term);
|
|
479
|
+
}
|
|
480
|
+
// 2
|
|
481
|
+
if (term === '') fail('invalid term definition', 'empty term');
|
|
482
|
+
MutableHashMap.set(defined, term, false);
|
|
483
|
+
// 3
|
|
484
|
+
let value = local[term];
|
|
485
|
+
// 4, 5
|
|
486
|
+
if (term === '@type' && env.processingMode !== 'json-ld-1.0' && isObject(value)) {
|
|
487
|
+
const keys = Record.keys(value);
|
|
488
|
+
if (
|
|
489
|
+
Arr.isReadonlyArrayEmpty(keys) ||
|
|
490
|
+
keys.some((k) => k !== '@container' && k !== '@protected') ||
|
|
491
|
+
('@container' in value && value['@container'] !== '@set')
|
|
492
|
+
) {
|
|
493
|
+
fail('keyword redefinition', term);
|
|
494
|
+
}
|
|
495
|
+
} else if (isKeyword(term)) {
|
|
496
|
+
fail('keyword redefinition', term);
|
|
497
|
+
} else if (hasKeywordForm(term)) {
|
|
498
|
+
MutableHashMap.set(defined, term, true);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
// 6
|
|
502
|
+
const previous = termOf(active, term);
|
|
503
|
+
MutableHashMap.remove(active.terms, term);
|
|
504
|
+
// 7, 8, 9
|
|
505
|
+
let simpleTerm = false;
|
|
506
|
+
if (value === null) value = { '@id': null };
|
|
507
|
+
else if (isString(value)) {
|
|
508
|
+
value = { '@id': value };
|
|
509
|
+
simpleTerm = true;
|
|
510
|
+
} else if (!isObject(value)) {
|
|
511
|
+
fail('invalid term definition', term);
|
|
512
|
+
}
|
|
513
|
+
// 10
|
|
514
|
+
const def: TermDefinition = {
|
|
515
|
+
iri: null,
|
|
516
|
+
reverse: false,
|
|
517
|
+
hasContext: false,
|
|
518
|
+
container: [],
|
|
519
|
+
prefix: false,
|
|
520
|
+
protected: state.protected,
|
|
521
|
+
hasColon: term.indexOf(':', 1) !== -1,
|
|
522
|
+
};
|
|
523
|
+
// 11
|
|
524
|
+
if ('@protected' in value) {
|
|
525
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid term definition');
|
|
526
|
+
if (!Predicate.isBoolean(value['@protected'])) fail('invalid @protected value');
|
|
527
|
+
def.protected = value['@protected'];
|
|
528
|
+
}
|
|
529
|
+
// 12
|
|
530
|
+
if ('@type' in value) {
|
|
531
|
+
const type = value['@type'];
|
|
532
|
+
if (!isString(type)) fail('invalid type mapping');
|
|
533
|
+
const expanded = expandIri(env, active, type, true, false, local, state);
|
|
534
|
+
if (expanded === '@json' || expanded === '@none') {
|
|
535
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid type mapping');
|
|
536
|
+
} else if (
|
|
537
|
+
expanded === null ||
|
|
538
|
+
(expanded !== '@id' && expanded !== '@vocab' && !isAbsoluteIri(expanded)) ||
|
|
539
|
+
isBlankNodeId(expanded)
|
|
540
|
+
) {
|
|
541
|
+
fail('invalid type mapping', type);
|
|
542
|
+
}
|
|
543
|
+
def.type = expanded;
|
|
544
|
+
}
|
|
545
|
+
// 13
|
|
546
|
+
if ('@reverse' in value) {
|
|
547
|
+
if ('@id' in value || '@nest' in value) fail('invalid reverse property');
|
|
548
|
+
const rev = value['@reverse'];
|
|
549
|
+
if (!isString(rev)) fail('invalid IRI mapping');
|
|
550
|
+
if (hasKeywordForm(rev)) {
|
|
551
|
+
MutableHashMap.set(defined, term, true);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
const iri = expandIri(env, active, rev, true, false, local, state);
|
|
555
|
+
if (iri === null || (!isAbsoluteIri(iri) && !isBlankNodeId(iri))) fail('invalid IRI mapping');
|
|
556
|
+
def.iri = iri;
|
|
557
|
+
if ('@container' in value) {
|
|
558
|
+
const c = value['@container'];
|
|
559
|
+
if (c !== null && c !== '@set' && c !== '@index') fail('invalid reverse property');
|
|
560
|
+
if (c !== null) def.container = [c];
|
|
561
|
+
}
|
|
562
|
+
def.reverse = true;
|
|
563
|
+
} else if ('@id' in value && value['@id'] !== term) {
|
|
564
|
+
// 15
|
|
565
|
+
const id = value['@id'];
|
|
566
|
+
if (id === null) {
|
|
567
|
+
def.iri = null;
|
|
568
|
+
} else {
|
|
569
|
+
if (!isString(id)) fail('invalid IRI mapping');
|
|
570
|
+
if (!isKeyword(id) && hasKeywordForm(id)) {
|
|
571
|
+
MutableHashMap.set(defined, term, true);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
const iri = expandIri(env, active, id, true, false, local, state);
|
|
575
|
+
if (iri === null || (!isKeyword(iri) && !isAbsoluteIri(iri) && !isBlankNodeId(iri))) {
|
|
576
|
+
fail('invalid IRI mapping', id);
|
|
577
|
+
}
|
|
578
|
+
if (iri === '@context') fail('invalid keyword alias');
|
|
579
|
+
def.iri = iri;
|
|
580
|
+
if (term.slice(1, -1).includes(':') || term.includes('/')) {
|
|
581
|
+
MutableHashMap.set(defined, term, true);
|
|
582
|
+
const termIri = expandIri(env, active, term, true, false, local, state);
|
|
583
|
+
if (termIri !== iri) fail('invalid IRI mapping', term);
|
|
584
|
+
}
|
|
585
|
+
if (!term.includes(':') && !term.includes('/') && simpleTerm) {
|
|
586
|
+
if (GEN_DELIMS.test(iri) || isBlankNodeId(iri)) def.prefix = true;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
} else if (term.indexOf(':', 1) !== -1) {
|
|
590
|
+
// 16
|
|
591
|
+
const i = term.indexOf(':');
|
|
592
|
+
const prefix = term.slice(0, i);
|
|
593
|
+
const suffix = term.slice(i + 1);
|
|
594
|
+
if (prefix !== '_' && !suffix.startsWith('//') && hasOwn(local, prefix)) {
|
|
595
|
+
createTermDefinition(env, active, local, prefix, state);
|
|
596
|
+
}
|
|
597
|
+
const prefixIri =
|
|
598
|
+
prefix === '_' ? null : Option.getOrNull(Option.map(termOf(active, prefix), (d) => d.iri));
|
|
599
|
+
def.iri = prefixIri === null ? term : prefixIri + suffix;
|
|
600
|
+
} else if (term.includes('/')) {
|
|
601
|
+
// 17
|
|
602
|
+
const iri = expandIri(env, active, term, true);
|
|
603
|
+
if (iri === null || !isAbsoluteIri(iri)) fail('invalid IRI mapping', term);
|
|
604
|
+
def.iri = iri;
|
|
605
|
+
} else if (term === '@type') {
|
|
606
|
+
// 18
|
|
607
|
+
def.iri = '@type';
|
|
608
|
+
} else if (active.vocab !== undefined) {
|
|
609
|
+
// 19
|
|
610
|
+
def.iri = active.vocab + term;
|
|
611
|
+
} else {
|
|
612
|
+
fail('invalid IRI mapping', term);
|
|
613
|
+
}
|
|
614
|
+
// 20
|
|
615
|
+
if ('@container' in value && !def.reverse) {
|
|
616
|
+
const c = value['@container'];
|
|
617
|
+
if (!validContainer(env, c)) fail('invalid container mapping');
|
|
618
|
+
def.container = Array.isArray(c) ? [...c] : [c];
|
|
619
|
+
if (def.container.includes('@type')) {
|
|
620
|
+
if (def.type === undefined) def.type = '@id';
|
|
621
|
+
if (def.type !== '@id' && def.type !== '@vocab') fail('invalid type mapping');
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
// 21
|
|
625
|
+
if ('@index' in value) {
|
|
626
|
+
if (env.processingMode === 'json-ld-1.0' || !def.container.includes('@index')) {
|
|
627
|
+
fail('invalid term definition');
|
|
628
|
+
}
|
|
629
|
+
const index = value['@index'];
|
|
630
|
+
if (!isString(index)) fail('invalid term definition');
|
|
631
|
+
const expanded = expandIri(env, active, index, true, false, local, state);
|
|
632
|
+
if (expanded === null || isKeyword(expanded) || !isAbsoluteIri(expanded)) {
|
|
633
|
+
fail('invalid term definition');
|
|
634
|
+
}
|
|
635
|
+
def.index = index;
|
|
636
|
+
}
|
|
637
|
+
// 22
|
|
638
|
+
if ('@context' in value) {
|
|
639
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid term definition');
|
|
640
|
+
const ctx = value['@context'];
|
|
641
|
+
mapJsonLdError(
|
|
642
|
+
() => processContext(env, active, ctx, baseUrl, remoteContexts, true, true, false),
|
|
643
|
+
(e) => fail('invalid scoped context', e.message),
|
|
644
|
+
);
|
|
645
|
+
def.context = ctx;
|
|
646
|
+
def.hasContext = true;
|
|
647
|
+
def.baseUrl = baseUrl;
|
|
648
|
+
}
|
|
649
|
+
// 23
|
|
650
|
+
if ('@language' in value && !('@type' in value)) {
|
|
651
|
+
const lang = value['@language'];
|
|
652
|
+
if (lang !== null && !isString(lang)) fail('invalid language mapping');
|
|
653
|
+
def.language = lang;
|
|
654
|
+
}
|
|
655
|
+
// 24
|
|
656
|
+
if ('@direction' in value && !('@type' in value)) {
|
|
657
|
+
const dir = value['@direction'];
|
|
658
|
+
if (dir !== null && dir !== 'ltr' && dir !== 'rtl') fail('invalid base direction');
|
|
659
|
+
def.direction = dir;
|
|
660
|
+
}
|
|
661
|
+
// 25
|
|
662
|
+
if ('@nest' in value) {
|
|
663
|
+
if (env.processingMode === 'json-ld-1.0') fail('invalid term definition');
|
|
664
|
+
const nest = value['@nest'];
|
|
665
|
+
if (!isString(nest) || (isKeyword(nest) && nest !== '@nest')) fail('invalid @nest value');
|
|
666
|
+
def.nest = nest;
|
|
667
|
+
}
|
|
668
|
+
// 26
|
|
669
|
+
if ('@prefix' in value) {
|
|
670
|
+
if (env.processingMode === 'json-ld-1.0' || term.includes(':') || term.includes('/')) {
|
|
671
|
+
fail('invalid term definition');
|
|
672
|
+
}
|
|
673
|
+
const p = value['@prefix'];
|
|
674
|
+
if (!Predicate.isBoolean(p)) fail('invalid @prefix value');
|
|
675
|
+
def.prefix = p;
|
|
676
|
+
if (p && def.iri !== null && isKeyword(def.iri)) fail('invalid term definition');
|
|
677
|
+
}
|
|
678
|
+
// 27
|
|
679
|
+
checkTermKeys(value);
|
|
680
|
+
finishDefinition(active, term, def, previous, overrideProtected, defined);
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
const checkTermKeys = (value: JsonObject): void => {
|
|
684
|
+
Record.keys(value).forEach((k) => {
|
|
685
|
+
if (!isTermKey(k)) fail('invalid term definition', k);
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
const finishDefinition = (
|
|
690
|
+
active: ActiveContext,
|
|
691
|
+
term: string,
|
|
692
|
+
def: TermDefinition,
|
|
693
|
+
previous: Option.Option<TermDefinition>,
|
|
694
|
+
overrideProtected: boolean,
|
|
695
|
+
defined: MutableHashMap.MutableHashMap<string, boolean>,
|
|
696
|
+
): void => {
|
|
697
|
+
// 28
|
|
698
|
+
const kept = Option.filter(previous, (p) => !overrideProtected && p.protected);
|
|
699
|
+
if (Option.isSome(kept) && !sameDefinition(def, kept.value)) {
|
|
700
|
+
fail('protected term redefinition', term);
|
|
701
|
+
}
|
|
702
|
+
// 29
|
|
703
|
+
MutableHashMap.set(
|
|
704
|
+
active.terms,
|
|
705
|
+
term,
|
|
706
|
+
Option.getOrElse(kept, () => def),
|
|
707
|
+
);
|
|
708
|
+
MutableHashMap.set(defined, term, true);
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
/** Whether the definition of `term` is still to be created from `local` (§4.2, step 3). */
|
|
712
|
+
const isPending = (local: JsonObject, state: DefineState, term: string): boolean =>
|
|
713
|
+
hasOwn(local, term) && !Option.getOrElse(MutableHashMap.get(state.defined, term), () => false);
|
|
714
|
+
|
|
715
|
+
const sameDefinition = (a: TermDefinition, b: TermDefinition): boolean =>
|
|
716
|
+
a.iri === b.iri &&
|
|
717
|
+
a.reverse === b.reverse &&
|
|
718
|
+
a.type === b.type &&
|
|
719
|
+
a.language === b.language &&
|
|
720
|
+
'language' in a === 'language' in b &&
|
|
721
|
+
a.direction === b.direction &&
|
|
722
|
+
'direction' in a === 'direction' in b &&
|
|
723
|
+
a.hasContext === b.hasContext &&
|
|
724
|
+
deepEqual(a.context, b.context) &&
|
|
725
|
+
a.container.length === b.container.length &&
|
|
726
|
+
a.container.every((c) => b.container.includes(c)) &&
|
|
727
|
+
a.index === b.index &&
|
|
728
|
+
a.nest === b.nest &&
|
|
729
|
+
a.prefix === b.prefix;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* IRI Expansion algorithm.
|
|
733
|
+
*
|
|
734
|
+
* @internal
|
|
735
|
+
*/
|
|
736
|
+
export const expandIri = (
|
|
737
|
+
env: Env,
|
|
738
|
+
active: ActiveContext,
|
|
739
|
+
value: string | null,
|
|
740
|
+
vocab = false,
|
|
741
|
+
documentRelative = false,
|
|
742
|
+
local?: JsonObject,
|
|
743
|
+
state?: DefineState,
|
|
744
|
+
): string | null => {
|
|
745
|
+
// 1
|
|
746
|
+
if (value === null || isKeyword(value)) return value;
|
|
747
|
+
// 2
|
|
748
|
+
if (hasKeywordForm(value)) return null;
|
|
749
|
+
// 3
|
|
750
|
+
if (local !== undefined && state !== undefined && isPending(local, state, value)) {
|
|
751
|
+
createTermDefinition(env, active, local, value, state);
|
|
752
|
+
}
|
|
753
|
+
const def = termOf(active, value);
|
|
754
|
+
if (Option.isSome(def)) {
|
|
755
|
+
const iri = def.value.iri;
|
|
756
|
+
// 4
|
|
757
|
+
if (iri !== null && isKeyword(iri)) return iri;
|
|
758
|
+
// 5
|
|
759
|
+
if (vocab) return iri;
|
|
760
|
+
}
|
|
761
|
+
// 6
|
|
762
|
+
const colon = value.indexOf(':', 1);
|
|
763
|
+
if (colon !== -1) {
|
|
764
|
+
const prefix = value.slice(0, colon);
|
|
765
|
+
const suffix = value.slice(colon + 1);
|
|
766
|
+
if (prefix === '_' || suffix.startsWith('//')) return value;
|
|
767
|
+
if (local !== undefined && state !== undefined && isPending(local, state, prefix)) {
|
|
768
|
+
createTermDefinition(env, active, local, prefix, state);
|
|
769
|
+
}
|
|
770
|
+
const prefixDef = termOf(active, prefix);
|
|
771
|
+
if (Option.isSome(prefixDef) && prefixDef.value.iri !== null && prefixDef.value.prefix) {
|
|
772
|
+
return prefixDef.value.iri + suffix;
|
|
773
|
+
}
|
|
774
|
+
if (isAbsoluteIri(value)) return value;
|
|
775
|
+
}
|
|
776
|
+
// 7
|
|
777
|
+
if (vocab && active.vocab !== undefined) return active.vocab + value;
|
|
778
|
+
// 8
|
|
779
|
+
if (documentRelative) return resolveIri(value, active.base);
|
|
780
|
+
return value;
|
|
781
|
+
};
|