From df839189cfd3767085a29a5a0807882ec4a0f5b0 Mon Sep 17 00:00:00 2001 From: Jackson Morgan Date: Thu, 20 Feb 2025 15:22:43 -0500 Subject: [PATCH] Corrected imports and SetIterator --- .../jsonld-dataset-proxy/src/ProxyContext.ts | 2 +- packages/jsonld-dataset-proxy/src/index.ts | 2 +- .../src/setProxy/SetProxy.ts | 8 +++---- .../src/setProxy/WildcardObjectSetProxy.ts | 2 +- .../src/setProxy/WildcardSubjectSetProxy.ts | 2 +- .../src/setProxy/createNewSetProxy.ts | 22 +------------------ .../src/setProxy/isSetProxy.ts | 2 +- .../src/setProxy/ldSet/LdSet.ts | 8 +++---- .../src/subjectProxy/getValueForKey.ts | 2 +- 9 files changed, 15 insertions(+), 35 deletions(-) diff --git a/packages/jsonld-dataset-proxy/src/ProxyContext.ts b/packages/jsonld-dataset-proxy/src/ProxyContext.ts index 3856ef1..6d20e88 100644 --- a/packages/jsonld-dataset-proxy/src/ProxyContext.ts +++ b/packages/jsonld-dataset-proxy/src/ProxyContext.ts @@ -2,7 +2,7 @@ import type { GraphNode, QuadMatch, SubjectNode } from "@ldo/rdf-utils"; import type { BlankNode, Dataset, NamedNode } from "@rdfjs/types"; import { createSubjectHandler } from "./subjectProxy/createSubjectHandler"; import type { SubjectProxy } from "./subjectProxy/SubjectProxy"; -import type { SetProxy } from "./setProxy/setProxy"; +import type { SetProxy } from "./setProxy/SetProxy"; import type { ContextUtil } from "./ContextUtil"; import type { LanguageOrdering } from "./language/languageTypes"; import { namedNode } from "@rdfjs/data-model"; diff --git a/packages/jsonld-dataset-proxy/src/index.ts b/packages/jsonld-dataset-proxy/src/index.ts index 9a43d16..b160b41 100644 --- a/packages/jsonld-dataset-proxy/src/index.ts +++ b/packages/jsonld-dataset-proxy/src/index.ts @@ -18,7 +18,7 @@ export * from "./language/languageTypes"; export * from "./language/languageUtils"; export * from "./setProxy/isSetProxy"; -export * from "./setProxy/setProxy"; +export * from "./setProxy/SetProxy"; export * from "./setProxy/ldSet/LdSet"; export * from "./setProxy/ldSet/BasicLdSet"; diff --git a/packages/jsonld-dataset-proxy/src/setProxy/SetProxy.ts b/packages/jsonld-dataset-proxy/src/setProxy/SetProxy.ts index 787b7c1..f45e6a8 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/SetProxy.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/SetProxy.ts @@ -85,7 +85,7 @@ export abstract class SetProxy< return dataset.match(subject, predicate, object).size; } - entries(): SetIterator<[T, T]> { + entries(): IterableIterator<[T, T]> { const iteratorSet = new Set<[T, T]>(); for (const value of this) { iteratorSet.add([value, value]); @@ -93,15 +93,15 @@ export abstract class SetProxy< return iteratorSet[Symbol.iterator](); } - keys(): SetIterator { + keys(): IterableIterator { return this.values(); } - values(): SetIterator { + values(): IterableIterator { return this[Symbol.iterator](); } - [Symbol.iterator](): SetIterator { + [Symbol.iterator](): IterableIterator { const { dataset } = this.context; const { subject, predicate, object } = this.getSPO(); const quads = dataset.match(subject, predicate, object); diff --git a/packages/jsonld-dataset-proxy/src/setProxy/WildcardObjectSetProxy.ts b/packages/jsonld-dataset-proxy/src/setProxy/WildcardObjectSetProxy.ts index f4913e1..e30493f 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/WildcardObjectSetProxy.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/WildcardObjectSetProxy.ts @@ -6,7 +6,7 @@ import type { } from "@ldo/rdf-utils"; import type { Dataset, Quad } from "@rdfjs/types"; import type { RawValue } from "../util/RawObject"; -import { SetProxy } from "./setProxy"; +import { SetProxy } from "./SetProxy"; import type { ProxyContext } from "../ProxyContext"; import { getNodeFromRawValue } from "../util/getNodeFromRaw"; diff --git a/packages/jsonld-dataset-proxy/src/setProxy/WildcardSubjectSetProxy.ts b/packages/jsonld-dataset-proxy/src/setProxy/WildcardSubjectSetProxy.ts index 9486aaa..415d794 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/WildcardSubjectSetProxy.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/WildcardSubjectSetProxy.ts @@ -6,7 +6,7 @@ import type { } from "@ldo/rdf-utils"; import type { Quad } from "@rdfjs/types"; import type { RawObject } from "../util/RawObject"; -import { SetProxy } from "./setProxy"; +import { SetProxy } from "./SetProxy"; import type { ProxyContext } from "../ProxyContext"; import { getNodeFromRawObject } from "../util/getNodeFromRaw"; diff --git a/packages/jsonld-dataset-proxy/src/setProxy/createNewSetProxy.ts b/packages/jsonld-dataset-proxy/src/setProxy/createNewSetProxy.ts index 6f22a4f..99c06b6 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/createNewSetProxy.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/createNewSetProxy.ts @@ -9,28 +9,8 @@ import type { WildcardObjectSetProxyQuadMatch } from "./WildcardObjectSetProxy"; import { WildcardObjectSetProxy } from "./WildcardObjectSetProxy"; import type { WildcardSubjectSetProxyQuadMatch } from "./WildcardSubjectSetProxy"; import { WildcardSubjectSetProxy } from "./WildcardSubjectSetProxy"; -import type { SetProxy } from "./setProxy"; +import type { SetProxy } from "./SetProxy"; -// export function createNewSetProxy>( -// quadMatch: ObjectSetProxyQuadMatch, -// isSubjectOriented: false, -// proxyContext: ProxyContext, -// ): ObjectSetProxy; -// export function createNewSetProxy( -// quadMatch: SubjectSetProxyQuadMatch, -// isSubjectOriented: true, -// proxyContext: ProxyContext, -// ): SubjectSetProxy; -// export function createNewSetProxy>( -// quadMatch: WildcardObjectSetProxyQuadMatch, -// isSubjectOriented: false, -// proxyContext: ProxyContext, -// ): WildcardObjectSetProxy; -// export function createNewSetProxy( -// quadMatch: WildcardSubjectSetProxyQuadMatch, -// isSubjectOriented: true, -// proxyContext: ProxyContext, -// ): WildcardSubjectSetProxy; export function createNewSetProxy>( quadMatch: QuadMatch, isSubjectOriented: boolean, diff --git a/packages/jsonld-dataset-proxy/src/setProxy/isSetProxy.ts b/packages/jsonld-dataset-proxy/src/setProxy/isSetProxy.ts index 9ec6383..36b19b7 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/isSetProxy.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/isSetProxy.ts @@ -1,4 +1,4 @@ -import { SetProxy } from "./setProxy"; +import { SetProxy } from "./SetProxy"; export function isSetProxy(someObject?: unknown): someObject is SetProxy { if (!someObject) return false; diff --git a/packages/jsonld-dataset-proxy/src/setProxy/ldSet/LdSet.ts b/packages/jsonld-dataset-proxy/src/setProxy/ldSet/LdSet.ts index 2c85d04..b71c22d 100644 --- a/packages/jsonld-dataset-proxy/src/setProxy/ldSet/LdSet.ts +++ b/packages/jsonld-dataset-proxy/src/setProxy/ldSet/LdSet.ts @@ -30,19 +30,19 @@ export interface LdSet extends Set { */ readonly size: number; /** Iterates over values in the set. */ - [Symbol.iterator](): SetIterator; + [Symbol.iterator](): IterableIterator; /** * Returns an iterable of [v,v] pairs for every value `v` in the set. */ - entries(): SetIterator<[T, T]>; + entries(): IterableIterator<[T, T]>; /** * Despite its name, returns an iterable of the values in the set. */ - keys(): SetIterator; + keys(): IterableIterator; /** * Returns an iterable of values in the set. */ - values(): SetIterator; + values(): IterableIterator; /** * =========================================================================== * ITERATOR METHODS diff --git a/packages/jsonld-dataset-proxy/src/subjectProxy/getValueForKey.ts b/packages/jsonld-dataset-proxy/src/subjectProxy/getValueForKey.ts index 4bebf3e..5244e30 100644 --- a/packages/jsonld-dataset-proxy/src/subjectProxy/getValueForKey.ts +++ b/packages/jsonld-dataset-proxy/src/subjectProxy/getValueForKey.ts @@ -2,7 +2,7 @@ import type { SubjectProxyTarget } from "./createSubjectHandler"; import { namedNode } from "@rdfjs/data-model"; import { nodeToJsonldRepresentation } from "../util/nodeToJsonldRepresentation"; import type { SubjectProxy } from "./SubjectProxy"; -import type { SetProxy } from "../setProxy/setProxy"; +import type { SetProxy } from "../setProxy/SetProxy"; import type { ProxyContext } from "../ProxyContext"; import { filterQuadsByLanguageOrdering } from "../language/languageUtils";