Updated rdf-utils for solid and solid-react

main
jaxoncreed 2 years ago
parent 3ec64611d7
commit ad1cfdd4bc
  1. 47
      package-lock.json
  2. 3
      packages/solid-react/package.json
  3. 2
      packages/solid-react/src/LdoProvider.tsx
  4. 27
      packages/solid-react/src/index.ts
  5. 2
      packages/solid-react/src/ldoHooks/helpers/TrackingProxyContext.ts
  6. 8
      packages/solid-react/src/ldoHooks/helpers/UpdateManager.ts
  7. 2
      packages/solid-react/src/ldoHooks/useSubject.ts
  8. 4
      packages/solid-react/src/useLdo.ts
  9. 2
      packages/solid/package.json
  10. 2
      packages/solid/src/SolidLdoDataset.ts
  11. 2
      packages/solid/src/createSolidLdoDataset.ts
  12. 10
      packages/solid/src/document/resource/dataResource/DataResource.ts
  13. 5
      packages/solid/src/util/splitChangesByGraph.ts

47
package-lock.json generated

@ -30554,6 +30554,8 @@
"readable-stream": "^4.2.0" "readable-stream": "^4.2.0"
}, },
"devDependencies": { "devDependencies": {
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/rdfjs__dataset": "^1.0.4", "@types/rdfjs__dataset": "^1.0.4",
@ -30939,12 +30941,14 @@
"version": "0.0.0", "version": "0.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/dataset": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^2.0.1",
"@rdfjs/dataset": "^1.1.0",
"jsonld2graphobject": "^0.0.4" "jsonld2graphobject": "^0.0.4"
}, },
"devDependencies": { "devDependencies": {
"@rdfjs/types": "^1.1.0",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -30957,6 +30961,14 @@
"tsc-watch": "^6.0.0" "tsc-watch": "^6.0.0"
} }
}, },
"packages/jsonld-dataset-proxy/node_modules/@rdfjs/data-model": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@rdfjs/data-model/-/data-model-2.0.1.tgz",
"integrity": "sha512-oRDYpy7/fJ9NNjS+M7m+dbnhi4lOWYGbBiM/A+u9bBExnN6ifXUF5mUsFxwZaQulmwTDaMhKERdV6iKTBUMgtw==",
"bin": {
"rdfjs-data-model-test": "bin/test.js"
}
},
"packages/jsonld-dataset-proxy/node_modules/ts-jest": { "packages/jsonld-dataset-proxy/node_modules/ts-jest": {
"version": "27.1.5", "version": "27.1.5",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz",
@ -31021,12 +31033,14 @@
"dependencies": { "dependencies": {
"@ldo/dataset": "^0.0.0", "@ldo/dataset": "^0.0.0",
"@ldo/jsonld-dataset-proxy": "^0.0.0", "@ldo/jsonld-dataset-proxy": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"readable-stream": "^4.3.0" "readable-stream": "^4.3.0"
}, },
"devDependencies": { "devDependencies": {
"@ldo/rdf-utils": "^0.0.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -31101,11 +31115,11 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@rdfjs/data-model": "^1.2.0", "@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"n3": "^1.17.1", "n3": "^1.17.1",
"rdf-string": "^1.6.3" "rdf-string": "^1.6.3"
}, },
"devDependencies": { "devDependencies": {
"@rdfjs/types": "^1.0.1",
"@types/jsonld": "^1.5.9" "@types/jsonld": "^1.5.9"
} }
}, },
@ -31239,6 +31253,8 @@
}, },
"devDependencies": { "devDependencies": {
"@ldo/cli": "^0.0.0", "@ldo/cli": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"ts-jest": "^29.0.2" "ts-jest": "^29.0.2"
} }
@ -31254,6 +31270,7 @@
"@ldo/ldo": "^0.0.0", "@ldo/ldo": "^0.0.0",
"@ldo/solid": "^0.0.0", "@ldo/solid": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"cross-fetch": "^3.1.6", "cross-fetch": "^3.1.6",
"solid-authn-react-native": "^2.0.3", "solid-authn-react-native": "^2.0.3",
"stream": "^0.0.2" "stream": "^0.0.2"
@ -31262,6 +31279,8 @@
"@babel/preset-env": "^7.22.10", "@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5", "@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.11", "@babel/preset-typescript": "^7.22.11",
"@ldo/rdf-utils": "^0.0.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"@types/jsonld": "^1.5.8", "@types/jsonld": "^1.5.8",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -33636,7 +33655,9 @@
"@ldo/rdf-utils": "^0.0.0" "@ldo/rdf-utils": "^0.0.0"
}, },
"devDependencies": { "devDependencies": {
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/dataset": "^1.1.0", "@rdfjs/dataset": "^1.1.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/rdfjs__dataset": "^1.0.4", "@types/rdfjs__dataset": "^1.0.4",
@ -38784,7 +38805,9 @@
"version": "file:packages/dataset", "version": "file:packages/dataset",
"requires": { "requires": {
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/dataset": "^1.1.0", "@rdfjs/dataset": "^1.1.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/rdfjs__dataset": "^1.0.4", "@types/rdfjs__dataset": "^1.0.4",
@ -39022,9 +39045,11 @@
"@ldo/jsonld-dataset-proxy": { "@ldo/jsonld-dataset-proxy": {
"version": "file:packages/jsonld-dataset-proxy", "version": "file:packages/jsonld-dataset-proxy",
"requires": { "requires": {
"@ldo/dataset": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^2.0.1",
"@rdfjs/dataset": "^1.1.0",
"@rdfjs/types": "^1.1.0",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -39038,6 +39063,11 @@
"tsc-watch": "^6.0.0" "tsc-watch": "^6.0.0"
}, },
"dependencies": { "dependencies": {
"@rdfjs/data-model": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@rdfjs/data-model/-/data-model-2.0.1.tgz",
"integrity": "sha512-oRDYpy7/fJ9NNjS+M7m+dbnhi4lOWYGbBiM/A+u9bBExnN6ifXUF5mUsFxwZaQulmwTDaMhKERdV6iKTBUMgtw=="
},
"ts-jest": { "ts-jest": {
"version": "27.1.5", "version": "27.1.5",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz",
@ -39070,6 +39100,8 @@
"@ldo/jsonld-dataset-proxy": "^0.0.0", "@ldo/jsonld-dataset-proxy": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -39198,6 +39230,8 @@
"@ldo/dataset": "^0.0.0", "@ldo/dataset": "^0.0.0",
"@ldo/ldo": "^0.0.0", "@ldo/ldo": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"cross-fetch": "^3.1.6", "cross-fetch": "^3.1.6",
"ts-jest": "^29.0.2" "ts-jest": "^29.0.2"
@ -40123,8 +40157,11 @@
"@ldo/dataset": "^0.0.0", "@ldo/dataset": "^0.0.0",
"@ldo/jsonld-dataset-proxy": "^0.0.0", "@ldo/jsonld-dataset-proxy": "^0.0.0",
"@ldo/ldo": "^0.0.0", "@ldo/ldo": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0",
"@ldo/solid": "^0.0.0", "@ldo/solid": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"@types/jsonld": "^1.5.8", "@types/jsonld": "^1.5.8",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -41050,7 +41087,9 @@
"requires": { "requires": {
"@ldo/dataset": "^0.0.0", "@ldo/dataset": "^0.0.0",
"@ldo/rdf-utils": "^0.0.0", "@ldo/rdf-utils": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/dataset": "^1.1.0", "@rdfjs/dataset": "^1.1.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/jsonld": "^1.5.6", "@types/jsonld": "^1.5.6",
"@types/rdfjs__dataset": "^1.0.4", "@types/rdfjs__dataset": "^1.0.4",

@ -26,6 +26,8 @@
"@babel/preset-env": "^7.22.10", "@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5", "@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.11", "@babel/preset-typescript": "^7.22.11",
"@ldo/rdf-utils": "^0.0.0",
"@rdfjs/types": "^1.0.1",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"@types/jsonld": "^1.5.8", "@types/jsonld": "^1.5.8",
"@types/n3": "^1.10.4", "@types/n3": "^1.10.4",
@ -39,6 +41,7 @@
"@ldo/ldo": "^0.0.0", "@ldo/ldo": "^0.0.0",
"@ldo/solid": "^0.0.0", "@ldo/solid": "^0.0.0",
"@ldo/subscribable-dataset": "^0.0.0", "@ldo/subscribable-dataset": "^0.0.0",
"@rdfjs/data-model": "^1.2.0",
"cross-fetch": "^3.1.6", "cross-fetch": "^3.1.6",
"solid-authn-react-native": "^2.0.3", "solid-authn-react-native": "^2.0.3",
"stream": "^0.0.2" "stream": "^0.0.2"

@ -5,7 +5,7 @@ import { createLdoDataset } from "@ldo/ldo";
import type { LdoContextData } from "./LdoContext"; import type { LdoContextData } from "./LdoContext";
import { LdoContextProvider } from "./LdoContext"; import { LdoContextProvider } from "./LdoContext";
import { UpdateManager } from "./ldoHooks/helpers/UpdateManager"; import { UpdateManager } from "./ldoHooks/helpers/UpdateManager";
import type { Dataset } from "@ldo/rdf-utils"; import type { Dataset } from "@rdfjs/types";
export interface LdoProviderProps extends PropsWithChildren { export interface LdoProviderProps extends PropsWithChildren {
fetch?: typeof fetch; fetch?: typeof fetch;

@ -1,30 +1,3 @@
// document
export * from "./document/FetchableDocument";
export * from "./document/DocumentStore";
// document/errors
export * from "./document/errors/DocumentError";
export * from "./document/errors/DocumentFetchError";
// document/accessRules
export * from "./document/accessRules/AccessRules";
export * from "./document/accessRules/AccessRulesStore";
// document/resource
export * from "./document/resource/Resource";
// document/resource/binaryResource
export * from "./document/resource/binaryResource/BinaryResource";
export * from "./document/resource/binaryResource/BinaryResourceStore";
// document/resource/dataResource
export * from "./document/resource/dataResource/DataResource";
export * from "./document/resource/dataResource/DataResourceStore";
// document/resource/containerResource
export * from "./document/resource/dataResource/containerResource/ContainerResource";
export * from "./document/resource/dataResource/containerResource/ContainerResourceStore";
// documentHooks // documentHooks
export * from "./documentHooks/useAccessRules"; export * from "./documentHooks/useAccessRules";
export * from "./documentHooks/useBinaryResource"; export * from "./documentHooks/useBinaryResource";

@ -5,7 +5,7 @@ import type {
} from "@ldo/jsonld-dataset-proxy"; } from "@ldo/jsonld-dataset-proxy";
import { ProxyContext } from "@ldo/jsonld-dataset-proxy"; import { ProxyContext } from "@ldo/jsonld-dataset-proxy";
import type { UpdateManager } from "./UpdateManager"; import type { UpdateManager } from "./UpdateManager";
import { namedNode } from "@ldo/rdf-utils"; import { namedNode } from "@rdfjs/data-model";
export class TrackingProxyContext extends ProxyContext { export class TrackingProxyContext extends ProxyContext {
private updateManager: UpdateManager; private updateManager: UpdateManager;

@ -1,13 +1,13 @@
import type { DatasetChanges } from "@ldo/subscribable-dataset";
import { createDataset } from "@ldo/dataset";
import { quadMatchToString } from "@ldo/rdf-utils";
import type { import type {
Quad, DatasetChanges,
QuadMatch, QuadMatch,
SubjectNode, SubjectNode,
PredicateNode, PredicateNode,
ObjectNode, ObjectNode,
} from "@ldo/rdf-utils"; } from "@ldo/rdf-utils";
import { createDataset } from "@ldo/dataset";
import { quadMatchToString } from "@ldo/rdf-utils";
import type { Quad } from "@rdfjs/types";
export class UpdateManager { export class UpdateManager {
private quadMatchListenerMap: Record<string, Set<() => void>> = {}; private quadMatchListenerMap: Record<string, Set<() => void>> = {};

@ -1,4 +1,4 @@
import { defaultGraph } from "@ldo/rdf-utils"; import { defaultGraph } from "@rdfjs/data-model";
import type { SubjectNode } from "@ldo/rdf-utils"; import type { SubjectNode } from "@ldo/rdf-utils";
import { import {
ContextUtil, ContextUtil,

@ -8,8 +8,8 @@ import type { DataResource } from "./document/resource/dataResource/DataResource
import type { BinaryResource } from "./document/resource/binaryResource/BinaryResource"; import type { BinaryResource } from "./document/resource/binaryResource/BinaryResource";
import type { ContainerResource } from "./document/resource/dataResource/containerResource/ContainerResource"; import type { ContainerResource } from "./document/resource/dataResource/containerResource/ContainerResource";
import type { AccessRules } from "./document/accessRules/AccessRules"; import type { AccessRules } from "./document/accessRules/AccessRules";
import type { DatasetChanges } from "@ldo/subscribable-dataset"; import type { DatasetChanges, SubjectNode } from "@ldo/rdf-utils";
import type { Quad, SubjectNode } from "@ldo/rdf-utils"; import type { Quad } from "@rdfjs/types";
export interface UseLdoReturn { export interface UseLdoReturn {
changeData<Type extends LdoBase>(input: Type, ...resources: Resource[]): Type; changeData<Type extends LdoBase>(input: Type, ...resources: Resource[]): Type;

@ -23,6 +23,8 @@
}, },
"homepage": "https://github.com/o-development/devtool-boilerplate#readme", "homepage": "https://github.com/o-development/devtool-boilerplate#readme",
"devDependencies": { "devDependencies": {
"@rdfjs/data-model": "^1.2.0",
"@rdfjs/types": "^1.0.1",
"@ldo/cli": "^0.0.0", "@ldo/cli": "^0.0.0",
"@types/jest": "^29.0.3", "@types/jest": "^29.0.3",
"ts-jest": "^29.0.2" "ts-jest": "^29.0.2"

@ -8,7 +8,7 @@ import type { DataResourceStore } from "./document/resource/dataResource/DataRes
import type { ContainerResourceStore } from "./document/resource/dataResource/containerResource/ContainerResourceStore"; import type { ContainerResourceStore } from "./document/resource/dataResource/containerResource/ContainerResourceStore";
import type { AccessRulesStore } from "./document/accessRules/AccessRulesStore"; import type { AccessRulesStore } from "./document/accessRules/AccessRulesStore";
import type { BinaryResourceStore } from "./document/resource/binaryResource/BinaryResourceStore"; import type { BinaryResourceStore } from "./document/resource/binaryResource/BinaryResourceStore";
import type { Dataset, DatasetFactory } from "@ldo/rdf-utils"; import type { Dataset, DatasetFactory } from "@rdfjs/types";
import type { Resource } from "./document/resource/Resource"; import type { Resource } from "./document/resource/Resource";
import type { DocumentError } from "./document/errors/DocumentError"; import type { DocumentError } from "./document/errors/DocumentError";

@ -1,4 +1,4 @@
import type { Dataset } from "@ldo/rdf-utils"; import type { Dataset } from "@rdfjs/types";
import type { SolidLdoDataset } from "./SolidLdoDataset"; import type { SolidLdoDataset } from "./SolidLdoDataset";
import { AccessRulesStore } from "./document/accessRules/AccessRulesStore"; import { AccessRulesStore } from "./document/accessRules/AccessRulesStore";
import { BinaryResourceStore } from "./document/resource/binaryResource/BinaryResourceStore"; import { BinaryResourceStore } from "./document/resource/binaryResource/BinaryResourceStore";

@ -3,12 +3,10 @@ import type { ResourceDependencies } from "../Resource";
import { Resource } from "../Resource"; import { Resource } from "../Resource";
import { DocumentFetchError } from "../../errors/DocumentFetchError"; import { DocumentFetchError } from "../../errors/DocumentFetchError";
import { DocumentError } from "../../errors/DocumentError"; import { DocumentError } from "../../errors/DocumentError";
import { import { namedNode, quad as createQuad } from "@rdfjs/data-model";
namedNode, import type { DatasetChanges } from "@ldo/rdf-utils";
quad as createQuad, import { changesToSparqlUpdate } from "@ldo/rdf-utils";
changesToSparqlUpdate, import type { Quad } from "@rdfjs/types";
} from "@ldo/rdf-utils";
import type { DatasetChanges, Quad } from "@ldo/rdf-utils";
import type { SolidLdoDataset } from "../../../SolidLdoDataset"; import type { SolidLdoDataset } from "../../../SolidLdoDataset";
export interface DataResourceDependencies extends ResourceDependencies { export interface DataResourceDependencies extends ResourceDependencies {

@ -1,6 +1,7 @@
import { createDataset } from "@ldo/dataset"; import { createDataset } from "@ldo/dataset";
import type { GraphNode, DatasetChanges, Quad } from "@ldo/rdf-utils"; import type { GraphNode, DatasetChanges } from "@ldo/rdf-utils";
import { defaultGraph, namedNode, quad as createQuad } from "@ldo/rdf-utils"; import type { Quad } from "@rdfjs/types";
import { defaultGraph, namedNode, quad as createQuad } from "@rdfjs/data-model";
export function graphNodeToString(graphNode: GraphNode): string { export function graphNodeToString(graphNode: GraphNode): string {
return graphNode.termType === "DefaultGraph" return graphNode.termType === "DefaultGraph"

Loading…
Cancel
Save