ldkit 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/library/decoder.js +5 -0
- package/esm/library/encoder.js +3 -3
- package/esm/library/engine/mod.js +2 -0
- package/esm/library/engine/query_engine.js +77 -0
- package/esm/library/engine/query_engine_proxy.js +35 -0
- package/esm/library/global.js +25 -0
- package/esm/library/namespaces/mod.js +1 -0
- package/esm/library/namespaces/rdfs.js +22 -0
- package/esm/library/rdf.js +78 -6
- package/esm/library/resource/query_builder.js +44 -37
- package/esm/library/resource/resource.js +19 -10
- package/esm/library/rxjs.js +2 -2
- package/esm/mod.js +1 -1
- package/package.json +2 -2
- package/script/library/decoder.js +5 -0
- package/script/library/encoder.js +2 -2
- package/script/library/engine/mod.js +7 -0
- package/script/library/engine/query_engine.js +81 -0
- package/script/library/engine/query_engine_proxy.js +39 -0
- package/script/library/global.js +32 -0
- package/script/library/namespaces/mod.js +3 -1
- package/script/library/namespaces/rdfs.js +24 -0
- package/script/library/rdf.js +84 -37
- package/script/library/resource/query_builder.js +41 -34
- package/script/library/resource/resource.js +19 -10
- package/script/library/rxjs.js +6 -3
- package/script/mod.js +4 -4
- package/types/library/decoder.d.ts +2 -3
- package/types/library/encoder.d.ts +2 -3
- package/types/library/engine/mod.d.ts +2 -0
- package/types/library/engine/query_engine.d.ts +10 -0
- package/types/library/engine/query_engine_proxy.d.ts +10 -0
- package/types/library/global.d.ts +5 -0
- package/types/library/namespaces/dcterms.d.ts +1 -1
- package/types/library/namespaces/mod.d.ts +1 -0
- package/types/library/namespaces/rdf.d.ts +4 -4
- package/types/library/namespaces/rdfs.d.ts +21 -0
- package/types/library/namespaces/schema.d.ts +6 -6
- package/types/library/namespaces/skos.d.ts +1 -1
- package/types/library/rdf.d.ts +47 -8
- package/types/library/resource/query_builder.d.ts +5 -5
- package/types/library/resource/query_helper.d.ts +6 -7
- package/types/library/resource/resource.d.ts +8 -8
- package/types/library/rxjs.d.ts +2 -2
- package/types/mod.d.ts +2 -1
- package/esm/library/context.js +0 -13
- package/esm/library/engine.js +0 -9
- package/script/library/context.js +0 -19
- package/script/library/engine.js +0 -16
- package/types/library/context.d.ts +0 -9
- package/types/library/engine.d.ts +0 -6
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
object: "rdf:object";
|
|
3
|
+
subject: "rdf:subject";
|
|
4
|
+
predicate: "rdf:predicate";
|
|
5
|
+
value: "rdf:value";
|
|
6
|
+
type: "rdf:type";
|
|
3
7
|
Alt: "rdf:Alt";
|
|
4
8
|
Bag: "rdf:Bag";
|
|
5
9
|
CompoundLiteral: "rdf:CompoundLiteral";
|
|
@@ -16,11 +20,7 @@ declare const _default: {
|
|
|
16
20
|
langString: "rdf:langString";
|
|
17
21
|
language: "rdf:language";
|
|
18
22
|
nil: "rdf:nil";
|
|
19
|
-
predicate: "rdf:predicate";
|
|
20
23
|
rest: "rdf:rest";
|
|
21
|
-
subject: "rdf:subject";
|
|
22
|
-
type: "rdf:type";
|
|
23
|
-
value: "rdf:value";
|
|
24
24
|
} & {
|
|
25
25
|
$prefix: "rdf:";
|
|
26
26
|
$iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Literal: "rdfs:Literal";
|
|
3
|
+
Class: "rdfs:Class";
|
|
4
|
+
Container: "rdfs:Container";
|
|
5
|
+
ContainerMembershipProperty: "rdfs:ContainerMembershipProperty";
|
|
6
|
+
Datatype: "rdfs:Datatype";
|
|
7
|
+
Resource: "rdfs:Resource";
|
|
8
|
+
comment: "rdfs:comment";
|
|
9
|
+
domain: "rdfs:domain";
|
|
10
|
+
isDefinedBy: "rdfs:isDefinedBy";
|
|
11
|
+
label: "rdfs:label";
|
|
12
|
+
member: "rdfs:member";
|
|
13
|
+
range: "rdfs:range";
|
|
14
|
+
seeAlso: "rdfs:seeAlso";
|
|
15
|
+
subClassOf: "rdfs:subClassOf";
|
|
16
|
+
subPropertyOf: "rdfs:subPropertyOf";
|
|
17
|
+
} & {
|
|
18
|
+
$prefix: "rdfs:";
|
|
19
|
+
$iri: "http://www.w3.org/2000/01/rdf-schema#";
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
object: "schema:object";
|
|
3
|
+
value: "schema:value";
|
|
4
|
+
query: "schema:query";
|
|
5
|
+
error: "schema:error";
|
|
3
6
|
map: "schema:map";
|
|
4
7
|
Property: "schema:Property";
|
|
5
8
|
language: "schema:language";
|
|
6
|
-
|
|
9
|
+
Class: "schema:Class";
|
|
10
|
+
comment: "schema:comment";
|
|
11
|
+
member: "schema:member";
|
|
7
12
|
abstract: "schema:abstract";
|
|
8
13
|
audience: "schema:audience";
|
|
9
14
|
contributor: "schema:contributor";
|
|
@@ -200,7 +205,6 @@ declare const _default: {
|
|
|
200
205
|
CivicStructure: "schema:CivicStructure";
|
|
201
206
|
Claim: "schema:Claim";
|
|
202
207
|
ClaimReview: "schema:ClaimReview";
|
|
203
|
-
Class: "schema:Class";
|
|
204
208
|
CleaningFee: "schema:CleaningFee";
|
|
205
209
|
Clinician: "schema:Clinician";
|
|
206
210
|
Clip: "schema:Clip";
|
|
@@ -1563,7 +1567,6 @@ declare const _default: {
|
|
|
1563
1567
|
collectionSize: "schema:collectionSize";
|
|
1564
1568
|
color: "schema:color";
|
|
1565
1569
|
colorist: "schema:colorist";
|
|
1566
|
-
comment: "schema:comment";
|
|
1567
1570
|
commentCount: "schema:commentCount";
|
|
1568
1571
|
commentText: "schema:commentText";
|
|
1569
1572
|
commentTime: "schema:commentTime";
|
|
@@ -1766,7 +1769,6 @@ declare const _default: {
|
|
|
1766
1769
|
episodeNumber: "schema:episodeNumber";
|
|
1767
1770
|
episodes: "schema:episodes";
|
|
1768
1771
|
equal: "schema:equal";
|
|
1769
|
-
error: "schema:error";
|
|
1770
1772
|
estimatedCost: "schema:estimatedCost";
|
|
1771
1773
|
estimatedFlightDuration: "schema:estimatedFlightDuration";
|
|
1772
1774
|
estimatedSalary: "schema:estimatedSalary";
|
|
@@ -2093,7 +2095,6 @@ declare const _default: {
|
|
|
2093
2095
|
medicalSpecialty: "schema:medicalSpecialty";
|
|
2094
2096
|
medicineSystem: "schema:medicineSystem";
|
|
2095
2097
|
meetsEmissionStandard: "schema:meetsEmissionStandard";
|
|
2096
|
-
member: "schema:member";
|
|
2097
2098
|
memberOf: "schema:memberOf";
|
|
2098
2099
|
members: "schema:members";
|
|
2099
2100
|
membershipNumber: "schema:membershipNumber";
|
|
@@ -2327,7 +2328,6 @@ declare const _default: {
|
|
|
2327
2328
|
purchaseDate: "schema:purchaseDate";
|
|
2328
2329
|
qualifications: "schema:qualifications";
|
|
2329
2330
|
quarantineGuidelines: "schema:quarantineGuidelines";
|
|
2330
|
-
query: "schema:query";
|
|
2331
2331
|
quest: "schema:quest";
|
|
2332
2332
|
question: "schema:question";
|
|
2333
2333
|
rangeIncludes: "schema:rangeIncludes";
|
package/types/library/rdf.d.ts
CHANGED
|
@@ -1,14 +1,53 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type {
|
|
1
|
+
import type { Bindings, BlankNode, Literal, NamedNode, Quad, Term, Variable } from "rdf-js";
|
|
2
|
+
export type { Bindings, BlankNode, Literal, NamedNode, Quad, Term, Variable };
|
|
3
|
+
import type * as RDF from "rdf-js";
|
|
4
|
+
export type { RDF };
|
|
3
5
|
export { fromRdf, toRdf } from "rdf-literal";
|
|
4
|
-
import * as DataFactory from "rdf-data-factory";
|
|
5
6
|
export { DataFactory } from "rdf-data-factory";
|
|
7
|
+
import { BindingsFactory as ComunicaBindingsFactory } from "@comunica/bindings-factory";
|
|
8
|
+
import type { IDataSource, IQueryContextCommon } from "@comunica/types";
|
|
9
|
+
export declare type LDkitContext = {
|
|
10
|
+
graph?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type Context = LDkitContext & RDF.QueryStringContext & RDF.QuerySourceContext<IDataSource> & IQueryContextCommon;
|
|
14
|
+
export declare type IQueryEngine = RDF.StringSparqlQueryable<RDF.SparqlResultSupport, Context>;
|
|
6
15
|
export declare type Iri = string;
|
|
7
16
|
export declare type Node = Map<Iri, Term[]>;
|
|
8
17
|
export declare type Graph = Map<Iri, Node>;
|
|
9
|
-
export declare const namedNode: <Iri_1 extends string = string>(value: Iri_1) => NamedNode<Iri_1>;
|
|
10
|
-
export declare const blankNode: (value: string) => DataFactory.BlankNode;
|
|
11
|
-
export declare const literal: (value: string, languageOrDatatype?: string | NamedNode) => Literal;
|
|
12
|
-
export declare const quad: (subject: Quad["subject"], predicate: Quad["predicate"], object: Quad["object"], graph?: Quad["graph"]) => Quad;
|
|
13
|
-
export declare const variable: (value: string) => Variable;
|
|
14
18
|
export declare const quadsToGraph: (quads: Quad[]) => Graph;
|
|
19
|
+
export declare namespace RDFJSON {
|
|
20
|
+
type Term = {
|
|
21
|
+
type: "uri" | "literal" | "bnode";
|
|
22
|
+
value: string;
|
|
23
|
+
"xml:lang"?: string;
|
|
24
|
+
datatype?: string;
|
|
25
|
+
};
|
|
26
|
+
type Bindings = Record<string, Term>;
|
|
27
|
+
interface TermFactory {
|
|
28
|
+
fromJson(jsonTerm: Term): RDF.Term;
|
|
29
|
+
}
|
|
30
|
+
interface BindingsFactory {
|
|
31
|
+
fromJson(jsonBindings: Bindings): RDF.Bindings;
|
|
32
|
+
}
|
|
33
|
+
interface QuadFactory {
|
|
34
|
+
fromJson(jsonBindings: Bindings): RDF.Quad;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export declare class TermFactory implements RDFJSON.TermFactory {
|
|
38
|
+
protected readonly dataFactory: RDF.DataFactory;
|
|
39
|
+
constructor(dataFactory?: RDF.DataFactory);
|
|
40
|
+
fromJson(jsonTerm: RDFJSON.Term): BlankNode | Literal | NamedNode<string>;
|
|
41
|
+
}
|
|
42
|
+
export declare class BindingsFactory extends ComunicaBindingsFactory implements RDFJSON.BindingsFactory {
|
|
43
|
+
protected readonly localDataFactory: RDF.DataFactory;
|
|
44
|
+
protected readonly termFactory: RDFJSON.TermFactory;
|
|
45
|
+
constructor(dataFactory?: RDF.DataFactory, termFactory?: RDFJSON.TermFactory);
|
|
46
|
+
fromJson(jsonBindings: RDFJSON.Bindings): Bindings;
|
|
47
|
+
}
|
|
48
|
+
export declare class QuadFactory implements RDFJSON.QuadFactory {
|
|
49
|
+
protected readonly dataFactory: RDF.DataFactory;
|
|
50
|
+
protected readonly bindingsFactory: RDFJSON.BindingsFactory;
|
|
51
|
+
constructor(dataFactory?: RDF.DataFactory, bindingsFactory?: RDFJSON.BindingsFactory);
|
|
52
|
+
fromJson(jsonBindings: RDFJSON.Bindings): Quad;
|
|
53
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { Schema } from "../schema/mod.js";
|
|
2
|
-
import {
|
|
3
|
-
import type { Context } from "../context.js";
|
|
2
|
+
import { type Context, type Iri, type RDF } from "../rdf.js";
|
|
4
3
|
import type { Entity } from "./types.js";
|
|
5
4
|
export declare class QueryBuilder {
|
|
6
5
|
private readonly schema;
|
|
7
6
|
private readonly schemaProperties;
|
|
8
7
|
private readonly context;
|
|
8
|
+
private readonly df;
|
|
9
9
|
constructor(schema: Schema, context: Context);
|
|
10
10
|
private getResourceSignature;
|
|
11
11
|
private getTypesSignature;
|
|
12
12
|
private entitiesToQuads;
|
|
13
13
|
private getShape;
|
|
14
14
|
countQuery(): string;
|
|
15
|
-
getQuery(where?: string | Quad[], limit?: number): string;
|
|
15
|
+
getQuery(where?: string | RDF.Quad[], limit?: number): string;
|
|
16
16
|
getByIrisQuery(iris: Iri[]): string;
|
|
17
17
|
insertQuery(entities: Entity[]): string;
|
|
18
|
-
insertDataQuery(quads: Quad[]): string;
|
|
18
|
+
insertDataQuery(quads: RDF.Quad[]): string;
|
|
19
19
|
deleteQuery: (iris: Iri[]) => string;
|
|
20
|
-
deleteDataQuery(quads: Quad[]): string;
|
|
20
|
+
deleteDataQuery(quads: RDF.Quad[]): string;
|
|
21
21
|
updateQuery(entities: Entity[]): string;
|
|
22
22
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Context } from "../
|
|
1
|
+
import type { Context, RDF } from "../rdf.js";
|
|
2
2
|
import type { Schema } from "../schema/mod.js";
|
|
3
|
-
import type { Quad } from "../rdf.js";
|
|
4
3
|
import type { Entity } from "./types.js";
|
|
5
4
|
export declare class QueryHelper {
|
|
6
5
|
private readonly entity;
|
|
@@ -10,11 +9,11 @@ export declare class QueryHelper {
|
|
|
10
9
|
private quads?;
|
|
11
10
|
private variableQuads?;
|
|
12
11
|
constructor(entity: Entity, schema: Schema, context: Context, variableInitCounter?: number);
|
|
13
|
-
getQuads(): Quad[];
|
|
14
|
-
getVariableQuads(): Quad[];
|
|
15
|
-
getDeleteQuads(): Quad[];
|
|
16
|
-
getInsertQuads(): Quad[];
|
|
17
|
-
getWhereQuads(): Quad[];
|
|
12
|
+
getQuads(): RDF.Quad[];
|
|
13
|
+
getVariableQuads(): RDF.Quad[];
|
|
14
|
+
getDeleteQuads(): RDF.Quad[];
|
|
15
|
+
getInsertQuads(): RDF.Quad[];
|
|
16
|
+
getWhereQuads(): RDF.Quad[];
|
|
18
17
|
private getEntityWithReplacedVariables;
|
|
19
18
|
private replaceVariables;
|
|
20
19
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { Iri,
|
|
2
|
-
import { type
|
|
3
|
-
import { type SchemaPrototype, type SchemaInterface, type SchemaInterfaceIdentity } from "../schema/mod.js";
|
|
1
|
+
import type { Context, IQueryEngine, Iri, RDF } from "../rdf.js";
|
|
2
|
+
import { type SchemaInterface, type SchemaInterfaceIdentity, type SchemaPrototype } from "../schema/mod.js";
|
|
4
3
|
import type { Entity } from "./types.js";
|
|
5
|
-
export declare const createResource: <T extends SchemaPrototype>(spec: T, context?: Context) => Resource<T, SchemaInterface<T>>;
|
|
4
|
+
export declare const createResource: <T extends SchemaPrototype>(spec: T, context?: Context, engine?: IQueryEngine) => Resource<T, SchemaInterface<T>>;
|
|
6
5
|
export declare class Resource<S extends SchemaPrototype, I = SchemaInterface<S>> {
|
|
7
6
|
private readonly schema;
|
|
8
7
|
private readonly context;
|
|
8
|
+
private readonly engine;
|
|
9
9
|
private readonly queryBuilder;
|
|
10
10
|
private readonly $trigger;
|
|
11
|
-
constructor(schema: S, context?: Context);
|
|
11
|
+
constructor(schema: S, context?: Context, engine?: IQueryEngine);
|
|
12
12
|
private decode;
|
|
13
13
|
count(): import("rxjs/internal/Observable").Observable<number>;
|
|
14
14
|
query(sparqlConstructQuery: string): import("rxjs/internal/Observable").Observable<I[]>;
|
|
15
|
-
find(where?: string | Quad[], limit?: number): import("rxjs/internal/Observable").Observable<I[]>;
|
|
15
|
+
find(where?: string | RDF.Quad[], limit?: number): import("rxjs/internal/Observable").Observable<I[]>;
|
|
16
16
|
findByIri(iri: Iri): import("rxjs/internal/Observable").Observable<I | undefined>;
|
|
17
17
|
findByIris(iris: Iri[]): import("rxjs/internal/Observable").Observable<I[]>;
|
|
18
18
|
private updateQuery;
|
|
19
19
|
insert(...entities: Entity<I>[]): import("rxjs/internal/Observable").Observable<void>;
|
|
20
|
-
insertData(...quads: Quad[]): import("rxjs/internal/Observable").Observable<void>;
|
|
20
|
+
insertData(...quads: RDF.Quad[]): import("rxjs/internal/Observable").Observable<void>;
|
|
21
21
|
update(...entities: Entity<I>[]): import("rxjs/internal/Observable").Observable<void>;
|
|
22
22
|
delete(...identities: SchemaInterfaceIdentity[] | Iri[]): import("rxjs/internal/Observable").Observable<void>;
|
|
23
|
-
deleteData(...quads: Quad[]): import("rxjs/internal/Observable").Observable<void>;
|
|
23
|
+
deleteData(...quads: RDF.Quad[]): import("rxjs/internal/Observable").Observable<void>;
|
|
24
24
|
}
|
package/types/library/rxjs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { map, switchMap, tap,
|
|
1
|
+
export { BehaviorSubject, firstValueFrom, from, lastValueFrom, type Observable, of, } from "rxjs";
|
|
2
|
+
export { map, share, switchMap, tap, } from "rxjs/operators";
|
package/types/mod.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
export { type Context, type IQueryEngine } from "./library/rdf.js";
|
|
2
|
+
export { setDefaultContext, setDefaultEngine } from "./library/global.js";
|
|
1
3
|
export { type SchemaInterface } from "./library/schema/mod.js";
|
|
2
4
|
export { createResource, type Resource } from "./library/resource/mod.js";
|
|
3
5
|
export { createNamespace } from "./library/namespaces/namespace.js";
|
|
4
|
-
export { type Context, createContext, createDefaultContext, } from "./library/context.js";
|
package/esm/library/context.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
let defaultContext = undefined;
|
|
2
|
-
export const createContext = (context) => {
|
|
3
|
-
return context;
|
|
4
|
-
};
|
|
5
|
-
export const createDefaultContext = (context) => {
|
|
6
|
-
defaultContext = createContext(context);
|
|
7
|
-
};
|
|
8
|
-
export const resolveContext = (context) => {
|
|
9
|
-
if (!context && !defaultContext) {
|
|
10
|
-
throw new Error("No context found. Please create a default context or pass one to createResource function");
|
|
11
|
-
}
|
|
12
|
-
return context || defaultContext;
|
|
13
|
-
};
|
package/esm/library/engine.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { QueryEngine } from "@comunica/query-sparql";
|
|
2
|
-
import { from, map, switchMap } from "./rxjs.js";
|
|
3
|
-
import { resolveContext } from "./context.js";
|
|
4
|
-
import { quadsToGraph } from "./rdf.js";
|
|
5
|
-
const engine = new QueryEngine();
|
|
6
|
-
export const booleanQuery = (query, context) => from(engine.queryBoolean(query, resolveContext(context)));
|
|
7
|
-
export const bindingsQuery = (query, context) => from(engine.queryBindings(query, resolveContext(context))).pipe(switchMap((stream) => from(stream.toArray())));
|
|
8
|
-
export const quadsQuery = (query, context) => from(engine.queryQuads(query, resolveContext(context))).pipe(switchMap((stream) => from(stream.toArray())), map((quads) => quadsToGraph(quads)));
|
|
9
|
-
export const updateQuery = (query, context) => from(engine.queryVoid(query, resolveContext(context)));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveContext = exports.createDefaultContext = exports.createContext = void 0;
|
|
4
|
-
let defaultContext = undefined;
|
|
5
|
-
const createContext = (context) => {
|
|
6
|
-
return context;
|
|
7
|
-
};
|
|
8
|
-
exports.createContext = createContext;
|
|
9
|
-
const createDefaultContext = (context) => {
|
|
10
|
-
defaultContext = (0, exports.createContext)(context);
|
|
11
|
-
};
|
|
12
|
-
exports.createDefaultContext = createDefaultContext;
|
|
13
|
-
const resolveContext = (context) => {
|
|
14
|
-
if (!context && !defaultContext) {
|
|
15
|
-
throw new Error("No context found. Please create a default context or pass one to createResource function");
|
|
16
|
-
}
|
|
17
|
-
return context || defaultContext;
|
|
18
|
-
};
|
|
19
|
-
exports.resolveContext = resolveContext;
|
package/script/library/engine.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateQuery = exports.quadsQuery = exports.bindingsQuery = exports.booleanQuery = void 0;
|
|
4
|
-
const query_sparql_1 = require("@comunica/query-sparql");
|
|
5
|
-
const rxjs_js_1 = require("./rxjs.js");
|
|
6
|
-
const context_js_1 = require("./context.js");
|
|
7
|
-
const rdf_js_1 = require("./rdf.js");
|
|
8
|
-
const engine = new query_sparql_1.QueryEngine();
|
|
9
|
-
const booleanQuery = (query, context) => (0, rxjs_js_1.from)(engine.queryBoolean(query, (0, context_js_1.resolveContext)(context)));
|
|
10
|
-
exports.booleanQuery = booleanQuery;
|
|
11
|
-
const bindingsQuery = (query, context) => (0, rxjs_js_1.from)(engine.queryBindings(query, (0, context_js_1.resolveContext)(context))).pipe((0, rxjs_js_1.switchMap)((stream) => (0, rxjs_js_1.from)(stream.toArray())));
|
|
12
|
-
exports.bindingsQuery = bindingsQuery;
|
|
13
|
-
const quadsQuery = (query, context) => (0, rxjs_js_1.from)(engine.queryQuads(query, (0, context_js_1.resolveContext)(context))).pipe((0, rxjs_js_1.switchMap)((stream) => (0, rxjs_js_1.from)(stream.toArray())), (0, rxjs_js_1.map)((quads) => (0, rdf_js_1.quadsToGraph)(quads)));
|
|
14
|
-
exports.quadsQuery = quadsQuery;
|
|
15
|
-
const updateQuery = (query, context) => (0, rxjs_js_1.from)(engine.queryVoid(query, (0, context_js_1.resolveContext)(context)));
|
|
16
|
-
exports.updateQuery = updateQuery;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { QueryStringContext } from "@comunica/types";
|
|
2
|
-
export declare type LibraryContext = Partial<{
|
|
3
|
-
graph: string;
|
|
4
|
-
language: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare type Context = LibraryContext & QueryStringContext;
|
|
7
|
-
export declare const createContext: (context: Context) => Context;
|
|
8
|
-
export declare const createDefaultContext: (context: Context) => void;
|
|
9
|
-
export declare const resolveContext: (context?: Context) => Context;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Context } from "./context.js";
|
|
2
|
-
import { type Bindings } from "./rdf.js";
|
|
3
|
-
export declare const booleanQuery: (query: string, context?: Context) => import("rxjs/internal/Observable").Observable<boolean>;
|
|
4
|
-
export declare const bindingsQuery: (query: string, context?: Context) => import("rxjs/internal/Observable").Observable<Bindings[]>;
|
|
5
|
-
export declare const quadsQuery: (query: string, context?: Context) => import("rxjs/internal/Observable").Observable<import("./rdf.js").Graph>;
|
|
6
|
-
export declare const updateQuery: (query: string, context?: Context) => import("rxjs/internal/Observable").Observable<void>;
|