From fca6283e21b3be4667503840434cc40e00816571 Mon Sep 17 00:00:00 2001 From: arielmirra Date: Wed, 4 Aug 2021 17:39:39 -0300 Subject: [PATCH 01/48] APIMF-2975: make nillable type behave like nil union --- .../union/optional-object.out.editing.raml | 20 +- .../resources/union/optional-object.out.raml | 8 +- .../union/optional-scalar.out.default.raml | 8 +- .../union/optional-scalar.out.editing.raml | 18 +- .../resources/union/optional-scalar.out.raml | 12 +- .../union/union-default.out.default.raml | 8 + .../union/union-default.out.editing.raml | 12 ++ .../resources/union/union-default.out.raml | 11 + .../test/resources/union/union-default.raml | 13 ++ .../api.raml.expanded.jsonld | 198 ++++++++++++------ .../api.raml.flattened.jsonld | 170 ++++++++++----- .../api.raml.jsonld.raml.ignore | 12 +- .../type_nil_shortcut/dumped.raml.ignore | 12 +- .../amf/emit/UnionRamlEmissionTest.scala | 19 ++ .../spec/raml/parser/Raml10TypeParser.scala | 37 ++-- 15 files changed, 369 insertions(+), 189 deletions(-) create mode 100644 amf-cli/shared/src/test/resources/union/union-default.out.default.raml create mode 100644 amf-cli/shared/src/test/resources/union/union-default.out.editing.raml create mode 100644 amf-cli/shared/src/test/resources/union/union-default.out.raml create mode 100644 amf-cli/shared/src/test/resources/union/union-default.raml diff --git a/amf-cli/shared/src/test/resources/union/optional-object.out.editing.raml b/amf-cli/shared/src/test/resources/union/optional-object.out.editing.raml index 515f26fac4..1c2445c2d5 100644 --- a/amf-cli/shared/src/test/resources/union/optional-object.out.editing.raml +++ b/amf-cli/shared/src/test/resources/union/optional-object.out.editing.raml @@ -1,16 +1,6 @@ #%RAML 1.0 title: New API types: - SomeType: - type: object - additionalProperties: true - properties: - a: - type: string - required: true - b: - type: integer - required: true OtherType: anyOf: - @@ -25,6 +15,16 @@ types: required: true - type: nil + SomeType: + type: object + additionalProperties: true + properties: + a: + type: string + required: true + b: + type: integer + required: true /someEndpoint: post: body: diff --git a/amf-cli/shared/src/test/resources/union/optional-object.out.raml b/amf-cli/shared/src/test/resources/union/optional-object.out.raml index c7159f11cd..a8b5770006 100644 --- a/amf-cli/shared/src/test/resources/union/optional-object.out.raml +++ b/amf-cli/shared/src/test/resources/union/optional-object.out.raml @@ -1,6 +1,8 @@ #%RAML 1.0 title: New API types: + OtherType: + type: SomeType | nil SomeType: type: object properties: @@ -8,12 +10,6 @@ types: type: string b: type: integer - OtherType: - anyOf: - - - type: SomeType - - - type: nil /someEndpoint: post: body: diff --git a/amf-cli/shared/src/test/resources/union/optional-scalar.out.default.raml b/amf-cli/shared/src/test/resources/union/optional-scalar.out.default.raml index 0e03f22965..eaa2124ac5 100644 --- a/amf-cli/shared/src/test/resources/union/optional-scalar.out.default.raml +++ b/amf-cli/shared/src/test/resources/union/optional-scalar.out.default.raml @@ -4,9 +4,5 @@ title: New API post: body: application/json: - anyOf: - - - type: string - description: some description - - - type: nil + description: some description + type: string | nil diff --git a/amf-cli/shared/src/test/resources/union/optional-scalar.out.editing.raml b/amf-cli/shared/src/test/resources/union/optional-scalar.out.editing.raml index 86db6c0d1e..29b3055da9 100644 --- a/amf-cli/shared/src/test/resources/union/optional-scalar.out.editing.raml +++ b/amf-cli/shared/src/test/resources/union/optional-scalar.out.editing.raml @@ -1,20 +1,12 @@ #%RAML 1.0 title: New API +types: + SomeType: + description: some description + type: string | nil /someEndpoint: post: body: application/json: - anyOf: - - - type: string - description: some description - - - type: nil -types: - SomeType: - anyOf: - - - type: string description: some description - - - type: nil + type: string | nil diff --git a/amf-cli/shared/src/test/resources/union/optional-scalar.out.raml b/amf-cli/shared/src/test/resources/union/optional-scalar.out.raml index 355e52c388..e0f5f0571f 100644 --- a/amf-cli/shared/src/test/resources/union/optional-scalar.out.raml +++ b/amf-cli/shared/src/test/resources/union/optional-scalar.out.raml @@ -1,15 +1,11 @@ #%RAML 1.0 title: New API +types: + SomeType: + type: string | nil + description: some description /someEndpoint: post: body: application/json: type: SomeType -types: - SomeType: - anyOf: - - - type: string - description: some description - - - type: nil diff --git a/amf-cli/shared/src/test/resources/union/union-default.out.default.raml b/amf-cli/shared/src/test/resources/union/union-default.out.default.raml new file mode 100644 index 0000000000..7336abb80e --- /dev/null +++ b/amf-cli/shared/src/test/resources/union/union-default.out.default.raml @@ -0,0 +1,8 @@ +#%RAML 1.0 +title: New API +/someEndpoint: + post: + body: + application/json: + default: 20 + type: integer | nil diff --git a/amf-cli/shared/src/test/resources/union/union-default.out.editing.raml b/amf-cli/shared/src/test/resources/union/union-default.out.editing.raml new file mode 100644 index 0000000000..0e7e091a96 --- /dev/null +++ b/amf-cli/shared/src/test/resources/union/union-default.out.editing.raml @@ -0,0 +1,12 @@ +#%RAML 1.0 +title: New API +types: + UnionType: + default: 20 + type: integer | nil +/someEndpoint: + post: + body: + application/json: + default: 20 + type: integer | nil diff --git a/amf-cli/shared/src/test/resources/union/union-default.out.raml b/amf-cli/shared/src/test/resources/union/union-default.out.raml new file mode 100644 index 0000000000..6dc8f750c9 --- /dev/null +++ b/amf-cli/shared/src/test/resources/union/union-default.out.raml @@ -0,0 +1,11 @@ +#%RAML 1.0 +title: New API +types: + UnionType: + type: integer | nil + default: 20 +/someEndpoint: + post: + body: + application/json: + type: UnionType diff --git a/amf-cli/shared/src/test/resources/union/union-default.raml b/amf-cli/shared/src/test/resources/union/union-default.raml new file mode 100644 index 0000000000..41dd3a7178 --- /dev/null +++ b/amf-cli/shared/src/test/resources/union/union-default.raml @@ -0,0 +1,13 @@ +#%RAML 1.0 +title: New API + +types: + UnionType: + type: integer? + default: 20 + +/someEndpoint: + post: + body: + application/json: + type: UnionType diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.expanded.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.expanded.jsonld index e7e4dedfdc..4fada3faf0 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.expanded.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.expanded.jsonld @@ -335,7 +335,7 @@ ], "http://a.ml/vocabularies/shapes#schema": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored", "@type": [ "http://a.ml/vocabularies/shapes#UnionShape", "http://a.ml/vocabularies/shapes#AnyShape", @@ -343,128 +343,196 @@ "http://a.ml/vocabularies/shapes#Shape", "http://a.ml/vocabularies/document#DomainElement" ], - "http://a.ml/vocabularies/shapes#anyOf": [ + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "ignored" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "This annotation allows to specify a method which will not be transformed into an operation.\nOptionally, a reason can be defined.\n" + } + ], + "http://a.ml/vocabularies/shapes#inherits": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union", "@type": [ - "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#UnionShape", "http://a.ml/vocabularies/shapes#AnyShape", "http://www.w3.org/ns/shacl#Shape", "http://a.ml/vocabularies/shapes#Shape", "http://a.ml/vocabularies/document#DomainElement" ], - "http://www.w3.org/ns/shacl#datatype": [ - { - "@id": "http://www.w3.org/2001/XMLSchema#string" - } - ], - "http://www.w3.org/ns/shacl#name": [ - { - "@value": "" - } - ], - "http://a.ml/vocabularies/core#description": [ - { - "@value": "This annotation allows to specify a method which will not be transformed into an operation.\nOptionally, a reason can be defined.\n" - } - ], - "http://a.ml/vocabularies/document-source-maps#sources": [ + "http://a.ml/vocabularies/shapes#anyOf": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar", "@type": [ - "http://a.ml/vocabularies/document-source-maps#SourceMap" + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" ], - "http://a.ml/vocabularies/document-source-maps#type-property-lexical-info": [ + "http://www.w3.org/ns/shacl#datatype": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/type-property-lexical-info/element_0", - "http://a.ml/vocabularies/document-source-maps#element": [ - { - "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/" - } + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" ], - "http://a.ml/vocabularies/document-source-maps#value": [ + "http://a.ml/vocabularies/document-source-maps#lexical": [ { - "@value": "[(1,0)-(1,0)]" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "[(0,0)-(0,6)]" + } + ] } ] } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil", + "@type": [ + "http://a.ml/vocabularies/shapes#NilShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" ], - "http://a.ml/vocabularies/document-source-maps#lexical": [ + "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_2", - "http://a.ml/vocabularies/document-source-maps#element": [ - { - "@value": "http://www.w3.org/ns/shacl#datatype" - } + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" ], - "http://a.ml/vocabularies/document-source-maps#value": [ + "http://a.ml/vocabularies/document-source-maps#lexical": [ { - "@value": "[(1,0)-(1,0)]" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "[(0,9)-(0,12)]" + } + ] } ] - }, + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#type-expression": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_0", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/type-expression/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ { - "@value": "http://a.ml/vocabularies/core#description" + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union" } ], "http://a.ml/vocabularies/document-source-maps#value": [ { - "@value": "[(10,8)-(13,0)]" + "@value": "string | nil" } ] - }, + } + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_1", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/lexical/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ { - "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/" + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union" } ], "http://a.ml/vocabularies/document-source-maps#value": [ { - "@value": "[(13,8)-(15,0)]" + "@value": "[(1,0)-(1,0)]" } ] } ] } ] - }, - { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/nil/default-nil", - "@type": [ - "http://a.ml/vocabularies/shapes#NilShape", - "http://www.w3.org/ns/shacl#Shape", - "http://a.ml/vocabularies/shapes#Shape", - "http://a.ml/vocabularies/document#DomainElement" - ] - } - ], - "http://www.w3.org/ns/shacl#name": [ - { - "@value": "schema" } ], "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map", "@type": [ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], - "http://a.ml/vocabularies/document-source-maps#synthesized-field": [ + "http://a.ml/vocabularies/document-source-maps#type-property-lexical-info": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map/synthesized-field/element_0", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/type-property-lexical-info/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ { - "@value": "http://a.ml/vocabularies/shapes#anyOf" + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored" } ], "http://a.ml/vocabularies/document-source-maps#value": [ { - "@value": "true" + "@value": "[(1,0)-(1,0)]" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_2", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/core#description" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "[(10,8)-(13,0)]" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#inherits" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "[(1,0)-(1,0)]" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "[(13,8)-(15,0)]" } ] } diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.flattened.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.flattened.jsonld index dbd3bad574..5ed1d70228 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.flattened.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.flattened.jsonld @@ -159,7 +159,7 @@ } ], "http://a.ml/vocabularies/shapes#schema": { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored" }, "http://a.ml/vocabularies/core#name": "ignored", "http://a.ml/vocabularies/document-source-maps#sources": [ @@ -256,7 +256,7 @@ ] }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored", "@type": [ "http://a.ml/vocabularies/shapes#UnionShape", "http://a.ml/vocabularies/shapes#AnyShape", @@ -264,18 +264,16 @@ "http://a.ml/vocabularies/shapes#Shape", "http://a.ml/vocabularies/document#DomainElement" ], - "http://a.ml/vocabularies/shapes#anyOf": [ - { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/" - }, + "http://www.w3.org/ns/shacl#name": "ignored", + "http://a.ml/vocabularies/core#description": "This annotation allows to specify a method which will not be transformed into an operation.\nOptionally, a reason can be defined.\n", + "http://a.ml/vocabularies/shapes#inherits": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/nil/default-nil" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union" } ], - "http://www.w3.org/ns/shacl#name": "schema", "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map" } ] }, @@ -455,44 +453,47 @@ "http://a.ml/vocabularies/document-source-maps#value": "[(7,4)-(7,8)]" }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union", "@type": [ - "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#UnionShape", "http://a.ml/vocabularies/shapes#AnyShape", "http://www.w3.org/ns/shacl#Shape", "http://a.ml/vocabularies/shapes#Shape", "http://a.ml/vocabularies/document#DomainElement" ], - "http://www.w3.org/ns/shacl#datatype": [ + "http://a.ml/vocabularies/shapes#anyOf": [ { - "@id": "http://www.w3.org/2001/XMLSchema#string" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil" } ], - "http://www.w3.org/ns/shacl#name": "", - "http://a.ml/vocabularies/core#description": "This annotation allows to specify a method which will not be transformed into an operation.\nOptionally, a reason can be defined.\n", "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map" } ] }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/nil/default-nil", - "@type": [ - "http://a.ml/vocabularies/shapes#NilShape", - "http://www.w3.org/ns/shacl#Shape", - "http://a.ml/vocabularies/shapes#Shape", - "http://a.ml/vocabularies/document#DomainElement" - ] - }, - { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map", "@type": [ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], - "http://a.ml/vocabularies/document-source-maps#synthesized-field": [ + "http://a.ml/vocabularies/document-source-maps#type-property-lexical-info": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/type-property-lexical-info/element_0" + } + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_2" + }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map/synthesized-field/element_0" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_0" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_1" } ] }, @@ -635,31 +636,74 @@ "http://a.ml/vocabularies/document-source-maps#value": "true" }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar", "@type": [ - "http://a.ml/vocabularies/document-source-maps#SourceMap" + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" ], - "http://a.ml/vocabularies/document-source-maps#type-property-lexical-info": [ + "http://www.w3.org/ns/shacl#datatype": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/type-property-lexical-info/element_0" + "@id": "http://www.w3.org/2001/XMLSchema#string" } ], - "http://a.ml/vocabularies/document-source-maps#lexical": [ + "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_2" - }, + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil", + "@type": [ + "http://a.ml/vocabularies/shapes#NilShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_0" - }, + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#type-expression": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/type-expression/element_0" + } + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_1" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/lexical/element_0" } ] }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/source-map/synthesized-field/element_0", - "http://a.ml/vocabularies/document-source-maps#element": "http://a.ml/vocabularies/shapes#anyOf", - "http://a.ml/vocabularies/document-source-maps#value": "true" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/type-property-lexical-info/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored", + "http://a.ml/vocabularies/document-source-maps#value": "[(1,0)-(1,0)]" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_2", + "http://a.ml/vocabularies/document-source-maps#element": "http://a.ml/vocabularies/core#description", + "http://a.ml/vocabularies/document-source-maps#value": "[(10,8)-(13,0)]" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "http://a.ml/vocabularies/shapes#inherits", + "http://a.ml/vocabularies/document-source-maps#value": "[(1,0)-(1,0)]" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored/source-map/lexical/element_1", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/ignored", + "http://a.ml/vocabularies/document-source-maps#value": "[(13,8)-(15,0)]" }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/operationName/scalar/schema/source-map/type-property-lexical-info/element_0", @@ -712,24 +756,46 @@ "http://a.ml/vocabularies/document-source-maps#value": "[(1,0)-(1,0)]" }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/type-property-lexical-info/element_0", - "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/", - "http://a.ml/vocabularies/document-source-maps#value": "[(1,0)-(1,0)]" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map/lexical/element_0" + } + ] }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_2", - "http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#datatype", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#lexical": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map/lexical/element_0" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/type-expression/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union", + "http://a.ml/vocabularies/document-source-maps#value": "string | nil" + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union", "http://a.ml/vocabularies/document-source-maps#value": "[(1,0)-(1,0)]" }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_0", - "http://a.ml/vocabularies/document-source-maps#element": "http://a.ml/vocabularies/core#description", - "http://a.ml/vocabularies/document-source-maps#value": "[(10,8)-(13,0)]" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/0/scalar/default-scalar", + "http://a.ml/vocabularies/document-source-maps#value": "[(0,0)-(0,6)]" }, { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/source-map/lexical/element_1", - "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/scalar/", - "http://a.ml/vocabularies/document-source-maps#value": "[(13,8)-(15,0)]" + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil/source-map/lexical/element_0", + "http://a.ml/vocabularies/document-source-maps#element": "file://amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml#/declarations/annotations/ignored/union/schema/union/default-union/1/nil/default-nil", + "http://a.ml/vocabularies/document-source-maps#value": "[(0,9)-(0,12)]" } ] } diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.jsonld.raml.ignore b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.jsonld.raml.ignore index 9f97a2221a..2ba8f8b1d8 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.jsonld.raml.ignore +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/api.raml.jsonld.raml.ignore @@ -5,16 +5,12 @@ annotationTypes: base: type: string | nil ignored: + type: string | nil + description: | + This annotation allows to specify a method which will not be transformed into an operation. + Optionally, a reason can be defined. allowedTargets: - Method - anyOf: - - - type: string - description: | - This annotation allows to specify a method which will not be transformed into an operation. - Optionally, a reason can be defined. - - - type: nil operationName: type: string description: | diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/dumped.raml.ignore b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/dumped.raml.ignore index b97a358615..f5ef35fc05 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/dumped.raml.ignore +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/raml10/type_nil_shortcut/dumped.raml.ignore @@ -5,19 +5,15 @@ annotationTypes: base: type: string | nil ignored: + type: string | nil + description: | + This annotation allows to specify a method which will not be transformed into an operation. + Optionally, a reason can be defined. description: | This annotation allows to specify a method which will not be transformed into an operation. Optionally, a reason can be defined. allowedTargets: - Method - anyOf: - - - type: string - description: | - This annotation allows to specify a method which will not be transformed into an operation. - Optionally, a reason can be defined. - - - type: nil operationName: type: string description: | diff --git a/amf-cli/shared/src/test/scala/amf/emit/UnionRamlEmissionTest.scala b/amf-cli/shared/src/test/scala/amf/emit/UnionRamlEmissionTest.scala index f27700e333..b4ec44f183 100644 --- a/amf-cli/shared/src/test/scala/amf/emit/UnionRamlEmissionTest.scala +++ b/amf-cli/shared/src/test/scala/amf/emit/UnionRamlEmissionTest.scala @@ -290,4 +290,23 @@ class UnionRamlEmissionTest extends FunSuiteCycleTests { pipeline = Some(PipelineId.Default)) } + test("Union with default - No Resolution") { + cycle("union-default.raml", "union-default.out.raml", Raml10YamlHint, Raml10YamlHint, pipeline = None) + } + + test("Union with default - Editing Resolution") { + cycle("union-default.raml", + "union-default.out.editing.raml", + Raml10YamlHint, + Raml10YamlHint, + pipeline = Some(PipelineId.Editing)) + } + + test("Union with default - Default Resolution") { + cycle("union-default.raml", + "union-default.out.default.raml", + Raml10YamlHint, + Raml10YamlHint, + pipeline = Some(PipelineId.Default)) + } } diff --git a/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala b/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala index d4b93bc378..5dea92f9fe 100644 --- a/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala +++ b/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala @@ -576,29 +576,40 @@ sealed abstract class RamlTypeParser(entryOrNode: YMapEntryLike, val union = UnionShape(Annotations.virtual()).withName(name, nameAnnotations) adopt(union) - val parsed = node.value match { + node.value match { case s: YScalar => val toParse = YMapEntry(YNode(""), YNode(s.text.stripSuffix("?"))) - ctx.typeParser(toParse, s => s.withId(union.id), typeInfo.isAnnotation, defaultType).parse().get + val parsed = + ctx.typeParser(toParse, s => s.withId(union.id), typeInfo.isAnnotation, defaultType).parse().get + union.set(UnionShapeModel.AnyOf, + AmfArray( + Seq( + parsed, + NilShape(Annotations.virtual()).withId(union.id) + )), + Annotations.synthesized()) case m: YMap => val newEntries = m.entries.map { entry => if (entry.key.as[YScalar].text == "type") { - YMapEntry("type", entry.value.as[YScalar].text.stripSuffix("?")) + val typeToUnion = s"${entry.value.as[YScalar].text.stripSuffix("?")} | nil" + YMapEntry("type", typeToUnion) } else { entry } } - - val toParse = YMapEntry(YNode(""), YMap(newEntries, newEntries.headOption.map(_.sourceName).getOrElse(""))) - ctx.typeParser(toParse, s => s.withId(union.id), typeInfo.isAnnotation, defaultType).parse().get + val toParse = YMapEntry(YNode(name), YMap(newEntries, newEntries.headOption.map(_.sourceName).getOrElse(""))) + val parsed = + ctx.typeParser(toParse, s => s.withId(union.id), typeInfo.isAnnotation, defaultType).parse().get + parsed.inherits.head match { + case union: UnionShape => + union.anyOf.tail.head match { + case nil: NilShape => nil.add(Annotations.virtual()) + case _ => // ignore + } + case _ => // ignore + } + parsed } - union.set(UnionShapeModel.AnyOf, - AmfArray( - Seq( - parsed, - NilShape(Annotations.virtual()).withId(union.id) - )), - Annotations.synthesized()) } // These are the actual custom facets, just regular properties in the AST map that have been From 56364c9c5a07cdcb5226b23b13903c4e1ac00fb3 Mon Sep 17 00:00:00 2001 From: Tomas Fernandez Date: Thu, 5 Aug 2021 14:10:43 -0300 Subject: [PATCH 02/48] APIMF-3261: Added tests for amf-core change --- .../cli/internal/convert/WrapperTests.scala | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/amf-cli/shared/src/test/scala/amf/cli/internal/convert/WrapperTests.scala b/amf-cli/shared/src/test/scala/amf/cli/internal/convert/WrapperTests.scala index b5c1bc462a..39cb7e10c6 100644 --- a/amf-cli/shared/src/test/scala/amf/cli/internal/convert/WrapperTests.scala +++ b/amf-cli/shared/src/test/scala/amf/cli/internal/convert/WrapperTests.scala @@ -15,9 +15,11 @@ import amf.core.client.common.render.JSONSchemaVersions import amf.core.client.common.transform.PipelineId import amf.core.client.common.validation.ValidationMode import amf.core.client.platform.config.RenderOptions +import amf.core.client.platform.model.AmfObjectWrapper import amf.core.client.platform.model.document.{BaseUnit, DeclaresModel, Document} import amf.core.client.platform.model.domain._ import amf.core.client.platform.parse.AMFParser +import amf.core.client.platform.parse.AMFParser.parseStartingPoint import amf.core.client.platform.resource.{ResourceNotFound, ResourceLoader => ClientResourceLoader} import amf.core.client.scala.AMFGraphConfiguration import amf.core.client.scala.errorhandling.DefaultErrorHandler @@ -38,6 +40,7 @@ import amf.core.internal.remote.Mimes._ import amf.core.internal.remote._ import amf.core.internal.resource.{ClientResourceLoaderAdapter, StringResourceLoader} import amf.io.{FileAssertionTest, MultiJsonldAsyncFunSuite} +import amf.shapes.client.platform.config.ShapesConfiguration import amf.shapes.client.platform.model.domain.{AnyShape, NodeShape, ScalarShape, SchemaShape} import amf.shapes.client.platform.render.JsonSchemaShapeRenderer import org.mulesoft.common.test.Diff @@ -2057,7 +2060,6 @@ trait WrapperTests extends MultiJsonldAsyncFunSuite with Matchers with NativeOps } } - // TODO check with @tomi and @agus test("Test domain element emitter with unknown spec") { assertThrows[Throwable]( amf.apicontract.client.scala.RAMLConfiguration.RAML10().elementClient().renderElement(InternalArrayNode())) @@ -2121,6 +2123,20 @@ trait WrapperTests extends MultiJsonldAsyncFunSuite with Matchers with NativeOps } } + test("test read declared shape from api") { + val configuration = ShapesConfiguration.predefined() + val basePath: String = "file://amf-cli/shared/src/test/resources/graphs/" + for { + content <- parseStartingPoint(basePath + "api.source.jsonld", "amf://id#1", configuration).asFuture + } yield { + val obj = content.element + obj.isInstanceOf[ScalarShape] should be(true) + val shape = obj.asInstanceOf[ScalarShape] + shape.name.value() should be("birthday") + succeed + } + } + // // // todo: move to common (file system) def getAbsolutePath(path: String): String From 12c13c3328532c71ba20a184670899c31519f84d Mon Sep 17 00:00:00 2001 From: arielmirra Date: Thu, 5 Aug 2021 17:28:21 -0300 Subject: [PATCH 03/48] APIMF-2975: nillable properties now accept required facet --- .../resources/validations/nillable-with-nillable.raml | 7 +++++++ .../resources/validations/nillable-with-required.raml | 8 ++++++++ .../validation/RamlModelUniquePlatformReportTest.scala | 8 ++++++++ .../internal/spec/raml/parser/Raml10TypeParser.scala | 3 +-- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 amf-cli/shared/src/test/resources/validations/nillable-with-nillable.raml create mode 100644 amf-cli/shared/src/test/resources/validations/nillable-with-required.raml diff --git a/amf-cli/shared/src/test/resources/validations/nillable-with-nillable.raml b/amf-cli/shared/src/test/resources/validations/nillable-with-nillable.raml new file mode 100644 index 0000000000..90759c70f6 --- /dev/null +++ b/amf-cli/shared/src/test/resources/validations/nillable-with-nillable.raml @@ -0,0 +1,7 @@ +#%RAML 1.0 +title: Sample API +types: + TestObject: + properties: + testProperty?: + type: string? diff --git a/amf-cli/shared/src/test/resources/validations/nillable-with-required.raml b/amf-cli/shared/src/test/resources/validations/nillable-with-required.raml new file mode 100644 index 0000000000..d65cef6f4a --- /dev/null +++ b/amf-cli/shared/src/test/resources/validations/nillable-with-required.raml @@ -0,0 +1,8 @@ +#%RAML 1.0 +title: Sample API +types: + TestObject: + properties: + testProperty: + required: false + type: string? diff --git a/amf-cli/shared/src/test/scala/amf/validation/RamlModelUniquePlatformReportTest.scala b/amf-cli/shared/src/test/scala/amf/validation/RamlModelUniquePlatformReportTest.scala index b5715dab33..afe5370826 100644 --- a/amf-cli/shared/src/test/scala/amf/validation/RamlModelUniquePlatformReportTest.scala +++ b/amf-cli/shared/src/test/scala/amf/validation/RamlModelUniquePlatformReportTest.scala @@ -630,4 +630,12 @@ class RamlModelUniquePlatformReportTest extends UniquePlatformReportGenTest { test("invalid duplicated nullable property") { validate("duplicate-property/api.raml", Some("raml/duplicated-property.report")) } + + test("nillable type notation should accept required facet") { + validate("nillable-with-required.raml") + } + + test("nillable property of nillable type") { + validate("nillable-with-nillable.raml") + } } diff --git a/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala b/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala index 5dea92f9fe..6dc344d79d 100644 --- a/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala +++ b/amf-shapes/shared/src/main/scala/amf/shapes/internal/spec/raml/parser/Raml10TypeParser.scala @@ -598,8 +598,7 @@ sealed abstract class RamlTypeParser(entryOrNode: YMapEntryLike, } } val toParse = YMapEntry(YNode(name), YMap(newEntries, newEntries.headOption.map(_.sourceName).getOrElse(""))) - val parsed = - ctx.typeParser(toParse, s => s.withId(union.id), typeInfo.isAnnotation, defaultType).parse().get + val parsed = Raml10TypeParser(toParse, s => s.withId(union.id), typeInfo).parse().get parsed.inherits.head match { case union: UnionShape => union.anyOf.tail.head match { From 83f55144a9507251bc33672372598a454534b17d Mon Sep 17 00:00:00 2001 From: Ariel Mirra <8195364+arielmirra@users.noreply.github.com> Date: Fri, 6 Aug 2021 11:58:38 -0300 Subject: [PATCH 04/48] fix broken link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4c76d3d12..f1f4dd253f 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The **only** guaranteed output of AMF is the JSON-LD "AMF model". Any other outp ## Documentation - [The AML Project](https://a.ml) -- [What is AMF?](https://a.ml/docbook/overview_amf.html) +- [What is AMF?](https://a.ml/docs) - [AMF model documentation](documentation/model.md) - [Validation insights](./documentation/validation.md) - [Basic use cases - parsing & validating an API](documentation/basic_use_cases.md) From 6ac0dbf245187fe8b35072717460fabcae093705 Mon Sep 17 00:00:00 2001 From: Tomas Fernandez Date: Wed, 4 Aug 2021 12:33:25 -0300 Subject: [PATCH 05/48] Adopted the new 'amf-rdf' module for testing. Corrected ajv.min.js location --- .../shacl/ShaclModelValidationPlugin.scala | 2 +- .../scala/amf/core/rdf/RdfModelTests.scala | 20 ----------- .../test/scala/amf/core/utils/CoreTest.scala | 31 ---------------- .../scala/amf/cycle/FromRdfCycleTest.scala | 13 ++++--- .../test/scala/amf/cycle/ToRdfCycleTest.scala | 4 +-- .../test/scala/amf/io/BuildCycleTests.scala | 2 +- .../test/scala/amf/parser/ParserTest.scala | 36 ------------------- .../js/src/main/resources/ajv.min.js | 0 build.sbt | 11 ++++-- 9 files changed, 18 insertions(+), 101 deletions(-) delete mode 100644 amf-cli/shared/src/test/scala/amf/core/rdf/RdfModelTests.scala delete mode 100644 amf-cli/shared/src/test/scala/amf/core/utils/CoreTest.scala rename {amf-api-contract => amf-shapes}/js/src/main/resources/ajv.min.js (100%) diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/validation/shacl/ShaclModelValidationPlugin.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/validation/shacl/ShaclModelValidationPlugin.scala index b91c2b5387..3e987596b2 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/validation/shacl/ShaclModelValidationPlugin.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/validation/shacl/ShaclModelValidationPlugin.scala @@ -28,7 +28,7 @@ object ShaclModelValidationPlugin extends BaseApiValidationPlugin with ShaclRepo val shaclOptions = DefaultShaclOptions(options.config.amfConfig.listeners.toSeq) .withMessageStyle(profile.messageStyle) - val validator = new CustomShaclValidator(functions, shaclOptions) + val validator = new CustomShaclValidator(functions, profile.messageStyle) validator .validate(unit, options.effectiveValidations.effective.values.toSeq) diff --git a/amf-cli/shared/src/test/scala/amf/core/rdf/RdfModelTests.scala b/amf-cli/shared/src/test/scala/amf/core/rdf/RdfModelTests.scala deleted file mode 100644 index efbd3d1f5f..0000000000 --- a/amf-cli/shared/src/test/scala/amf/core/rdf/RdfModelTests.scala +++ /dev/null @@ -1,20 +0,0 @@ -package amf.core.rdf - -import amf.core.internal.unsafe.PlatformSecrets -import org.scalatest.FunSuite - -class RdfModelTests extends FunSuite with PlatformSecrets { - - test("Manipulation of triples should invalidate cache") { - val model = platform.rdfFramework.get.emptyRdfModel() - val subject = "http://test.com/a" - model.addTriple(subject, "http://test.com/p", "test", None) - val resBefore = model.findNode(subject) - assert(resBefore.isDefined) - assert(resBefore.get.getKeys().size == 1) - model.addTriple(subject, "http://test.com/pp", "test", None) - val resAfter = model.findNode(subject) - assert(resAfter.isDefined) - assert(resAfter.get.getKeys().size == 2) - } -} diff --git a/amf-cli/shared/src/test/scala/amf/core/utils/CoreTest.scala b/amf-cli/shared/src/test/scala/amf/core/utils/CoreTest.scala deleted file mode 100644 index 77875c1c41..0000000000 --- a/amf-cli/shared/src/test/scala/amf/core/utils/CoreTest.scala +++ /dev/null @@ -1,31 +0,0 @@ -package amf.core.utils - -import amf.core.internal.utils.{AmfStrings, QName} -import org.scalatest.FunSuite -import org.scalatest.Matchers._ - -/** - * [[amf.core.utils]] test - */ -class CoreTest extends FunSuite { - - test("Escape special chars") { - val testStringNewline = "test\ntest" - testStringNewline.escape should be("test\\ntest") - val testStringQuotes = s""""test"""" - testStringQuotes.escape should be("\"test\"") - val testStringIsoControl = '\u0013'.toString - testStringIsoControl.escape should be("\\u13") - val testStringNormal = "test" - testStringNormal.escape should be(testStringNormal) - } - - test("QName") { - val qNameWithoutDot = "test" - QName(qNameWithoutDot) should be(QName("", qNameWithoutDot)) - val qNameWithDot = "test.dot" - QName(qNameWithDot) should be(QName("test", "dot")) - val emptyString = "" - QName(emptyString) should be(QName("", "")) - } -} diff --git a/amf-cli/shared/src/test/scala/amf/cycle/FromRdfCycleTest.scala b/amf-cli/shared/src/test/scala/amf/cycle/FromRdfCycleTest.scala index 4c5397af39..0faa68577a 100644 --- a/amf-cli/shared/src/test/scala/amf/cycle/FromRdfCycleTest.scala +++ b/amf-cli/shared/src/test/scala/amf/cycle/FromRdfCycleTest.scala @@ -3,9 +3,9 @@ package amf.cycle import amf.apicontract.client.scala.WebAPIConfiguration import amf.core.client.scala.errorhandling.UnhandledErrorHandler import amf.core.client.scala.model.document.BaseUnit -import amf.core.client.scala.rdf.RdfUnitConverter -import amf.core.internal.unsafe.PlatformSecrets import amf.io.FileAssertionTest +import amf.rdf.client.scala.RdfUnitConverter +import amf.rdf.internal.unsafe.RdfPlatformSecrets import org.mulesoft.common.test.AsyncBeforeAndAfterEach import org.scalatest.{Assertion, Matchers} @@ -15,7 +15,7 @@ import scala.concurrent.{ExecutionContext, Future} * TODO: implement test also in JS. * It isn't currently implemented there because of some strange errors when loading text/n3 rdf */ -trait FromRdfCycleTest extends AsyncBeforeAndAfterEach with FileAssertionTest with Matchers with PlatformSecrets { +trait FromRdfCycleTest extends AsyncBeforeAndAfterEach with FileAssertionTest with Matchers with RdfPlatformSecrets { override implicit val executionContext: ExecutionContext = ExecutionContext.Implicits.global @@ -36,10 +36,9 @@ trait FromRdfCycleTest extends AsyncBeforeAndAfterEach with FileAssertionTest wi } private def build(path: String, baseUnitId: String): Option[BaseUnit] = { - val fullPath = basePath + path - val content = fs.syncFile(fullPath).read() - val rdfFramework = platform.rdfFramework.get - val modelDoc = rdfFramework.syntaxToRdfModel("text/n3", content) + val fullPath = basePath + path + val content = fs.syncFile(fullPath).read() + val modelDoc = framework.syntaxToRdfModel("text/n3", content) val result = RdfUnitConverter.fromNativeRdfModel( baseUnitId, modelDoc.model, diff --git a/amf-cli/shared/src/test/scala/amf/cycle/ToRdfCycleTest.scala b/amf-cli/shared/src/test/scala/amf/cycle/ToRdfCycleTest.scala index c3f6449ecf..d8ef8231d0 100644 --- a/amf-cli/shared/src/test/scala/amf/cycle/ToRdfCycleTest.scala +++ b/amf-cli/shared/src/test/scala/amf/cycle/ToRdfCycleTest.scala @@ -1,17 +1,15 @@ package amf.cycle -import amf.apicontract.client.scala.WebAPIConfiguration import amf.core.client.common.transform.PipelineId import amf.core.client.scala.AMFGraphConfiguration import amf.core.client.scala.config.RenderOptions import amf.core.client.scala.errorhandling.UnhandledErrorHandler import amf.core.client.scala.model.document.BaseUnit -import amf.core.client.scala.rdf.RdfUnitConverter import amf.core.internal.remote.Spec import amf.core.internal.unsafe.PlatformSecrets import amf.io.FileAssertionTest +import amf.rdf.client.scala.RdfUnitConverter import amf.resolution.ResolutionCapabilities -import amf.testing.ConfigProvider import amf.testing.ConfigProvider.configFor import org.mulesoft.common.test.AsyncBeforeAndAfterEach import org.scalatest.{AsyncFunSuite, Matchers} diff --git a/amf-cli/shared/src/test/scala/amf/io/BuildCycleTests.scala b/amf-cli/shared/src/test/scala/amf/io/BuildCycleTests.scala index 424aa7dff7..e931349fd2 100644 --- a/amf-cli/shared/src/test/scala/amf/io/BuildCycleTests.scala +++ b/amf-cli/shared/src/test/scala/amf/io/BuildCycleTests.scala @@ -5,9 +5,9 @@ import amf.core.client.scala.AMFGraphConfiguration import amf.core.client.scala.config.RenderOptions import amf.core.client.scala.errorhandling.{AMFErrorHandler, IgnoringErrorHandler} import amf.core.client.scala.model.document.BaseUnit -import amf.core.client.scala.rdf.{RdfModel, RdfUnitConverter} import amf.core.internal.plugins.document.graph.{EmbeddedForm, FlattenedForm, JsonLdDocumentForm} import amf.core.internal.remote.{AmfJsonHint, Hint, Spec} +import amf.rdf.client.scala.{RdfModel, RdfUnitConverter} import amf.testing.ConfigProvider.configFor import org.scalactic.Fail import org.scalatest.{Assertion, AsyncFunSuite} diff --git a/amf-cli/shared/src/test/scala/amf/parser/ParserTest.scala b/amf-cli/shared/src/test/scala/amf/parser/ParserTest.scala index 025af1fd62..b7960cf49c 100644 --- a/amf-cli/shared/src/test/scala/amf/parser/ParserTest.scala +++ b/amf-cli/shared/src/test/scala/amf/parser/ParserTest.scala @@ -1,19 +1,10 @@ package amf.parser -import amf.core.client.scala.model.document.BaseUnit -import amf.core.client.scala.rdf.RdfModel -import amf.core.internal.validation.core.{ - SHACLValidator, - ShaclValidationOptions, - ValidationReport, - ValidationSpecification -} import org.scalatest.FunSuite import org.scalatest.Matchers._ import org.yaml.model._ import org.yaml.parser.YamlParser -import scala.concurrent.{ExecutionContext, Future} import scala.language.postfixOps class ParserTest extends FunSuite { @@ -131,32 +122,5 @@ class ParserTest extends FunSuite { sequence.nodes(1).as[Int] shouldBe 3 include(content.entries(3)) - - class TestValidator extends SHACLValidator { - override def validate(data: String, dataMediaType: String, shapes: String, shapesMediaType: String)( - implicit executionContext: ExecutionContext): Future[String] = - throw new Exception("Validation not supported") - - override def report(data: String, dataMediaType: String, shapes: String, shapesMediaType: String)( - implicit executionContext: ExecutionContext): Future[ValidationReport] = - throw new Exception("Validation not supported") - - override def registerLibrary(url: String, code: String): Unit = throw new Exception("Validation not supported") - - override def validate(data: BaseUnit, shapes: Seq[ValidationSpecification], options: ShaclValidationOptions)( - implicit executionContext: ExecutionContext): Future[String] = - throw new Exception("Validation not supported") - - override def report(data: BaseUnit, shapes: Seq[ValidationSpecification], options: ShaclValidationOptions)( - implicit executionContext: ExecutionContext): Future[ValidationReport] = - throw new Exception("Validation not supported") - - override def emptyRdfModel(): RdfModel = throw new Exception("Validation not supported") - - override def shapes(shapes: Seq[ValidationSpecification], functionsUrl: String): RdfModel = - throw new Exception("Validation not supported") - - override def supportsJSFunctions: Boolean = false - } } } diff --git a/amf-api-contract/js/src/main/resources/ajv.min.js b/amf-shapes/js/src/main/resources/ajv.min.js similarity index 100% rename from amf-api-contract/js/src/main/resources/ajv.min.js rename to amf-shapes/js/src/main/resources/ajv.min.js diff --git a/build.sbt b/build.sbt index b568b7d6dd..de027d0358 100644 --- a/build.sbt +++ b/build.sbt @@ -61,6 +61,11 @@ lazy val amlJSRef = ProjectRef(Common.workspaceDirectory / "amf-aml", "amlJS") lazy val amlLibJVM = "com.github.amlorg" %% "amf-aml" % amlVersion lazy val amlLibJS = "com.github.amlorg" %% "amf-aml_sjs0.6" % amlVersion +lazy val rdfJVMRef = ProjectRef(Common.workspaceDirectory / "amf-aml", "rdfJVM") +lazy val rdfLibJVM = "com.github.amlorg" %% "amf-rdf" % amlVersion +lazy val rdfJSRef = ProjectRef(Common.workspaceDirectory / "amf-aml", "rdfJS") +lazy val rdfLibJS = "com.github.amlorg" %% "amf-rdf.6" % amlVersion + lazy val defaultProfilesGenerationTask = TaskKey[Unit]( "defaultValidationProfilesGeneration", "Generates the validation dialect documents for the standard profiles") @@ -82,6 +87,7 @@ lazy val shapes = crossProject(JSPlatform, JVMPlatform) artifactPath in (Compile, packageDoc) := baseDirectory.value / "target" / "artifact" / "amf-shapes-javadoc.jar", ) .jsSettings( + jsDependencies += ProvidedJS / "ajv.min.js", scalaJSModuleKind := ModuleKind.CommonJSModule, artifactPath in (Compile, fullOptJS) := baseDirectory.value / "target" / "artifact" / "amf-shapes-module.js", scalacOptions += "-P:scalajs:suppressExportDeprecations" @@ -203,9 +209,10 @@ lazy val cli = crossProject(JSPlatform, JVMPlatform) ) .disablePlugins(SonarPlugin) -lazy val cliJVM = - cli.jvm.in(file("./amf-cli/jvm")) +lazy val cliJVM = cli.jvm.in(file("./amf-cli/jvm")) + .sourceDependency(rdfJVMRef % "test", rdfLibJVM % "test") lazy val cliJS = cli.js.in(file("./amf-cli/js")) + .sourceDependency(rdfJSRef % "test", rdfLibJS % "test") // Tasks From 8e1885643be4f62eb9a3432a6aebb2a266151cdf Mon Sep 17 00:00:00 2001 From: Tomas Fernandez Date: Wed, 4 Aug 2021 12:49:21 -0300 Subject: [PATCH 06/48] Removed shacl.js from published npm package --- amf-cli/js/build-scripts/buildjs.sh | 1 - amf-cli/js/src/main/resources/shacl.js | 106890 ---------------------- 2 files changed, 106891 deletions(-) delete mode 100644 amf-cli/js/src/main/resources/shacl.js diff --git a/amf-cli/js/build-scripts/buildjs.sh b/amf-cli/js/build-scripts/buildjs.sh index e6faf7e49a..6a63510dcc 100755 --- a/amf-cli/js/build-scripts/buildjs.sh +++ b/amf-cli/js/build-scripts/buildjs.sh @@ -2,7 +2,6 @@ cd ./amf-cli/js || exit -echo 'globalThis.SHACLValidator = require("amf-shacl-node")' > amf.js || exit echo 'globalThis.Ajv = require("ajv")' >> amf.js || exit cat ./target/artifact/amf-client-module.js >> amf.js || exit chmod a+x amf.js diff --git a/amf-cli/js/src/main/resources/shacl.js b/amf-cli/js/src/main/resources/shacl.js deleted file mode 100644 index f98a8e3749..0000000000 --- a/amf-cli/js/src/main/resources/shacl.js +++ /dev/null @@ -1,106890 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= items.length) { - return T("rdf:nil"); - } - else { - var bnode = TermFactory.blankNode(); - store.add(bnode, T("rdf:first"), items[index]); - store.add(bnode, T("rdf:rest"), createRDFListNode(store, items, index + 1)); - return bnode; - } -}; - - -// SHACL Interface -/** - * SHACL Validator. - * Main interface with the library - */ -var SHACLValidator = function() { - this.$data = new RDFLibGraph(); - this.$shapes = new RDFLibGraph(); - this.depth = 0; - this.results = null; - this.validationEngine = null; - this.validationError = null; - this.sequence = null; - this.shapesGraph = new ShapesGraph(this); - this.configuration = new ValidationEngineConfiguration(); - this.functionsRegistry = require("./src/libraries"); -}; - -SHACLValidator.prototype.compareNodes = function(node1, node2) { - // TODO: Does not handle the case where nodes cannot be compared - if (node1 && node2 && node1.isLiteral() && node2.isLiteral()) { - if ((node1.datatype != null) !== (node2.datatype != null)) { - return null; - } else if (node1.datatype && node2.datatype && node1.datatype.value !== node2.datatype.value) { - return null; - } - } - return RDFQuery.compareTerms(node1, node2); -}; - -SHACLValidator.prototype.getConfiguration = function () { - return this.configuration; -}; - -SHACLValidator.prototype.nodeConformsToShape = function(focusNode, shapeNode) { - var shape = this.shapesGraph.getShape(shapeNode); - try { - this.depth++; - return this.validationEngine.validateNodeAgainstShape(focusNode, shape, this.$data, false) - .then((foundViolations) =>{ - return !foundViolations; - }) - .catch((e) => { - this.depth--; - }) - } - finally { - this.depth--; - } -} - -// Data graph and Shapes graph logic - - -SHACLValidator.prototype.parseDataGraph = function(text, mediaType, andThen) { - this.$data.clear(); - this.$data.loadGraph(text, dataGraphURI, mediaType, function () { - andThen(); - }, function (ex) { - error(ex); - }); -}; - -/** - * Reloads the shapes graph. - * It will load SHACL and DASH shapes constraints. - */ -SHACLValidator.prototype.loadDataGraph = function(rdfGraph, andThen) { - this.$data.clear(); - this.$data.loadMemoryGraph(dataGraphURI, rdfGraph, function () { - andThen(); - }, function(ex) { - error(ex); - }); -}; - - -/** - * Validates the data graph against the shapes graph using the validation engine - */ -SHACLValidator.prototype.updateValidationEngine = function() { - results = []; - this.validationEngine = new ValidationEngine(this); - this.validationEngine.setConfiguration(this.configuration); - try { - this.validationError = null; - if (this.sequence) { - this.sequence = []; - } - return this.validationEngine.validateAll(this.$data); - } - catch (ex) { - this.validationError = ex; - return new Promise((_, reject) => reject(ex)); - } -}; - -/** - * Checks for a validation error or results in the validation - * engine to build the RDF graph with the validation report. - * It returns a ValidationReport object wrapping the RDF graph - */ -SHACLValidator.prototype.showValidationResults = function(cb) { - if (this.validationError) { - error("Validation Failure: " + this.validationError); - throw (this.validationError); - } - else { - - var resultGraph = $rdf.graph(); - var reportNode = TermFactory.blankNode("report"); - resultGraph.add(reportNode, T("rdf:type"), T("sh:ValidationReport")); - resultGraph.add(reportNode, T("sh:conforms"), T("" + (this.validationEngine.results.length == 0))); - var nodes = {}; - - for (var i = 0; i < this.validationEngine.results.length; i++) { - var result = this.validationEngine.results[i]; - if (nodes[result[0].toString()] == null) { - nodes[result[0].toString()] = true; - resultGraph.add(reportNode, T("sh:result"), result[0]); - } - resultGraph.add(result[0], result[1], result[2]); - } - - const mySerializer = new JsonLdSerializer({ space: ' ' }); - var acc = ""; - mySerializer - .on('data', function(chunk) { - acc = acc += chunk; - }) - .on('error', cb) - .on('end', function() { - cb(null, new ValidationReport(JSON.parse(acc))); - }); - const resultGraphDataSet = resultGraph.getQuads(); - for (let i=0; i< resultGraphDataSet.length; i++) { - mySerializer.write(resultGraphDataSet[i]); - } - mySerializer.end(); - } -}; - -/** - * Reloads the shapes graph. - * It will load SHACL and DASH shapes constraints. - */ -SHACLValidator.prototype.parseShapesGraph = function(text, mediaType, andThen) { - var handleError = function (ex) { - error(ex); - }; - var that = this; - this.$shapes.clear(); - this.$shapes.loadGraph(text, shapesGraphURI, mediaType, function () { - that.$shapes.loadGraph(shaclFile, "http://shacl.org", "text/turtle", function () { - that.$shapes.loadGraph(dashFile, "http://datashapes.org/dash", "text/turtle", function () { - andThen(); - }); - }, handleError); - }, handleError); -}; - -/** - * Reloads the shapes graph. - * It will load SHACL and DASH shapes constraints. - */ -SHACLValidator.prototype.loadShapesGraph = function(rdfGraph, andThen) { - var handleError = function (ex) { - error(ex); - }; - var that = this; - this.$shapes.clear(); - this.$shapes.loadMemoryGraph(shapesGraphURI, rdfGraph, function () { - that.$shapes.loadGraph(shaclFile, "http://shacl.org", "text/turtle", function () { - that.$shapes.loadGraph(dashFile, "http://datashapes.org/dash", "text/turtle", function () { - andThen(); - }); - }, handleError); - }, handleError); -}; - - -// Update validations - -/** - * Updates the data graph and validate it against the current data shapes - */ -SHACLValidator.prototype.updateDataGraph = function(text, mediaType, cb) { - var startTime = new Date().getTime(); - this.parseDataGraph(text, mediaType, this.onDataGraphChange(startTime, cb)); -}; - -/** - * Updates the data graph and validate it against the current data shapes - */ -SHACLValidator.prototype.updateDataGraphRdfModel = function(dataRdfGraph, cb) { - var startTime = new Date().getTime(); - this.loadDataGraph(dataRdfGraph, this.onDataGraphChange(startTime, cb)); -}; - -SHACLValidator.prototype.onDataGraphChange = function(startTime, cb) { - var that = this; - return function() { - var midTime = new Date().getTime(); - that.updateValidationEngine().then((_) => { - var endTime = new Date().getTime(); - debug("Parsing took " + (midTime - startTime) + " ms. Validating the data took " + (endTime - midTime) + " ms."); - try { - that.showValidationResults(cb); - } catch (e) { - cb(e, null); - } - }).catch(cb); - } -} - -/** - * Updates the shapes graph and validates it against the current data graph - */ -SHACLValidator.prototype.updateShapesGraph = function(shapes, mediaType, cb) { - var startTime = new Date().getTime(); - this.parseShapesGraph(shapes, mediaType, this.onShapesGraphChange(startTime, cb)); -}; - -/** - * Updates the shapes graph from a memory model, and validates it against the current data graph - */ -SHACLValidator.prototype.updateShapesGraphRdfModel = function(shapesRdfGraph, cb) { - var startTime = new Date().getTime(); - this.loadShapesGraph(shapesRdfGraph, this.onShapesGraphChange(startTime, cb)); -}; - -SHACLValidator.prototype.onShapesGraphChange = function(startTime, cb) { - var that = this; - return function() { - var midTime = new Date().getTime(); - that.shapesGraph = new ShapesGraph(that); - var midTime2 = new Date().getTime(); - that.shapesGraph.loadJSLibraries(function (err) { - if (err) { - cb(err, null); - } else { - that.updateValidationEngine().then((e, results) => { - var endTime = new Date().getTime(); - debug("Parsing took " + (midTime - startTime) + " ms. Preparing the shapes took " + (midTime2 - midTime) - + " ms. Validation the data took " + (endTime - midTime2) + " ms."); - try { - - that.showValidationResults(cb); - } catch (e) { - cb(e, null); - } - }).catch(cb); - } - }); - } -} - -/** - * Validates the provided data graph against the provided shapes graph - */ -SHACLValidator.prototype.validate = function (data, dataMediaType, shapes, shapesMediaType, cb) { - var that = this; - this.updateDataGraph(data, dataMediaType, function (e) { - if (e != null) { - cb(e, null); - } else { - that.updateShapesGraph(shapes, shapesMediaType, function (e, result) { - if (e) { - cb(e, null); - } else { - cb(null, result); - } - }); - } - }); -}; - - -/** - * Validates the provided data graph against the provided shapes graph - */ -SHACLValidator.prototype.validateFromModels = function (dataRdfGraph, shapesRdfGraph, cb) { - var that = this; - this.updateDataGraphRdfModel(dataRdfGraph, function (e) { - if (e != null) { - cb(e, null); - } else { - that.updateShapesGraphRdfModel(shapesRdfGraph, function (e, result) { - if (e) { - cb(e, null); - } else { - cb(null, result); - } - }); - } - }); -}; - -/** - * Saves a cached version of a remote JS file used during validation - * @param url URL of the library to cache - * @param localFile path to a local version of the file identified by url - * @param cb invoked with an optional error when registration of the cached function has finished - */ -SHACLValidator.prototype.registerJSLibrary = function(url, localFile, cb){ - var that = this; - fs.readFile(localFile, function(error, buffer) { - if (error != null) { - cb(error) - } else { - that.functionsRegistry[url] = buffer.toString(); - cb(null) - } - }); -}; - -/** - * Saves a some JS library code using the provided URL that can be used during validation - * @param url URL of the library to register - * @param libraryCode JS code for the library being registered - */ -SHACLValidator.prototype.registerJSCode = function(url, jsCode){ - this.functionsRegistry[url] = jsCode; -}; - -// Expose the RDF interface -SHACLValidator.$rdf = $rdf; - -if (typeof(window) != "undefined") { - window.GlobalSHACLValidator = SHACLValidator; -} -if (typeof(global) != "undefined") { - global.GlobalSHACLValidator = SHACLValidator; -} - - -module.exports = SHACLValidator; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./src/libraries":716,"./src/n3-graph":717,"./src/rdfquery":718,"./src/rdfquery/term-factory":719,"./src/shapes-graph":720,"./src/validation-engine":722,"./src/validation-engine-configuration":721,"./src/validation-report":724,"./src/vocabularies":725,"debug":345,"fs":331,"jsonld-streaming-serializer":494}],2:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/AbstractBindingsHash")); -__export(require("./lib/AbstractFilterHash")); - -},{"./lib/AbstractBindingsHash":3,"./lib/AbstractFilterHash":4}],3:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const AbstractFilterHash_1 = require("./AbstractFilterHash"); -/** - * A comunica Hash Query Operation Actor. - */ -class AbstractBindingsHash extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args, operator) { - super(args, operator); - if (!AbstractFilterHash_1.AbstractFilterHash.doesHashAlgorithmExist(this.hashAlgorithm)) { - throw new Error("The given hash algorithm is not present in this version of Node: " + this.hashAlgorithm); - } - if (!AbstractFilterHash_1.AbstractFilterHash.doesDigestAlgorithmExist(this.digestAlgorithm)) { - throw new Error("The given digest algorithm is not present in this version of Node: " + this.digestAlgorithm); - } - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern.input, context })); - const bindingsStream = output.bindingsStream.filter(this.newHashFilter(this.hashAlgorithm, this.digestAlgorithm)); - return { type: 'bindings', bindingsStream, metadata: output.metadata, variables: output.variables }; - } -} -exports.AbstractBindingsHash = AbstractBindingsHash; - -},{"./AbstractFilterHash":4,"@comunica/bus-query-operation":205}],4:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const crypto_1 = require("crypto"); -const rdf_string_1 = require("rdf-string"); -/** - * A comunica Hash Query Operation Actor. - */ -class AbstractFilterHash extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args, operator) { - super(args, operator); - if (!AbstractFilterHash.doesHashAlgorithmExist(this.hashAlgorithm)) { - throw new Error("The given hash algorithm is not present in this version of Node: " + this.hashAlgorithm); - } - if (!AbstractFilterHash.doesDigestAlgorithmExist(this.digestAlgorithm)) { - throw new Error("The given digest algorithm is not present in this version of Node: " + this.digestAlgorithm); - } - } - /** - * Check if the given hash algorithm (such as sha1) exists. - * @param {string} hashAlgorithm A hash algorithm. - * @return {boolean} If it exists. - */ - static doesHashAlgorithmExist(hashAlgorithm) { - return crypto_1.getHashes().indexOf(hashAlgorithm) >= 0; - } - /** - * Check if the given digest (such as base64) algorithm exists. - * @param {string} digestAlgorithm A digest algorithm. - * @return {boolean} If it exists. - */ - static doesDigestAlgorithmExist(digestAlgorithm) { - return ["latin1", "hex", "base64"].indexOf(digestAlgorithm) >= 0; - } - /** - * Create a string-based hash of the given object. - * @param {string} hashAlgorithm A hash algorithm. - * @param {string} digestAlgorithm A digest algorithm. - * @param bindings The bindings to hash. - * @return {string} The object's hash. - */ - static hash(hashAlgorithm, digestAlgorithm, bindings) { - const hash = crypto_1.createHash(hashAlgorithm); - hash.update(require('json-stable-stringify')(bindings.map(rdf_string_1.termToString))); - return hash.digest(digestAlgorithm); - } -} -exports.AbstractFilterHash = AbstractFilterHash; - -},{"@comunica/bus-query-operation":205,"crypto":344,"json-stable-stringify":484,"rdf-string":559}],5:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorAbstractMediaTyped")); -__export(require("./lib/ActorAbstractMediaTypedFixed")); - -},{"./lib/ActorAbstractMediaTyped":6,"./lib/ActorAbstractMediaTypedFixed":7}],6:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("@comunica/core"); -/** - * An abstract actor that handles media-typed actions. - * - * It splits up a action between a 'handle' and a 'mediaTypes' action. - * A 'mediaTypes' action is used to retrieve the available media types from this actor. - * A 'handle' action is abstract, and can be implemented to do anything, - * such as parsing, serializing, etc. - * @see IActionAbstractMediaTyped - * - * @see ActorAbstractMediaTypedFixed - */ -class ActorAbstractMediaTyped extends core_1.Actor { - constructor(args) { - super(args); - } - async run(action) { - if ('handle' in action) { - const typedAction = action; - return { handle: await this.runHandle(typedAction.handle, typedAction.handleMediaType, action.context) }; - } - else if ('mediaTypes' in action) { - return { mediaTypes: await this.getMediaTypes(action.context) }; - } - else if ('mediaTypeFormats' in action) { - return { mediaTypeFormats: await this.getMediaTypeFormats(action.context) }; - } - else { - throw new Error('Either a handle, mediaTypes or mediaTypeFormats action needs to be provided'); - } - } - async test(action) { - if ('handle' in action) { - const typedAction = action; - return { handle: await this.testHandle(typedAction.handle, typedAction.handleMediaType, action.context) }; - } - else if ('mediaTypes' in action) { - return { mediaTypes: await this.testMediaType(action.context) }; - } - else if ('mediaTypeFormats' in action) { - return { mediaTypeFormats: await this.testMediaTypeFormats(action.context) }; - } - else { - throw new Error('Either a handle, mediaTypes or mediaTypeFormats action needs to be provided'); - } - } -} -exports.ActorAbstractMediaTyped = ActorAbstractMediaTyped; - -},{"@comunica/core":242}],7:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const ActorAbstractMediaTyped_1 = require("./ActorAbstractMediaTyped"); -class ActorAbstractMediaTypedFixed extends ActorAbstractMediaTyped_1.ActorAbstractMediaTyped { - constructor(args) { - super(args); - const scale = this.priorityScale || this.priorityScale === 0 ? this.priorityScale : 1; - this.mediaTypes = require('lodash.mapvalues')(this.mediaTypes, (priority) => priority * scale); - this.mediaTypes = Object.freeze(this.mediaTypes); - this.mediaTypeFormats = Object.freeze(this.mediaTypeFormats); - } - async testHandle(action, mediaType, context) { - if (!(mediaType in this.mediaTypes)) { - throw new Error('Unrecognized media type: ' + mediaType); - } - return await this.testHandleChecked(action, context); - } - async testMediaType(context) { - return true; - } - async getMediaTypes(context) { - return this.mediaTypes; - } - async testMediaTypeFormats(context) { - return true; - } - async getMediaTypeFormats(context) { - return this.mediaTypeFormats; - } -} -exports.ActorAbstractMediaTypedFixed = ActorAbstractMediaTypedFixed; - -},{"./ActorAbstractMediaTyped":6,"lodash.mapvalues":503}],8:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorAbstractPath")); - -},{"./lib/ActorAbstractPath":9}],9:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const data_model_1 = require("@rdfjs/data-model"); -const asynciterator_1 = require("asynciterator"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * An abstract actor that handles Path operations. - * - * Provides multiple helper functions used by the Path operation actors. - */ -class ActorAbstractPath extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args, predicateType) { - super(args, 'path'); - this.predicateType = predicateType; - } - async testOperation(pattern, context) { - if (pattern.predicate.type !== this.predicateType) { - throw new Error('This Actor only supports ' + this.predicateType + ' Path operations.'); - } - return true; - } - // generates a blank node that does not yet occur in the path - generateBlankNode(path, name) { - if (!name) { - return this.generateBlankNode(path, 'b'); - } - // path predicates can't contain variables/blank nodes - if (path && (path.subject.value === name || path.object.value === name)) { - return this.generateBlankNode(path, name + 'b'); - } - return data_model_1.blankNode(name); - } - // based on definition in spec https://www.w3.org/TR/sparql11-query/ - // returns all nodes visited by infinitely repeating the given predicate, starting from x - async ALPeval(x, predicate, context) { - const it = new asynciterator_1.BufferedIterator(); - await this.ALP(x, predicate, context, {}, it, { count: 0 }); - return it; - } - async ALP(x, predicate, context, V, it, counter) { - const s = rdf_string_1.termToString(x); - if (V[s]) { - return; - } - it._push(x); - V[s] = x; - const b = this.generateBlankNode(); - const bString = rdf_string_1.termToString(b); - const path = ActorAbstractPath.FACTORY.createPath(x, predicate, b); - const results = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: path, context })); - counter.count++; - results.bindingsStream.on('data', async (bindings) => { - const result = bindings.get(bString); - await this.ALP(result, predicate, context, V, it, counter); - }); - results.bindingsStream.on('end', () => { - if (--counter.count === 0) { - it.close(); - } - }); - } -} -exports.ActorAbstractPath = ActorAbstractPath; -ActorAbstractPath.FACTORY = new sparqlalgebrajs_1.Factory(); - -},{"@comunica/bus-query-operation":205,"@rdfjs/data-model":263,"asynciterator":291,"rdf-string":559,"sparqlalgebrajs":608}],10:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorHttpMemento")); - -},{"./lib/ActorHttpMemento":11}],11:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_http_1 = require("@comunica/bus-http"); -require("isomorphic-fetch"); -const parseLink = require("parse-link-header"); -/** - * A comunica Memento Http Actor. - */ -class ActorHttpMemento extends bus_http_1.ActorHttp { - constructor(args) { - super(args); - } - async test(action) { - if (!(action.context && action.context.has(exports.KEY_CONTEXT_DATETIME) && - action.context.get(exports.KEY_CONTEXT_DATETIME) instanceof Date)) { - throw new Error('This actor only handles request with a set valid datetime.'); - } - if (action.init && new Headers(action.init.headers || {}).has('accept-datetime')) { - throw new Error('The request already has a set datetime.'); - } - return true; - } - async run(action) { - // Duplicate the ActionHttp to append a datetime header to the request. - const init = action.init ? Object.assign({}, action.init) : {}; - const headers = init.headers = new Headers(init.headers || {}); - if (action.context && action.context.has(exports.KEY_CONTEXT_DATETIME)) { - headers.append('accept-datetime', action.context.get(exports.KEY_CONTEXT_DATETIME).toUTCString()); - } - const httpAction = { context: action.context, input: action.input, init }; - // Execute the request and follow the timegate in the response (if any). - const result = await this.mediatorHttp.mediate(httpAction); - // Did we ask for a time-negotiated response, but haven't received one? - if (headers.has('accept-datetime') && result.headers && !result.headers.has('memento-datetime')) { - // The links might have a timegate that can help us - const links = result.headers.has('link') && parseLink(result.headers.get('link')); - if (links && links.timegate) { - result.body.cancel(); - // Respond with a time-negotiated response from the timegate instead - const followLink = { context: action.context, input: links.timegate.url, init }; - return this.mediatorHttp.mediate(followLink); - } - } - return result; - } -} -exports.ActorHttpMemento = ActorHttpMemento; -/** - * @type {string} Context entry for the desired datetime. - */ -exports.KEY_CONTEXT_DATETIME = '@comunica/actor-http-memento:datetime'; - -},{"@comunica/bus-http":198,"isomorphic-fetch":483,"parse-link-header":530}],12:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorHttpNative")); - -},{"./lib/ActorHttpNative":13}],13:[function(require,module,exports){ -(function (process,setImmediate){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_http_1 = require("@comunica/bus-http"); -require("isomorphic-fetch"); -const Requester_1 = require("./Requester"); -/** - * A comunica Follow Redirects Http Actor. - */ -class ActorHttpNative extends bus_http_1.ActorHttp { - constructor(args) { - super(args); - this.userAgent = ActorHttpNative.createUserAgent(); - this.requester = new Requester_1.default(args.agentOptions ? JSON.parse(args.agentOptions) : undefined); - } - static createUserAgent() { - return `Comunica/actor-http-native (${typeof window === 'undefined' - ? 'Node.js ' + process.version + '; ' + process.platform : 'Browser-' + window.navigator.userAgent})`; - } - async test(action) { - // TODO: check for unsupported fetch features - return { time: Infinity }; - } - async run(action) { - const options = {}; - // input can be a Request object or a string - // if it is a Request object it can contain the same settings as the init object - if (action.input.url) { - options.url = action.input.url; - Object.assign(options, action.input); - } - else { - options.url = action.input; - } - if (action.init) { - Object.assign(options, action.init); - } - if (options.headers) { - const headers = {}; - options.headers.forEach((val, key) => { - headers[key] = val; - }); - options.headers = headers; - } - else { - options.headers = {}; - } - if (!options.headers['user-agent']) { - options.headers['user-agent'] = this.userAgent; - } - options.method = options.method || 'GET'; - this.logInfo(action.context, `Requesting ${options.url}`); - // not all options are supported - return new Promise((resolve, reject) => { - const req = this.requester.createRequest(options); - req.on('error', reject); - req.on('response', (httpResponse) => { - httpResponse.on('error', (e) => { - httpResponse = null; - reject(e); - }); - // Avoid memory leak on HEAD requests - if (options.method === 'HEAD') { - httpResponse.destroy(); - } - // using setImmediate so error can be caught should it be thrown - setImmediate(() => { - if (httpResponse) { - // Expose fetch cancel promise - httpResponse.cancel = () => Promise.resolve(httpResponse.destroy()); - // missing several of the required fetch fields - const headers = new Headers(httpResponse.headers); - const result = { - body: httpResponse, - headers, - ok: httpResponse.statusCode < 300, - redirected: options.url !== httpResponse.responseUrl, - status: httpResponse.statusCode, - // when the content came from another resource because of conneg, let Content-Location deliver the url - url: headers.has('content-location') ? headers.get('content-location') : httpResponse.responseUrl, - }; - resolve(result); - } - }); - }); - }); - } -} -exports.ActorHttpNative = ActorHttpNative; - -}).call(this,require('_process'),require("timers").setImmediate) -},{"./Requester":14,"@comunica/bus-http":198,"_process":537,"isomorphic-fetch":483,"timers":674}],14:[function(require,module,exports){ -"use strict"; -/*! @license MIT ©2013-2016 Ruben Verborgh, Ghent University - imec */ -/* Single-function HTTP(S) request module for browsers */ -/* Translated from https://github.com/LinkedDataFragments/Client.js/blob/master/lib/browser/Request.js */ -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = require("events"); -const parseLink = require("parse-link-header"); -const stream_1 = require("stream"); -// Headers we cannot send (see https://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method) -const UNSAFE_REQUEST_HEADERS = { 'accept-encoding': true, 'user-agent': true, 'referer': true }; -class Requester { - constructor() { - this.negotiatedResources = {}; - } - // Creates an HTTP request with the given settings - createRequest(settings) { - // PERFORMANCE HACK: - // Reduce OPTIONS preflight requests by removing the Accept-Datetime header - // on requests for resources that are presumed to have been time-negotiated - if (this.negotiatedResources[this.removeQuery(settings.url)]) { - delete settings.headers['accept-datetime']; - } - // Create the actual XMLHttpRequest - const request = new XMLHttpRequest(); - const reqHeaders = settings.headers; - request.open(settings.method, settings.url, true); - request.timeout = settings.timeout; - for (const header in reqHeaders) { - if (!(header in UNSAFE_REQUEST_HEADERS) && reqHeaders[header]) { - request.setRequestHeader(header, reqHeaders[header]); - } - } - // Create a proxy for the XMLHttpRequest - const requestProxy = new events_1.EventEmitter(); - requestProxy.abort = () => { request.abort(); }; - // Handle the arrival of a response - request.onload = () => { - // Convert the response into an iterator - const response = new stream_1.Readable(); - response.push(request.responseText || ''); - response.push(null); - response.statusCode = request.status; - response.responseUrl = request.responseURL; - // Parse the response headers - response.headers = {}; - const resHeaders = response.headers; - const rawHeaders = request.getAllResponseHeaders() || ''; - const headerMatcher = /^([^:\n\r]+):[ \t]*([^\r\n]*)$/mg; - let match = headerMatcher.exec(rawHeaders); - while (match) { - resHeaders[match[1].toLowerCase()] = match[2]; - match = headerMatcher.exec(rawHeaders); - } - // Emit the response - requestProxy.emit('response', response); - // If the resource was time-negotiated, store its queryless URI - // to enable the PERFORMANCE HACK explained above - if (reqHeaders['accept-datetime'] && resHeaders['memento-datetime']) { - const resource = this.removeQuery(resHeaders['content-location'] || settings.url); - if (!this.negotiatedResources[resource]) { - // Ensure the resource is not a timegate - const links = resHeaders.link && parseLink(resHeaders.link); - const timegate = this.removeQuery(links && links.timegate && links.timegate.url); - if (resource !== timegate) { - this.negotiatedResources[resource] = true; - } - } - } - }; - // Report errors and timeouts - request.onerror = () => { - requestProxy.emit('error', new Error('Error requesting ' + settings.url)); - }; - request.ontimeout = () => { - requestProxy.emit('error', new Error('Timeout requesting ' + settings.url)); - }; - // Execute the request - request.send(); - return requestProxy; - } - // Removes the query string from a URL - removeQuery(url) { - return url ? url.replace(/\?.*$/, '') : ''; - } -} -exports.default = Requester; - -},{"events":395,"parse-link-header":530,"stream":651}],15:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorHttpProxy")); -__export(require("./lib/ProxyHandlerStatic")); - -},{"./lib/ActorHttpProxy":16,"./lib/ProxyHandlerStatic":17}],16:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_http_1 = require("@comunica/bus-http"); -/** - * A comunica Proxy Http Actor. - */ -class ActorHttpProxy extends bus_http_1.ActorHttp { - constructor(args) { - super(args); - } - async test(action) { - const proxyHandler = action.context.get(exports.KEY_CONTEXT_HTTPPROXYHANDLER); - if (!proxyHandler) { - throw new Error(`Actor ${this.name} could not find a proxy handler in the context.`); - } - if (!await proxyHandler.getProxy(action)) { - throw new Error(`Actor ${this.name} could not determine a proxy for the given request.`); - } - return { time: Infinity }; - } - async run(action) { - const requestedUrl = typeof action.input === 'string' ? action.input : action.input.url; - const proxyHandler = action.context.get(exports.KEY_CONTEXT_HTTPPROXYHANDLER); - // Send a request for the modified request - const output = await this.mediatorHttp.mediate(Object.assign(Object.assign({}, await proxyHandler.getProxy(action)), { context: action.context.delete(exports.KEY_CONTEXT_HTTPPROXYHANDLER) })); - // Modify the response URL - output.url = output.headers.get('x-final-url') || requestedUrl; - return output; - } -} -exports.ActorHttpProxy = ActorHttpProxy; -exports.KEY_CONTEXT_HTTPPROXYHANDLER = '@comunica/actor-http-proxy:httpProxyHandler'; - -},{"@comunica/bus-http":198}],17:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * A proxy handler that prefixes all URLs with a given string. - */ -class ProxyHandlerStatic { - constructor(prefixUrl) { - this.prefixUrl = prefixUrl; - } - async getProxy(request) { - return { - init: request.init, - input: this.modifyInput(request.input), - }; - } - modifyInput(input) { - if (typeof input === 'string') { - return this.prefixUrl + input; - } - else { - return new Request(this.prefixUrl + input.url, input); - } - } -} -exports.ProxyHandlerStatic = ProxyHandlerStatic; - -},{}],18:[function(require,module,exports){ -const __b16bnode145 = new (require('@comunica/logger-void').LoggerVoid)({}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/Bus/Init' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/Bus/RdfJoin' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-quad-pattern/Bus/RdfResolveQuadPattern' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-serialize/Bus/RdfSerialize' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_optimize_query_operation_Bus_OptimizeQueryOperation = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-optimize-query-operation/Bus/OptimizeQueryOperation' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-sparql-parse/Bus/SparqlParse' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-sparql-serialize/Bus/SparqlSerialize' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess_Bus_ContextPreprocess = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-context-preprocess/Bus/ContextPreprocess' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_invalidate_Bus_HttpInvalidate = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/Bus/HttpInvalidate' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/Bus/Http' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation = new (require('@comunica/core').BusIndexed)({ - 'actorIdentifierFields': [ - 'operationName' - ], - 'actionIdentifierFields': [ - 'operation', - 'type' - ], - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/Bus/QueryOperation' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorRdfJoin', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinActor = new (require('@comunica/actor-rdf-join-symmetrichash').ActorRdfJoinSymmetricHash)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/join.json#myRdfJoinActor', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorResolveQuadPattern', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const config_sets_resolve_file_json_myRdfRdfJsSourceQuadPatternResolver = new (require('@comunica/actor-rdf-resolve-quad-pattern-rdfjs-source').ActorRdfResolveQuadPatternRdfJsSource)({ - 'name': 'config-sets:resolve-file.json#myRdfRdfJsSourceQuadPatternResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializerN3 = new (require('@comunica/actor-rdf-serialize-n3').ActorRdfSerializeN3)({ - 'mediaTypes': { - 'application/trig': '1.0', - 'application/n-quads': '0.7', - 'text/turtle': '0.6', - 'application/n-triples': '0.3', - 'text/n3': '0.2' - }, - 'mediaTypeFormats': { - 'application/trig': 'http://www.w3.org/ns/formats/TriG', - 'application/n-quads': 'http://www.w3.org/ns/formats/N-Quads', - 'text/turtle': 'http://www.w3.org/ns/formats/Turtle', - 'application/n-triples': 'http://www.w3.org/ns/formats/N-Triples', - 'text/n3': 'http://www.w3.org/ns/formats/N3' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-serializers.json#myRdfSerializerN3', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializeJsonLd = new (require('@comunica/actor-rdf-serialize-jsonld').ActorRdfSerializeJsonLd)({ - 'jsonStringifyIndentSpaces': 2, - 'mediaTypes': { - 'application/ld+json': '1.0' - }, - 'mediaTypeFormats': { - 'application/ld+json': 'http://www.w3.org/ns/formats/JSON-LD' - }, - 'priorityScale': '9.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-serializers.json#myRdfSerializeJsonLd', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mediatorRdfSerialize = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mediatorRdfSerialize', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const __b0bnode308 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': '_:b0bnode308', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const __b1bnode308 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypeFormats', - 'name': '_:b1bnode308', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorOptimizeQueryOperation = new (require('@comunica/mediator-combine-pipeline').MediatorCombinePipeline)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorOptimizeQueryOperation', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_optimize_query_operation_Bus_OptimizeQueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlParse = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorSparqlParse', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_parsers_json_mySparqlParser = new (require('@comunica/actor-sparql-parse-algebra').ActorSparqlParseAlgebra)({ - 'prefixes': { - 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'owl': 'http://www.w3.org/2002/07/owl#', - 'xsd': 'http://www.w3.org/2001/XMLSchema#', - 'dc': 'http://purl.org/dc/terms/', - 'dcterms': 'http://purl.org/dc/terms/', - 'dc11': 'http://purl.org/dc/elements/1.1/', - 'foaf': 'http://xmlns.com/foaf/0.1/', - 'geo': 'http://www.w3.org/2003/01/geo/wgs84_pos#', - 'dbpedia': 'http://dbpedia.org/resource/', - 'dbpedia-owl': 'http://dbpedia.org/ontology/', - 'dbpprop': 'http://dbpedia.org/property/', - 'schema': 'http://schema.org/', - 'skos': 'http://www.w3.org/2008/05/skos#' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-parsers.json#mySparqlParser', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlSerialize = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorSparqlSerialize', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const __b0bnode306 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': '_:b0bnode306', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const __b1bnode306 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypeFormats', - 'name': '_:b1bnode306', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myJsonSparqlSerializer = new (require('@comunica/actor-sparql-serialize-json').ActorSparqlSerializeJson)({ - 'mediaTypes': { - 'application/json': '1.0' - }, - 'mediaTypeFormats': { - 'application/json': 'https://comunica.linkeddatafragments.org/#results_JSON' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myJsonSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySimpleSparqlSerializer = new (require('@comunica/actor-sparql-serialize-simple').ActorSparqlSerializeSimple)({ - 'mediaTypes': { - 'simple': '1.0' - }, - 'mediaTypeFormats': { - 'simple': 'https://comunica.linkeddatafragments.org/#results_simple' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySimpleSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlJsonSparqlSerializer = new (require('@comunica/actor-sparql-serialize-sparql-json').ActorSparqlSerializeSparqlJson)({ - 'mediaTypes': { - 'application/sparql-results+json': '1.0' - }, - 'mediaTypeFormats': { - 'application/sparql-results+json': 'http://www.w3.org/ns/formats/SPARQL_Results_JSON' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySparqlJsonSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlXmlSparqlSerializer = new (require('@comunica/actor-sparql-serialize-sparql-xml').ActorSparqlSerializeSparqlXml)({ - 'mediaTypes': { - 'application/sparql-results+xml': '1.0' - }, - 'mediaTypeFormats': { - 'application/sparql-results+xml': 'http://www.w3.org/ns/formats/SPARQL_Results_XML' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySparqlXmlSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTableSparqlSerializer = new (require('@comunica/actor-sparql-serialize-table').ActorSparqlSerializeTable)({ - 'columnWidth': 50, - 'mediaTypes': { - 'table': '1.0' - }, - 'mediaTypeFormats': { - 'table': 'https://comunica.linkeddatafragments.org/#results_table' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myTableSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTreeSparqlSerializer = new (require('@comunica/actor-sparql-serialize-tree').ActorSparqlSerializeTree)({ - 'mediaTypes': { - 'tree': '0.9' - }, - 'mediaTypeFormats': { - 'tree': 'https://comunica.linkeddatafragments.org/#results_tree' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myTreeSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorContextPreprocess = new (require('@comunica/mediator-combine-pipeline').MediatorCombinePipeline)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorContextPreprocess', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess_Bus_ContextPreprocess -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorHttpInvalidate = new (require('@comunica/mediator-all').MediatorAll)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorHttpInvalidate', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_invalidate_Bus_HttpInvalidate -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_sparql_serialize_stats_Actor_SparqlSerialize_Stats_httpObserver_default = new (require('@comunica/actor-sparql-serialize-stats').ActionObserverHttp)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-sparql-serialize-stats/Actor/SparqlSerialize/Stats/httpObserver/default', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation = new (require('@comunica/mediator-number').MediatorNumber)({ - 'field': 'httpRequests', - 'type': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number/Mediator/Number/type/TypeMin', - 'ignoreErrors': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorQueryOperation', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myEmptyBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-empty').ActorQueryOperationBgpEmpty)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myEmptyBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myValuesQueryOperator = new (require('@comunica/actor-query-operation-values').ActorQueryOperationValues)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myValuesQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinMultiActor = new (require('@comunica/actor-rdf-join-multi-smallest').ActorRdfJoinMultiSmallest)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/join.json#myRdfJoinMultiActor', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_federated_json_myFederatedQuadPatternResolver = new (require('@comunica/actor-rdf-resolve-quad-pattern-federated').ActorRdfResolveQuadPatternFederated)({ - 'mediatorResolveQuadPattern': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern, - 'skipEmptyPatterns': false, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-federated.json#myFederatedQuadPatternResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myQuadPatternQueryOperator = new (require('@comunica/actor-query-operation-quadpattern').ActorQueryOperationQuadpattern)({ - 'mediatorResolveQuadPattern': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myQuadPatternQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myRdfSparqlSerializer = new (require('@comunica/actor-sparql-serialize-rdf').ActorSparqlSerializeRdf)({ - 'mediatorRdfSerialize': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mediatorRdfSerialize, - 'mediatorMediaTypeCombiner': __b0bnode308, - 'mediatorMediaTypeFormatCombiner': __b1bnode308, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myRdfSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myStatsSparqlSerializer = new (require('@comunica/actor-sparql-serialize-stats').ActorSparqlSerializeStats)({ - 'httpObserver': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_sparql_serialize_stats_Actor_SparqlSerialize_Stats_httpObserver_default, - 'mediaTypes': { - 'stats': '1.0' - }, - 'mediaTypeFormats': { - 'stats': 'https://comunica.linkeddatafragments.org/#results_stats' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myStatsSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const urn_comunica_sparqlinit = new (require('@comunica/actor-init-sparql').ActorInitSparql)({ - 'mediatorOptimizeQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorOptimizeQueryOperation, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'mediatorSparqlParse': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlParse, - 'mediatorSparqlSerialize': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlSerialize, - 'mediatorSparqlSerializeMediaTypeCombiner': __b0bnode306, - 'mediatorSparqlSerializeMediaTypeFormatCombiner': __b1bnode306, - 'mediatorContextPreprocess': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorContextPreprocess, - 'mediatorHttpInvalidate': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorHttpInvalidate, - 'logger': __b16bnode145, - 'contextKeyShortcuts': { - 'source': '@comunica/bus-rdf-resolve-quad-pattern:source', - 'sources': '@comunica/bus-rdf-resolve-quad-pattern:sources', - 'initialBindings': '@comunica/actor-init-sparql:initialBindings', - 'queryFormat': '@comunica/actor-init-sparql:queryFormat', - 'baseIRI': '@comunica/actor-init-sparql:baseIRI', - 'log': '@comunica/core:log', - 'datetime': '@comunica/actor-http-memento:datetime', - 'queryTimestamp': '@comunica/actor-init-sparql:queryTimestamp', - 'httpProxyHandler': '@comunica/actor-http-proxy:httpProxyHandler', - 'lenient': '@comunica/actor-init-sparql:lenient' - }, - 'name': 'urn:comunica:sparqlinit', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myAskQueryOperator = new (require('@comunica/actor-query-operation-ask').ActorQueryOperationAsk)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myAskQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myServiceQueryOperator = new (require('@comunica/actor-query-operation-service').ActorQueryOperationService)({ - 'forceSparqlEndpoint': false, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myServiceQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySliceQueryOperator = new (require('@comunica/actor-query-operation-slice').ActorQueryOperationSlice)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mySliceQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySingleBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-single').ActorQueryOperationBgpSingle)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mySingleBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftDeepSmallestBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-left-deep-smallest').ActorQueryOperationBgpLeftDeepSmallest)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myLeftDeepSmallestBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myConstructQueryOperator = new (require('@comunica/actor-query-operation-construct').ActorQueryOperationConstruct)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myConstructQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDescribeQueryOperator = new (require('@comunica/actor-query-operation-describe-subject').ActorQueryOperationDescribeSubject)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myDescribeQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDistinctQueryOperator = new (require('@comunica/actor-query-operation-distinct-hash').ActorQueryOperationDistinctHash)({ - 'hashAlgorithm': 'sha1', - 'digestAlgorithm': 'base64', - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myDistinctQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myExtendQueryOperator = new (require('@comunica/actor-query-operation-extend').ActorQueryOperationExtend)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myExtendQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myReducedQueryOperator = new (require('@comunica/actor-query-operation-reduced-hash').ActorQueryOperationReducedHash)({ - 'hashAlgorithm': 'sha1', - 'digestAlgorithm': 'base64', - 'cacheSize': 100, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myReducedQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFilterQueryOperator = new (require('@comunica/actor-query-operation-filter-sparqlee').ActorQueryOperationFilterSparqlee)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myFilterQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFromQueryOperator = new (require('@comunica/actor-query-operation-from-quad').ActorQueryOperationFromQuad)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myFromQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myGroupQueryOperator = new (require('@comunica/actor-query-operation-group').ActorQueryOperationGroup)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myGroupQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myJoinQueryOperator = new (require('@comunica/actor-query-operation-join').ActorQueryOperationJoin)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myJoinQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftJoinQueryOperator = new (require('@comunica/actor-query-operation-leftjoin-left-deep').ActorQueryOperationLeftJoinLeftDeep)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myLeftJoinQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myOrderByQueryOperator = new (require('@comunica/actor-query-operation-orderby-sparqlee').ActorQueryOperationOrderBySparqlee)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myOrderByQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myProjectQueryOperator = new (require('@comunica/actor-query-operation-project').ActorQueryOperationProject)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myProjectQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myUnionQueryOperator = new (require('@comunica/actor-query-operation-union').ActorQueryOperationUnion)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myUnionQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myMinusQueryOperator = new (require('@comunica/actor-query-operation-minus').ActorQueryOperationMinus)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myMinusQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myAltPathOperator = new (require('@comunica/actor-query-operation-path-alt').ActorQueryOperationPathAlt)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myAltPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myInvPathOperator = new (require('@comunica/actor-query-operation-path-inv').ActorQueryOperationPathInv)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myInvPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myLinkPathOperator = new (require('@comunica/actor-query-operation-path-link').ActorQueryOperationPathLink)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myLinkPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myNpsPathOperator = new (require('@comunica/actor-query-operation-path-nps').ActorQueryOperationPathNps)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myNpsPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myOneOrMorePathOperator = new (require('@comunica/actor-query-operation-path-one-or-more').ActorQueryOperationPathOneOrMore)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myOneOrMorePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_mySeqPathOperator = new (require('@comunica/actor-query-operation-path-seq').ActorQueryOperationPathSeq)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#mySeqPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrMorePathOperator = new (require('@comunica/actor-query-operation-path-zero-or-more').ActorQueryOperationPathZeroOrMore)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myZeroOrMorePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrOnePathOperator = new (require('@comunica/actor-query-operation-path-zero-or-one').ActorQueryOperationPathZeroOrOne)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myZeroOrOnePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const urn_comunica_my = ({ - 'busInit': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init, - 'actors': [ - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinMultiActor, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinActor, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_federated_json_myFederatedQuadPatternResolver, - config_sets_resolve_file_json_myRdfRdfJsSourceQuadPatternResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializerN3, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializeJsonLd, - urn_comunica_sparqlinit, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_parsers_json_mySparqlParser, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myJsonSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myRdfSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySimpleSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlJsonSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlXmlSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myStatsSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTableSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTreeSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myAskQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myServiceQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySliceQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myEmptyBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySingleBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftDeepSmallestBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myConstructQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDescribeQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDistinctQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myExtendQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myReducedQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFilterQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFromQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myGroupQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myJoinQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftJoinQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myOrderByQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myProjectQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myUnionQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myMinusQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myValuesQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myQuadPatternQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myAltPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myInvPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myLinkPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myNpsPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myOneOrMorePathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_mySeqPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrMorePathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrOnePathOperator - ] -}); -module.exports = urn_comunica_sparqlinit; - -},{"@comunica/actor-init-sparql":21,"@comunica/actor-query-operation-ask":25,"@comunica/actor-query-operation-bgp-empty":27,"@comunica/actor-query-operation-bgp-left-deep-smallest":29,"@comunica/actor-query-operation-bgp-single":31,"@comunica/actor-query-operation-construct":33,"@comunica/actor-query-operation-describe-subject":36,"@comunica/actor-query-operation-distinct-hash":38,"@comunica/actor-query-operation-extend":40,"@comunica/actor-query-operation-filter-sparqlee":42,"@comunica/actor-query-operation-from-quad":44,"@comunica/actor-query-operation-group":46,"@comunica/actor-query-operation-join":49,"@comunica/actor-query-operation-leftjoin-left-deep":51,"@comunica/actor-query-operation-minus":53,"@comunica/actor-query-operation-orderby-sparqlee":56,"@comunica/actor-query-operation-path-alt":59,"@comunica/actor-query-operation-path-inv":61,"@comunica/actor-query-operation-path-link":63,"@comunica/actor-query-operation-path-nps":65,"@comunica/actor-query-operation-path-one-or-more":67,"@comunica/actor-query-operation-path-seq":69,"@comunica/actor-query-operation-path-zero-or-more":71,"@comunica/actor-query-operation-path-zero-or-one":73,"@comunica/actor-query-operation-project":75,"@comunica/actor-query-operation-quadpattern":77,"@comunica/actor-query-operation-reduced-hash":79,"@comunica/actor-query-operation-service":82,"@comunica/actor-query-operation-slice":84,"@comunica/actor-query-operation-union":88,"@comunica/actor-query-operation-values":90,"@comunica/actor-rdf-join-multi-smallest":95,"@comunica/actor-rdf-join-symmetrichash":97,"@comunica/actor-rdf-resolve-quad-pattern-federated":158,"@comunica/actor-rdf-resolve-quad-pattern-rdfjs-source":168,"@comunica/actor-rdf-serialize-jsonld":170,"@comunica/actor-rdf-serialize-n3":172,"@comunica/actor-sparql-parse-algebra":174,"@comunica/actor-sparql-serialize-json":178,"@comunica/actor-sparql-serialize-rdf":180,"@comunica/actor-sparql-serialize-simple":182,"@comunica/actor-sparql-serialize-sparql-json":184,"@comunica/actor-sparql-serialize-sparql-xml":186,"@comunica/actor-sparql-serialize-stats":188,"@comunica/actor-sparql-serialize-table":191,"@comunica/actor-sparql-serialize-tree":193,"@comunica/core":242,"@comunica/logger-void":249,"@comunica/mediator-all":251,"@comunica/mediator-combine-pipeline":253,"@comunica/mediator-combine-union":255,"@comunica/mediator-number":257,"@comunica/mediator-race":259}],19:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Create a new comunica engine from the default config. - * @return {ActorInitSparql} A comunica engine. - */ -function newEngine() { - return require('./engine-default.js'); -} -exports.newEngine = newEngine; - -},{"./engine-default.js":18}],20:[function(require,module,exports){ -const __b16bnode134 = new (require('@comunica/logger-void').LoggerVoid)({}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/Bus/Init' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/Bus/Http' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/Bus/RdfJoin' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse/Bus/RdfParse' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_dereference_Bus_RdfDereference = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-dereference/Bus/RdfDereference' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-serialize/Bus/RdfSerialize' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-quad-pattern/Bus/RdfResolveQuadPattern' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_Bus_RdfMetadata = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata/Bus/RdfMetadata' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_extract_Bus_RdfMetadataExtract = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata-extract/Bus/RdfMetadataExtract' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_Bus_RdfResolveHypermedia = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia/Bus/RdfResolveHypermedia' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_links_Bus_RdfResolveHypermediaLinks = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia-links/Bus/RdfResolveHypermediaLinks' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_invalidate_Bus_HttpInvalidate = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/Bus/HttpInvalidate' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_html_Bus_RdfParseHtml = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-parse-html/Bus/RdfParseHtml' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_optimize_query_operation_Bus_OptimizeQueryOperation = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-optimize-query-operation/Bus/OptimizeQueryOperation' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-sparql-parse/Bus/SparqlParse' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-sparql-serialize/Bus/SparqlSerialize' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess_Bus_ContextPreprocess = new (require('@comunica/core').Bus)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-context-preprocess/Bus/ContextPreprocess' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation = new (require('@comunica/core').BusIndexed)({ - 'actorIdentifierFields': [ - 'operationName' - ], - 'actionIdentifierFields': [ - 'operation', - 'type' - ], - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/Bus/QueryOperation' -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp = new (require('@comunica/mediator-number').MediatorNumber)({ - 'field': 'time', - 'type': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number/Mediator/Number/type/TypeMin', - 'ignoreErrors': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/http.json#mediatorHttp', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_myHttpFetcher = new (require('@comunica/actor-http-native').ActorHttpNative)({ - 'agentOptions': '{ \"keepAlive\": true, \"maxSockets\": 5 }', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/http.json#myHttpFetcher', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_sparql_serialize_stats_Actor_SparqlSerialize_Stats_httpObserver_default = new (require('@comunica/actor-sparql-serialize-stats').ActionObserverHttp)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-sparql-serialize-stats/Actor/SparqlSerialize/Stats/httpObserver/default', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorRdfJoin', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinActor = new (require('@comunica/actor-rdf-join-symmetrichash').ActorRdfJoinSymmetricHash)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/join.json#myRdfJoinActor', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_mediatorRdfParseMediatypes = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-dereference.json#mediatorRdfParseMediatypes', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_mediatorRdfParseHandle = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-dereference.json#mediatorRdfParseHandle', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserN3 = new (require('@comunica/actor-rdf-parse-n3').ActorRdfParseN3)({ - 'mediaTypes': { - 'application/n-quads': '1.0', - 'application/trig': '0.95', - 'application/n-triples': '0.8', - 'text/turtle': '0.5', - 'text/n3': '0.35' - }, - 'mediaTypeFormats': { - 'application/n-quads': 'http://www.w3.org/ns/formats/N-Quads', - 'application/trig': 'http://www.w3.org/ns/formats/TriG', - 'application/n-triples': 'http://www.w3.org/ns/formats/N-Triples', - 'text/turtle': 'http://www.w3.org/ns/formats/Turtle', - 'text/n3': 'http://www.w3.org/ns/formats/N3' - }, - 'priorityScale': '1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserN3', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserRdfXml = new (require('@comunica/actor-rdf-parse-rdfxml').ActorRdfParseRdfXml)({ - 'mediaTypes': { - 'application/rdf+xml': '1.0' - }, - 'mediaTypeFormats': { - 'application/rdf+xml': 'http://www.w3.org/ns/formats/RDF_XML' - }, - 'priorityScale': '5.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserRdfXml', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserXmlRdfa = new (require('@comunica/actor-rdf-parse-xml-rdfa').ActorRdfParseXmlRdfa)({ - 'mediaTypes': { - 'application/xml': '1.0', - 'text/xml': '1.0', - 'image/svg+xml': '1.0' - }, - 'mediaTypeFormats': { - 'application/xml': 'http://www.w3.org/ns/formats/RDFa', - 'text/xml': 'http://www.w3.org/ns/formats/RDFa', - 'image/svg+xml': 'http://www.w3.org/ns/formats/RDFa' - }, - 'priorityScale': '3.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserXmlRdfa', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_mediatorRdfParseMediatypes = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#mediatorRdfParseMediatypes', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_mediatorRdfParseHandle = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#mediatorRdfParseHandle', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfDereference = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#mediatorRdfDereference', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_dereference_Bus_RdfDereference -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializerN3 = new (require('@comunica/actor-rdf-serialize-n3').ActorRdfSerializeN3)({ - 'mediaTypes': { - 'application/trig': '1.0', - 'application/n-quads': '0.7', - 'text/turtle': '0.6', - 'application/n-triples': '0.3', - 'text/n3': '0.2' - }, - 'mediaTypeFormats': { - 'application/trig': 'http://www.w3.org/ns/formats/TriG', - 'application/n-quads': 'http://www.w3.org/ns/formats/N-Quads', - 'text/turtle': 'http://www.w3.org/ns/formats/Turtle', - 'application/n-triples': 'http://www.w3.org/ns/formats/N-Triples', - 'text/n3': 'http://www.w3.org/ns/formats/N3' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-serializers.json#myRdfSerializerN3', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializeJsonLd = new (require('@comunica/actor-rdf-serialize-jsonld').ActorRdfSerializeJsonLd)({ - 'jsonStringifyIndentSpaces': 2, - 'mediaTypes': { - 'application/ld+json': '1.0' - }, - 'mediaTypeFormats': { - 'application/ld+json': 'http://www.w3.org/ns/formats/JSON-LD' - }, - 'priorityScale': '9.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-serializers.json#myRdfSerializeJsonLd', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mediatorRdfSerialize = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mediatorRdfSerialize', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const __b0bnode318 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': '_:b0bnode318', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const __b1bnode318 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypeFormats', - 'name': '_:b1bnode318', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_serialize_Bus_RdfSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorResolveQuadPattern', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const config_sets_resolve_file_json_myRdfRdfJsSourceQuadPatternResolver = new (require('@comunica/actor-rdf-resolve-quad-pattern-rdfjs-source').ActorRdfResolveQuadPatternRdfJsSource)({ - 'name': 'config-sets:resolve-file.json#myRdfRdfJsSourceQuadPatternResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadata = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#mediatorMetadata', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_Bus_RdfMetadata -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataPrimaryTopic = new (require('@comunica/actor-rdf-metadata-primary-topic').ActorRdfMetadataPrimaryTopic)({ - 'metadataToData': false, - 'dataToMetadataOnInvalidMetadataGraph': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myRdfMetadataPrimaryTopic', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_Bus_RdfMetadata -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataAll = new (require('@comunica/actor-rdf-metadata-all').ActorRdfMetadataAll)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myRdfMetadataAll', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_Bus_RdfMetadata -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadataExtract = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'metadata', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#mediatorMetadataExtract', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_extract_Bus_RdfMetadataExtract -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataExtractHydraControls = new (require('@comunica/actor-rdf-metadata-extract-hydra-controls').ActorRdfMetadataExtractHydraControls)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myRdfMetadataExtractHydraControls', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_extract_Bus_RdfMetadataExtract -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataExtractHydraCount = new (require('@comunica/actor-rdf-metadata-extract-hydra-count').ActorRdfMetadataExtractHydraCount)({ - 'predicates': [ - 'http://www.w3.org/ns/hydra/core#totalItems', - 'http://rdfs.org/ns/void#triples' - ], - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myRdfMetadataExtractHydraCount', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_extract_Bus_RdfMetadataExtract -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_myRdfMetadataExtractSparqlService = new (require('@comunica/actor-rdf-metadata-extract-sparql-service').ActorRdfMetadataExtractSparqlService)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-sparql.json#myRdfMetadataExtractSparqlService', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_metadata_extract_Bus_RdfMetadataExtract -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaNoneResolver = new (require('@comunica/actor-rdf-resolve-hypermedia-none').ActorRdfResolveHypermediaNone)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myHypermediaNoneResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_Bus_RdfResolveHypermedia -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfResolveHypermedia = new (require('@comunica/mediator-number').MediatorNumber)({ - 'field': 'filterFactor', - 'type': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number/Mediator/Number/type/TypeMax', - 'ignoreErrors': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#mediatorRdfResolveHypermedia', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_Bus_RdfResolveHypermedia -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfResolveHypermediaLinks = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#mediatorRdfResolveHypermediaLinks', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_links_Bus_RdfResolveHypermediaLinks -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaLinksNext = new (require('@comunica/actor-rdf-resolve-hypermedia-links-next').ActorRdfResolveHypermediaLinksNext)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myHypermediaLinksNext', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_links_Bus_RdfResolveHypermediaLinks -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_rdf_resolve_quad_pattern_hypermedia_Actor_RdfResolveQuadPattern_Hypermedia_httpInvalidator_default = new (require('@comunica/bus-http-invalidate').ActorHttpInvalidateListenable)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-resolve-quad-pattern-hypermedia/Actor/RdfResolveQuadPattern/Hypermedia/httpInvalidator#default', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_invalidate_Bus_HttpInvalidate -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorHttpInvalidate = new (require('@comunica/mediator-all').MediatorAll)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorHttpInvalidate', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_invalidate_Bus_HttpInvalidate -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtml = new (require('@comunica/actor-rdf-parse-html').ActorRdfParseHtml)({ - 'busRdfParseHtml': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_html_Bus_RdfParseHtml, - 'mediaTypes': { - 'text/html': '1.0', - 'application/xhtml+xml': '0.9' - }, - 'mediaTypeFormats': { - 'text/html': 'http://www.w3.org/ns/formats/HTML', - 'application/xhtml+xml': 'http://www.w3.org/ns/formats/HTML' - }, - 'priorityScale': '2.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserHtml', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtmlRdfa = new (require('@comunica/actor-rdf-parse-html-rdfa').ActorRdfParseHtmlRdfa)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserHtmlRdfa', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_html_Bus_RdfParseHtml -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorOptimizeQueryOperation = new (require('@comunica/mediator-combine-pipeline').MediatorCombinePipeline)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorOptimizeQueryOperation', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_optimize_query_operation_Bus_OptimizeQueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_optimize_json_myJoinBgpOptimizer = new (require('@comunica/actor-optimize-query-operation-join-bgp').ActorOptimizeQueryOperationJoinBgp)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-optimize.json#myJoinBgpOptimizer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_optimize_query_operation_Bus_OptimizeQueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlParse = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorSparqlParse', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_graphql_parsers_json_myGraphqlParser = new (require('@comunica/actor-sparql-parse-graphql').ActorSparqlParseGraphql)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/graphql-parsers.json#myGraphqlParser', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_parsers_json_mySparqlParser = new (require('@comunica/actor-sparql-parse-algebra').ActorSparqlParseAlgebra)({ - 'prefixes': { - 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'owl': 'http://www.w3.org/2002/07/owl#', - 'xsd': 'http://www.w3.org/2001/XMLSchema#', - 'dc': 'http://purl.org/dc/terms/', - 'dcterms': 'http://purl.org/dc/terms/', - 'dc11': 'http://purl.org/dc/elements/1.1/', - 'foaf': 'http://xmlns.com/foaf/0.1/', - 'geo': 'http://www.w3.org/2003/01/geo/wgs84_pos#', - 'dbpedia': 'http://dbpedia.org/resource/', - 'dbpedia-owl': 'http://dbpedia.org/ontology/', - 'dbpprop': 'http://dbpedia.org/property/', - 'schema': 'http://schema.org/', - 'skos': 'http://www.w3.org/2008/05/skos#' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-parsers.json#mySparqlParser', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_parse_Bus_SparqlParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlSerialize = new (require('@comunica/mediator-race').MediatorRace)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorSparqlSerialize', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const __b0bnode312 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypes', - 'name': '_:b0bnode312', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const __b1bnode312 = new (require('@comunica/mediator-combine-union').MediatorCombineUnion)({ - 'field': 'mediaTypeFormats', - 'name': '_:b1bnode312', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myJsonSparqlSerializer = new (require('@comunica/actor-sparql-serialize-json').ActorSparqlSerializeJson)({ - 'mediaTypes': { - 'application/json': '1.0' - }, - 'mediaTypeFormats': { - 'application/json': 'https://comunica.linkeddatafragments.org/#results_JSON' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myJsonSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySimpleSparqlSerializer = new (require('@comunica/actor-sparql-serialize-simple').ActorSparqlSerializeSimple)({ - 'mediaTypes': { - 'simple': '1.0' - }, - 'mediaTypeFormats': { - 'simple': 'https://comunica.linkeddatafragments.org/#results_simple' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySimpleSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlJsonSparqlSerializer = new (require('@comunica/actor-sparql-serialize-sparql-json').ActorSparqlSerializeSparqlJson)({ - 'mediaTypes': { - 'application/sparql-results+json': '1.0' - }, - 'mediaTypeFormats': { - 'application/sparql-results+json': 'http://www.w3.org/ns/formats/SPARQL_Results_JSON' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySparqlJsonSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlXmlSparqlSerializer = new (require('@comunica/actor-sparql-serialize-sparql-xml').ActorSparqlSerializeSparqlXml)({ - 'mediaTypes': { - 'application/sparql-results+xml': '1.0' - }, - 'mediaTypeFormats': { - 'application/sparql-results+xml': 'http://www.w3.org/ns/formats/SPARQL_Results_XML' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#mySparqlXmlSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTableSparqlSerializer = new (require('@comunica/actor-sparql-serialize-table').ActorSparqlSerializeTable)({ - 'columnWidth': 50, - 'mediaTypes': { - 'table': '1.0' - }, - 'mediaTypeFormats': { - 'table': 'https://comunica.linkeddatafragments.org/#results_table' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myTableSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTreeSparqlSerializer = new (require('@comunica/actor-sparql-serialize-tree').ActorSparqlSerializeTree)({ - 'mediaTypes': { - 'tree': '0.9' - }, - 'mediaTypeFormats': { - 'tree': 'https://comunica.linkeddatafragments.org/#results_tree' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myTreeSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorContextPreprocess = new (require('@comunica/mediator-combine-pipeline').MediatorCombinePipeline)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-init.json#mediatorContextPreprocess', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_context_preprocess_Bus_ContextPreprocess -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation = new (require('@comunica/mediator-number').MediatorNumber)({ - 'field': 'httpRequests', - 'type': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number/Mediator/Number/type/TypeMin', - 'ignoreErrors': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mediatorQueryOperation', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myEmptyBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-empty').ActorQueryOperationBgpEmpty)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myEmptyBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myValuesQueryOperator = new (require('@comunica/actor-query-operation-values').ActorQueryOperationValues)({ - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myValuesQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_memento_json_myHttpFetcher = new (require('@comunica/actor-http-memento').ActorHttpMemento)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/http-memento.json#myHttpFetcher', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserJsonLd = new (require('@comunica/actor-rdf-parse-jsonld').ActorRdfParseJsonLd)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'mediaTypes': { - 'application/ld+json': '1.0', - 'application/json': '0.5' - }, - 'mediaTypeFormats': { - 'application/ld+json': 'http://www.w3.org/ns/formats/JSON-LD', - 'application/json': 'http://www.w3.org/ns/formats/JSON-LD' - }, - 'priorityScale': '9.0E-1', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserJsonLd', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_Bus_RdfParse -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_mySparqlQuadPatternResolver = new (require('@comunica/actor-rdf-resolve-hypermedia-sparql').ActorRdfResolveHypermediaSparql)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'checkUrlSuffix': true, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-sparql.json#mySparqlQuadPatternResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_Bus_RdfResolveHypermedia -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_mySparqlEndpointResolver = new (require('@comunica/actor-query-operation-sparql-endpoint').ActorQueryOperationSparqlEndpoint)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-sparql.json#mySparqlEndpointResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myStatsSparqlSerializer = new (require('@comunica/actor-sparql-serialize-stats').ActorSparqlSerializeStats)({ - 'httpObserver': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_sparql_serialize_stats_Actor_SparqlSerialize_Stats_httpObserver_default, - 'mediaTypes': { - 'stats': '1.0' - }, - 'mediaTypeFormats': { - 'stats': 'https://comunica.linkeddatafragments.org/#results_stats' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myStatsSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinMultiActor = new (require('@comunica/actor-rdf-join-multi-smallest').ActorRdfJoinMultiSmallest)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/join.json#myRdfJoinMultiActor', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_join_Bus_RdfJoin -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_myRdfDereferencer = new (require('@comunica/actor-rdf-dereference-http-parse').ActorRdfDereferenceHttpParse)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'mediatorRdfParseMediatypes': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_mediatorRdfParseMediatypes, - 'mediatorRdfParseHandle': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_mediatorRdfParseHandle, - 'maxAcceptHeaderLength': 1024, - 'maxAcceptHeaderLengthBrowser': 128, - 'mediaMappings': { - 'ttl': 'text/turtle', - 'turtle': 'text/turtle', - 'nt': 'application/n-triples', - 'ntriples': 'application/n-triples', - 'nq': 'application/n-quads', - 'nquads': 'application/n-quads', - 'rdf': 'application/rdf+xml', - 'rdfxml': 'application/rdf+xml', - 'owl': 'application/rdf+xml', - 'n3': 'text/n3', - 'trig': 'application/trig', - 'jsonld': 'application/ld+json', - 'json': 'application/json', - 'html': 'text/html', - 'htm': 'text/html', - 'xhtml': 'application/xhtml+xml', - 'xht': 'application/xhtml+xml', - 'xml': 'application/xml', - 'svg': 'image/svg+xml', - 'svgz': 'image/svg+xml' - }, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-dereference.json#myRdfDereferencer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_dereference_Bus_RdfDereference -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtmlScript = new (require('@comunica/actor-rdf-parse-html-script').ActorRdfParseHtmlScript)({ - 'mediatorRdfParseMediatypes': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_mediatorRdfParseMediatypes, - 'mediatorRdfParseHandle': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_mediatorRdfParseHandle, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/rdf-parsers.json#myRdfParserHtmlScript', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_parse_html_Bus_RdfParseHtml -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myRdfSparqlSerializer = new (require('@comunica/actor-sparql-serialize-rdf').ActorSparqlSerializeRdf)({ - 'mediatorRdfSerialize': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mediatorRdfSerialize, - 'mediatorMediaTypeCombiner': __b0bnode318, - 'mediatorMediaTypeFormatCombiner': __b1bnode318, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-serializers.json#myRdfSparqlSerializer', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_sparql_serialize_Bus_SparqlSerialize -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_federated_json_myFederatedQuadPatternResolver = new (require('@comunica/actor-rdf-resolve-quad-pattern-federated').ActorRdfResolveQuadPatternFederated)({ - 'mediatorResolveQuadPattern': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern, - 'skipEmptyPatterns': false, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-federated.json#myFederatedQuadPatternResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myQuadPatternQueryOperator = new (require('@comunica/actor-query-operation-quadpattern').ActorQueryOperationQuadpattern)({ - 'mediatorResolveQuadPattern': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorResolveQuadPattern, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myQuadPatternQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaQpfResolver = new (require('@comunica/actor-rdf-resolve-hypermedia-qpf').ActorRdfResolveHypermediaQpf)({ - 'mediatorMetadata': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadata, - 'mediatorMetadataExtract': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadataExtract, - 'mediatorRdfDereference': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfDereference, - 'subjectUri': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#subject', - 'predicateUri': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate', - 'objectUri': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#object', - 'graphUri': 'http://www.w3.org/ns/sparql-service-description#graph', - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myHypermediaQpfResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_hypermedia_Bus_RdfResolveHypermedia -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myQuadPatternHypermediaResolver = new (require('@comunica/actor-rdf-resolve-quad-pattern-hypermedia').ActorRdfResolveQuadPatternHypermedia)({ - 'mediatorRdfDereference': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfDereference, - 'mediatorMetadata': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadata, - 'mediatorMetadataExtract': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorMetadataExtract, - 'mediatorRdfResolveHypermedia': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfResolveHypermedia, - 'mediatorRdfResolveHypermediaLinks': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_mediatorRdfResolveHypermediaLinks, - 'cacheSize': 100, - 'httpInvalidator': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_rdf_resolve_quad_pattern_hypermedia_Actor_RdfResolveQuadPattern_Hypermedia_httpInvalidator_default, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/resolve-hypermedia.json#myQuadPatternHypermediaResolver', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_rdf_resolve_quad_pattern_Bus_RdfResolveQuadPattern -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_myHttpProxy = new (require('@comunica/actor-http-proxy').ActorHttpProxy)({ - 'mediatorHttp': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_mediatorHttp, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/http.json#myHttpProxy', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_http_Bus_Http, - 'beforeActors': [ - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_myHttpFetcher - ] -}); -const urn_comunica_sparqlinit = new (require('./index.js').ActorInitSparql)({ - 'mediatorOptimizeQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorOptimizeQueryOperation, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'mediatorSparqlParse': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlParse, - 'mediatorSparqlSerialize': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorSparqlSerialize, - 'mediatorSparqlSerializeMediaTypeCombiner': __b0bnode312, - 'mediatorSparqlSerializeMediaTypeFormatCombiner': __b1bnode312, - 'mediatorContextPreprocess': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorContextPreprocess, - 'mediatorHttpInvalidate': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_init_json_mediatorHttpInvalidate, - 'logger': __b16bnode134, - 'contextKeyShortcuts': { - 'source': '@comunica/bus-rdf-resolve-quad-pattern:source', - 'sources': '@comunica/bus-rdf-resolve-quad-pattern:sources', - 'initialBindings': '@comunica/actor-init-sparql:initialBindings', - 'queryFormat': '@comunica/actor-init-sparql:queryFormat', - 'baseIRI': '@comunica/actor-init-sparql:baseIRI', - 'log': '@comunica/core:log', - 'datetime': '@comunica/actor-http-memento:datetime', - 'queryTimestamp': '@comunica/actor-init-sparql:queryTimestamp', - 'httpProxyHandler': '@comunica/actor-http-proxy:httpProxyHandler', - 'lenient': '@comunica/actor-init-sparql:lenient' - }, - 'name': 'urn:comunica:sparqlinit', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myAskQueryOperator = new (require('@comunica/actor-query-operation-ask').ActorQueryOperationAsk)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myAskQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myServiceQueryOperator = new (require('@comunica/actor-query-operation-service').ActorQueryOperationService)({ - 'forceSparqlEndpoint': false, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myServiceQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySliceQueryOperator = new (require('@comunica/actor-query-operation-slice').ActorQueryOperationSlice)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mySliceQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySingleBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-single').ActorQueryOperationBgpSingle)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#mySingleBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftDeepSmallestBgpQueryOperator = new (require('@comunica/actor-query-operation-bgp-left-deep-smallest').ActorQueryOperationBgpLeftDeepSmallest)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myLeftDeepSmallestBgpQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myConstructQueryOperator = new (require('@comunica/actor-query-operation-construct').ActorQueryOperationConstruct)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myConstructQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDescribeQueryOperator = new (require('@comunica/actor-query-operation-describe-subject').ActorQueryOperationDescribeSubject)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myDescribeQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDistinctQueryOperator = new (require('@comunica/actor-query-operation-distinct-hash').ActorQueryOperationDistinctHash)({ - 'hashAlgorithm': 'sha1', - 'digestAlgorithm': 'base64', - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myDistinctQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myExtendQueryOperator = new (require('@comunica/actor-query-operation-extend').ActorQueryOperationExtend)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myExtendQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myReducedQueryOperator = new (require('@comunica/actor-query-operation-reduced-hash').ActorQueryOperationReducedHash)({ - 'hashAlgorithm': 'sha1', - 'digestAlgorithm': 'base64', - 'cacheSize': 100, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myReducedQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFilterQueryOperator = new (require('@comunica/actor-query-operation-filter-sparqlee').ActorQueryOperationFilterSparqlee)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myFilterQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFromQueryOperator = new (require('@comunica/actor-query-operation-from-quad').ActorQueryOperationFromQuad)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myFromQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myGroupQueryOperator = new (require('@comunica/actor-query-operation-group').ActorQueryOperationGroup)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myGroupQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myJoinQueryOperator = new (require('@comunica/actor-query-operation-join').ActorQueryOperationJoin)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myJoinQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftJoinQueryOperator = new (require('@comunica/actor-query-operation-leftjoin-left-deep').ActorQueryOperationLeftJoinLeftDeep)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myLeftJoinQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myOrderByQueryOperator = new (require('@comunica/actor-query-operation-orderby-sparqlee').ActorQueryOperationOrderBySparqlee)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myOrderByQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myProjectQueryOperator = new (require('@comunica/actor-query-operation-project').ActorQueryOperationProject)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myProjectQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myUnionQueryOperator = new (require('@comunica/actor-query-operation-union').ActorQueryOperationUnion)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myUnionQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myMinusQueryOperator = new (require('@comunica/actor-query-operation-minus').ActorQueryOperationMinus)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperators.json#myMinusQueryOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myAltPathOperator = new (require('@comunica/actor-query-operation-path-alt').ActorQueryOperationPathAlt)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myAltPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myInvPathOperator = new (require('@comunica/actor-query-operation-path-inv').ActorQueryOperationPathInv)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myInvPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myLinkPathOperator = new (require('@comunica/actor-query-operation-path-link').ActorQueryOperationPathLink)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myLinkPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myNpsPathOperator = new (require('@comunica/actor-query-operation-path-nps').ActorQueryOperationPathNps)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myNpsPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myOneOrMorePathOperator = new (require('@comunica/actor-query-operation-path-one-or-more').ActorQueryOperationPathOneOrMore)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myOneOrMorePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_mySeqPathOperator = new (require('@comunica/actor-query-operation-path-seq').ActorQueryOperationPathSeq)({ - 'mediatorJoin': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorRdfJoin, - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#mySeqPathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrMorePathOperator = new (require('@comunica/actor-query-operation-path-zero-or-more').ActorQueryOperationPathZeroOrMore)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myZeroOrMorePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrOnePathOperator = new (require('@comunica/actor-query-operation-path-zero-or-one').ActorQueryOperationPathZeroOrOne)({ - 'mediatorQueryOperation': https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mediatorQueryOperation, - 'name': 'https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-sparql/^1.0.0/config/sets/sparql-queryoperator-path.json#myZeroOrOnePathOperator', - 'bus': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_query_operation_Bus_QueryOperation -}); -const urn_comunica_my = ({ - 'busInit': https___linkedsoftwaredependencies_org_bundles_npm__comunica_bus_init_Bus_Init, - 'actors': [ - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_myHttpProxy, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_json_myHttpFetcher, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_http_memento_json_myHttpFetcher, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinMultiActor, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_join_json_myRdfJoinActor, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_dereference_json_myRdfDereferencer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializerN3, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_serializers_json_myRdfSerializeJsonLd, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_federated_json_myFederatedQuadPatternResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaQpfResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaNoneResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myQuadPatternHypermediaResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myHypermediaLinksNext, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataPrimaryTopic, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataAll, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataExtractHydraControls, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_hypermedia_json_myRdfMetadataExtractHydraCount, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserN3, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserJsonLd, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserRdfXml, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserXmlRdfa, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtml, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtmlRdfa, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_rdf_parsers_json_myRdfParserHtmlScript, - urn_comunica_sparqlinit, - config_sets_resolve_file_json_myRdfRdfJsSourceQuadPatternResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_graphql_parsers_json_myGraphqlParser, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_optimize_json_myJoinBgpOptimizer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_parsers_json_mySparqlParser, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myAskQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myServiceQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySliceQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myEmptyBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_mySingleBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftDeepSmallestBgpQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myConstructQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDescribeQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myDistinctQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myExtendQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myReducedQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFilterQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myFromQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myGroupQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myJoinQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myLeftJoinQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myOrderByQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myProjectQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myUnionQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myMinusQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myValuesQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperators_json_myQuadPatternQueryOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_mySparqlQuadPatternResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_myRdfMetadataExtractSparqlService, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_resolve_sparql_json_mySparqlEndpointResolver, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myAltPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myInvPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myLinkPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myNpsPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myOneOrMorePathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_mySeqPathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrMorePathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_queryoperator_path_json_myZeroOrOnePathOperator, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myJsonSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myRdfSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySimpleSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlJsonSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_mySparqlXmlSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myStatsSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTableSparqlSerializer, - https___linkedsoftwaredependencies_org_bundles_npm__comunica_actor_init_sparql__1_0_0_config_sets_sparql_serializers_json_myTreeSparqlSerializer - ] -}); -module.exports = urn_comunica_sparqlinit; - -},{"./index.js":21,"@comunica/actor-http-memento":10,"@comunica/actor-http-native":12,"@comunica/actor-http-proxy":15,"@comunica/actor-optimize-query-operation-join-bgp":23,"@comunica/actor-query-operation-ask":25,"@comunica/actor-query-operation-bgp-empty":27,"@comunica/actor-query-operation-bgp-left-deep-smallest":29,"@comunica/actor-query-operation-bgp-single":31,"@comunica/actor-query-operation-construct":33,"@comunica/actor-query-operation-describe-subject":36,"@comunica/actor-query-operation-distinct-hash":38,"@comunica/actor-query-operation-extend":40,"@comunica/actor-query-operation-filter-sparqlee":42,"@comunica/actor-query-operation-from-quad":44,"@comunica/actor-query-operation-group":46,"@comunica/actor-query-operation-join":49,"@comunica/actor-query-operation-leftjoin-left-deep":51,"@comunica/actor-query-operation-minus":53,"@comunica/actor-query-operation-orderby-sparqlee":56,"@comunica/actor-query-operation-path-alt":59,"@comunica/actor-query-operation-path-inv":61,"@comunica/actor-query-operation-path-link":63,"@comunica/actor-query-operation-path-nps":65,"@comunica/actor-query-operation-path-one-or-more":67,"@comunica/actor-query-operation-path-seq":69,"@comunica/actor-query-operation-path-zero-or-more":71,"@comunica/actor-query-operation-path-zero-or-one":73,"@comunica/actor-query-operation-project":75,"@comunica/actor-query-operation-quadpattern":77,"@comunica/actor-query-operation-reduced-hash":79,"@comunica/actor-query-operation-service":82,"@comunica/actor-query-operation-slice":84,"@comunica/actor-query-operation-sparql-endpoint":86,"@comunica/actor-query-operation-union":88,"@comunica/actor-query-operation-values":90,"@comunica/actor-rdf-dereference-http-parse":92,"@comunica/actor-rdf-join-multi-smallest":95,"@comunica/actor-rdf-join-symmetrichash":97,"@comunica/actor-rdf-metadata-all":99,"@comunica/actor-rdf-metadata-extract-hydra-controls":101,"@comunica/actor-rdf-metadata-extract-hydra-count":103,"@comunica/actor-rdf-metadata-extract-sparql-service":105,"@comunica/actor-rdf-metadata-primary-topic":107,"@comunica/actor-rdf-parse-html":114,"@comunica/actor-rdf-parse-html-rdfa":109,"@comunica/actor-rdf-parse-html-script":111,"@comunica/actor-rdf-parse-jsonld":116,"@comunica/actor-rdf-parse-n3":141,"@comunica/actor-rdf-parse-rdfxml":143,"@comunica/actor-rdf-parse-xml-rdfa":145,"@comunica/actor-rdf-resolve-hypermedia-links-next":147,"@comunica/actor-rdf-resolve-hypermedia-none":149,"@comunica/actor-rdf-resolve-hypermedia-qpf":152,"@comunica/actor-rdf-resolve-hypermedia-sparql":155,"@comunica/actor-rdf-resolve-quad-pattern-federated":158,"@comunica/actor-rdf-resolve-quad-pattern-hypermedia":162,"@comunica/actor-rdf-resolve-quad-pattern-rdfjs-source":168,"@comunica/actor-rdf-serialize-jsonld":170,"@comunica/actor-rdf-serialize-n3":172,"@comunica/actor-sparql-parse-algebra":174,"@comunica/actor-sparql-parse-graphql":176,"@comunica/actor-sparql-serialize-json":178,"@comunica/actor-sparql-serialize-rdf":180,"@comunica/actor-sparql-serialize-simple":182,"@comunica/actor-sparql-serialize-sparql-json":184,"@comunica/actor-sparql-serialize-sparql-xml":186,"@comunica/actor-sparql-serialize-stats":188,"@comunica/actor-sparql-serialize-table":191,"@comunica/actor-sparql-serialize-tree":193,"@comunica/bus-http-invalidate":195,"@comunica/core":242,"@comunica/logger-void":249,"@comunica/mediator-all":251,"@comunica/mediator-combine-pipeline":253,"@comunica/mediator-combine-union":255,"@comunica/mediator-number":257,"@comunica/mediator-race":259}],21:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorInitSparql-browser")); -var actor_sparql_serialize_tree_1 = require("@comunica/actor-sparql-serialize-tree"); -exports.bindingsStreamToGraphQl = actor_sparql_serialize_tree_1.bindingsStreamToGraphQl; -/** - * Create a new comunica engine from the default config. - * @return {ActorInitSparql} A comunica engine. - */ -function newEngine() { - return require('./engine-default.js'); -} -exports.newEngine = newEngine; -// TODO: remove in 2.0.0, this is just here for backwards-compatibility -function evaluateQuery(query, context) { - return newEngine().query(query, context); -} -exports.evaluateQuery = evaluateQuery; - -},{"./engine-default.js":20,"./lib/ActorInitSparql-browser":22,"@comunica/actor-sparql-serialize-tree":193}],22:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_init_1 = require("@comunica/bus-init"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const bus_rdf_resolve_quad_pattern_1 = require("@comunica/bus-rdf-resolve-quad-pattern"); -const core_1 = require("@comunica/core"); -const asyncreiterable_1 = require("asyncreiterable"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A browser-safe comunica SPARQL Init Actor. - */ -class ActorInitSparql extends bus_init_1.ActorInit { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - /** - * Evaluate the given query - * @param {string | Algebra.Operation} query A query string or algebra. - * @param context An optional query context. - * @return {Promise} A promise that resolves to the query output. - */ - async query(query, context) { - context = context || {}; - // Expand shortcuts - for (const key in context) { - if (this.contextKeyShortcuts[key]) { - const existingEntry = context[key]; - context[this.contextKeyShortcuts[key]] = existingEntry; - delete context[key]; - } - } - // Set the default logger if none is provided - if (!context[core_1.KEY_CONTEXT_LOG]) { - context[core_1.KEY_CONTEXT_LOG] = this.logger; - } - if (!context[bus_query_operation_1.KEY_CONTEXT_QUERY_TIMESTAMP]) { - context[bus_query_operation_1.KEY_CONTEXT_QUERY_TIMESTAMP] = new Date(); - } - // Ensure sources are an async re-iterable - if (Array.isArray(context[bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES])) { - // TODO: backwards compatibility - context[bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES].map((source) => { - if (typeof source !== 'string' && (source.type === 'auto' || source.type === 'hypermedia')) { - delete source.type; - } - }); - context[bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES] = asyncreiterable_1.AsyncReiterableArray.fromFixedData(context[bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES]); - } - // Prepare context - context = core_1.ActionContext(context); - let queryFormat = 'sparql'; - if (context && context.has(exports.KEY_CONTEXT_QUERYFORMAT)) { - queryFormat = context.get(exports.KEY_CONTEXT_QUERYFORMAT); - context = context.delete(exports.KEY_CONTEXT_QUERYFORMAT); - if (queryFormat === 'graphql' && !context.has(exports.KEY_CONTEXT_GRAPHQL_SINGULARIZEVARIABLES)) { - context = context.set(exports.KEY_CONTEXT_GRAPHQL_SINGULARIZEVARIABLES, {}); - } - } - let baseIRI; - if (context && context.has(bus_query_operation_1.KEY_CONTEXT_BASEIRI)) { - baseIRI = context.get(bus_query_operation_1.KEY_CONTEXT_BASEIRI); - } - // Pre-processing the context - context = (await this.mediatorContextPreprocess.mediate({ context })).context; - // Parse query - let operation; - if (typeof query === 'string') { - const queryParseOutput = await this.mediatorSparqlParse.mediate({ context, query, queryFormat, baseIRI }); - operation = queryParseOutput.operation; - // Update the baseIRI in the context if the query modified it. - if (queryParseOutput.baseIRI) { - context = context.set(bus_query_operation_1.KEY_CONTEXT_BASEIRI, queryParseOutput.baseIRI); - } - } - else { - operation = query; - } - // Apply initial bindings in context - if (context.has(exports.KEY_CONTEXT_INITIALBINDINGS)) { - const bindings = context.get(exports.KEY_CONTEXT_INITIALBINDINGS); - operation = bus_query_operation_1.materializeOperation(operation, bus_query_operation_1.ensureBindings(bindings)); - } - // Optimize the query operation - operation = (await this.mediatorOptimizeQueryOperation.mediate({ context, operation })).operation; - // Execute query - const resolve = { context, operation }; - const output = await this.mediatorQueryOperation.mediate(resolve); - output.context = context; - return output; - } - /** - * @param context An optional context. - * @return {Promise<{[p: string]: number}>} All available SPARQL (weighted) result media types. - */ - async getResultMediaTypes(context) { - return (await this.mediatorSparqlSerializeMediaTypeCombiner.mediate({ context, mediaTypes: true })).mediaTypes; - } - /** - * @param context An optional context. - * @return {Promise<{[p: string]: number}>} All available SPARQL result media type formats. - */ - async getResultMediaTypeFormats(context) { - return (await this.mediatorSparqlSerializeMediaTypeFormatCombiner.mediate({ context, mediaTypeFormats: true })).mediaTypeFormats; - } - /** - * Convert a query result to a string stream based on a certain media type. - * @param {IActorQueryOperationOutput} queryResult A query result. - * @param {string} mediaType A media type. - * @param {ActionContext} context An optional context. - * @return {Promise} A text stream. - */ - async resultToString(queryResult, mediaType, context) { - context = core_1.ActionContext(context); - if (!mediaType) { - switch (queryResult.type) { - case 'bindings': - mediaType = 'application/json'; - break; - case 'quads': - mediaType = 'application/trig'; - break; - default: - mediaType = 'simple'; - break; - } - } - const handle = queryResult; - handle.context = context; - return (await this.mediatorSparqlSerialize.mediate({ context, handle, handleMediaType: mediaType })).handle; - } - /** - * Invalidate all internal caches related to the given page URL. - * If no page URL is given, then all pages will be invalidated. - * @param {string} url The page URL to invalidate. - * @return {Promise} A promise resolving when the caches have been invalidated. - */ - invalidateHttpCache(url) { - return this.mediatorHttpInvalidate.mediate({ url }); - } - async run(action) { - throw new Error('ActorInitSparql#run is not supported in the browser.'); - } -} -exports.ActorInitSparql = ActorInitSparql; -ActorInitSparql.ALGEBRA_TYPES = Object.keys(sparqlalgebrajs_1.Algebra.types) - .reduce((acc, key) => { acc[sparqlalgebrajs_1.Algebra.types[key]] = true; return acc; }, {}); -exports.KEY_CONTEXT_INITIALBINDINGS = '@comunica/actor-init-sparql:initialBindings'; -exports.KEY_CONTEXT_QUERYFORMAT = '@comunica/actor-init-sparql:queryFormat'; -exports.KEY_CONTEXT_GRAPHQL_SINGULARIZEVARIABLES = '@comunica/actor-init-sparql:singularizeVariables'; -exports.KEY_CONTEXT_LENIENT = '@comunica/actor-init-sparql:lenient'; - -},{"@comunica/bus-init":201,"@comunica/bus-query-operation":205,"@comunica/bus-rdf-resolve-quad-pattern":231,"@comunica/core":242,"asyncreiterable":298,"sparqlalgebrajs":608}],23:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorOptimizeQueryOperationJoinBgp")); - -},{"./lib/ActorOptimizeQueryOperationJoinBgp":24}],24:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_optimize_query_operation_1 = require("@comunica/bus-optimize-query-operation"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Join BGP Optimize Query Operation Actor. - */ -class ActorOptimizeQueryOperationJoinBgp extends bus_optimize_query_operation_1.ActorOptimizeQueryOperation { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - async run(action) { - const operation = sparqlalgebrajs_1.Util.mapOperation(action.operation, { - join: (op, factory) => { - if (op.left.type === 'bgp' && op.right.type === 'bgp') { - return { - recurse: false, - result: factory.createBgp(op.left.patterns.concat(op.right.patterns)), - }; - } - else { - return { - recurse: false, - result: op, - }; - } - }, - }); - return { operation }; - } -} -exports.ActorOptimizeQueryOperationJoinBgp = ActorOptimizeQueryOperationJoinBgp; - -},{"@comunica/bus-optimize-query-operation":203,"sparqlalgebrajs":608}],25:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationAsk")); - -},{"./lib/ActorQueryOperationAsk":26}],26:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Ask Query Operation Actor. - */ -class ActorQueryOperationAsk extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'ask'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Call other query operations like this: - const output = await this.mediatorQueryOperation.mediate({ operation: pattern.input, context }); - const bindings = bus_query_operation_1.ActorQueryOperation.getSafeBindings(output); - const booleanResult = new Promise((resolve, reject) => { - // Resolve to true if we find one element, and close immediately - bindings.bindingsStream.once('data', () => { - resolve(true); - bindings.bindingsStream.close(); - }); - // If we reach the end of the stream without finding anything, resolve to false - bindings.bindingsStream.on('end', () => resolve(false)); - // Reject if an error occurs in the stream - bindings.bindingsStream.on('error', reject); - }); - return { type: 'boolean', booleanResult }; - } -} -exports.ActorQueryOperationAsk = ActorQueryOperationAsk; - -},{"@comunica/bus-query-operation":205}],27:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationBgpEmpty")); - -},{"./lib/ActorQueryOperationBgpEmpty":28}],28:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_1 = require("asynciterator"); -/** - * A comunica Query Operation Actor for empty BGPs. - */ -class ActorQueryOperationBgpEmpty extends bus_query_operation_1.ActorQueryOperationTyped { - constructor(args) { - super(args, 'bgp'); - } - async testOperation(pattern, context) { - if (pattern.patterns.length !== 0) { - throw new Error('Actor ' + this.name + ' can only operate on empty BGPs.'); - } - return true; - } - async runOperation(pattern, context) { - return { - bindingsStream: new asynciterator_1.SingletonIterator(bus_query_operation_1.Bindings({})), - metadata: () => Promise.resolve({ totalItems: 1 }), - type: 'bindings', - variables: [], - }; - } -} -exports.ActorQueryOperationBgpEmpty = ActorQueryOperationBgpEmpty; - -},{"@comunica/bus-query-operation":205,"asynciterator":291}],29:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationBgpLeftDeepSmallest")); - -},{"./lib/ActorQueryOperationBgpLeftDeepSmallest":30}],30:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_1 = require("asynciterator"); -const asynciterator_promiseproxy_1 = require("asynciterator-promiseproxy"); -const rdf_string_1 = require("rdf-string"); -const rdf_terms_1 = require("rdf-terms"); -/** - * A comunica Query Operation Actor that resolves BGPs in a left-deep manner - * based on the pattern with the smallest item count. - */ -class ActorQueryOperationBgpLeftDeepSmallest extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'bgp'); - } - /** - * Create a new bindings stream - * that takes every binding of the base stream, - * materializes the remaining patterns with it, - * and emits all bindings from this new set of patterns. - * @param {BindingsStream} baseStream The base stream. - * @param {Algebra.Pattern[]} patterns The patterns to materialize with each binding of the base stream. - * @param {{ pattern: Algebra.Pattern, bindings: IPatternBindings }[]) => Promise} - * patternBinder A callback - * to retrieve the bindings stream of an array of patterns. - * @return {BindingsStream} - */ - static createLeftDeepStream(baseStream, patterns, patternBinder) { - const bindingsStream = new asynciterator_1.MultiTransformIterator(baseStream); - bindingsStream._createTransformer = (bindings) => { - const bindingsMerger = (subBindings) => subBindings.merge(bindings); - return new asynciterator_promiseproxy_1.PromiseProxyIterator(async () => (await patternBinder(ActorQueryOperationBgpLeftDeepSmallest.materializePatterns(patterns, bindings))).map(bindingsMerger), { autoStart: true, maxBufferSize: 128 }); - }; - return bindingsStream; - } - /** - * Get the combined list of variables of the given pattern outputs. - * @param {IActorQueryOperationOutput[]} patternOutputs An array of query operation outputs - * @return {string[]} The array of variable names. - */ - static getCombinedVariables(patternOutputs) { - return require('lodash.uniq')([].concat.apply([], patternOutputs.map((patternOutput) => patternOutput.variables))); - } - /** - * Find the pattern index with the smallest number of elements. - * @param {{[p: string]: any}[]} metadatas An array of optional metadata objects for the patterns. - * @return {number} The index of the pattern with the smallest number of elements. - */ - static getSmallestPatternId(metadatas) { - let smallestId = -1; - let smallestCount = Infinity; - for (let i = 0; i < metadatas.length; i++) { - const meta = metadatas[i]; - const count = ActorQueryOperationBgpLeftDeepSmallest.getTotalItems(meta); - if (count <= smallestCount) { - smallestCount = count; - smallestId = i; - } - } - return smallestId; - } - /** - * Estimate an upper bound for the total number of items from the given metadata. - * @param {{[p: string]: any}} smallestPattern The optional metadata for the pattern - * with the smallest number of elements. - * @param {{[p: string]: any}[]} otherPatterns The array of optional metadata for the other patterns. - * @return {number} The estimated number of total items. - */ - static estimateCombinedTotalItems(smallestPattern, otherPatterns) { - const smallestCount = ActorQueryOperationBgpLeftDeepSmallest.getTotalItems(smallestPattern); - return otherPatterns - .map((otherPattern) => smallestCount * ActorQueryOperationBgpLeftDeepSmallest.getTotalItems(otherPattern)) - .reduce((sum, element) => sum + element, 0); - } - /** - * Get the estimated number of items from the given metadata. - * @param {{[p: string]: any}} metadata An optional metadata object. - * @return {number} The estimated number of items, or `Infinity` if metadata is falsy. - */ - static getTotalItems(metadata) { - const totalItems = (metadata || {}).totalItems; - return totalItems || totalItems === 0 ? totalItems : Infinity; - } - /** - * Materialize all patterns in the given pattern array with the given bindings. - * @param {Pattern[]} patterns SPARQL algebra patterns. - * @param {Bindings} bindings A bindings object. - * @return { pattern: Algebra.Pattern, bindings: IPatternBindings }[] An array of patterns with their bindings. - */ - static materializePatterns(patterns, bindings) { - return patterns.map((pattern) => ActorQueryOperationBgpLeftDeepSmallest.materializePattern(pattern, bindings)); - } - /** - * Materialize a pattern with the given bindings. - * @param {Pattern} pattern A SPARQL algebra pattern. - * @param {Bindings} bindings A bindings object. - * @return { pattern: Algebra.Pattern, bindings: IPatternBindings } A new materialized pattern. - */ - static materializePattern(pattern, bindings) { - const bindingsOut = {}; - const patternOut = Object.assign(rdf_terms_1.mapTerms(pattern, (term, termPosition) => { - const materializedTerm = ActorQueryOperationBgpLeftDeepSmallest.materializeTerm(term, bindings); - if (term !== materializedTerm) { - bindingsOut[termPosition] = term; - } - return materializedTerm; - }), { type: 'pattern', context: pattern.context }); - return { pattern: patternOut, bindings: bindingsOut }; - } - /** - * Materialize a term with the given binding. - * - * If the given term is a variable (or blank node) - * and that variable exist in the given bindings object, - * the value of that binding is returned. - * In all other cases, the term itself is returned. - * - * @param {RDF.Term} term A term. - * @param {Bindings} bindings A bindings object. - * @return {RDF.Term} The materialized term. - */ - static materializeTerm(term, bindings) { - if (term.termType === 'Variable') { - const value = bindings.get(rdf_string_1.termToString(term)); - if (value) { - return value; - } - } - return term; - } - /** - * Check if at least one of the given outputs has an empty output, i.e., when the estimated count is zero. - * @param {IActorQueryOperationOutputBindings[]} patternOutputs Pattern outputs. - * @return {Promise} A promise for indicating whether or not at least one of the outputs is empty. - */ - static async hasOneEmptyPatternOutput(patternOutputs) { - for (const patternOutput of patternOutputs) { - if (patternOutput.metadata) { - const metadata = await patternOutput.metadata(); - if (!ActorQueryOperationBgpLeftDeepSmallest.getTotalItems(metadata)) { - return true; - } - } - } - return false; - } - async testOperation(pattern, context) { - if (pattern.patterns.length < 2) { - throw new Error('Actor ' + this.name + ' can only operate on BGPs with at least two patterns.'); - } - return true; - } - async runOperation(pattern, context) { - // Get the total number of items for all patterns by resolving the quad patterns - const patternOutputs = (await Promise.all(pattern.patterns - .map((subPattern) => this.mediatorQueryOperation.mediate({ operation: subPattern, context })))) - .map(bus_query_operation_1.ActorQueryOperation.getSafeBindings); - // If a triple pattern has no matches, the entire graph pattern has no matches. - if (await ActorQueryOperationBgpLeftDeepSmallest.hasOneEmptyPatternOutput(patternOutputs)) { - return { - bindingsStream: new asynciterator_1.EmptyIterator(), - metadata: () => Promise.resolve({ totalItems: 0 }), - type: 'bindings', - variables: [], - }; - } - // Find the pattern with the smallest number of elements - const metadatas = await Promise.all(patternOutputs.map(async (patternOutput) => patternOutput.metadata ? await patternOutput.metadata() : {})); - const smallestId = ActorQueryOperationBgpLeftDeepSmallest.getSmallestPatternId(metadatas); - this.logDebug(context, 'Smallest pattern: ', { pattern: pattern.patterns[smallestId], metadata: metadatas[smallestId] }); - // Close the non-smallest streams - for (let i = 0; i < patternOutputs.length; i++) { - if (i !== smallestId) { - patternOutputs[i].bindingsStream.close(); - } - } - // Take the pattern with the smallest number of items - const smallestPattern = patternOutputs.slice(smallestId)[0]; - const remainingPatterns = pattern.patterns.concat([]); - remainingPatterns.splice(smallestId, 1); - const remainingMetadatas = metadatas.concat([]); - remainingMetadatas.splice(smallestId, 1); - // Check if the output type is correct - bus_query_operation_1.ActorQueryOperation.validateQueryOutput(smallestPattern, 'bindings'); - // Materialize the remaining patterns for each binding in the stream. - const subContext = context && context - .set(bus_query_operation_1.KEY_CONTEXT_BGP_CURRENTMETADATA, metadatas[smallestId]) - .set(bus_query_operation_1.KEY_CONTEXT_BGP_PARENTMETADATA, remainingMetadatas); - const bindingsStream = ActorQueryOperationBgpLeftDeepSmallest.createLeftDeepStream(smallestPattern.bindingsStream, remainingPatterns, async (patterns) => { - // Send the materialized patterns to the mediator for recursive BGP evaluation. - const operation = { type: 'bgp', patterns: patterns.map((p) => p.pattern) }; - const bindings = patterns.map((p) => p.bindings); - return bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation, context: subContext.set(bus_query_operation_1.KEY_CONTEXT_BGP_PATTERNBINDINGS, bindings) })).bindingsStream; - }); - // Prepare variables and metadata - const variables = ActorQueryOperationBgpLeftDeepSmallest.getCombinedVariables(patternOutputs); - const metadata = () => Promise.resolve({ - totalItems: ActorQueryOperationBgpLeftDeepSmallest.estimateCombinedTotalItems(metadatas[smallestId], metadatas.slice(smallestId)), - }); - return { type: 'bindings', bindingsStream, variables, metadata }; - } -} -exports.ActorQueryOperationBgpLeftDeepSmallest = ActorQueryOperationBgpLeftDeepSmallest; - -},{"@comunica/bus-query-operation":205,"asynciterator":291,"asynciterator-promiseproxy":287,"lodash.uniq":505,"rdf-string":559,"rdf-terms":561}],31:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationBgpSingle")); - -},{"./lib/ActorQueryOperationBgpSingle":32}],32:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Query Operation Actor for BGPs with a single pattern. - */ -class ActorQueryOperationBgpSingle extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'bgp'); - } - async testOperation(pattern, context) { - if (pattern.patterns.length !== 1) { - throw new Error('Actor ' + this.name + ' can only operate on BGPs with a single pattern.'); - } - return true; - } - runOperation(pattern, context) { - // If we have parent metadata, extract the single parent metadata entry. - if (context && context.has(bus_query_operation_1.KEY_CONTEXT_BGP_PARENTMETADATA)) { - const metadatas = context.get(bus_query_operation_1.KEY_CONTEXT_BGP_PARENTMETADATA); - context = context.delete(bus_query_operation_1.KEY_CONTEXT_BGP_PARENTMETADATA); - context = context.set(bus_query_operation_1.KEY_CONTEXT_PATTERN_PARENTMETADATA, metadatas[0]); - } - return this.mediatorQueryOperation.mediate({ operation: pattern.patterns[0], context }); - } -} -exports.ActorQueryOperationBgpSingle = ActorQueryOperationBgpSingle; - -},{"@comunica/bus-query-operation":205}],33:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationConstruct")); - -},{"./lib/ActorQueryOperationConstruct":34}],34:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const rdf_terms_1 = require("rdf-terms"); -const BindingsToQuadsIterator_1 = require("./BindingsToQuadsIterator"); -/** - * A comunica Construct Query Operation Actor. - */ -class ActorQueryOperationConstruct extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'construct'); - } - /** - * Find all variables in a list of triple patterns. - * @param {Algebra.Pattern[]} patterns An array of triple patterns. - * @return {RDF.Variable[]} The variables in the triple patterns. - */ - static getVariables(patterns) { - return rdf_terms_1.uniqTerms([].concat.apply([], patterns.map((pattern) => rdf_terms_1.getVariables(rdf_terms_1.getTerms(pattern))))); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Apply a projection on our CONSTRUCT variables first, as the query may contain other variables as well. - const variables = ActorQueryOperationConstruct.getVariables(pattern.template); - const operation = { type: 'project', input: pattern.input, variables }; - // Evaluate the input query - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation, context })); - // construct triples using the result based on the pattern. - const quadStream = new BindingsToQuadsIterator_1.BindingsToQuadsIterator(pattern.template, output.bindingsStream); - // Let the final metadata contain the estimated number of triples - let metadata = null; - if (output.metadata) { - metadata = () => output.metadata().then((m) => { - if (m) { - if (m.totalItems) { - return Object.assign({}, m, { totalItems: m.totalItems * pattern.template.length }); - } - return m; - } - return null; - }); - } - return { - metadata, - quadStream, - type: 'quads', - }; - } -} -exports.ActorQueryOperationConstruct = ActorQueryOperationConstruct; - -},{"./BindingsToQuadsIterator":35,"@comunica/bus-query-operation":205,"rdf-terms":561}],35:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const data_model_1 = require("@rdfjs/data-model"); -const asynciterator_1 = require("asynciterator"); -const rdf_terms_1 = require("rdf-terms"); -/** - * Transforms a bindings stream into a quad stream given a quad template. - * - * This conforms to the SPARQL 1.1 spec on constructing triples: - * https://www.w3.org/TR/sparql11-query/#rConstructTriples - */ -class BindingsToQuadsIterator extends asynciterator_1.MultiTransformIterator { - constructor(template, bindingsStream) { - super(bindingsStream); - this.template = template; - this.blankNodeCounter = 0; - } - /** - * Bind the given term. - * If the term is a variable and the variable is bound in the bindings object, - * return the bindings value. - * If the term is a variable and the variable is not bound in the bindings object, - * a falsy value is returned.. - * Otherwise, the term itself is returned. - * @param {Bindings} bindings A bindings object. - * @param {RDF.Term} term An RDF term. - * @return {RDF.Term} If the given term is not a variable, the term itself is returned. - * If the given term is a variable, then the bound term is returned, - * or a falsy value if it did not exist in the bindings. - */ - static bindTerm(bindings, term) { - if (term.termType === 'Variable') { - return bindings.get('?' + term.value); - } - return term; - } - /** - * Bind the given quad pattern. - * If one of the terms was a variable AND is not bound in the bindings, - * a falsy value will be returned. - * @param {Bindings} bindings A bindings object. - * @param {RDF.Quad} pattern An RDF quad. - * @return {RDF.Quad} A bound RDF quad or falsy. - */ - static bindQuad(bindings, pattern) { - try { - return rdf_terms_1.mapTerms(pattern, (term) => { - const boundTerm = BindingsToQuadsIterator.bindTerm(bindings, term); - if (!boundTerm) { - throw new Error('Unbound term'); - } - return boundTerm; - }); - } - catch (error) { - return null; - } - } - /** - * Convert a blank node to a unique blank node in the given context. - * If the given term is not a blank node, the term itself will be returned. - * @param blankNodeCounter A counter value for the blank node. - * @param {RDF.Term} term The term that should be localized. - * @return {RDF.Term} A term. - */ - static localizeBlankNode(blankNodeCounter, term) { - if (term.termType === 'BlankNode') { - return data_model_1.blankNode(term.value + blankNodeCounter); - } - return term; - } - /** - * Convert the given quad to a quad that only contains unique blank nodes. - * @param blankNodeCounter A counter value for the blank node. - * @param {RDF.BaseQuad} pattern The pattern that should be localized. - * @return {RDF.BaseQuad} A quad. - */ - static localizeQuad(blankNodeCounter, pattern) { - return rdf_terms_1.mapTerms(pattern, (term) => BindingsToQuadsIterator.localizeBlankNode(blankNodeCounter, term)); - } - /** - * Convert the given template to a list of quads based on the given bindings. - * @param {Bindings} bindings A bindings object. - * @param {RDF.Quad[]} template A list of quad patterns. - * @param blankNodeCounter A counter value for the blank node. - * @return {RDF.Quad[]} A list of quads. - */ - static bindTemplate(bindings, template, blankNodeCounter) { - return template - // Bind variables to bound terms - .map(BindingsToQuadsIterator.bindQuad.bind(null, bindings)) - // Remove quads that contained unbound terms, i.e., variables. - .filter((q) => !!q) - // Make sure the multiple instantiations of the template contain different blank nodes, as required by SPARQL 1.1. - .map(BindingsToQuadsIterator.localizeQuad.bind(null, blankNodeCounter)); - } - _createTransformer(bindings) { - return new asynciterator_1.ArrayIterator(BindingsToQuadsIterator.bindTemplate(bindings, this.template, this.blankNodeCounter++)); - } -} -exports.BindingsToQuadsIterator = BindingsToQuadsIterator; - -},{"@rdfjs/data-model":263,"asynciterator":291,"rdf-terms":561}],36:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationDescribeSubject")); - -},{"./lib/ActorQueryOperationDescribeSubject":37}],37:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_query_operation_union_1 = require("@comunica/actor-query-operation-union"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const data_model_1 = require("@rdfjs/data-model"); -const asynciterator_union_1 = require("asynciterator-union"); -/** - * A comunica Describe Subject Query Operation Actor. - */ -class ActorQueryOperationDescribeSubject extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'describe'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Create separate construct queries for all non-variable terms - const operations = pattern.terms - .filter((term) => term.termType !== 'Variable') - .map((term) => { - // Transform each term to a separate construct operation with S ?p ?o patterns (BGP) for all terms - const patterns = [ - data_model_1.triple(term, data_model_1.variable('__predicate'), data_model_1.variable('__object')), - ]; - patterns.forEach((templatePattern) => templatePattern.type = 'pattern'); - const templateOperation = { type: 'bgp', patterns: patterns }; - // Create a construct query - return { - input: templateOperation, - template: patterns, - type: 'construct', - }; - }); - // If we have variables in the term list, - // create one separate construct operation to determine these variables using the input pattern. - if (operations.length !== pattern.terms.length) { - let variablePatterns = []; - pattern.terms - .filter((term) => term.termType === 'Variable') - .forEach((term, i) => { - // Transform each term to an S ?p ?o pattern in a non-conflicting way - const patterns = [ - data_model_1.triple(term, data_model_1.variable('__predicate' + i), data_model_1.variable('__object' + i)), - ]; - patterns.forEach((templatePattern) => templatePattern.type = 'pattern'); - variablePatterns = variablePatterns.concat(patterns); - }); - // Add a single construct for the variables - // This requires a join between the input pattern and our variable patterns that form a simple BGP - operations.push({ - input: { type: 'join', left: pattern.input, right: { type: 'bgp', patterns: variablePatterns } }, - template: variablePatterns, - type: 'construct', - }); - } - // Evaluate the construct queries - const outputs = (await Promise.all(operations.map((operation) => this.mediatorQueryOperation.mediate({ operation, context })))) - .map(bus_query_operation_1.ActorQueryOperation.getSafeQuads); - // Take the union of all quad streams - const quadStream = new asynciterator_union_1.RoundRobinUnionIterator(outputs.map((output) => output.quadStream)); - // Take union of metadata - const metadata = () => Promise.all(outputs - .map((output) => output.metadata) - .filter((m) => !!m) - .map((m) => m())) - .then(actor_query_operation_union_1.ActorQueryOperationUnion.unionMetadata); - return { type: 'quads', quadStream, metadata }; - } -} -exports.ActorQueryOperationDescribeSubject = ActorQueryOperationDescribeSubject; - -},{"@comunica/actor-query-operation-union":88,"@comunica/bus-query-operation":205,"@rdfjs/data-model":263,"asynciterator-union":289}],38:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationDistinctHash")); - -},{"./lib/ActorQueryOperationDistinctHash":39}],39:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_bindings_hash_1 = require("@comunica/actor-abstract-bindings-hash"); -/** - * A comunica Distinct Hash Query Operation Actor. - */ -class ActorQueryOperationDistinctHash extends actor_abstract_bindings_hash_1.AbstractBindingsHash { - constructor(args) { - super(args, 'distinct'); - } - /** - * Create a new distinct filter function for the given hash algorithm and digest algorithm. - * This will maintain an internal hash datastructure so that every bindings object only returns true once. - * @param {string} hashAlgorithm A hash algorithm. - * @param {string} digestAlgorithm A digest algorithm. - * @return {(bindings: Bindings) => boolean} A distinct filter for bindings. - */ - newHashFilter(hashAlgorithm, digestAlgorithm) { - const hashes = {}; - return (bindings) => { - const hash = actor_abstract_bindings_hash_1.AbstractFilterHash.hash(hashAlgorithm, digestAlgorithm, bindings); - return !(hash in hashes) && (hashes[hash] = true); - }; - } -} -exports.ActorQueryOperationDistinctHash = ActorQueryOperationDistinctHash; - -},{"@comunica/actor-abstract-bindings-hash":2}],40:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationExtend")); - -},{"./lib/ActorQueryOperationExtend":41}],41:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rdf_string_1 = require("rdf-string"); -const sparqlee_1 = require("sparqlee"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Extend Query Operation Actor. - * - * See https://www.w3.org/TR/sparql11-query/#sparqlAlgebra; - */ -class ActorQueryOperationExtend extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'extend'); - } - async testOperation(pattern, context) { - // Will throw error for unsupported opperations - const _ = !!new sparqlee_1.AsyncEvaluator(pattern.expression); - return true; - } - async runOperation(pattern, context) { - const { expression, input, variable } = pattern; - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: input, context })); - const extendKey = rdf_string_1.termToString(variable); - const config = Object.assign({}, bus_query_operation_1.ActorQueryOperation.getExpressionContext(context)); - const evaluator = new sparqlee_1.AsyncEvaluator(expression, config); - // Transform the stream by extending each Bindings with the expression result - const transform = async (bindings, next) => { - try { - const result = await evaluator.evaluate(bindings); - // Extend operation is undefined when the key already exists - // We just override it here. - const extended = bindings.set(extendKey, result); - bindingsStream._push(extended); - } - catch (err) { - if (sparqlee_1.isExpressionError(err)) { - // Errors silently don't actually extend according to the spec - bindingsStream._push(bindings); - // But let's warn anyway - this.logWarn(context, `Expression error for extend operation with bindings '${JSON.stringify(bindings)}'`); - } - else { - bindingsStream.emit('error', err); - } - } - next(); - }; - const variables = output.variables.concat([extendKey]); - const bindingsStream = output.bindingsStream.transform({ transform }); - const metadata = output.metadata; - return { type: 'bindings', bindingsStream, metadata, variables }; - } -} -exports.ActorQueryOperationExtend = ActorQueryOperationExtend; - -},{"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlee":614}],42:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationFilterSparqlee")); - -},{"./lib/ActorQueryOperationFilterSparqlee":43}],43:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sparqlee_1 = require("sparqlee"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Filter Sparqlee Query Operation Actor. - */ -class ActorQueryOperationFilterSparqlee extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'filter'); - } - async testOperation(pattern, context) { - // Will throw error for unsupported operators - const config = { exists: this.createExistenceResolver(context) }; - const _ = new sparqlee_1.AsyncEvaluator(pattern.expression, config); - return true; - } - async runOperation(pattern, context) { - const outputRaw = await this.mediatorQueryOperation.mediate({ operation: pattern.input, context }); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(outputRaw); - bus_query_operation_1.ActorQueryOperation.validateQueryOutput(output, 'bindings'); - const { variables, metadata } = output; - const expressionContext = bus_query_operation_1.ActorQueryOperation.getExpressionContext(context); - const config = Object.assign(Object.assign({}, expressionContext), { exists: this.createExistenceResolver(context) }); - const evaluator = new sparqlee_1.AsyncEvaluator(pattern.expression, config); - const transform = async (item, next) => { - try { - const result = await evaluator.evaluateAsEBV(item); - if (result) { - bindingsStream._push(item); - } - } - catch (err) { - if (!sparqlee_1.isExpressionError(err)) { - bindingsStream.emit('error', err); - } - } - next(); - }; - const bindingsStream = output.bindingsStream.transform({ transform }); - return { type: 'bindings', bindingsStream, metadata, variables }; - } - createExistenceResolver(context) { - return async (expr, bindings) => { - const operation = bus_query_operation_1.materializeOperation(expr.input, bindings); - const outputRaw = await this.mediatorQueryOperation.mediate({ operation, context }); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(outputRaw); - return new Promise((resolve, reject) => { - output.bindingsStream.on('end', () => { - resolve(false); - }); - output.bindingsStream.on('error', reject); - output.bindingsStream.on('data', () => { - output.bindingsStream.close(); - resolve(true); - }); - }) - .then((exists) => expr.not ? !exists : exists); - }; - } -} -exports.ActorQueryOperationFilterSparqlee = ActorQueryOperationFilterSparqlee; - -},{"@comunica/bus-query-operation":205,"sparqlee":614}],44:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationFromQuad")); - -},{"./lib/ActorQueryOperationFromQuad":45}],45:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica From Query Operation Actor. - */ -class ActorQueryOperationFromQuad extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'from'); - } - /** - * Create a deep copy of the given operation. - * @param {Operation} operation An operation. - * @param {(subOperation: Operation) => Operation} recursiveCb A callback for recursive operation calls. - * @return {Operation} The copied operation. - */ - static copyOperation(operation, recursiveCb) { - const copiedOperation = {}; - for (const key of Object.keys(operation)) { - if (Array.isArray(operation[key])) { - if (key === 'variables') { - copiedOperation[key] = operation[key]; - } - else { - copiedOperation[key] = operation[key].map(recursiveCb); - } - } - else if (ActorQueryOperationFromQuad.ALGEBRA_TYPES.indexOf(operation[key].type) >= 0) { - copiedOperation[key] = recursiveCb(operation[key]); - } - else { - copiedOperation[key] = operation[key]; - } - } - return copiedOperation; - } - /** - * Recursively transform the given operation to use the given graphs as default graph - * This will (possibly) create a new operation and not modify the given operation. - * @param {Operation} operation An operation. - * @param {RDF.Term[]} defaultGraphs Graph terms. - * @return {Operation} A new operation. - */ - static applyOperationDefaultGraph(operation, defaultGraphs) { - // If the operation is a BGP or Path, change the graph. - if ((operation.type === 'bgp' && operation.patterns.length) || operation.type === 'path') { - if (operation.type === 'bgp') { - return ActorQueryOperationFromQuad.joinOperations(operation.patterns.map((pattern) => { - if (pattern.graph.termType !== 'DefaultGraph') { - return ActorQueryOperationFromQuad.FACTORY.createBgp([pattern]); - } - const bgps = defaultGraphs.map((graph) => ActorQueryOperationFromQuad.FACTORY.createBgp([ActorQueryOperationFromQuad.FACTORY - .createPattern(pattern.subject, pattern.predicate, pattern.object, graph)])); - return ActorQueryOperationFromQuad.unionOperations(bgps); - })); - } - else { - if (operation.graph.termType !== 'DefaultGraph') { - return operation; - } - const paths = defaultGraphs.map((graph) => ActorQueryOperationFromQuad.FACTORY - .createPath(operation.subject, operation.predicate, operation.object, graph)); - return ActorQueryOperationFromQuad.joinOperations(paths); - } - } - return ActorQueryOperationFromQuad.copyOperation(operation, (subOperation) => this.applyOperationDefaultGraph(subOperation, defaultGraphs)); - } - /** - * Recursively transform the given operation to use the given graphs as named graph - * This will (possibly) create a new operation and not modify the given operation. - * @param {Operation} operation An operation. - * @param {RDF.Term[]} namedGraphs Graph terms. - * @return {Operation} A new operation. - */ - static applyOperationNamedGraph(operation, namedGraphs, defaultGraphs) { - // If the operation is a BGP or Path, change the graph. - if ((operation.type === 'bgp' && operation.patterns.length) || operation.type === 'path') { - let patternGraph; - if (operation.type === 'bgp') { - // We assume that the BGP has at least one pattern and all have the same graph. - patternGraph = operation.patterns[0].graph; - } - else { - patternGraph = operation.graph; - } - if (patternGraph.termType === 'DefaultGraph') { - // SPARQL spec (8.2) describes that when FROM NAMED's are used without a FROM, the default graph must be empty. - // The FROMs are transformed before this step to a named node, so this will not apply to this case anymore. - return { type: 'bgp', patterns: [] }; - } - else if (patternGraph.termType === 'Variable') { - if (namedGraphs.length === 1) { - const graph = namedGraphs[0]; - // If the pattern graph is a variable, replace the graph and bind the variable using VALUES - const bindings = {}; - bindings['?' + patternGraph.value] = graph; - const values = ActorQueryOperationFromQuad.FACTORY - .createValues([patternGraph], [bindings]); - let pattern; - if (operation.type === 'bgp') { - pattern = ActorQueryOperationFromQuad.FACTORY - .createBgp(operation.patterns.map((p) => ActorQueryOperationFromQuad.FACTORY - .createPattern(p.subject, p.predicate, p.object, graph))); - } - else { - pattern = ActorQueryOperationFromQuad.FACTORY - .createPath(operation.subject, operation.predicate, operation.object, graph); - } - return ActorQueryOperationFromQuad.FACTORY.createJoin(values, pattern); - } - else { - // If the pattern graph is a variable, take the union of the pattern applied to each available named graph - return ActorQueryOperationFromQuad.unionOperations(namedGraphs.map((graph) => ActorQueryOperationFromQuad.applyOperationNamedGraph(operation, [graph], defaultGraphs))); - } - } - else { - // The pattern's graph is defined (including the default graphs) - const isNamedGraphAvailable = require('lodash.find')(namedGraphs.concat(defaultGraphs), (namedGraph) => namedGraph.equals(patternGraph)); - if (isNamedGraphAvailable) { - // Return the pattern as-is if the pattern's graph was selected in a FROM NAMED - return operation; - } - else { - // No-op if the pattern's graph was not selected in a FROM NAMED. - return { type: 'bgp', patterns: [] }; - } - } - } - return ActorQueryOperationFromQuad.copyOperation(operation, (subOperation) => this.applyOperationNamedGraph(subOperation, namedGraphs, defaultGraphs)); - } - /** - * Transform the given array of operations into a join operation. - * @param {Operation[]} operations An array of operations, must contain at least one operation. - * @return {Join} A join operation. - */ - static joinOperations(operations) { - if (operations.length === 1) { - return operations[0]; - } - else if (operations.length === 2) { - return ActorQueryOperationFromQuad.FACTORY.createJoin(operations[0], operations[1]); - } - else if (operations.length > 2) { - return ActorQueryOperationFromQuad.FACTORY.createJoin(operations.shift(), this.joinOperations(operations)); - } - else { - throw new Error('A join can only be applied on at least one operation'); - } - } - /** - * Transform the given array of operations into a union operation. - * @param {Operation[]} operations An array of operations, must contain at least one operation. - * @return {Union} A union operation. - */ - static unionOperations(operations) { - if (operations.length === 1) { - return operations[0]; - } - else if (operations.length === 2) { - return ActorQueryOperationFromQuad.FACTORY.createUnion(operations[0], operations[1]); - } - else if (operations.length > 2) { - return ActorQueryOperationFromQuad.FACTORY.createUnion(operations.shift(), this.unionOperations(operations)); - } - else { - throw new Error('A union can only be applied on at least one operation'); - } - } - /** - * Transform an operation based on the default and named graphs in the pattern. - * - * FROM sets the default graph. - * If multiple are available, take the union of the operation for all of them at quad-pattern level. - * - * FROM NAMED indicates which named graphs are available. - * This will rewrite the query so that only triples from the given named graphs can be selected. - * - * @param {From} pattern A from operation. - * @return {Operation} The transformed operation. - */ - static createOperation(pattern) { - let operation = pattern.input; - if (pattern.default.length) { - operation = ActorQueryOperationFromQuad.applyOperationDefaultGraph(operation, pattern.default); - } - if (pattern.named.length) { - operation = ActorQueryOperationFromQuad.applyOperationNamedGraph(operation, pattern.named, pattern.default); - } - return operation; - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - const operation = ActorQueryOperationFromQuad.createOperation(pattern); - return this.mediatorQueryOperation.mediate({ operation, context }); - } -} -exports.ActorQueryOperationFromQuad = ActorQueryOperationFromQuad; -ActorQueryOperationFromQuad.FACTORY = new sparqlalgebrajs_1.Factory(); -ActorQueryOperationFromQuad.ALGEBRA_TYPES = Object.keys(sparqlalgebrajs_1.Algebra.types).map((key) => sparqlalgebrajs_1.Algebra.types[key]); - -},{"@comunica/bus-query-operation":205,"lodash.find":501,"sparqlalgebrajs":608}],46:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationGroup")); - -},{"./lib/ActorQueryOperationGroup":47}],47:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const asynciterator_1 = require("asynciterator"); -const rdf_string_1 = require("rdf-string"); -const sparqlee_1 = require("sparqlee"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const GroupsState_1 = require("./GroupsState"); -/** - * A comunica Group Query Operation Actor. - */ -class ActorQueryOperationGroup extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'group'); - } - async testOperation(pattern, context) { - for (const i in pattern.aggregates) { - // Will throw for unsupported expressions - const _ = new sparqlee_1.SyncEvaluator(pattern.aggregates[i].expression); - } - return true; - } - async runOperation(pattern, context) { - // Get result stream for the input query - const { input, aggregates } = pattern; - const outputRaw = await this.mediatorQueryOperation.mediate({ operation: input, context }); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(outputRaw); - // The variables in scope are the variables on which we group, i.e. pattern.variables. - // For 'GROUP BY ?x, ?z', this is [?x, ?z], for 'GROUP by expr(?x) as ?e' this is [?e]. - // But also in scope are the variables defined by the aggregations, since GROUP has to handle this. - const variables = pattern.variables - .map(rdf_string_1.termToString) - .concat(aggregates.map((agg) => rdf_string_1.termToString(agg.variable))); - const sparqleeConfig = Object.assign({}, bus_query_operation_1.ActorQueryOperation.getExpressionContext(context)); - // Return a new promise that completes when the stream has ended or when - // an error occurs - return new Promise((resolve, reject) => { - const groups = new GroupsState_1.GroupsState(pattern, sparqleeConfig); - // Phase 2: Collect aggregator results - // We can only return when the binding stream ends, when that happens - // we return the identified groups. Which are nothing more than Bindings - // of the grouping variables merged with the aggregate variables - output.bindingsStream.on('end', () => { - try { - const bindingsStream = new asynciterator_1.ArrayIterator(groups.collectResults()); - const metadata = output.metadata; - resolve({ type: 'bindings', bindingsStream, metadata, variables }); - } - catch (err) { - reject(err); - } - }); - // Make sure to propagate any errors in the binding stream - output.bindingsStream.on('error', reject); - // Phase 1: Consume the stream, identify the groups and populate the aggregators. - // We need to bind this after the 'error' and 'end' listeners to avoid the - // stream having ended before those listeners are bound. - output.bindingsStream.on('data', (bindings) => { - try { - groups.consumeBindings(bindings); - } - catch (err) { - reject(err); - } - }); - }); - } -} -exports.ActorQueryOperationGroup = ActorQueryOperationGroup; - -},{"./GroupsState":48,"@comunica/bus-query-operation":205,"asynciterator":291,"rdf-string":559,"sparqlee":614}],48:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rdf_string_1 = require("rdf-string"); -const sparqlee_1 = require("sparqlee"); -const actor_abstract_bindings_hash_1 = require("@comunica/actor-abstract-bindings-hash"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A state manager for the groups constructed by consuming the bindings-stream. - */ -class GroupsState { - constructor(pattern, sparqleeConfig) { - this.pattern = pattern; - this.sparqleeConfig = sparqleeConfig; - this.groups = new Map(); - this.groupVariables = new Set(this.pattern.variables.map(rdf_string_1.termToString)); - this.distinctHashes = pattern.aggregates.some(({ distinct }) => distinct) - ? new Map() - : null; - } - /** - * - Consumes a stream binding - * - Find the corresponding group and create one if need be - * - Feeds the binding to the group's aggregators - * - * @param {Bindings} bindings - The Bindings to consume - */ - consumeBindings(bindings) { - // Select the bindings on which we group - const grouper = bindings - .filter((_, variable) => this.groupVariables.has(variable)) - .toMap(); - const groupHash = this.hashBindings(grouper); - // First member of group -> create new group - if (!this.groups.has(groupHash)) { - // Initialize state for all aggregators for new group - const aggregators = {}; - for (const i in this.pattern.aggregates) { - const aggregate = this.pattern.aggregates[i]; - const key = rdf_string_1.termToString(aggregate.variable); - aggregators[key] = new sparqlee_1.AggregateEvaluator(aggregate, this.sparqleeConfig); - aggregators[key].put(bindings); - } - const group = { aggregators, bindings: grouper }; - this.groups.set(groupHash, group); - if (this.distinctHashes) { - const bindingsHash = this.hashBindings(bindings); - this.distinctHashes.set(groupHash, new Set([bindingsHash])); - } - } - else { - // Group already exists - // Update all the aggregators with the input binding - const group = this.groups.get(groupHash); - for (const i in this.pattern.aggregates) { - const aggregate = this.pattern.aggregates[i]; - // If distinct, check first wether we have inserted these values already - if (aggregate.distinct) { - const hash = this.hashBindings(bindings); - if (this.distinctHashes.get(groupHash).has(hash)) { - continue; - } - else { - this.distinctHashes.get(groupHash).add(hash); - } - } - const variable = rdf_string_1.termToString(aggregate.variable); - group.aggregators[variable].put(bindings); - } - } - } - /** - * Collect the result of the current state. This returns a Bindings per group, - * and a (possibly empty) Bindings in case the no Bindings have been consumed yet. - */ - collectResults() { - // Collect groups - let rows = Array.from(this.groups, ([_, group]) => { - const { bindings: groupBindings, aggregators } = group; - // Collect aggregator bindings - // If the aggregate errorred, the result will be undefined - const aggBindings = {}; - for (const variable in aggregators) { - const value = aggregators[variable].result(); - if (value !== undefined) { // Filter undefined - aggBindings[variable] = value; - } - } - // Merge grouping bindings and aggregator bindings - return groupBindings.merge(aggBindings); - }); - // Case: No Input - // Some aggregators still define an output on the empty input - // Result is a single Bindings - if (rows.length === 0) { - const single = {}; - for (const i in this.pattern.aggregates) { - const aggregate = this.pattern.aggregates[i]; - const key = rdf_string_1.termToString(aggregate.variable); - const value = sparqlee_1.AggregateEvaluator.emptyValue(aggregate); - if (value !== undefined) { - single[key] = value; - } - } - rows = [bus_query_operation_1.Bindings(single)]; - } - return rows; - } - /** - * @param {Bindings} bindings - Bindings to hash - */ - hashBindings(bindings) { - return actor_abstract_bindings_hash_1.AbstractFilterHash.hash('sha1', 'hex', bindings); - } -} -exports.GroupsState = GroupsState; - -},{"@comunica/actor-abstract-bindings-hash":2,"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlee":614}],49:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationJoin")); - -},{"./lib/ActorQueryOperationJoin":50}],50:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Join Query Operation Actor. - */ -class ActorQueryOperationJoin extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'join'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - const left = this.mediatorQueryOperation.mediate({ operation: pattern.left, context }); - const right = this.mediatorQueryOperation.mediate({ operation: pattern.right, context }); - return this.mediatorJoin.mediate({ - entries: [bus_query_operation_1.ActorQueryOperation.getSafeBindings(await left), bus_query_operation_1.ActorQueryOperation.getSafeBindings(await right)], - }); - } -} -exports.ActorQueryOperationJoin = ActorQueryOperationJoin; - -},{"@comunica/bus-query-operation":205}],51:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationLeftJoinLeftDeep")); - -},{"./lib/ActorQueryOperationLeftJoinLeftDeep":52}],52:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const bus_rdf_join_1 = require("@comunica/bus-rdf-join"); -const asynciterator_1 = require("asynciterator"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -const asynciterator_promiseproxy_1 = require("asynciterator-promiseproxy"); -/** - * A comunica LeftJoin left-deep Query Operation Actor. - */ -class ActorQueryOperationLeftJoinLeftDeep extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'leftjoin'); - } - /** - * Create a new bindings stream - * that takes every binding of the base stream, - * materializes the remaining patterns with it, - * and emits all bindings from this new set of patterns. - * @param {BindingsStream} leftStream The base stream. - * @param {Algebra.Operation} rightOperation The operation to materialize with each binding of the base stream. - * @param {Algebra.Operation => Promise} operationBinder A callback to retrieve the bindings stream - * of an operation. - * @return {BindingsStream} - */ - static createLeftDeepStream(leftStream, rightOperation, operationBinder) { - const bindingsStream = new asynciterator_1.MultiTransformIterator(leftStream, { optional: true }); - bindingsStream._createTransformer = (bindings) => { - const bindingsMerger = (subBindings) => subBindings.merge(bindings); - return new asynciterator_promiseproxy_1.PromiseProxyIterator(async () => (await operationBinder(bus_query_operation_1.materializeOperation(rightOperation, bindings))) - .map(bindingsMerger), { autoStart: true, maxBufferSize: 128 }); - }; - return bindingsStream; - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Initiate left and right operations - // Only the left stream will be used. - // The right stream is ignored and only its metadata and variables are used. - const left = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation - .mediate({ operation: pattern.left, context })); - const right = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation - .mediate({ operation: pattern.right, context })); - // Close the right stream, since we don't need that one - right.bindingsStream.close(); - // If an expression was defined, wrap the right operation in a filter expression. - const rightOperation = pattern.expression - ? ActorQueryOperationLeftJoinLeftDeep.FACTORY.createFilter(pattern.right, pattern.expression) - : pattern.right; - // Create a left-deep stream with left and right. - const bindingsStream = ActorQueryOperationLeftJoinLeftDeep.createLeftDeepStream(left.bindingsStream, rightOperation, async (operation) => bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation, context })).bindingsStream); - // Determine variables and metadata - const variables = bus_rdf_join_1.ActorRdfJoin.joinVariables({ entries: [left, right] }); - const metadata = () => Promise.all([left, right].map((entry) => entry.metadata())) - .then((metadatas) => metadatas.reduce((acc, val) => acc * val.totalItems, 1)) - .catch(() => Infinity) - .then((totalItems) => ({ totalItems })); - // TODO: We manually trigger the left metadata to be resolved. - // If we don't do this, the inner metadata event seems to be lost in some cases, - // the left promise above is never resolved, this whole metadata promise is never resolved, - // and the application terminates without producing any results. - left.metadata().catch(() => { return; }); - return { type: 'bindings', bindingsStream, metadata, variables }; - } -} -exports.ActorQueryOperationLeftJoinLeftDeep = ActorQueryOperationLeftJoinLeftDeep; -ActorQueryOperationLeftJoinLeftDeep.FACTORY = new sparqlalgebrajs_1.Factory(); - -},{"@comunica/bus-query-operation":205,"@comunica/bus-rdf-join":213,"asynciterator":291,"asynciterator-promiseproxy":287,"sparqlalgebrajs":608}],53:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationMinus")); - -},{"./lib/ActorQueryOperationMinus":54}],54:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_promiseproxy_1 = require("asynciterator-promiseproxy"); -const BindingsIndex_1 = require("./BindingsIndex"); -/** - * A comunica Minus Query Operation Actor. - */ -class ActorQueryOperationMinus extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'minus'); - } - async testOperation(operation, context) { - return true; - } - async runOperation(pattern, context) { - const buffer = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern.right, context })); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern.left, context })); - const commons = this.getCommonVariables(buffer.variables, output.variables); - if (commons.length !== 0) { - /** - * To assure we've filtered all B (`buffer`) values from A (`output`) we wait until we've fetched all values of B. - * Then we save these triples in `index` and use it to filter our A-stream. - */ - const index = new BindingsIndex_1.BindingsIndex(commons); - const bindingsStream = new asynciterator_promiseproxy_1.PromiseProxyIterator(async () => { - await new Promise((resolve) => { - buffer.bindingsStream.on('data', (data) => index.add(data)); - buffer.bindingsStream.on('end', resolve); - }); - return output.bindingsStream.filter((data) => !index.contains(data)); - }); - return { type: 'bindings', bindingsStream, variables: output.variables, metadata: output.metadata }; - } - else { - return output; - } - } - /** - * This function puts all common values between 2 arrays in a map with `value` : true - */ - getCommonVariables(array1, array2) { - return Object.keys(array1.filter((n) => -1 !== array2.indexOf(n)) - .reduce((m, key) => { m[key] = true; return m; }, {})); - } -} -exports.ActorQueryOperationMinus = ActorQueryOperationMinus; - -},{"./BindingsIndex":55,"@comunica/bus-query-operation":205,"asynciterator-promiseproxy":287}],55:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rdf_string_1 = require("rdf-string"); -/** - * A simple efficient tree-based index for maintaining bindings, - * and checking whether or not a bindings is contained in this index. - * - * This will consider bindings with a variable term or a missing term - * as a 'match-all' with other terms. - */ -class BindingsIndex { - constructor(keys) { - this.data = {}; - this.keys = keys; - } - static hashTerm(term) { - return term && term.termType !== 'Variable' ? rdf_string_1.termToString(term) : ''; - } - /** - * Add the given bindings to the index. - * @param {Bindings} bindings A bindings. - */ - add(bindings) { - if (this.isBindingsValid(bindings)) { - let dataIt = this.data; - for (const key of this.keys) { - const dataKey = BindingsIndex.hashTerm(bindings.get(key)); - let subDataIt = dataIt[dataKey]; - if (!subDataIt) { - subDataIt = dataIt[dataKey] = {}; - } - dataIt = subDataIt; - } - } - } - /** - * Check if the given bindings is contained in this index. - * @param {Bindings} bindings A bindings. - * @return {boolean} If it exists in the index. - */ - contains(bindings) { - // Always return false if the bindings contain none of the expected keys - if (!this.isBindingsValid(bindings)) { - return false; - } - return this.containsRecursive(bindings, this.keys, [this.data]); - } - isBindingsValid(bindings) { - let validKeys = false; - for (const key of this.keys) { - if (bindings.get(key)) { - validKeys = true; - break; - } - } - return validKeys; - } - containsRecursive(bindings, keys, dataIndexes) { - if (keys.length === 0) { - return true; - } - let key; - [key, ...keys] = keys; - for (const data of dataIndexes) { - // If the index contained a variable, all terms will match. - const dataKey = BindingsIndex.hashTerm(bindings.get(key)); - if (!dataKey) { - // Iterate over all entries - let subDatas = Object.keys(data).map((k) => data[k]); - if (subDatas.length === 0) { - subDatas = [{}]; - } - if (this.containsRecursive(bindings, keys, subDatas)) { - return true; - } - } - else { - // Check the entry for the term, and the variable term. - const subDatas = [data[dataKey], data['']].filter((e) => !!e); - if (subDatas.length === 0) { - continue; - } - if (this.containsRecursive(bindings, keys, subDatas)) { - return true; - } - } - } - return false; - } -} -exports.BindingsIndex = BindingsIndex; - -},{"rdf-string":559}],56:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationOrderBySparqlee")); - -},{"./lib/ActorQueryOperationOrderBySparqlee":57}],57:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -const sparqlee_1 = require("sparqlee"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const SortIterator_1 = require("./SortIterator"); -/** - * A comunica OrderBy Sparqlee Query Operation Actor. - */ -class ActorQueryOperationOrderBySparqlee extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'orderby'); - this.window = args.window || Infinity; - } - async testOperation(pattern, context) { - // Will throw error for unsupported operators - for (let expr of pattern.expressions) { - expr = this.extractSortExpression(expr); - const _ = new sparqlee_1.AsyncEvaluator(expr); - } - return true; - } - async runOperation(pattern, context) { - const outputRaw = await this.mediatorQueryOperation.mediate({ operation: pattern.input, context }); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(outputRaw); - const options = { window: this.window }; - const sparqleeConfig = Object.assign({}, bus_query_operation_1.ActorQueryOperation.getExpressionContext(context)); - let bindingsStream = output.bindingsStream; - for (let expr of pattern.expressions) { - const isAscending = this.isAscending(expr); - expr = this.extractSortExpression(expr); - // Transform the stream by annotating it with the expr result - const evaluator = new sparqlee_1.AsyncEvaluator(expr, sparqleeConfig); - const transform = async (bindings, next) => { - try { - const result = await evaluator.evaluate(bindings); - transformedStream._push({ bindings, result }); - } - catch (err) { - if (!sparqlee_1.isExpressionError(err)) { - bindingsStream.emit('error', err); - } - transformedStream._push({ bindings, result: undefined }); - } - next(); - }; - const transformedStream = bindingsStream.transform({ transform }); - // Sort the annoted stream - const sortedStream = new SortIterator_1.SortIterator(transformedStream, (a, b) => { - const orderA = rdf_string_1.termToString(a.result); - const orderB = rdf_string_1.termToString(b.result); - if (!orderA || !orderB) { - return 0; - } - return orderA > orderB === isAscending ? 1 : -1; - }, options); - // Remove the annotation - bindingsStream = sortedStream.map(({ bindings, result }) => bindings); - } - return { type: 'bindings', bindingsStream, metadata: output.metadata, variables: output.variables }; - } - // Remove descending operator if necessary - extractSortExpression(expr) { - const { expressionType, operator } = expr; - if (expressionType !== sparqlalgebrajs_1.Algebra.expressionTypes.OPERATOR) { - return expr; - } - return (operator === 'desc') - ? expr.args[0] - : expr; - } - isAscending(expr) { - const { expressionType, operator } = expr; - if (expressionType !== sparqlalgebrajs_1.Algebra.expressionTypes.OPERATOR) { - return true; - } - return operator !== 'desc'; - } -} -exports.ActorQueryOperationOrderBySparqlee = ActorQueryOperationOrderBySparqlee; - -},{"./SortIterator":58,"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlalgebrajs":608,"sparqlee":614}],58:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const asynciterator_1 = require("asynciterator"); -// based on https://github.com/LinkedDataFragments/Client.js/blob/master/lib/sparql/SortIterator.js -class SortIterator extends asynciterator_1.TransformIterator { - constructor(source, sort, options) { - super(source, options); - // The `window` parameter indicates the length of the sliding window to apply sorting - const window = options && options.window; - this.windowLength = isFinite(window) && window > 0 ? window : Infinity; - this.sort = sort; - this.sorted = []; - } - // Reads the smallest item in the current sorting window - _read(count, done) { - let item; - let length = this.sorted.length; - // Try to read items until we reach the desired window length - while (length !== this.windowLength) { - item = this.source.read(); - if (item === null) { - break; - } - // Insert the item in the sorted window (smallest last) - let left = 0; - let right = length - 1; - let mid; - let order; - while (left <= right) { - mid = Math.trunc((left + right) / 2); - order = this.sort(item, this.sorted[mid]); - if (order < 0) { - left = mid + 1; - } - else if (order > 0) { - right = mid - 1; - } - else { - left = mid; - right = -1; - } - } - this.sorted.splice(left, 0, item); - length++; - } - // Push the smallest item in the window - if (length === this.windowLength) { - this._push(this.sorted.pop()); - } - done(); - } - // Flushes remaining data after the source has ended - _flush(done) { - let length = this.sorted.length; - while (length--) { - this._push(this.sorted.pop()); - } - done(); - } -} -exports.SortIterator = SortIterator; - -},{"asynciterator":291}],59:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathAlt")); - -},{"./lib/ActorQueryOperationPathAlt":60}],60:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_union_1 = require("asynciterator-union"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path Alt Query Operation Actor. - */ -class ActorQueryOperationPathAlt extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.ALT); - } - async runOperation(path, context) { - const predicate = path.predicate; - const subOperations = (await Promise.all([ - this.mediatorQueryOperation.mediate({ - context, - operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate.left, path.object, path.graph), - }), - this.mediatorQueryOperation.mediate({ - context, - operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate.right, path.object, path.graph), - }), - ])).map((op) => bus_query_operation_1.ActorQueryOperation.getSafeBindings(op)); - const bindingsStream = new asynciterator_union_1.RoundRobinUnionIterator(subOperations.map((op) => op.bindingsStream)); - const variables = require('lodash.uniq')([].concat.apply([], subOperations.map((op) => op.variables))); - return { type: 'bindings', bindingsStream, variables }; - } -} -exports.ActorQueryOperationPathAlt = ActorQueryOperationPathAlt; - -},{"@comunica/actor-abstract-path":8,"@comunica/bus-query-operation":205,"asynciterator-union":289,"lodash.uniq":505,"sparqlalgebrajs":608}],61:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathInv")); - -},{"./lib/ActorQueryOperationPathInv":62}],62:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path Inv Query Operation Actor. - */ -class ActorQueryOperationPathInv extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.INV); - } - async runOperation(path, context) { - const predicate = path.predicate; - const invPath = actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.object, predicate.path, path.subject, path.graph); - return this.mediatorQueryOperation.mediate({ operation: invPath, context }); - } -} -exports.ActorQueryOperationPathInv = ActorQueryOperationPathInv; - -},{"@comunica/actor-abstract-path":8,"sparqlalgebrajs":608}],63:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathLink")); - -},{"./lib/ActorQueryOperationPathLink":64}],64:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path Link Query Operation Actor. - */ -class ActorQueryOperationPathLink extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.LINK); - } - async runOperation(path, context) { - const predicate = path.predicate; - const operation = actor_abstract_path_1.ActorAbstractPath.FACTORY.createPattern(path.subject, predicate.iri, path.object, path.graph); - return this.mediatorQueryOperation.mediate({ operation, context }); - } -} -exports.ActorQueryOperationPathLink = ActorQueryOperationPathLink; - -},{"@comunica/actor-abstract-path":8,"sparqlalgebrajs":608}],65:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathNps")); - -},{"./lib/ActorQueryOperationPathNps":66}],66:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path/"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path Nps Query Operation Actor. - */ -class ActorQueryOperationPathNps extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.NPS); - } - async runOperation(path, context) { - const predicate = path.predicate; - const blank = this.generateBlankNode(path); - const blankName = rdf_string_1.termToString(blank); - const pattern = actor_abstract_path_1.ActorAbstractPath.FACTORY.createPattern(path.subject, blank, path.object, path.graph); - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern, context })); - // remove the generated blank nodes from the bindings - const bindingsStream = output.bindingsStream.transform({ - filter: (bindings) => { - return !predicate.iris.some((iri) => iri.equals(bindings.get(blankName))); - }, - transform: (item, next) => { - bindingsStream._push(item.delete(blankName)); - next(null); - }, - }); - return { type: 'bindings', bindingsStream, variables: output.variables }; - } -} -exports.ActorQueryOperationPathNps = ActorQueryOperationPathNps; - -},{"@comunica/actor-abstract-path/":8,"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlalgebrajs":608}],67:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathOneOrMore")); - -},{"./lib/ActorQueryOperationPathOneOrMore":68}],68:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_1 = require("asynciterator"); -const asynciterator_promiseproxy_1 = require("asynciterator-promiseproxy"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path OneOrMore Query Operation Actor. - */ -class ActorQueryOperationPathOneOrMore extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.ONE_OR_MORE_PATH); - } - async runOperation(path, context) { - const predicate = path.predicate; - const sVar = path.subject.termType === 'Variable'; - const oVar = path.object.termType === 'Variable'; - if (!sVar && oVar) { - // get all the results of applying this once, then do zeroOrMore for those - const single = actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate.path, path.object, path.graph); - const results = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ context, operation: single })); - const o = rdf_string_1.termToString(path.object); - // all branches need to share the same V to prevent duplicates - const V = {}; - const bindingsStream = new asynciterator_1.MultiTransformIterator(results.bindingsStream); - bindingsStream._createTransformer = (bindings) => { - const val = bindings.get(o); - return new asynciterator_promiseproxy_1.PromiseProxyIterator(async () => { - const it = new asynciterator_1.BufferedIterator(); - await this.ALP(val, predicate.path, context, V, it, { count: 0 }); - return it.transform({ - transform: (item, next) => { - bindingsStream._push(bus_query_operation_1.Bindings({ [o]: item })); - next(null); - }, - }); - }, { autoStart: true, maxBufferSize: 128 }); - }; - return { type: 'bindings', bindingsStream, variables: [o] }; - } - else if (sVar && oVar) { - throw new Error('ZeroOrMore path expressions with 2 variables not supported yet'); - } - else if (sVar && !oVar) { - return this.mediatorQueryOperation.mediate({ - context, - operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.object, actor_abstract_path_1.ActorAbstractPath.FACTORY.createOneOrMorePath(actor_abstract_path_1.ActorAbstractPath.FACTORY.createInv(predicate.path)), path.subject, path.graph), - }); - } - else { // if (!sVar && !oVar) - const b = this.generateBlankNode(); - const bString = rdf_string_1.termToString(b); - const results = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ - context, - operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate, b, path.graph), - })); - const bindingsStream = results.bindingsStream.transform({ - filter: (item) => item.get(bString).equals(path.object), - transform: (item, next) => { - bindingsStream._push(bus_query_operation_1.Bindings({})); - next(null); - }, - }); - return { type: 'bindings', bindingsStream, variables: [] }; - } - } -} -exports.ActorQueryOperationPathOneOrMore = ActorQueryOperationPathOneOrMore; - -},{"@comunica/actor-abstract-path":8,"@comunica/bus-query-operation":205,"asynciterator":291,"asynciterator-promiseproxy":287,"rdf-string":559,"sparqlalgebrajs":608}],69:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathSeq")); - -},{"./lib/ActorQueryOperationPathSeq":70}],70:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path Seq Query Operation Actor. - */ -class ActorQueryOperationPathSeq extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.SEQ); - } - async runOperation(path, context) { - const predicate = path.predicate; - const blank = this.generateBlankNode(path); - const blankName = rdf_string_1.termToString(blank); - const subOperations = (await Promise.all([ - this.mediatorQueryOperation.mediate({ - context, operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate.left, blank, path.graph), - }), - this.mediatorQueryOperation.mediate({ - context, operation: actor_abstract_path_1.ActorAbstractPath.FACTORY.createPath(blank, predicate.right, path.object, path.graph), - }), - ])).map((op) => bus_query_operation_1.ActorQueryOperation.getSafeBindings(op)); - const join = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorJoin.mediate({ entries: subOperations })); - // remove the generated blank nodes from the bindings - const bindingsStream = join.bindingsStream.transform({ - transform: (item, next) => { - bindingsStream._push(item.delete(blankName)); - next(null); - }, - }); - return { type: 'bindings', bindingsStream, variables: join.variables }; - } -} -exports.ActorQueryOperationPathSeq = ActorQueryOperationPathSeq; - -},{"@comunica/actor-abstract-path":8,"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlalgebrajs":608}],71:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathZeroOrMore")); - -},{"./lib/ActorQueryOperationPathZeroOrMore":72}],72:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_path_1 = require("@comunica/actor-abstract-path"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path ZeroOrMore Query Operation Actor. - */ -class ActorQueryOperationPathZeroOrMore extends actor_abstract_path_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.ZERO_OR_MORE_PATH); - } - async runOperation(path, context) { - const predicate = path.predicate; - const sVar = path.subject.termType === 'Variable'; - const oVar = path.object.termType === 'Variable'; - if (sVar && oVar) { - throw new Error('ZeroOrMore path expressions with 2 variables not supported yet'); - } - else if (!sVar && !oVar) { - const bindingsStream = (await this.ALPeval(path.subject, predicate.path, context)) - .transform({ - filter: (item) => item.equals(path.object), - transform: (item, next) => { - bindingsStream._push(bus_query_operation_1.Bindings({})); - next(null); - }, - }); - return { type: 'bindings', bindingsStream, variables: [] }; - } - else { // if (sVar || oVar) - const v = rdf_string_1.termToString(sVar ? path.subject : path.object); - const pred = sVar ? actor_abstract_path_1.ActorAbstractPath.FACTORY.createInv(predicate.path) : predicate.path; - const bindingsStream = (await this.ALPeval(sVar ? path.object : path.subject, pred, context)) - .transform({ - transform: (item, next) => { - bindingsStream._push(bus_query_operation_1.Bindings({ [v]: item })); - next(null); - }, - }); - return { type: 'bindings', bindingsStream, variables: [v] }; - } - } -} -exports.ActorQueryOperationPathZeroOrMore = ActorQueryOperationPathZeroOrMore; - -},{"@comunica/actor-abstract-path":8,"@comunica/bus-query-operation":205,"rdf-string":559,"sparqlalgebrajs":608}],73:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationPathZeroOrOne")); - -},{"./lib/ActorQueryOperationPathZeroOrOne":74}],74:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const ActorAbstractPath_1 = require("@comunica/actor-abstract-path/lib/ActorAbstractPath"); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_1 = require("asynciterator"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica Path ZeroOrOne Query Operation Actor. - */ -class ActorQueryOperationPathZeroOrOne extends ActorAbstractPath_1.ActorAbstractPath { - constructor(args) { - super(args, sparqlalgebrajs_1.Algebra.types.ZERO_OR_ONE_PATH); - } - async runOperation(path, context) { - const predicate = path.predicate; - const sVar = path.subject.termType === 'Variable'; - const oVar = path.object.termType === 'Variable'; - const extra = []; - // both subject and object non-variables - if (!sVar && !oVar) { - if (path.subject.equals(path.object)) { - return { type: 'bindings', bindingsStream: new asynciterator_1.SingletonIterator(bus_query_operation_1.Bindings({})), variables: [] }; - } - } - if (sVar && oVar) { - throw new Error('ZeroOrOne path expressions with 2 variables not supported yet'); - } - if (sVar) { - extra.push(bus_query_operation_1.Bindings({ [rdf_string_1.termToString(path.subject)]: path.object })); - } - if (oVar) { - extra.push(bus_query_operation_1.Bindings({ [rdf_string_1.termToString(path.object)]: path.subject })); - } - const single = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ - context, - operation: ActorAbstractPath_1.ActorAbstractPath.FACTORY.createPath(path.subject, predicate.path, path.object, path.graph), - })); - const bindingsStream = single.bindingsStream.prepend(extra); - return { type: 'bindings', bindingsStream, variables: single.variables }; - } -} -exports.ActorQueryOperationPathZeroOrOne = ActorQueryOperationPathZeroOrOne; - -},{"@comunica/actor-abstract-path/lib/ActorAbstractPath":9,"@comunica/bus-query-operation":205,"asynciterator":291,"rdf-string":559,"sparqlalgebrajs":608}],75:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationProject")); - -},{"./lib/ActorQueryOperationProject":76}],76:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const data_model_1 = require("@rdfjs/data-model"); -const rdf_string_1 = require("rdf-string"); -/** - * A comunica Project Query Operation Actor. - */ -class ActorQueryOperationProject extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'project'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Resolve the input - const output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern.input, context })); - // Find all variables that should be deleted from the input stream - // and all variables that are not bound in the input stream. - const variables = pattern.variables.map(rdf_string_1.termToString); - const deleteVariables = output.variables.filter((variable) => variables.indexOf(variable) < 0); - const missingVariables = variables.filter((variable) => output.variables.indexOf(variable) < 0); - // Make sure the project variables are the only variables that are present in the bindings. - let bindingsStream = !deleteVariables.length && !missingVariables.length - ? output.bindingsStream : output.bindingsStream.map((binding) => { - for (const deleteVariable of deleteVariables) { - binding = binding.delete(deleteVariable); - } - for (const missingVariable of missingVariables) { - binding = binding.set(missingVariable, null); - } - return binding; - }); - // Make sure that blank nodes with same labels are not reused over different bindings, as required by SPARQL 1.1. - // Required for the BNODE() function: https://www.w3.org/TR/sparql11-query/#func-bnode - let blankNodeCounter = 0; - bindingsStream = bindingsStream.map((bindings) => { - blankNodeCounter++; - return bindings.map((term) => { - if (term && term.termType === 'BlankNode') { - return data_model_1.blankNode(term.value + blankNodeCounter); - } - return term; - }); - }); - return { type: 'bindings', bindingsStream, metadata: output.metadata, variables }; - } -} -exports.ActorQueryOperationProject = ActorQueryOperationProject; - -},{"@comunica/bus-query-operation":205,"@rdfjs/data-model":263,"rdf-string":559}],77:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationQuadpattern")); - -},{"./lib/ActorQueryOperationQuadpattern":78}],78:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_promiseproxy_1 = require("asynciterator-promiseproxy"); -const rdf_string_1 = require("rdf-string"); -const rdf_terms_1 = require("rdf-terms"); -/** - * A comunica actor for handling 'quadpattern' query operations. - */ -class ActorQueryOperationQuadpattern extends bus_query_operation_1.ActorQueryOperationTyped { - constructor(args) { - super(args, 'pattern'); - } - /** - * Check if a term is a variable. - * @param {RDF.Term} term An RDF term. - * @return {any} If the term is a variable or blank node. - */ - static isTermVariable(term) { - return term.termType === 'Variable'; - } - /** - * Get all variables in the given pattern. - * No duplicates are returned. - * @param {RDF.BaseQuad} pattern A quad pattern. - * @return {string[]} The variables in this pattern, without '?' prefix. - */ - static getVariables(pattern) { - return rdf_terms_1.uniqTerms(rdf_terms_1.getTerms(pattern) - .filter(ActorQueryOperationQuadpattern.isTermVariable)) - .map(rdf_string_1.termToString); - } - /** - * A helper function to find a hash with quad elements that have duplicate variables. - * - * @param {RDF.Quad} pattern A quad pattern. - * - * @return {{[p: string]: string[]}} If no equal variable names are present in the four terms, this returns null. - * Otherwise, this maps quad elements ('subject', 'predicate', 'object', 'graph') - * to the list of quad elements it shares a variable name with. - * If no links for a certain element exist, this element will - * not be included in the hash. - * Note 1: Quad elements will never have a link to themselves. - * So this can never occur: { subject: [ 'subject'] }, - * instead 'null' would be returned. - * Note 2: Links only exist in one direction, - * this means that { subject: [ 'predicate'], predicate: [ 'subject' ] } - * will not occur, instead only { subject: [ 'predicate'] } - * will be returned. - */ - static getDuplicateElementLinks(pattern) { - // Collect a variable to quad elements mapping. - const variableElements = {}; - let duplicateVariables = false; - for (const key of rdf_terms_1.QUAD_TERM_NAMES) { - if (pattern[key].termType === 'Variable') { - const val = rdf_string_1.termToString(pattern[key]); - const length = (variableElements[val] || (variableElements[val] = [])).push(key); - duplicateVariables = duplicateVariables || length > 1; - } - } - if (!duplicateVariables) { - return null; - } - // Collect quad element to elements with equal variables mapping. - const duplicateElementLinks = {}; - for (const variable in variableElements) { - const elements = variableElements[variable]; - const remainingElements = elements.slice(1); - // Only store the elements that have at least one equal element. - if (remainingElements.length) { - duplicateElementLinks[elements[0]] = remainingElements; - } - } - return duplicateElementLinks; - } - async testOperation(operation, context) { - return true; - } - async runOperation(pattern, context) { - // Apply the (optional) pattern-specific context - if (pattern.context) { - context = context ? context.merge(pattern.context) : pattern.context; - } - // Resolve the quad pattern - const result = await this.mediatorResolveQuadPattern.mediate({ pattern, context }); - // Collect all variables from the pattern - const variables = ActorQueryOperationQuadpattern.getVariables(pattern); - // Convenience datastructure for mapping quad elements to variables - const elementVariables = rdf_terms_1.reduceTerms(pattern, (acc, term, key) => { - if (ActorQueryOperationQuadpattern.isTermVariable(term)) { - acc[key] = rdf_string_1.termToString(term); - } - return acc; - }, {}); - const quadBindingsReducer = (acc, term, key) => { - const variable = elementVariables[key]; - if (variable) { - acc[variable] = term; - } - return acc; - }; - // Optionally filter, and construct bindings - const bindingsStream = new asynciterator_promiseproxy_1.PromiseProxyIterator(async () => { - let filteredOutput = result.data; - // Detect duplicate variables in the pattern - const duplicateElementLinks = ActorQueryOperationQuadpattern - .getDuplicateElementLinks(pattern); - // If there are duplicate variables in the search pattern, - // make sure that we filter out the triples that don't have equal values for those triple elements, - // as QPF ignores variable names. - if (duplicateElementLinks) { - filteredOutput = filteredOutput.filter((quad) => { - // No need to check the graph, because an equal element already would have to be found in s, p, or o. - for (const element1 of rdf_terms_1.TRIPLE_TERM_NAMES) { - for (const element2 of (duplicateElementLinks[element1] || [])) { - if (!quad[element1].equals(quad[element2])) { - return false; - } - } - } - return true; - }); - } - return filteredOutput.map((quad) => { - return bus_query_operation_1.Bindings(rdf_terms_1.reduceTerms(quad, quadBindingsReducer, {})); - }, { autoStart: true, maxBufferSize: 128 }); - }); - return { type: 'bindings', bindingsStream, variables, metadata: result.metadata }; - } -} -exports.ActorQueryOperationQuadpattern = ActorQueryOperationQuadpattern; - -},{"@comunica/bus-query-operation":205,"asynciterator-promiseproxy":287,"rdf-string":559,"rdf-terms":561}],79:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationReducedHash")); - -},{"./lib/ActorQueryOperationReducedHash":80}],80:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const actor_abstract_bindings_hash_1 = require("@comunica/actor-abstract-bindings-hash"); -const LRU = require("lru-cache"); -/** - * A comunica Reduced Hash Query Operation Actor. - */ -class ActorQueryOperationReducedHash extends actor_abstract_bindings_hash_1.AbstractBindingsHash { - constructor(args) { - super(args, 'reduced'); - } - /** - * Create a new distinct filter function for the given hash algorithm and digest algorithm. - * This will maintain an internal hash datastructure so that every bindings object only returns true once. - * @param {string} hashAlgorithm A hash algorithm. - * @param {string} digestAlgorithm A digest algorithm. - * @return {(bindings: Bindings) => boolean} A distinct filter for bindings. - */ - newHashFilter(hashAlgorithm, digestAlgorithm) { - const hashes = new LRU({ max: this.cacheSize }); - return (bindings) => { - const hash = actor_abstract_bindings_hash_1.AbstractFilterHash.hash(hashAlgorithm, digestAlgorithm, bindings); - return !(hashes.has(hash)) && hashes.set(hash, true); - }; - } -} -exports.ActorQueryOperationReducedHash = ActorQueryOperationReducedHash; - -},{"@comunica/actor-abstract-bindings-hash":2,"lru-cache":81}],81:[function(require,module,exports){ -'use strict' - -// A linked list to keep track of recently-used-ness -const Yallist = require('yallist') - -const MAX = Symbol('max') -const LENGTH = Symbol('length') -const LENGTH_CALCULATOR = Symbol('lengthCalculator') -const ALLOW_STALE = Symbol('allowStale') -const MAX_AGE = Symbol('maxAge') -const DISPOSE = Symbol('dispose') -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') -const LRU_LIST = Symbol('lruList') -const CACHE = Symbol('cache') -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - -const naiveLength = () => 1 - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -class LRUCache { - constructor (options) { - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - if (options.max && (typeof options.max !== 'number' || options.max < 0)) - throw new TypeError('max must be a non-negative number') - // Kind of weird to have a default max of Infinity, but oh well. - const max = this[MAX] = options.max || Infinity - - const lc = options.length || naiveLength - this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc - this[ALLOW_STALE] = options.stale || false - if (options.maxAge && typeof options.maxAge !== 'number') - throw new TypeError('maxAge must be a number') - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false - this.reset() - } - - // resize the cache when the max changes. - set max (mL) { - if (typeof mL !== 'number' || mL < 0) - throw new TypeError('max must be a non-negative number') - - this[MAX] = mL || Infinity - trim(this) - } - get max () { - return this[MAX] - } - - set allowStale (allowStale) { - this[ALLOW_STALE] = !!allowStale - } - get allowStale () { - return this[ALLOW_STALE] - } - - set maxAge (mA) { - if (typeof mA !== 'number') - throw new TypeError('maxAge must be a non-negative number') - - this[MAX_AGE] = mA - trim(this) - } - get maxAge () { - return this[MAX_AGE] - } - - // resize the cache when the lengthCalculator changes. - set lengthCalculator (lC) { - if (typeof lC !== 'function') - lC = naiveLength - - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }) - } - trim(this) - } - get lengthCalculator () { return this[LENGTH_CALCULATOR] } - - get length () { return this[LENGTH] } - get itemCount () { return this[LRU_LIST].length } - - rforEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } - } - - forEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } - } - - keys () { - return this[LRU_LIST].toArray().map(k => k.key) - } - - values () { - return this[LRU_LIST].toArray().map(k => k.value) - } - - reset () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) - } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list - } - - dump () { - return this[LRU_LIST].map(hit => - isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h) - } - - dumpLru () { - return this[LRU_LIST] - } - - set (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] - - if (maxAge && typeof maxAge !== 'number') - throw new TypeError('maxAge must be a number') - - const now = maxAge ? Date.now() : 0 - const len = this[LENGTH_CALCULATOR](value, key) - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } - - const node = this[CACHE].get(key) - const item = node.value - - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value) - } - - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true - } - - const hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) - this[DISPOSE](key, value) - - return false - } - - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true - } - - has (key) { - if (!this[CACHE].has(key)) return false - const hit = this[CACHE].get(key).value - return !isStale(this, hit) - } - - get (key) { - return get(this, key, true) - } - - peek (key) { - return get(this, key, false) - } - - pop () { - const node = this[LRU_LIST].tail - if (!node) - return null - - del(this, node) - return node.value - } - - del (key) { - del(this, this[CACHE].get(key)) - } - - load (arr) { - // reset the cache - this.reset() - - const now = Date.now() - // A previous serialized cache has the most recent items first - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l] - const expiresAt = hit.e || 0 - if (expiresAt === 0) - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - else { - const maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } - } - - prune () { - this[CACHE].forEach((value, key) => get(this, key, false)) - } -} - -const get = (self, key, doUse) => { - const node = self[CACHE].get(key) - if (node) { - const hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - return undefined - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) - node.value.now = Date.now() - self[LRU_LIST].unshiftNode(node) - } - } - return hit.value - } -} - -const isStale = (self, hit) => { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) - return false - - const diff = Date.now() - hit.now - return hit.maxAge ? diff > hit.maxAge - : self[MAX_AGE] && (diff > self[MAX_AGE]) -} - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -const del = (self, node) => { - if (node) { - const hit = node.value - if (self[DISPOSE]) - self[DISPOSE](hit.key, hit.value) - - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) - } -} - -class Entry { - constructor (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 - } -} - -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - hit = undefined - } - if (hit) - fn.call(thisp, hit.value, hit.key, self) -} - -module.exports = LRUCache - -},{"yallist":702}],82:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationService")); - -},{"./lib/ActorQueryOperationService":83}],83:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const bus_rdf_resolve_quad_pattern_1 = require("@comunica/bus-rdf-resolve-quad-pattern"); -const core_1 = require("@comunica/core"); -const asynciterator_1 = require("asynciterator"); -const asyncreiterable_1 = require("asyncreiterable"); -/** - * A comunica Service Query Operation Actor. - * It unwraps the SERVICE operation and executes it on the given source. - */ -class ActorQueryOperationService extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'service'); - } - async testOperation(pattern, context) { - if (pattern.name.termType !== 'NamedNode') { - throw new Error(`${this.name} can only query services by IRI, while a ${pattern.name.termType} was given.`); - } - return true; - } - async runOperation(pattern, context) { - const endpoint = pattern.name.value; - // Adjust our context to only have the endpoint as source - context = context || core_1.ActionContext({}); - let subContext = context.delete(bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCE).delete(bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES); - const sourceType = this.forceSparqlEndpoint ? 'sparql' : 'auto'; - subContext = subContext.set(bus_rdf_resolve_quad_pattern_1.KEY_CONTEXT_SOURCES, asyncreiterable_1.AsyncReiterableArray.fromFixedData([{ type: sourceType, value: endpoint }])); - // Query the source - let output; - try { - output = bus_query_operation_1.ActorQueryOperation.getSafeBindings(await this.mediatorQueryOperation.mediate({ operation: pattern.input, context: subContext })); - } - catch (e) { - if (pattern.silent) { - // Emit a single empty binding - output = { - bindingsStream: new asynciterator_1.SingletonIterator(bus_query_operation_1.Bindings({})), - type: 'bindings', - variables: [], - }; - } - else { - throw e; - } - } - return output; - } -} -exports.ActorQueryOperationService = ActorQueryOperationService; - -},{"@comunica/bus-query-operation":205,"@comunica/bus-rdf-resolve-quad-pattern":231,"@comunica/core":242,"asynciterator":291,"asyncreiterable":298}],84:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationSlice")); - -},{"./lib/ActorQueryOperationSlice":85}],85:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -/** - * A comunica Slice Query Operation Actor. - */ -class ActorQueryOperationSlice extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'slice'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - // Resolve the input - const output = await this.mediatorQueryOperation.mediate({ operation: pattern.input, context }); - const metadata = this.sliceMetadata(output, pattern); - if (output.type === 'bindings') { - const bindingsOutput = output; - const bindingsStream = this.sliceStream(bindingsOutput.bindingsStream, pattern); - return { type: 'bindings', bindingsStream, metadata, variables: bindingsOutput.variables }; - } - if (output.type === 'quads') { - const quadOutput = output; - const quadStream = this.sliceStream(quadOutput.quadStream, pattern); - return { type: 'quads', quadStream, metadata }; - } - throw new Error(`Invalid query output type: Expected 'bindings' or 'quads' but got '${output.type}'`); - } - // Slice the stream based on the pattern values - sliceStream(stream, pattern) { - const hasLength = !!pattern.length || pattern.length === 0; - return stream.range(pattern.start, hasLength ? pattern.start + pattern.length - 1 : Infinity); - } - // If we find metadata, apply slicing on the total number of items - sliceMetadata(output, pattern) { - const hasLength = !!pattern.length || pattern.length === 0; - return !output.metadata ? null : () => output.metadata() - .then((subMetadata) => { - let totalItems = subMetadata.totalItems; - if (isFinite(totalItems)) { - totalItems = Math.max(0, totalItems - pattern.start); - if (hasLength) { - totalItems = Math.min(totalItems, pattern.length); - } - } - return Object.assign({}, subMetadata, { totalItems }); - }); - } -} -exports.ActorQueryOperationSlice = ActorQueryOperationSlice; - -},{"@comunica/bus-query-operation":205}],86:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationSparqlEndpoint")); - -},{"./lib/ActorQueryOperationSparqlEndpoint":87}],87:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const bus_rdf_resolve_quad_pattern_1 = require("@comunica/bus-rdf-resolve-quad-pattern"); -const utils_datasource_1 = require("@comunica/utils-datasource"); -const asynciterator_1 = require("asynciterator"); -const fetch_sparql_endpoint_1 = require("fetch-sparql-endpoint"); -const rdf_string_1 = require("rdf-string"); -const sparqlalgebrajs_1 = require("sparqlalgebrajs"); -/** - * A comunica SPARQL Endpoint Query Operation Actor. - */ -class ActorQueryOperationSparqlEndpoint extends bus_query_operation_1.ActorQueryOperation { - constructor(args) { - super(args); - this.endpointFetcher = new fetch_sparql_endpoint_1.SparqlEndpointFetcher({ - fetch: (input, init) => this.mediatorHttp.mediate({ input, init, context: this.lastContext }), - prefixVariableQuestionMark: true, - }); - } - async test(action) { - if (!action.operation) { - throw new Error('Missing field \'operation\' in a query operation action.'); - } - const source = await utils_datasource_1.DataSourceUtils.getSingleSource(action.context); - if (source && bus_rdf_resolve_quad_pattern_1.getDataSourceType(source) === 'sparql') { - return { httpRequests: 1 }; - } - throw new Error(this.name + ' requires a single source with a \'sparql\' endpoint to be present in the context.'); - } - async run(action) { - const endpoint = bus_rdf_resolve_quad_pattern_1.getDataSourceValue(await utils_datasource_1.DataSourceUtils.getSingleSource(action.context)); - this.lastContext = action.context; - // Determine the full SPARQL query that needs to be sent to the endpoint - // Also check the type of the query (SELECT, CONSTRUCT (includes DESCRIBE) or ASK) - let query; - let type; - let variables; - try { - query = sparqlalgebrajs_1.toSparql(action.operation); - // This will throw an error in case the result is an invalid SPARQL query - type = this.endpointFetcher.getQueryType(query); - } - catch (e) { - // Ignore errors - } - // If the input is an sub-query, wrap this in a SELECT - if (!type || type === 'UNKNOWN') { - variables = sparqlalgebrajs_1.Util.inScopeVariables(action.operation); - query = sparqlalgebrajs_1.toSparql(ActorQueryOperationSparqlEndpoint.FACTORY.createProject(action.operation, variables)); - type = 'SELECT'; - } - // Execute the query against the endpoint depending on the type - switch (type) { - case 'SELECT': - if (!variables) - variables = sparqlalgebrajs_1.Util.inScopeVariables(action.operation); - return this.executeQuery(endpoint, query, false, variables); - case 'CONSTRUCT': - return this.executeQuery(endpoint, query, true); - case 'ASK': - return { - type: 'boolean', - booleanResult: this.endpointFetcher.fetchAsk(endpoint, query), - }; - } - } - /** - * Execute the given SELECT or CONSTRUCT query against the given endpoint. - * @param endpoint A SPARQL endpoint URL. - * @param query A SELECT or CONSTRUCT query. - * @param quads If the query returns quads, i.e., if it is a CONSTRUCT query. - * @param variables Variables for SELECT queries. - */ - executeQuery(endpoint, query, quads, variables) { - const stream = new asynciterator_1.BufferedIterator({ autoStart: false, maxBufferSize: Infinity }); - const inputStream = quads - ? this.endpointFetcher.fetchTriples(endpoint, query) - : this.endpointFetcher.fetchBindings(endpoint, query); - inputStream - .then((rawStream) => { - let totalItems = 0; - rawStream.on('error', (error) => stream.emit('error', error)); - rawStream.on('data', (rawData) => { - totalItems++; - stream._push(quads ? rawData : bus_query_operation_1.Bindings(rawData)); - }); - rawStream.on('end', () => { - stream.emit('metadata', { totalItems }); - stream.close(); - }); - }) - .catch((error) => stream.emit('error', error)); - const metadata = ActorQueryOperationSparqlEndpoint.cachifyMetadata(() => new Promise((resolve, reject) => { - stream._fillBuffer(); - stream.on('error', reject); - stream.on('end', () => reject(new Error('No metadata was found'))); - stream.on('metadata', resolve); - })); - if (quads) - return { - type: 'quads', - quadStream: stream, - metadata, - }; - return { - type: 'bindings', - bindingsStream: stream, - metadata, - variables: variables.map(rdf_string_1.termToString), - }; - } -} -exports.ActorQueryOperationSparqlEndpoint = ActorQueryOperationSparqlEndpoint; -ActorQueryOperationSparqlEndpoint.FACTORY = new sparqlalgebrajs_1.Factory(); - -},{"@comunica/bus-query-operation":205,"@comunica/bus-rdf-resolve-quad-pattern":231,"@comunica/utils-datasource":261,"asynciterator":291,"fetch-sparql-endpoint":398,"rdf-string":559,"sparqlalgebrajs":608}],88:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationUnion")); - -},{"./lib/ActorQueryOperationUnion":89}],89:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_union_1 = require("asynciterator-union"); -/** - * A comunica Union Query Operation Actor. - */ -class ActorQueryOperationUnion extends bus_query_operation_1.ActorQueryOperationTypedMediated { - constructor(args) { - super(args, 'union'); - } - /** - * Takes the union of the given double array variables. - * Uniqueness is guaranteed. - * @param {string[][]} variables Double array of variables to take the union of. - * @return {string[]} The union of the given variables. - */ - static unionVariables(variables) { - return require('lodash.union').apply({}, variables); - } - /** - * Takes the union of the given metadata array. - * It will ensure that the totalItems metadata value is properly calculated. - * @param {{[p: string]: any}[]} metadatas Array of metadata. - * @return {{[p: string]: any}} Union of the metadata. - */ - static unionMetadata(metadatas) { - let totalItems = 0; - for (const metadata of metadatas) { - if (metadata.totalItems && isFinite(metadata.totalItems)) { - totalItems += metadata.totalItems; - } - else { - totalItems = Infinity; - break; - } - } - return { totalItems }; - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - const outputs = (await Promise.all([ - this.mediatorQueryOperation.mediate({ operation: pattern.left, context }), - this.mediatorQueryOperation.mediate({ operation: pattern.right, context }), - ])).map(bus_query_operation_1.ActorQueryOperation.getSafeBindings); - const bindingsStream = new asynciterator_union_1.RoundRobinUnionIterator(outputs.map((output) => output.bindingsStream)); - const metadata = outputs[0].metadata && outputs[1].metadata ? () => Promise.all([outputs[0].metadata(), outputs[1].metadata()]).then(ActorQueryOperationUnion.unionMetadata) - : null; - const variables = ActorQueryOperationUnion.unionVariables(outputs.map((output) => output.variables)); - return { type: 'bindings', bindingsStream, metadata, variables }; - } -} -exports.ActorQueryOperationUnion = ActorQueryOperationUnion; - -},{"@comunica/bus-query-operation":205,"asynciterator-union":289,"lodash.union":504}],90:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorQueryOperationValues")); - -},{"./lib/ActorQueryOperationValues":91}],91:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_query_operation_1 = require("@comunica/bus-query-operation"); -const asynciterator_1 = require("asynciterator"); -const rdf_string_1 = require("rdf-string"); -/** - * A comunica Values Query Operation Actor. - */ -class ActorQueryOperationValues extends bus_query_operation_1.ActorQueryOperationTyped { - constructor(args) { - super(args, 'values'); - } - async testOperation(pattern, context) { - return true; - } - async runOperation(pattern, context) { - const bindingsStream = new asynciterator_1.ArrayIterator(pattern.bindings.map(bus_query_operation_1.Bindings)); - const metadata = () => Promise.resolve({ totalItems: pattern.bindings.length }); - const variables = pattern.variables.map(rdf_string_1.termToString); - return { type: 'bindings', bindingsStream, metadata, variables }; - } -} -exports.ActorQueryOperationValues = ActorQueryOperationValues; - -},{"@comunica/bus-query-operation":205,"asynciterator":291,"rdf-string":559}],92:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfDereferenceHttpParseBase")); -__export(require("./lib/ActorRdfDereferenceHttpParse")); - -},{"./lib/ActorRdfDereferenceHttpParse":93,"./lib/ActorRdfDereferenceHttpParseBase":94}],93:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const ActorRdfDereferenceHttpParseBase_1 = require("./ActorRdfDereferenceHttpParseBase"); -/** - * The browser variant of {@link ActorRdfDereferenceHttpParse}. - */ -class ActorRdfDereferenceHttpParse extends ActorRdfDereferenceHttpParseBase_1.ActorRdfDereferenceHttpParseBase { - constructor(args) { - super(args); - } - getMaxAcceptHeaderLength() { - return this.maxAcceptHeaderLengthBrowser; - } -} -exports.ActorRdfDereferenceHttpParse = ActorRdfDereferenceHttpParse; - -},{"./ActorRdfDereferenceHttpParseBase":94}],94:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_http_1 = require("@comunica/bus-http"); -const bus_rdf_dereference_1 = require("@comunica/bus-rdf-dereference"); -const relative_to_absolute_iri_1 = require("relative-to-absolute-iri"); -/** - * An actor that listens on the 'rdf-dereference' bus. - * - * It starts by grabbing all available RDF media types from the RDF parse bus. - * After that, it resolves the URL using the HTTP bus using an accept header compiled from the available media types. - * Finally, the response is parsed using the RDF parse bus. - */ -class ActorRdfDereferenceHttpParseBase extends bus_rdf_dereference_1.ActorRdfDereferenceMediaMappings { - constructor(args) { - super(args); - } - async test(action) { - if (!/^https?:/.test(action.url)) { - throw new Error(`Cannot retrieve ${action.url} because it is not an HTTP(S) URL.`); - } - return true; - } - async run(action) { - // Define accept header based on available media types. - const mediaTypes = (await this.mediatorRdfParseMediatypes.mediate({ context: action.context, mediaTypes: true })) - .mediaTypes; - const acceptHeader = this.mediaTypesToAcceptString(mediaTypes, this.getMaxAcceptHeaderLength()); - // Resolve HTTP URL using appropriate accept header - const headers = new Headers(); - headers.append('Accept', acceptHeader); - // Append any custom passed headers - for (const key in action.headers) { - headers.append(key, action.headers[key]); - } - const httpAction = { - context: action.context, - init: { headers, method: action.method }, - input: action.url, - }; - let httpResponse; - try { - httpResponse = await this.mediatorHttp.mediate(httpAction); - } - catch (error) { - return this.handleDereferenceError(action, error); - } - const url = relative_to_absolute_iri_1.resolve(httpResponse.url, action.url); // The response URL can be relative to the given URL - // Convert output headers to a hash - const outputHeaders = {}; - httpResponse.headers.forEach((value, key) => outputHeaders[key] = value); - // Wrap WhatWG readable stream into a Node.js readable stream - // If the body already is a Node.js stream (in the case of node-fetch), don't do explicit conversion. - const responseStream = bus_http_1.ActorHttp.toNodeReadable(httpResponse.body); - // Only parse if retrieval was successful - if (httpResponse.status !== 200) { - const error = new Error(`Could not retrieve ${action.url} (${httpResponse.status}: ${httpResponse.statusText || 'unknown error'})`); - return this.handleDereferenceError(action, error); - } - // Parse the resulting response - let mediaType = httpResponse.headers.has('content-type') - ? ActorRdfDereferenceHttpParseBase.REGEX_MEDIATYPE.exec(httpResponse.headers.get('content-type'))[0] : null; - // If no media type could be found, try to determine it via the file extension - if (!mediaType || mediaType === 'text/plain') { - mediaType = this.getMediaTypeFromExtension(httpResponse.url); - } - const parseAction = { - baseIRI: url, - headers: httpResponse.headers, - input: responseStream, - }; - let parseOutput; - try { - parseOutput = (await this.mediatorRdfParseHandle.mediate({ context: action.context, handle: parseAction, handleMediaType: mediaType })).handle; - } - catch (error) { - return this.handleDereferenceError(action, error); - } - const quads = this.handleDereferenceStreamErrors(action, parseOutput.quads); - // Return the parsed quad stream and whether or not only triples are supported - return { url, quads, triples: parseOutput.triples, headers: outputHeaders }; - } - mediaTypesToAcceptString(mediaTypes, maxLength) { - maxLength -= 10; // Ensure a ',*/*;q=0.1' suffix - const parts = []; - const sortedMediaTypes = Object.keys(mediaTypes) - .map((mediaType) => ({ mediaType, priority: mediaTypes[mediaType] })) - .sort((a, b) => b.priority - a.priority); - let partsLength = 0; - for (const entry of sortedMediaTypes) { - const part = entry.mediaType + (entry.priority !== 1 ? ';q=' + entry.priority.toFixed(3).replace(/0*$/, '') : ''); - if (partsLength + part.length > maxLength) { - parts.push('*/*;q=0.1'); - break; - } - parts.push(part); - partsLength += part.length; - } - if (!parts.length) { - return '*/*'; - } - return parts.join(','); - } -} -exports.ActorRdfDereferenceHttpParseBase = ActorRdfDereferenceHttpParseBase; -ActorRdfDereferenceHttpParseBase.REGEX_MEDIATYPE = /^[^ ;]*/; - -},{"@comunica/bus-http":198,"@comunica/bus-rdf-dereference":210,"relative-to-absolute-iri":589}],95:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfJoinMultiSmallest")); - -},{"./lib/ActorRdfJoinMultiSmallest":96}],96:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_join_1 = require("@comunica/bus-rdf-join"); -/** - * A Multi Smallest RDF Join Actor. - * It accepts 3 or more streams, joins the smallest two, and joins the result with the remaining streams. - */ -class ActorRdfJoinMultiSmallest extends bus_rdf_join_1.ActorRdfJoin { - constructor(args) { - super(args, 3, true); - } - static getSmallestPatternId(totalItems) { - let smallestId = -1; - let smallestCount = Infinity; - for (let i = 0; i < totalItems.length; i++) { - const count = totalItems[i]; - if (count <= smallestCount) { - smallestCount = count; - smallestId = i; - } - } - return smallestId; - } - async getOutput(action) { - const entries = action.entries.slice(); - // Determine the two smallest streams by estimated count - const entriesTotalItems = (await Promise.all(action.entries.map((entry) => entry.metadata()))) - .map((metadata) => 'totalItems' in metadata ? metadata.totalItems : Infinity); - const smallestIndex1 = ActorRdfJoinMultiSmallest.getSmallestPatternId(entriesTotalItems); - const smallestItem1 = entries.splice(smallestIndex1, 1)[0]; - const smallestCount1 = entriesTotalItems.splice(smallestIndex1, 1); - const smallestIndex2 = ActorRdfJoinMultiSmallest.getSmallestPatternId(entriesTotalItems); - const smallestItem2 = entries.splice(smallestIndex2, 1)[0]; - const smallestCount2 = entriesTotalItems.splice(smallestIndex2, 1); - // Join the two selected streams, and then join the result with the remaining streams - const firstEntry = await this.mediatorJoin.mediate({ entries: [smallestItem1, smallestItem2] }); - entries.push(firstEntry); - return await this.mediatorJoin.mediate({ entries }); - } - async getIterations(action) { - return (await Promise.all(action.entries.map((entry) => entry.metadata()))) - .reduce((acc, value) => acc * value.totalItems, 1); - } -} -exports.ActorRdfJoinMultiSmallest = ActorRdfJoinMultiSmallest; - -},{"@comunica/bus-rdf-join":213}],97:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfJoinSymmetricHash")); - -},{"./lib/ActorRdfJoinSymmetricHash":98}],98:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_join_1 = require("@comunica/bus-rdf-join"); -const asyncjoin_1 = require("asyncjoin"); -/** - * A comunica Hash RDF Join Actor. - */ -class ActorRdfJoinSymmetricHash extends bus_rdf_join_1.ActorRdfJoin { - constructor(args) { - super(args, 2); - } - /** - * Creates a hash of the given bindings by concatenating the results of the given variables. - * This function will not sort the variables and expects them to be in the same order for every call. - * @param {Bindings} bindings - * @param {string[]} variables - * @returns {string} - */ - static hash(bindings, variables) { - return variables.map((v) => bindings.get(v)).join(''); - } - async getOutput(action) { - const variables = bus_rdf_join_1.ActorRdfJoin.overlappingVariables(action); - const join = new asyncjoin_1.SymmetricHashJoin(action.entries[0].bindingsStream, action.entries[1].bindingsStream, (entry) => ActorRdfJoinSymmetricHash.hash(entry, variables), bus_rdf_join_1.ActorRdfJoin.join); - return { type: 'bindings', bindingsStream: join, variables: bus_rdf_join_1.ActorRdfJoin.joinVariables(action) }; - } - async getIterations(action) { - return (await action.entries[0].metadata()).totalItems + (await action.entries[1].metadata()).totalItems; - } -} -exports.ActorRdfJoinSymmetricHash = ActorRdfJoinSymmetricHash; - -},{"@comunica/bus-rdf-join":213,"asyncjoin":292}],99:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfMetadataAll")); - -},{"./lib/ActorRdfMetadataAll":100}],100:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_metadata_1 = require("@comunica/bus-rdf-metadata"); -const stream_1 = require("stream"); -/** - * A comunica All RDF Metadata Actor. - */ -class ActorRdfMetadataAll extends bus_rdf_metadata_1.ActorRdfMetadata { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - async run(action) { - const data = new stream_1.Readable({ objectMode: true }); - const metadata = new stream_1.Readable({ objectMode: true }); - // Delay attachment of listeners until the data or metadata stream is being read. - const attachListeners = () => { - // Attach listeners only once - data._read = metadata._read = () => { return; }; - // Forward errors - action.quads.on('error', (error) => { - data.emit('error', error); - metadata.emit('error', error); - }); - // Forward quads to both streams - action.quads.on('data', (quad) => { - data.push(quad); - metadata.push(quad); - }); - // Terminate both streams on-end - action.quads.on('end', () => { - data.push(null); - metadata.push(null); - }); - }; - data._read = metadata._read = () => { attachListeners(); }; - return { data, metadata }; - } -} -exports.ActorRdfMetadataAll = ActorRdfMetadataAll; - -},{"@comunica/bus-rdf-metadata":219,"stream":651}],101:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfMetadataExtractHydraControls")); - -},{"./lib/ActorRdfMetadataExtractHydraControls":102}],102:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_metadata_extract_1 = require("@comunica/bus-rdf-metadata-extract"); -const uritemplate_1 = require("uritemplate"); -/** - * An RDF Metadata Extract Actor that extracts all Hydra controls from the metadata stream. - */ -class ActorRdfMetadataExtractHydraControls extends bus_rdf_metadata_extract_1.ActorRdfMetadataExtract { - constructor(args) { - super(args); - this.parsedUriTemplateCache = {}; - } - async test(action) { - return true; - } - /** - * Collect all Hydra page links from the given Hydra properties object. - * @param pageUrl The page URL in which the Hydra properties are defined. - * @param hydraProperties The collected Hydra properties. - * @return The Hydra links - */ - getLinks(pageUrl, hydraProperties) { - return ActorRdfMetadataExtractHydraControls.LINK_TYPES.reduce((metadata, link) => { - // First check the correct hydra:next, then the deprecated hydra:nextPage - const links = hydraProperties[link] || hydraProperties[link + 'Page']; - const linkTargets = links && links[pageUrl]; - metadata[link] = linkTargets && linkTargets.length > 0 ? linkTargets[0] : null; - return metadata; - }, {}); - } - /** - * Parse a URI template, or retrieve it from a cache. - * @param {string} template A URI template string. - * @return {} A parsed URI template object. - */ - parseUriTemplateCached(template) { - const cachedUriTemplate = this.parsedUriTemplateCache[template]; - if (cachedUriTemplate) { - return cachedUriTemplate; - } - return this.parsedUriTemplateCache[template] = uritemplate_1.parse(template); - } - /** - * Collect all search forms from the given Hydra properties object. - * @param hydraProperties The collected Hydra properties. - * @return The search forms. - */ - getSearchForms(hydraProperties) { - const searchFormData = hydraProperties.search; - const searchForms = []; - if (searchFormData) { - for (const dataset in searchFormData) { - for (const searchFormId of searchFormData[dataset]) { - const searchTemplates = (hydraProperties.template || {})[searchFormId] || []; - // Parse the template - if (searchTemplates.length !== 1) { - throw new Error('Expected 1 hydra:template for ' + searchFormId); - } - const template = searchTemplates[0]; - const searchTemplate = this.parseUriTemplateCached(template); - // Parse the template mappings - const mappings = ((hydraProperties.mapping || {})[searchFormId] || []) - .reduce((acc, mapping) => { - const variable = ((hydraProperties.variable || {})[mapping] || [])[0]; - const property = ((hydraProperties.property || {})[mapping] || [])[0]; - if (!variable) { - throw new Error('Expected a hydra:variable for ' + mapping); - } - if (!property) { - throw new Error('Expected a hydra:property for ' + mapping); - } - acc[property] = variable; - return acc; - }, {}); - // Gets the URL of the Triple Pattern Fragment with the given triple pattern - const getUri = (entries) => { - return searchTemplate.expand(Object.keys(entries).reduce((variables, key) => { - variables[mappings[key]] = entries[key]; - return variables; - }, {})); - }; - searchForms.push({ dataset, template, mappings, getUri }); - } - } - } - return { values: searchForms }; - } - /** - * Collect all hydra properties from a given metadata stream - * in a nice convenient nested hash (property / subject / objects). - * @param {RDF.Stream} metadata - * @return The collected Hydra properties. - */ - getHydraProperties(metadata) { - return new Promise((resolve, reject) => { - metadata.on('error', reject); - // Collect all hydra properties in a nice convenient nested hash (property / subject / objects). - const hydraProperties = {}; - metadata.on('data', (quad) => { - if (quad.predicate.value.startsWith(ActorRdfMetadataExtractHydraControls.HYDRA)) { - const property = quad.predicate.value.substr(ActorRdfMetadataExtractHydraControls.HYDRA.length); - const subjectProperties = hydraProperties[property] || (hydraProperties[property] = {}); - const objects = subjectProperties[quad.subject.value] || (subjectProperties[quad.subject.value] = []); - objects.push(quad.object.value); - } - }); - metadata.on('end', () => resolve(hydraProperties)); - }); - } - async run(action) { - const metadata = {}; - const hydraProperties = await this.getHydraProperties(action.metadata); - require('lodash.assign')(metadata, this.getLinks(action.url, hydraProperties)); - metadata.searchForms = this.getSearchForms(hydraProperties); - return { metadata }; - } -} -exports.ActorRdfMetadataExtractHydraControls = ActorRdfMetadataExtractHydraControls; -ActorRdfMetadataExtractHydraControls.HYDRA = 'http://www.w3.org/ns/hydra/core#'; -ActorRdfMetadataExtractHydraControls.LINK_TYPES = ['first', 'next', 'previous', 'last']; - -},{"@comunica/bus-rdf-metadata-extract":215,"lodash.assign":499,"uritemplate":676}],103:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfMetadataExtractHydraCount")); - -},{"./lib/ActorRdfMetadataExtractHydraCount":104}],104:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_metadata_extract_1 = require("@comunica/bus-rdf-metadata-extract"); -/** - * An RDF Metadata Extract Actor that extracts total items counts from a metadata stream based on the given predicates. - */ -class ActorRdfMetadataExtractHydraCount extends bus_rdf_metadata_extract_1.ActorRdfMetadataExtract { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - run(action) { - return new Promise((resolve, reject) => { - // Forward errors - action.metadata.on('error', reject); - // Immediately resolve when a value has been found. - action.metadata.on('data', (quad) => { - if (this.predicates.indexOf(quad.predicate.value) >= 0) { - resolve({ metadata: { totalItems: parseInt(quad.object.value, 10) } }); - } - }); - // If no value has been found, assume infinity. - action.metadata.on('end', () => { - resolve({ metadata: { totalItems: Infinity } }); - }); - }); - } -} -exports.ActorRdfMetadataExtractHydraCount = ActorRdfMetadataExtractHydraCount; - -},{"@comunica/bus-rdf-metadata-extract":215}],105:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfMetadataExtractSparqlService")); - -},{"./lib/ActorRdfMetadataExtractSparqlService":106}],106:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_metadata_extract_1 = require("@comunica/bus-rdf-metadata-extract"); -const relative_to_absolute_iri_1 = require("relative-to-absolute-iri"); -/** - * A comunica RDF Metadata Extract Actor for SPARQL service descriptions. - */ -class ActorRdfMetadataExtractSparqlService extends bus_rdf_metadata_extract_1.ActorRdfMetadataExtract { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - async run(action) { - return new Promise((resolve, reject) => { - // Forward errors - action.metadata.on('error', reject); - // Immediately resolve when a SPARQL service endpoint URL has been found - const metadata = {}; - action.metadata.on('data', (quad) => { - if (quad.predicate.value === 'http://www.w3.org/ns/sparql-service-description#endpoint' - && (quad.subject.termType === 'BlankNode' || quad.subject.value === action.url)) { - metadata.sparqlService = quad.object.termType === 'Literal' - ? relative_to_absolute_iri_1.resolve(quad.object.value, action.url) - : quad.object.value; - } - else if (quad.predicate.value === 'http://www.w3.org/ns/sparql-service-description#defaultGraph') { - metadata.defaultGraph = quad.object.value; - } - }); - // If no value has been found, emit nothing. - action.metadata.on('end', () => { - resolve({ metadata }); - }); - }); - } -} -exports.ActorRdfMetadataExtractSparqlService = ActorRdfMetadataExtractSparqlService; - -},{"@comunica/bus-rdf-metadata-extract":215,"relative-to-absolute-iri":589}],107:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfMetadataPrimaryTopic")); - -},{"./lib/ActorRdfMetadataPrimaryTopic":108}],108:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_metadata_1 = require("@comunica/bus-rdf-metadata"); -const stream_1 = require("stream"); -/** - * An RDF Metadata Actor that splits off the metadata based on the existence of a 'foaf:primaryTopic' link. - * Only non-triple quad streams are supported. - */ -class ActorRdfMetadataPrimaryTopic extends bus_rdf_metadata_1.ActorRdfMetadata { - constructor(args) { - super(args); - } - async test(action) { - if (action.triples) { - throw new Error('This actor only supports non-triple quad streams.'); - } - return true; - } - async run(action) { - const data = new stream_1.Readable({ objectMode: true }); - const metadata = new stream_1.Readable({ objectMode: true }); - // Delay attachment of listeners until the data or metadata stream is being read. - const attachListeners = () => { - // Attach listeners only once - data._read = metadata._read = () => { return; }; - // Forward errors - action.quads.on('error', (error) => { - data.emit('error', error); - metadata.emit('error', error); - }); - // First pass over data to categorize in graphs, - // and to detect the primaryTopic triple. - const graphs = {}; - let endpointIdentifier = null; - const primaryTopics = {}; - action.quads.on('data', (quad) => { - if (quad.predicate.value === 'http://rdfs.org/ns/void#subset' - && quad.object.value === action.url) { - endpointIdentifier = quad.subject.value; - } - else if (quad.predicate.value === 'http://xmlns.com/foaf/0.1/primaryTopic') { - primaryTopics[quad.object.value] = quad.subject.value; - } - let quads = graphs[quad.graph.value]; - if (!quads) { - quads = graphs[quad.graph.value] = []; - } - quads.push(quad); - }); - // When the stream has finished, - // determine the appropriate metadata graph, - // and emit all quads to the appropriate streams. - action.quads.on('end', () => { - const metadataGraph = endpointIdentifier ? primaryTopics[endpointIdentifier] : null; - for (const graphName in graphs) { - if (graphName === metadataGraph) { - for (const quad of graphs[graphName]) { - metadata.push(quad); - } - // Also emit metadata to data if requested - if (this.metadataToData) { - for (const quad of graphs[graphName]) { - data.push(quad); - } - } - } - else { - for (const quad of graphs[graphName]) { - data.push(quad); - } - if (!metadataGraph && this.dataToMetadataOnInvalidMetadataGraph) { - for (const quad of graphs[graphName]) { - metadata.push(quad); - } - } - } - } - data.push(null); - metadata.push(null); - }); - }; - data._read = metadata._read = () => { attachListeners(); }; - return { data, metadata }; - } -} -exports.ActorRdfMetadataPrimaryTopic = ActorRdfMetadataPrimaryTopic; - -},{"@comunica/bus-rdf-metadata":219,"stream":651}],109:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfParseHtmlRdfa")); - -},{"./lib/ActorRdfParseHtmlRdfa":110}],110:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_parse_html_1 = require("@comunica/bus-rdf-parse-html"); -const rdfa_streaming_parser_1 = require("rdfa-streaming-parser"); -/** - * A comunica RDFa RDF Parse Html Actor. - */ -class ActorRdfParseHtmlRdfa extends bus_rdf_parse_html_1.ActorRdfParseHtml { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - async run(action) { - const mediaType = action.headers ? action.headers.get('content-type') : null; - const language = action.headers ? action.headers.get('content-language') : null; - const profile = mediaType && mediaType.indexOf('xml') >= 0 ? 'xhtml' : 'html'; - const htmlParseListener = new rdfa_streaming_parser_1.RdfaParser({ baseIRI: action.baseIRI, profile, language }); - htmlParseListener.on('error', action.error); - htmlParseListener.on('data', action.emit); - const onTagEndOld = htmlParseListener.onEnd; - htmlParseListener.onEnd = () => { - onTagEndOld.call(htmlParseListener); - action.end(); - }; - return { htmlParseListener }; - } -} -exports.ActorRdfParseHtmlRdfa = ActorRdfParseHtmlRdfa; - -},{"@comunica/bus-rdf-parse-html":222,"rdfa-streaming-parser":564}],111:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lib/ActorRdfParseHtmlScript")); - -},{"./lib/ActorRdfParseHtmlScript":112}],112:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const bus_rdf_parse_html_1 = require("@comunica/bus-rdf-parse-html"); -const HtmlScriptListener_1 = require("./HtmlScriptListener"); -/** - * A HTML script RDF Parse actor that listens on the 'rdf-parse' bus. - * - * It is able to extract and parse any RDF serialization from script tags in HTML files - * and announce the presence of them by media type. - */ -class ActorRdfParseHtmlScript extends bus_rdf_parse_html_1.ActorRdfParseHtml { - constructor(args) { - super(args); - } - async test(action) { - return true; - } - async run(action) { - const supportedTypes = (await this.mediatorRdfParseMediatypes - .mediate({ context: action.context, mediaTypes: true })).mediaTypes; - const htmlParseListener = new HtmlScriptListener_1.HtmlScriptListener(this.mediatorRdfParseHandle, action.emit, action.error, action.end, supportedTypes, action.context, action.baseIRI, action.headers); - return { htmlParseListener }; - } -} -exports.ActorRdfParseHtmlScript = ActorRdfParseHtmlScript; - -},{"./HtmlScriptListener":113,"@comunica/bus-rdf-parse-html":222}],113:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const relative_to_absolute_iri_1 = require("relative-to-absolute-iri"); -/** - * An HTML parse listeners that detects