gremlin 3.8.1 → 4.0.0-beta.2
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/README.md +18 -4
- package/build/cjs/driver/auth.cjs +69 -0
- package/build/cjs/driver/auth.d.cts +9 -0
- package/build/cjs/driver/client.cjs +134 -0
- package/build/cjs/driver/client.d.cts +85 -0
- package/build/cjs/driver/connection.cjs +250 -0
- package/build/cjs/driver/connection.d.cts +63 -0
- package/build/cjs/driver/driver-remote-connection.cjs +141 -0
- package/build/cjs/driver/driver-remote-connection.d.cts +33 -0
- package/build/cjs/driver/remote-connection.cjs +75 -0
- package/build/cjs/driver/remote-connection.d.cts +72 -0
- package/build/cjs/driver/request-message.cjs +157 -0
- package/build/cjs/driver/request-message.d.cts +49 -0
- package/build/cjs/driver/response-error.cjs +45 -0
- package/build/cjs/driver/response-error.d.cts +13 -0
- package/build/cjs/driver/result-set.cjs +111 -0
- package/build/cjs/driver/result-set.d.cts +29 -0
- package/build/cjs/index.cjs +125 -0
- package/build/cjs/index.d.cts +393 -0
- package/build/cjs/language/grammar/GremlinLexer.cjs +1851 -0
- package/build/cjs/language/grammar/GremlinLexer.d.cts +340 -0
- package/build/cjs/language/grammar/GremlinListener.cjs +4490 -0
- package/build/cjs/language/grammar/GremlinListener.d.cts +4898 -0
- package/build/cjs/language/grammar/GremlinParser.cjs +35244 -0
- package/build/cjs/language/grammar/GremlinParser.d.cts +5881 -0
- package/build/cjs/language/index.cjs +48 -0
- package/build/cjs/language/index.d.cts +12 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.cjs +157 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.d.cts +36 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.cjs +826 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.d.cts +155 -0
- package/build/cjs/language/translator/GoTranslateVisitor.cjs +339 -0
- package/build/cjs/language/translator/GoTranslateVisitor.d.cts +31 -0
- package/build/cjs/language/translator/GremlinTranslator.cjs +96 -0
- package/build/cjs/language/translator/GremlinTranslator.d.cts +18 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.cjs +287 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.d.cts +34 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.cjs +247 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.d.cts +23 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.cjs +220 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.d.cts +25 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.cjs +304 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.d.cts +28 -0
- package/build/cjs/language/translator/TranslateVisitor.cjs +389 -0
- package/build/cjs/language/translator/TranslateVisitor.d.cts +91 -0
- package/build/cjs/language/translator/Translation.cjs +47 -0
- package/build/cjs/language/translator/Translation.d.cts +13 -0
- package/build/cjs/language/translator/Translator.cjs +46 -0
- package/build/cjs/language/translator/Translator.d.cts +24 -0
- package/build/cjs/language/translator/TranslatorException.cjs +31 -0
- package/build/cjs/language/translator/TranslatorException.d.cts +6 -0
- package/build/cjs/process/anonymous-traversal.cjs +78 -0
- package/build/cjs/process/anonymous-traversal.d.cts +40 -0
- package/build/cjs/process/graph-traversal.cjs +1702 -0
- package/build/cjs/process/graph-traversal.d.cts +1134 -0
- package/build/cjs/process/gremlin-lang.cjs +196 -0
- package/build/cjs/process/gremlin-lang.d.cts +15 -0
- package/build/cjs/process/transaction.cjs +69 -0
- package/build/cjs/process/transaction.d.cts +34 -0
- package/build/cjs/process/traversal-strategy.cjs +360 -0
- package/build/cjs/process/traversal-strategy.d.cts +211 -0
- package/build/cjs/process/traversal.cjs +482 -0
- package/build/cjs/process/traversal.d.cts +186 -0
- package/build/cjs/structure/graph.cjs +157 -0
- package/build/cjs/structure/graph.d.cts +57 -0
- package/build/cjs/structure/io/binary/GraphBinary.cjs +148 -0
- package/build/cjs/structure/io/binary/GraphBinary.d.cts +91 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.cjs +80 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.d.cts +8 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.cjs +139 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.cjs +136 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.d.cts +14 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.cjs +112 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.cjs +93 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.cjs +88 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.d.cts +10 -0
- package/build/cjs/structure/io/binary/internals/DataType.cjs +63 -0
- package/build/cjs/structure/io/binary/internals/DataType.d.cts +35 -0
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.cjs +139 -0
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.cjs +201 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.d.cts +20 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.cjs +127 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.d.cts +24 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.cjs +97 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryWriter.cjs +85 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryWriter.d.cts +9 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.cjs +103 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.d.cts +13 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.cjs +95 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.cjs +144 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.d.cts +13 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.cjs +63 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.d.cts +8 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.cjs +66 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.d.cts +9 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.cjs +113 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.cjs +130 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.cjs +138 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.cjs +107 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.d.cts +11 -0
- package/{lib/driver/auth/authenticator.js → build/cjs/structure/io/binary/internals/StubSerializer.cjs} +14 -20
- package/build/cjs/structure/io/binary/internals/StubSerializer.d.cts +7 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.cjs +70 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.cjs +109 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.d.cts +14 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.cjs +163 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.cjs +128 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.d.cts +17 -0
- package/build/cjs/structure/io/binary/internals/utils.cjs +53 -0
- package/build/cjs/structure/io/binary/internals/utils.d.cts +6 -0
- package/build/cjs/utils.cjs +142 -0
- package/build/cjs/utils.d.cts +20 -0
- package/build/esm/driver/auth.d.ts +9 -0
- package/build/esm/driver/auth.js +65 -0
- package/build/esm/driver/client.d.ts +85 -0
- package/build/esm/driver/client.js +128 -0
- package/build/esm/driver/connection.d.ts +63 -0
- package/build/esm/driver/connection.js +211 -0
- package/build/esm/driver/driver-remote-connection.d.ts +33 -0
- package/build/esm/driver/driver-remote-connection.js +102 -0
- package/build/esm/driver/remote-connection.d.ts +72 -0
- package/build/esm/driver/remote-connection.js +69 -0
- package/build/esm/driver/request-message.d.ts +49 -0
- package/build/esm/driver/request-message.js +152 -0
- package/build/esm/driver/response-error.d.ts +13 -0
- package/{lib → build/esm}/driver/response-error.js +21 -26
- package/build/esm/driver/result-set.d.ts +29 -0
- package/build/esm/driver/result-set.js +75 -0
- package/build/esm/index.d.ts +393 -0
- package/{index.js → build/esm/index.js} +23 -33
- package/build/esm/language/grammar/GremlinLexer.d.ts +340 -0
- package/build/esm/language/grammar/GremlinLexer.js +1814 -0
- package/build/esm/language/grammar/GremlinListener.d.ts +4898 -0
- package/build/esm/language/grammar/GremlinListener.js +4486 -0
- package/build/esm/language/grammar/GremlinParser.d.ts +5881 -0
- package/build/esm/language/grammar/GremlinParser.js +34711 -0
- package/build/esm/language/index.d.ts +12 -0
- package/build/esm/language/index.js +30 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.d.ts +36 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.js +151 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.d.ts +155 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.js +820 -0
- package/build/esm/language/translator/GoTranslateVisitor.d.ts +31 -0
- package/build/esm/language/translator/GoTranslateVisitor.js +333 -0
- package/build/esm/language/translator/GremlinTranslator.d.ts +18 -0
- package/build/esm/language/translator/GremlinTranslator.js +89 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.d.ts +34 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.js +281 -0
- package/build/esm/language/translator/JavaTranslateVisitor.d.ts +23 -0
- package/build/esm/language/translator/JavaTranslateVisitor.js +241 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.d.ts +25 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.js +214 -0
- package/build/esm/language/translator/PythonTranslateVisitor.d.ts +28 -0
- package/build/esm/language/translator/PythonTranslateVisitor.js +298 -0
- package/build/esm/language/translator/TranslateVisitor.d.ts +91 -0
- package/build/esm/language/translator/TranslateVisitor.js +386 -0
- package/build/esm/language/translator/Translation.d.ts +13 -0
- package/build/esm/language/translator/Translation.js +43 -0
- package/build/esm/language/translator/Translator.d.ts +24 -0
- package/build/esm/language/translator/Translator.js +40 -0
- package/build/esm/language/translator/TranslatorException.d.ts +6 -0
- package/build/esm/language/translator/TranslatorException.js +27 -0
- package/build/esm/process/anonymous-traversal.d.ts +40 -0
- package/build/esm/process/anonymous-traversal.js +72 -0
- package/build/esm/process/graph-traversal.d.ts +1134 -0
- package/build/esm/process/graph-traversal.js +1693 -0
- package/build/esm/process/gremlin-lang.d.ts +15 -0
- package/build/esm/process/gremlin-lang.js +193 -0
- package/build/esm/process/transaction.d.ts +34 -0
- package/build/esm/process/transaction.js +65 -0
- package/build/esm/process/traversal-strategy.d.ts +211 -0
- package/build/esm/process/traversal-strategy.js +319 -0
- package/build/esm/process/traversal.d.ts +186 -0
- package/build/esm/process/traversal.js +469 -0
- package/build/esm/structure/graph.d.ts +57 -0
- package/build/esm/structure/graph.js +148 -0
- package/build/esm/structure/io/binary/GraphBinary.d.ts +91 -0
- package/build/esm/structure/io/binary/GraphBinary.js +108 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.d.ts +8 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.js +77 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.js +136 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.d.ts +14 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.js +133 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.js +109 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.js +90 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.d.ts +10 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.js +85 -0
- package/build/esm/structure/io/binary/internals/DataType.d.ts +35 -0
- package/{lib/driver/auth/mechanisms/sasl-mechanism-base.js → build/esm/structure/io/binary/internals/DataType.js} +43 -34
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.js +136 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.d.ts +20 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.js +198 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.d.ts +24 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.js +124 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.js +94 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryWriter.d.ts +9 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryWriter.js +82 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.d.ts +13 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.js +100 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.js +92 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.d.ts +13 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.js +141 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.d.ts +8 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.js +60 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.d.ts +9 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.js +63 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.js +110 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.js +127 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.js +135 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.js +104 -0
- package/build/esm/structure/io/binary/internals/StubSerializer.d.ts +7 -0
- package/{.prettierrc.js → build/esm/structure/io/binary/internals/StubSerializer.js} +11 -11
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.js +67 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.d.ts +14 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.js +106 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.js +160 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.d.ts +17 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.js +125 -0
- package/build/esm/structure/io/binary/internals/utils.d.ts +6 -0
- package/{lib → build/esm}/structure/io/binary/internals/utils.js +23 -35
- package/build/esm/utils.d.ts +20 -0
- package/build/esm/utils.js +98 -0
- package/package.json +56 -20
- package/.nvmrc +0 -1
- package/NOTICE +0 -5
- package/doc/AnonymousTraversalSource.html +0 -793
- package/doc/Authenticator.html +0 -303
- package/doc/Bytecode.html +0 -941
- package/doc/CardinalityValue.html +0 -711
- package/doc/Client.html +0 -1869
- package/doc/Connection.html +0 -1192
- package/doc/DriverRemoteConnection.html +0 -1528
- package/doc/EdgeLabelVerificationStrategy.html +0 -238
- package/doc/Graph.html +0 -343
- package/doc/GraphSON2Reader.html +0 -407
- package/doc/GraphSON2Writer.html +0 -558
- package/doc/GraphSON3Reader.html +0 -170
- package/doc/GraphSON3Writer.html +0 -170
- package/doc/GraphTraversal.html +0 -22974
- package/doc/GraphTraversalSource.html +0 -3683
- package/doc/HaltedTraverserStrategy.html +0 -215
- package/doc/MatchAlgorithmStrategy.html +0 -210
- package/doc/P.html +0 -2020
- package/doc/PartitionStrategy.html +0 -387
- package/doc/Path.html +0 -242
- package/doc/PlainTextSaslAuthenticator.html +0 -456
- package/doc/ProductiveByStrategy.html +0 -258
- package/doc/RemoteConnection.html +0 -1086
- package/doc/RemoteStrategy.html +0 -307
- package/doc/RemoteTraversal.html +0 -170
- package/doc/ReservedKeysVerificationStrategy.html +0 -261
- package/doc/ResponseError.html +0 -360
- package/doc/ResultSet.html +0 -633
- package/doc/SaslAuthenticator.html +0 -455
- package/doc/SaslMechanismBase.html +0 -506
- package/doc/SaslMechanismPlain.html +0 -925
- package/doc/SeedStrategy.html +0 -288
- package/doc/SubgraphStrategy.html +0 -387
- package/doc/TextP.html +0 -1440
- package/doc/Transaction.html +0 -655
- package/doc/Translator.html +0 -527
- package/doc/TraversalStrategies.html +0 -652
- package/doc/TraversalStrategy.html +0 -393
- package/doc/TypeSerializer.html +0 -166
- package/doc/driver_auth_authenticator.js.html +0 -89
- package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +0 -103
- package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +0 -157
- package/doc/driver_auth_plain-text-sasl-authenticator.js.html +0 -106
- package/doc/driver_auth_sasl-authenticator.js.html +0 -100
- package/doc/driver_client.js.html +0 -250
- package/doc/driver_connection.js.html +0 -518
- package/doc/driver_driver-remote-connection.js.html +0 -193
- package/doc/driver_remote-connection.js.html +0 -198
- package/doc/driver_response-error.js.html +0 -98
- package/doc/driver_result-set.js.html +0 -134
- package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/global.html +0 -728
- package/doc/index.html +0 -185
- package/doc/module.exports.html +0 -301
- package/doc/process_anonymous-traversal.js.html +0 -138
- package/doc/process_bytecode.js.html +0 -175
- package/doc/process_graph-traversal.js.html +0 -1936
- package/doc/process_transaction.js.html +0 -151
- package/doc/process_translator.js.html +0 -172
- package/doc/process_traversal-strategy.js.html +0 -466
- package/doc/process_traversal.js.html +0 -592
- package/doc/scripts/linenumber.js +0 -25
- package/doc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/doc/scripts/prettify/lang-css.js +0 -2
- package/doc/scripts/prettify/prettify.js +0 -28
- package/doc/structure_graph.js.html +0 -233
- package/doc/structure_io_binary_internals_DataType.js.html +0 -151
- package/doc/structure_io_binary_internals_GraphBinaryReader.js.html +0 -133
- package/doc/structure_io_binary_internals_GraphBinaryWriter.js.html +0 -136
- package/doc/structure_io_graph-serializer.js.html +0 -354
- package/doc/structure_io_type-serializers.js.html +0 -617
- package/doc/styles/jsdoc-default.css +0 -358
- package/doc/styles/prettify-jsdoc.css +0 -111
- package/doc/styles/prettify-tomorrow.css +0 -132
- package/doc/utils.js.html +0 -181
- package/docker-compose.yml +0 -76
- package/eslint.config.mjs +0 -143
- package/lib/driver/auth/mechanisms/sasl-mechanism-plain.js +0 -106
- package/lib/driver/auth/plain-text-sasl-authenticator.js +0 -55
- package/lib/driver/auth/sasl-authenticator.js +0 -49
- package/lib/driver/client.js +0 -199
- package/lib/driver/connection.js +0 -467
- package/lib/driver/driver-remote-connection.js +0 -142
- package/lib/driver/remote-connection.js +0 -147
- package/lib/driver/result-set.js +0 -83
- package/lib/process/anonymous-traversal.js +0 -87
- package/lib/process/bytecode.js +0 -124
- package/lib/process/graph-traversal.js +0 -1885
- package/lib/process/transaction.js +0 -100
- package/lib/process/translator.js +0 -121
- package/lib/process/traversal-strategy.js +0 -415
- package/lib/process/traversal.js +0 -541
- package/lib/structure/graph.js +0 -182
- package/lib/structure/io/binary/GraphBinary.js +0 -110
- package/lib/structure/io/binary/internals/AnySerializer.js +0 -100
- package/lib/structure/io/binary/internals/ArraySerializer.js +0 -137
- package/lib/structure/io/binary/internals/BigIntegerSerializer.js +0 -153
- package/lib/structure/io/binary/internals/BooleanSerializer.js +0 -105
- package/lib/structure/io/binary/internals/BulkSetSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteBufferSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteSerializer.js +0 -97
- package/lib/structure/io/binary/internals/BytecodeSerializer.js +0 -250
- package/lib/structure/io/binary/internals/ClassSerializer.js +0 -60
- package/lib/structure/io/binary/internals/DataType.js +0 -100
- package/lib/structure/io/binary/internals/DateSerializer.js +0 -105
- package/lib/structure/io/binary/internals/DoubleSerializer.js +0 -101
- package/lib/structure/io/binary/internals/EdgeSerializer.js +0 -216
- package/lib/structure/io/binary/internals/EnumSerializer.js +0 -152
- package/lib/structure/io/binary/internals/FloatSerializer.js +0 -101
- package/lib/structure/io/binary/internals/GraphBinaryReader.js +0 -82
- package/lib/structure/io/binary/internals/GraphBinaryWriter.js +0 -85
- package/lib/structure/io/binary/internals/IntSerializer.js +0 -114
- package/lib/structure/io/binary/internals/LambdaSerializer.js +0 -71
- package/lib/structure/io/binary/internals/LongSerializer.js +0 -109
- package/lib/structure/io/binary/internals/LongSerializerNg.js +0 -104
- package/lib/structure/io/binary/internals/MapSerializer.js +0 -155
- package/lib/structure/io/binary/internals/NumberSerializationStrategy.js +0 -73
- package/lib/structure/io/binary/internals/OffsetDateTimeSerializer.js +0 -151
- package/lib/structure/io/binary/internals/PSerializer.js +0 -152
- package/lib/structure/io/binary/internals/PathSerializer.js +0 -124
- package/lib/structure/io/binary/internals/PropertySerializer.js +0 -142
- package/lib/structure/io/binary/internals/SetSerializer.js +0 -134
- package/lib/structure/io/binary/internals/ShortSerializer.js +0 -101
- package/lib/structure/io/binary/internals/StringSerializer.js +0 -116
- package/lib/structure/io/binary/internals/TextPSerializer.js +0 -146
- package/lib/structure/io/binary/internals/TraversalStrategySerializer.js +0 -69
- package/lib/structure/io/binary/internals/TraverserSerializer.js +0 -124
- package/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js +0 -77
- package/lib/structure/io/binary/internals/UuidSerializer.js +0 -121
- package/lib/structure/io/binary/internals/VertexPropertySerializer.js +0 -176
- package/lib/structure/io/binary/internals/VertexSerializer.js +0 -139
- package/lib/structure/io/graph-serializer.js +0 -303
- package/lib/structure/io/type-serializers.js +0 -566
- package/lib/utils.js +0 -130
package/lib/process/traversal.js
DELETED
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @author Jorge Bay Gondra
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
'use strict';
|
|
25
|
-
|
|
26
|
-
const itemDone = Object.freeze({ value: null, done: true });
|
|
27
|
-
const asyncIteratorSymbol = Symbol.asyncIterator || Symbol('@@asyncIterator');
|
|
28
|
-
|
|
29
|
-
class Traversal {
|
|
30
|
-
constructor(graph, traversalStrategies, bytecode) {
|
|
31
|
-
this.graph = graph;
|
|
32
|
-
this.traversalStrategies = traversalStrategies;
|
|
33
|
-
this.bytecode = bytecode;
|
|
34
|
-
/** @type {Array<Traverser>} */
|
|
35
|
-
this.traversers = null;
|
|
36
|
-
this.sideEffects = null;
|
|
37
|
-
this._traversalStrategiesPromise = null;
|
|
38
|
-
this._traversersIteratorIndex = 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Async iterable method implementation.
|
|
43
|
-
*/
|
|
44
|
-
[asyncIteratorSymbol]() {
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** @returns {Bytecode} */
|
|
49
|
-
getBytecode() {
|
|
50
|
-
return this.bytecode;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Returns an Array containing the traverser objects.
|
|
55
|
-
* @returns {Promise.<Array>}
|
|
56
|
-
*/
|
|
57
|
-
toList() {
|
|
58
|
-
return this._applyStrategies().then(() => {
|
|
59
|
-
const result = [];
|
|
60
|
-
let it;
|
|
61
|
-
while ((it = this._getNext()) && !it.done) {
|
|
62
|
-
result.push(it.value);
|
|
63
|
-
}
|
|
64
|
-
return result;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Determines if there are any more items to iterate from the traversal.
|
|
70
|
-
* @returns {Promise.<boolean>}
|
|
71
|
-
*/
|
|
72
|
-
hasNext() {
|
|
73
|
-
return this._applyStrategies().then(
|
|
74
|
-
() =>
|
|
75
|
-
this.traversers &&
|
|
76
|
-
this.traversers.length > 0 &&
|
|
77
|
-
this._traversersIteratorIndex < this.traversers.length &&
|
|
78
|
-
this.traversers[this._traversersIteratorIndex].bulk > 0,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Iterates all Traverser instances in the traversal.
|
|
84
|
-
* @returns {Promise}
|
|
85
|
-
*/
|
|
86
|
-
iterate() {
|
|
87
|
-
this.bytecode.addStep('discard');
|
|
88
|
-
return this._applyStrategies().then(() => {
|
|
89
|
-
let it;
|
|
90
|
-
while ((it = this._getNext()) && !it.done) {
|
|
91
|
-
//
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Async iterator method implementation.
|
|
98
|
-
* Returns a promise containing an iterator item.
|
|
99
|
-
* @returns {Promise.<{value, done}>}
|
|
100
|
-
*/
|
|
101
|
-
next() {
|
|
102
|
-
return this._applyStrategies().then(() => this._getNext());
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Synchronous iterator of traversers including
|
|
107
|
-
* @private
|
|
108
|
-
*/
|
|
109
|
-
_getNext() {
|
|
110
|
-
while (this.traversers && this._traversersIteratorIndex < this.traversers.length) {
|
|
111
|
-
const traverser = this.traversers[this._traversersIteratorIndex];
|
|
112
|
-
if (traverser.bulk > 0) {
|
|
113
|
-
traverser.bulk--;
|
|
114
|
-
return { value: traverser.object, done: false };
|
|
115
|
-
}
|
|
116
|
-
this._traversersIteratorIndex++;
|
|
117
|
-
}
|
|
118
|
-
return itemDone;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
_applyStrategies() {
|
|
122
|
-
if (this._traversalStrategiesPromise) {
|
|
123
|
-
// Apply strategies only once
|
|
124
|
-
return this._traversalStrategiesPromise;
|
|
125
|
-
}
|
|
126
|
-
return (this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Returns step instructions during JSON serialization
|
|
131
|
-
* @returns {Array}
|
|
132
|
-
*/
|
|
133
|
-
toJSON() {
|
|
134
|
-
return this.bytecode.stepInstructions;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Returns the Bytecode JSON representation of the traversal
|
|
139
|
-
* @returns {String}
|
|
140
|
-
*/
|
|
141
|
-
toString() {
|
|
142
|
-
return this.bytecode.toString();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
class IO {
|
|
147
|
-
static get graphml() {
|
|
148
|
-
return 'graphml';
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
static get graphson() {
|
|
152
|
-
return 'graphson';
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
static get gryo() {
|
|
156
|
-
return 'gryo';
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
static get reader() {
|
|
160
|
-
return '~tinkerpop.io.reader';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
static get registry() {
|
|
164
|
-
return '~tinkerpop.io.registry';
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
static get writer() {
|
|
168
|
-
return '~tinkerpop.io.writer';
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// eslint-disable-next-line no-unused-vars
|
|
173
|
-
class ConnectedComponent {
|
|
174
|
-
static get component() {
|
|
175
|
-
return 'gremlin.connectedComponentVertexProgram.component';
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
static get edges() {
|
|
179
|
-
return '~tinkerpop.connectedComponent.edges';
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
static get propertyName() {
|
|
183
|
-
return '~tinkerpop.connectedComponent.propertyName';
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// eslint-disable-next-line no-unused-vars
|
|
188
|
-
class ShortestPath {
|
|
189
|
-
static get distance() {
|
|
190
|
-
return '~tinkerpop.shortestPath.distance';
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
static get edges() {
|
|
194
|
-
return '~tinkerpop.shortestPath.edges';
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
static get includeEdges() {
|
|
198
|
-
return '~tinkerpop.shortestPath.includeEdges';
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
static get maxDistance() {
|
|
202
|
-
return '~tinkerpop.shortestPath.maxDistance';
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
static get target() {
|
|
206
|
-
return '~tinkerpop.shortestPath.target';
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// eslint-disable-next-line no-unused-vars
|
|
211
|
-
class PageRank {
|
|
212
|
-
static get edges() {
|
|
213
|
-
return '~tinkerpop.pageRank.edges';
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
static get propertyName() {
|
|
217
|
-
return '~tinkerpop.pageRank.propertyName';
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
static get times() {
|
|
221
|
-
return '~tinkerpop.pageRank.times';
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// eslint-disable-next-line no-unused-vars
|
|
226
|
-
class PeerPressure {
|
|
227
|
-
static get edges() {
|
|
228
|
-
return '~tinkerpop.peerPressure.edges';
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
static get propertyName() {
|
|
232
|
-
return '~tinkerpop.peerPressure.propertyName';
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
static get times() {
|
|
236
|
-
return '~tinkerpop.peerPressure.times';
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
class P {
|
|
241
|
-
/**
|
|
242
|
-
* Represents an operation.
|
|
243
|
-
* @constructor
|
|
244
|
-
*/
|
|
245
|
-
constructor(operator, value, other) {
|
|
246
|
-
this.operator = operator;
|
|
247
|
-
this.value = value;
|
|
248
|
-
this.other = other;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Returns the string representation of the instance.
|
|
253
|
-
* @returns {string}
|
|
254
|
-
*/
|
|
255
|
-
toString() {
|
|
256
|
-
function formatValue(value) {
|
|
257
|
-
if (Array.isArray(value)) {
|
|
258
|
-
const acc = [];
|
|
259
|
-
for (const item of value) {
|
|
260
|
-
acc.push(formatValue(item));
|
|
261
|
-
}
|
|
262
|
-
return acc;
|
|
263
|
-
}
|
|
264
|
-
if (value && typeof value === 'string') {
|
|
265
|
-
return `'${value}'`;
|
|
266
|
-
}
|
|
267
|
-
return value;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (this.other === undefined || this.other === null) {
|
|
271
|
-
return this.operator + '(' + formatValue(this.value) + ')';
|
|
272
|
-
}
|
|
273
|
-
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
and(arg) {
|
|
277
|
-
return new P('and', this, arg);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
or(arg) {
|
|
281
|
-
return new P('or', this, arg);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
static within(...args) {
|
|
285
|
-
if (args.length === 1 && Array.isArray(args[0])) {
|
|
286
|
-
return new P('within', args[0], null);
|
|
287
|
-
}
|
|
288
|
-
return new P('within', args, null);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
static without(...args) {
|
|
292
|
-
if (args.length === 1 && Array.isArray(args[0])) {
|
|
293
|
-
return new P('without', args[0], null);
|
|
294
|
-
}
|
|
295
|
-
return new P('without', args, null);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/** @param {...Object} args */
|
|
299
|
-
static between(...args) {
|
|
300
|
-
return createP('between', args);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/** @param {...Object} args */
|
|
304
|
-
static eq(...args) {
|
|
305
|
-
return createP('eq', args);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/** @param {...Object} args */
|
|
309
|
-
static gt(...args) {
|
|
310
|
-
return createP('gt', args);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/** @param {...Object} args */
|
|
314
|
-
static gte(...args) {
|
|
315
|
-
return createP('gte', args);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/** @param {...Object} args */
|
|
319
|
-
static inside(...args) {
|
|
320
|
-
return createP('inside', args);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/** @param {...Object} args */
|
|
324
|
-
static lt(...args) {
|
|
325
|
-
return createP('lt', args);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/** @param {...Object} args */
|
|
329
|
-
static lte(...args) {
|
|
330
|
-
return createP('lte', args);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/** @param {...Object} args */
|
|
334
|
-
static neq(...args) {
|
|
335
|
-
return createP('neq', args);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/** @param {...Object} args */
|
|
339
|
-
static not(...args) {
|
|
340
|
-
return createP('not', args);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/** @param {...Object} args */
|
|
344
|
-
static outside(...args) {
|
|
345
|
-
return createP('outside', args);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/** @param {...Object} args */
|
|
349
|
-
static typeOf(...args) {
|
|
350
|
-
return createP('typeOf', args);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/** @param {...Object} args */
|
|
354
|
-
static test(...args) {
|
|
355
|
-
return createP('test', args);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
function createP(operator, args) {
|
|
360
|
-
args.unshift(null, operator);
|
|
361
|
-
return new (Function.prototype.bind.apply(P, args))();
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
class TextP {
|
|
365
|
-
/**
|
|
366
|
-
* Represents an operation.
|
|
367
|
-
* @constructor
|
|
368
|
-
*/
|
|
369
|
-
constructor(operator, value, other) {
|
|
370
|
-
this.operator = operator;
|
|
371
|
-
this.value = value;
|
|
372
|
-
this.other = other;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Returns the string representation of the instance.
|
|
377
|
-
* @returns {string}
|
|
378
|
-
*/
|
|
379
|
-
toString() {
|
|
380
|
-
function formatValue(value) {
|
|
381
|
-
if (value && typeof value === 'string') {
|
|
382
|
-
return `'${value}'`;
|
|
383
|
-
}
|
|
384
|
-
return value;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
if (this.other === undefined) {
|
|
388
|
-
return this.operator + '(' + formatValue(this.value) + ')';
|
|
389
|
-
}
|
|
390
|
-
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
and(arg) {
|
|
394
|
-
return new P('and', this, arg);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
or(arg) {
|
|
398
|
-
return new P('or', this, arg);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/** @param {...Object} args */
|
|
402
|
-
static containing(...args) {
|
|
403
|
-
return createTextP('containing', args);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/** @param {...Object} args */
|
|
407
|
-
static endingWith(...args) {
|
|
408
|
-
return createTextP('endingWith', args);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/** @param {...Object} args */
|
|
412
|
-
static notContaining(...args) {
|
|
413
|
-
return createTextP('notContaining', args);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/** @param {...Object} args */
|
|
417
|
-
static notEndingWith(...args) {
|
|
418
|
-
return createTextP('notEndingWith', args);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/** @param {...Object} args */
|
|
422
|
-
static notStartingWith(...args) {
|
|
423
|
-
return createTextP('notStartingWith', args);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/** @param {...Object} args */
|
|
427
|
-
static startingWith(...args) {
|
|
428
|
-
return createTextP('startingWith', args);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/** @param {...Object} args */
|
|
432
|
-
static regex(...args) {
|
|
433
|
-
return createTextP('regex', args);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/** @param {...Object} args */
|
|
437
|
-
static notRegex(...args) {
|
|
438
|
-
return createTextP('notRegex', args);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
function createTextP(operator, args) {
|
|
443
|
-
args.unshift(null, operator);
|
|
444
|
-
return new (Function.prototype.bind.apply(TextP, args))();
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
class Traverser {
|
|
448
|
-
constructor(object, bulk) {
|
|
449
|
-
this.object = object;
|
|
450
|
-
this.bulk = bulk || 1;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
class TraversalSideEffects {}
|
|
455
|
-
|
|
456
|
-
const withOptions = {
|
|
457
|
-
tokens: '~tinkerpop.valueMap.tokens',
|
|
458
|
-
none: 0,
|
|
459
|
-
ids: 1,
|
|
460
|
-
labels: 2,
|
|
461
|
-
keys: 4,
|
|
462
|
-
values: 8,
|
|
463
|
-
all: 15,
|
|
464
|
-
indexer: '~tinkerpop.index.indexer',
|
|
465
|
-
list: 0,
|
|
466
|
-
map: 1,
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
function toEnum(typeName, keys) {
|
|
470
|
-
const result = {};
|
|
471
|
-
keys.split(' ').forEach((k) => {
|
|
472
|
-
let jsKey = k;
|
|
473
|
-
if (jsKey === jsKey.toUpperCase()) {
|
|
474
|
-
jsKey = jsKey.toLowerCase();
|
|
475
|
-
}
|
|
476
|
-
result[jsKey] = new EnumValue(typeName, k);
|
|
477
|
-
});
|
|
478
|
-
return result;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
const directionAlias = {
|
|
482
|
-
from_: 'out',
|
|
483
|
-
to: 'in',
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
// for direction enums, maps the same EnumValue object to the enum aliases after creating them
|
|
487
|
-
function toDirectionEnum(typeName, keys) {
|
|
488
|
-
const result = toEnum(typeName, keys);
|
|
489
|
-
Object.keys(directionAlias).forEach((k) => {
|
|
490
|
-
result[k] = result[directionAlias[k]];
|
|
491
|
-
});
|
|
492
|
-
return result;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
function toGTypeEnum(typeName, keys) {
|
|
496
|
-
const result = {};
|
|
497
|
-
keys.split(' ').forEach((k) => {
|
|
498
|
-
result[k] = new EnumValue(typeName, k.toUpperCase());
|
|
499
|
-
});
|
|
500
|
-
return result;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
class EnumValue {
|
|
504
|
-
constructor(typeName, elementName) {
|
|
505
|
-
this.typeName = typeName;
|
|
506
|
-
this.elementName = elementName;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
toString() {
|
|
510
|
-
return this.elementName;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
module.exports = {
|
|
515
|
-
EnumValue,
|
|
516
|
-
P,
|
|
517
|
-
TextP,
|
|
518
|
-
withOptions,
|
|
519
|
-
IO,
|
|
520
|
-
Traversal,
|
|
521
|
-
TraversalSideEffects,
|
|
522
|
-
Traverser,
|
|
523
|
-
barrier: toEnum('Barrier', 'normSack'),
|
|
524
|
-
cardinality: toEnum('Cardinality', 'list set single'),
|
|
525
|
-
column: toEnum('Column', 'keys values'),
|
|
526
|
-
direction: toDirectionEnum('Direction', 'BOTH IN OUT from_ to'),
|
|
527
|
-
dt: toEnum('DT', 'second minute hour day'),
|
|
528
|
-
gType: toGTypeEnum(
|
|
529
|
-
'GType',
|
|
530
|
-
'bigDecimal bigInt binary boolean byte char datetime double duration edge float graph int list long map null number path property set short string tree uuid vertex vproperty',
|
|
531
|
-
),
|
|
532
|
-
graphSONVersion: toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0'),
|
|
533
|
-
gryoVersion: toEnum('GryoVersion', 'V1_0 V3_0'),
|
|
534
|
-
merge: toEnum('Merge', 'onCreate onMatch outV inV'),
|
|
535
|
-
operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
|
|
536
|
-
order: toEnum('Order', 'asc desc shuffle'),
|
|
537
|
-
pick: toEnum('Pick', 'any none unproductive'),
|
|
538
|
-
pop: toEnum('Pop', 'all first last mixed'),
|
|
539
|
-
scope: toEnum('Scope', 'global local'),
|
|
540
|
-
t: toEnum('T', 'id key label value'),
|
|
541
|
-
};
|
package/lib/structure/graph.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @author Jorge Bay Gondra
|
|
22
|
-
*/
|
|
23
|
-
'use strict';
|
|
24
|
-
|
|
25
|
-
const gt = require('../process/graph-traversal');
|
|
26
|
-
const { TraversalStrategies } = require('../process/traversal-strategy');
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* An "empty" graph object to server only as a reference.
|
|
30
|
-
*/
|
|
31
|
-
class Graph {
|
|
32
|
-
/**
|
|
33
|
-
* Returns the graph traversal source.
|
|
34
|
-
* @param {Function} [traversalSourceClass] The constructor to use for the {@code GraphTraversalSource} instance.
|
|
35
|
-
* @returns {GraphTraversalSource}
|
|
36
|
-
* @deprecated As of release 3.3.5, replaced by the traversal() anonymous function.
|
|
37
|
-
*/
|
|
38
|
-
traversal(traversalSourceClass) {
|
|
39
|
-
const traversalSourceConstructor = traversalSourceClass || gt.GraphTraversalSource;
|
|
40
|
-
return new traversalSourceConstructor(this, new TraversalStrategies());
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
toString() {
|
|
44
|
-
return 'graph[]';
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
class Element {
|
|
49
|
-
// properties are stored as list of property objects
|
|
50
|
-
constructor(id, label, properties = []) {
|
|
51
|
-
this.id = id;
|
|
52
|
-
this.label = label;
|
|
53
|
-
this.properties = properties != null ? properties : [];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Compares this instance to another and determines if they can be considered as equal.
|
|
58
|
-
* @param {Element} other
|
|
59
|
-
* @returns {boolean}
|
|
60
|
-
*/
|
|
61
|
-
equals(other) {
|
|
62
|
-
return other instanceof Element && this.id === other.id;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
class Vertex extends Element {
|
|
67
|
-
constructor(id, label, properties = []) {
|
|
68
|
-
super(id, label, properties);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
toString() {
|
|
72
|
-
return `v[${this.id}]`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
class Edge extends Element {
|
|
77
|
-
constructor(id, outV, label, inV, properties = []) {
|
|
78
|
-
super(id, label, properties);
|
|
79
|
-
this.outV = outV;
|
|
80
|
-
this.inV = inV;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
toString() {
|
|
84
|
-
const outVId = this.outV ? this.outV.id : '?';
|
|
85
|
-
const inVId = this.inV ? this.inV.id : '?';
|
|
86
|
-
|
|
87
|
-
return `e[${this.id}][${outVId}-${this.label}->${inVId}]`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
class VertexProperty extends Element {
|
|
92
|
-
constructor(id, label, value, properties = []) {
|
|
93
|
-
super(id, label, properties);
|
|
94
|
-
this.value = value;
|
|
95
|
-
this.key = this.label;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
toString() {
|
|
99
|
-
return `vp[${this.label}->${summarize(this.value)}]`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
class Property {
|
|
104
|
-
constructor(key, value) {
|
|
105
|
-
this.key = key;
|
|
106
|
-
this.value = value;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
toString() {
|
|
110
|
-
return `p[${this.key}->${summarize(this.value)}]`;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
equals(other) {
|
|
114
|
-
return other instanceof Property && this.key === other.key && this.value === other.value;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
class Path {
|
|
119
|
-
/**
|
|
120
|
-
* Represents a walk through a graph as defined by a traversal.
|
|
121
|
-
* @param {Array} labels
|
|
122
|
-
* @param {Array} objects
|
|
123
|
-
* @constructor
|
|
124
|
-
*/
|
|
125
|
-
constructor(labels, objects) {
|
|
126
|
-
this.labels = labels;
|
|
127
|
-
this.objects = objects;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
toString() {
|
|
131
|
-
return `path[${(this.objects || []).join(', ')}]`;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
equals(other) {
|
|
135
|
-
if (!(other instanceof Path)) {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
if (other === this) {
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
return areEqual(this.objects, other.objects) && areEqual(this.labels, other.labels);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function areEqual(obj1, obj2) {
|
|
146
|
-
if (obj1 === obj2) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
if (typeof obj1.equals === 'function') {
|
|
150
|
-
return obj1.equals(obj2);
|
|
151
|
-
}
|
|
152
|
-
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
153
|
-
if (obj1.length !== obj2.length) {
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
for (let i = 0; i < obj1.length; i++) {
|
|
157
|
-
if (!areEqual(obj1[i], obj2[i])) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function summarize(value) {
|
|
167
|
-
if (value === null || value === undefined) {
|
|
168
|
-
return value;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const strValue = value.toString();
|
|
172
|
-
return strValue.length > 20 ? strValue.substr(0, 20) : strValue;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
module.exports = {
|
|
176
|
-
Edge,
|
|
177
|
-
Graph,
|
|
178
|
-
Path,
|
|
179
|
-
Property,
|
|
180
|
-
Vertex,
|
|
181
|
-
VertexProperty,
|
|
182
|
-
};
|