Added Doc Generation

main
jaxoncreed 2 years ago
parent 09706ef4d7
commit cc4159e348
  1. 2
      .gitignore
  2. 42
      package-lock.json
  3. 77
      packages/ldo/example/example.ts
  4. 26
      packages/ldo/example/ldo/foafProfile.context.ts
  5. 93
      packages/ldo/example/ldo/foafProfile.schema.ts
  6. 19
      packages/ldo/example/ldo/foafProfile.shapeTypes.ts
  7. 33
      packages/ldo/example/ldo/foafProfile.typings.ts
  8. 15
      packages/ldo/example/shapes/foafProfile.shex
  9. 5
      packages/ldo/src/createLdoDataset.ts
  10. 7
      packages/solid/README.md
  11. 195
      packages/solid/example/example-methodBrainstorm.ts
  12. 22
      packages/solid/example/example.ts
  13. 7
      packages/solid/package.json
  14. 10
      packages/solid/src/index.ts
  15. 4
      packages/solid/src/util/uriTypes.ts
  16. 5
      packages/solid/typedoc.json
  17. 4
      packages/subscribable-dataset/src/ProxyTransactionalDataset.ts
  18. 4
      packages/subscribable-dataset/src/WrapperSubscribableDataset.ts
  19. 4
      packages/subscribable-dataset/src/WrapperSubscribableDatasetFactory.ts
  20. 6
      packages/subscribable-dataset/src/createWrapperSubscribableDataset.ts
  21. 4
      packages/subscribable-dataset/src/createWrapperSubscribableDatasetFromSerializedInput.ts
  22. 10
      packages/subscribable-dataset/src/index.ts

2
.gitignore vendored

@ -16,3 +16,5 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
coverage/ coverage/
docs/

42
package-lock.json generated

@ -31209,9 +31209,9 @@
} }
}, },
"node_modules/typedoc": { "node_modules/typedoc": {
"version": "0.25.3", "version": "0.25.4",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.3.tgz", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz",
"integrity": "sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==", "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lunr": "^2.3.9", "lunr": "^2.3.9",
@ -31226,13 +31226,13 @@
"node": ">= 16" "node": ">= 16"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x" "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x"
} }
}, },
"node_modules/typedoc-plugin-markdown": { "node_modules/typedoc-plugin-markdown": {
"version": "3.17.0", "version": "3.17.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.0.tgz", "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz",
"integrity": "sha512-+uh5fHNfNSGdUxae0FWOuJ8Xu9Sl08jkdshOg6dilAqN/ZXmYsUFFDKw70fYfiGxdCLvpUuyr9FYO+WAa2lHeA==", "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"handlebars": "^4.7.7" "handlebars": "^4.7.7"
@ -33492,9 +33492,7 @@
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"jest": "^27.4.5", "jest": "^27.4.5",
"ts-jest": "^27.1.2", "ts-jest": "^27.1.2",
"ts-node": "^10.4.0", "ts-node": "^10.4.0"
"typedoc": "^0.25.3",
"typedoc-plugin-markdown": "^3.17.0"
} }
}, },
"packages/ldo/node_modules/ts-jest": { "packages/ldo/node_modules/ts-jest": {
@ -34815,7 +34813,9 @@
"jest-rdf": "^1.8.0", "jest-rdf": "^1.8.0",
"ts-jest": "^29.0.2", "ts-jest": "^29.0.2",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typed-emitter": "^2.1.0" "typed-emitter": "^2.1.0",
"typedoc": "^0.25.4",
"typedoc-plugin-markdown": "^3.17.1"
} }
}, },
"packages/solid-react": { "packages/solid-react": {
@ -43913,9 +43913,7 @@
"jest": "^27.4.5", "jest": "^27.4.5",
"readable-stream": "^4.3.0", "readable-stream": "^4.3.0",
"ts-jest": "^27.1.2", "ts-jest": "^27.1.2",
"ts-node": "^10.4.0", "ts-node": "^10.4.0"
"typedoc": "*",
"typedoc-plugin-markdown": "*"
}, },
"dependencies": { "dependencies": {
"ts-jest": { "ts-jest": {
@ -44812,7 +44810,9 @@
"ts-jest": "^29.0.2", "ts-jest": "^29.0.2",
"ts-mixer": "^6.0.3", "ts-mixer": "^6.0.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typed-emitter": "^2.1.0" "typed-emitter": "^2.1.0",
"typedoc": "^0.25.4",
"typedoc-plugin-markdown": "^3.17.1"
}, },
"dependencies": { "dependencies": {
"@jest/console": { "@jest/console": {
@ -62571,9 +62571,9 @@
} }
}, },
"typedoc": { "typedoc": {
"version": "0.25.3", "version": "0.25.4",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.3.tgz", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz",
"integrity": "sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==", "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lunr": "^2.3.9", "lunr": "^2.3.9",
@ -62603,9 +62603,9 @@
} }
}, },
"typedoc-plugin-markdown": { "typedoc-plugin-markdown": {
"version": "3.17.0", "version": "3.17.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.0.tgz", "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz",
"integrity": "sha512-+uh5fHNfNSGdUxae0FWOuJ8Xu9Sl08jkdshOg6dilAqN/ZXmYsUFFDKw70fYfiGxdCLvpUuyr9FYO+WAa2lHeA==", "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==",
"dev": true, "dev": true,
"requires": { "requires": {
"handlebars": "^4.7.7" "handlebars": "^4.7.7"

@ -1,77 +0,0 @@
import { parseRdf, startTransaction, toSparqlUpdate, toTurtle } from "../src";
import { FoafProfileShapeType } from "./ldo/foafProfile.shapeTypes";
async function run() {
const rawTurtle = `
<#me> a <http://xmlns.com/foaf/0.1/Person>;
<http://xmlns.com/foaf/0.1/name> "Jane Doe".
`;
/**
* Step 1: Convert Raw RDF into a Linked Data Object
*/
const ldoDataset = await parseRdf(rawTurtle, {
baseIRI: "https://solidweb.me/jane_doe/profile/card",
});
// Create a linked data object by telling the dataset the type and subject of
// the object
const janeProfile = ldoDataset
// Tells the LDO dataset that we're looking for a FoafProfile
.usingType(FoafProfileShapeType)
// Says the subject of the FoafProfile
.fromSubject("https://solidweb.me/jane_doe/profile/card#me");
/**
* Step 2: Manipulate the Linked Data Object
*/
// Logs "Jane Doe"
console.log(janeProfile.name);
// Logs "Person"
console.log(janeProfile.type);
// Logs 0
console.log(janeProfile.knows?.length);
// Begins a transaction that tracks your changes
startTransaction(janeProfile);
janeProfile.name = "Jane Smith";
janeProfile.knows?.push({
"@id": "https://solidweb.me/john_smith/profile/card#me",
type: {
"@id": "Person",
},
name: "John Smith",
knows: [janeProfile],
});
// Logs "Jane Smith"
console.log(janeProfile.name);
// Logs "John Smith"
console.log(janeProfile.knows?.[0].name);
// Logs "Jane Smith"
console.log(janeProfile.knows?.[0].knows?.[0].name);
/**
* Step 3: Convert it back to RDF
*/
// Logs:
// <https://solidweb.me/jane_doe/profile/card#me> a <http://xmlns.com/foaf/0.1/Person>;
// <http://xmlns.com/foaf/0.1/name> "Jane Smith";
// <http://xmlns.com/foaf/0.1/knows> <https://solidweb.me/john_smith/profile/card#me>.
// <https://solidweb.me/john_smith/profile/card#me> a <http://xmlns.com/foaf/0.1/Person>;
// <http://xmlns.com/foaf/0.1/name> "John Smith";
// <http://xmlns.com/foaf/0.1/knows> <https://solidweb.me/jane_doe/profile/card#me>.
console.log(await toTurtle(janeProfile));
// Logs:
// DELETE DATA {
// <https://solidweb.me/jane_doe/profile/card#me> <http://xmlns.com/foaf/0.1/name> "Jane Doe" .
// };
// INSERT DATA {
// <https://solidweb.me/jane_doe/profile/card#me> <http://xmlns.com/foaf/0.1/name> "Jane Smith" .
// <https://solidweb.me/jane_doe/profile/card#me> <http://xmlns.com/foaf/0.1/knows> <https://solidweb.me/john_smith/profile/card#me> .
// <https://solidweb.me/john_smith/profile/card#me> <http://xmlns.com/foaf/0.1/name> "John Smith" .
// <https://solidweb.me/john_smith/profile/card#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
// <https://solidweb.me/john_smith/profile/card#me> <http://xmlns.com/foaf/0.1/knows> <https://solidweb.me/jane_doe/profile/card#me> .
// }
console.log(await toSparqlUpdate(janeProfile));
}
run();

@ -1,26 +0,0 @@
import type { ContextDefinition } from "jsonld";
/**
* =============================================================================
* foafProfileContext: JSONLD Context for foafProfile
* =============================================================================
*/
export const foafProfileContext: ContextDefinition = {
type: {
"@id": "@type",
},
Person: "http://xmlns.com/foaf/0.1/Person",
name: {
"@id": "http://xmlns.com/foaf/0.1/name",
"@type": "http://www.w3.org/2001/XMLSchema#string",
},
img: {
"@id": "http://xmlns.com/foaf/0.1/img",
"@type": "http://www.w3.org/2001/XMLSchema#string",
},
knows: {
"@id": "http://xmlns.com/foaf/0.1/knows",
"@type": "@id",
"@container": "@set",
},
};

@ -1,93 +0,0 @@
import { Schema } from "shexj";
/**
* =============================================================================
* foafProfileSchema: ShexJ Schema for foafProfile
* =============================================================================
*/
export const foafProfileSchema: Schema = {
type: "Schema",
shapes: [
{
id: "https://example.com/FoafProfile",
type: "Shape",
expression: {
type: "EachOf",
expressions: [
{
type: "TripleConstraint",
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
valueExpr: {
type: "NodeConstraint",
values: ["http://xmlns.com/foaf/0.1/Person"],
},
annotations: [
{
type: "Annotation",
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
object: {
value: "Defines the node as a Person (from foaf)",
},
},
],
},
{
type: "TripleConstraint",
predicate: "http://xmlns.com/foaf/0.1/name",
valueExpr: {
type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string",
},
min: 0,
max: 1,
annotations: [
{
type: "Annotation",
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
object: {
value: "Define a person's name.",
},
},
],
},
{
type: "TripleConstraint",
predicate: "http://xmlns.com/foaf/0.1/img",
valueExpr: {
type: "NodeConstraint",
datatype: "http://www.w3.org/2001/XMLSchema#string",
},
min: 0,
max: 1,
annotations: [
{
type: "Annotation",
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
object: {
value: "Photo link but in string form",
},
},
],
},
{
type: "TripleConstraint",
predicate: "http://xmlns.com/foaf/0.1/knows",
valueExpr: "https://example.com/FoafProfile",
min: 0,
max: -1,
annotations: [
{
type: "Annotation",
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
object: {
value: "A list of WebIds for all the people this user knows.",
},
},
],
},
],
},
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
},
],
};

@ -1,19 +0,0 @@
import { ShapeType } from "../../lib";
import { foafProfileSchema } from "./foafProfile.schema";
import { foafProfileContext } from "./foafProfile.context";
import { FoafProfile } from "./foafProfile.typings";
/**
* =============================================================================
* LDO ShapeTypes foafProfile
* =============================================================================
*/
/**
* FoafProfile ShapeType
*/
export const FoafProfileShapeType: ShapeType<FoafProfile> = {
schema: foafProfileSchema,
shape: "https://example.com/FoafProfile",
context: foafProfileContext,
};

@ -1,33 +0,0 @@
import { ContextDefinition } from "jsonld";
/**
* =============================================================================
* Typescript Typings for foafProfile
* =============================================================================
*/
/**
* FoafProfile Type
*/
export interface FoafProfile {
"@id"?: string;
"@context"?: ContextDefinition;
/**
* Defines the node as a Person (from foaf)
*/
type: {
"@id": "Person";
};
/**
* Define a person's name.
*/
name?: string;
/**
* Photo link but in string form
*/
img?: string;
/**
* A list of WebIds for all the people this user knows.
*/
knows?: FoafProfile[];
}

@ -1,15 +0,0 @@
PREFIX ex: <https://example.com/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ex:FoafProfile EXTRA a {
a [ foaf:Person ]
// rdfs:comment "Defines the node as a Person (from foaf)" ;
foaf:name xsd:string ?
// rdfs:comment "Define a person's name." ;
foaf:img xsd:string ?
// rdfs:comment "Photo link but in string form" ;
foaf:knows @ex:FoafProfile *
// rdfs:comment "A list of WebIds for all the people this user knows." ;
}

@ -1,6 +1,7 @@
import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types"; import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types";
import { createDataset } from "@ldo/dataset"; import { createDataset } from "@ldo/dataset";
import { LdoDatasetFactory } from "./LdoDatasetFactory"; import { LdoDatasetFactory } from "./LdoDatasetFactory";
import type { LdoDataset } from "./LdoDataset";
/** /**
* Creates an LDO Dataset Factory * Creates an LDO Dataset Factory
@ -18,11 +19,11 @@ export function createLdoDatasetFactory() {
/** /**
* Create an LDO Dataset * Create an LDO Dataset
* @param initialDataset * @param initialDataset
* @returns An LDO Dataset Factory * @returns An LDO Dataset
*/ */
export function createLdoDataset( export function createLdoDataset(
initialDataset?: Dataset<Quad, Quad> | Quad[], initialDataset?: Dataset<Quad, Quad> | Quad[],
) { ): LdoDataset {
const ldoDatasetFactory = createLdoDatasetFactory(); const ldoDatasetFactory = createLdoDatasetFactory();
return ldoDatasetFactory.dataset(initialDataset); return ldoDatasetFactory.dataset(initialDataset);
} }

@ -1,13 +1,6 @@
# @ldo/solid # @ldo/solid
Alpha
## Notes:
- Any quads in the default graph will not be synced to Solid Pods, but will be added to the dataset without any syncing
## TODO:
- Add Documentation
- Access rule stuff just doesn't work. I might need to program a custom implementation for that
## Sponsorship ## Sponsorship
This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/). This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/).

@ -1,195 +0,0 @@
const resourceMethods: Record<string, string[]> = {
RootContainerResource: [
"uri",
"isLoading",
"didInitialFetch",
"ldoDataset",
"getIsRootContainer",
"createContainerIn",
"createDataResourceIn",
"uploadBinaryIn",
"createOrOverwrite",
"read",
"reload",
"load",
"clear",
"clearIfPresent",
],
ContainerResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getIsRootContainer",
"getParentContainer",
"childResources",
"getRootContainer",
"createContainerIn",
"createDataResourceIn",
"uploadBinaryIn",
"ldoDataset",
"createOrOverwrite",
"read",
"reload",
"load",
"delete",
"deleteIfPresent",
"clear",
"clearIfPresent",
],
ChildDataResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getParentContainer",
"hasData",
"ldoDataset",
"getRootContainer",
"createOrOverwrite",
"read",
"reload",
"load",
"delete",
"deleteIfPresent",
],
BinaryResource: [
"uri",
"isLoading",
"didInitialFetch",
"mimeType",
"fileExtension",
"getRootContainer",
"getParentContainer",
"uploadOrOverwrite",
"read",
"reload",
"load",
"delete",
"deleteIfPresent",
],
AbsentContainerResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getIsRootContainer",
"getParentContainer",
"getRootContainer",
"createContainerIn",
"createDataResourceIn",
"uploadBinaryIn",
"createOrOverwrite",
"create",
"createIfAbsent",
"read",
"reload",
"load",
"deleteIfPresent",
"clearIfPresent",
],
AbsentChildDataResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getParentContainer",
"getRootContainer",
"createOrOverwrite",
"create",
"createIfAbsent",
"read",
"reload",
"load",
"deleteIfPresent",
],
AbsentBinaryResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getParentContainer",
"getRootContainer",
"uploadOrOverwrite",
"upload",
"uploadIfAbsent",
"read",
"reload",
"load",
"deleteIfPresent",
],
UnfetchedContainerResource: [
"uri",
"isLoading",
"didInitialFetch",
"getIsRootContainer",
"getParentContainer",
"getRootContainer",
"createContainerIn",
"createDataResourceIn",
"uploadBinaryIn",
"createOrOverwrite",
"createIfAbsent",
"read",
"reload",
"load",
"clearIfPresent",
],
UnfetchedChildDataResource: [
"parentContainer",
"getParentContainer",
"uri",
"isLoading",
"didInitialFetch",
"getRootContainer",
"createOrOverwrite",
"createIfAbsent",
"read",
"reload",
"load",
"deleteIfPresent",
],
UnfetchedBinaryResource: [
"uri",
"isLoading",
"didInitialFetch",
"parentContainer",
"getParentContainer",
"getRootContainer",
"uploadOrOverwrite",
"createOrOverwrite",
"uploadIfAbsent",
"read",
"reload",
"load",
"deleteIfPresent",
],
};
function processTypes() {
const usedKeys = new Set();
const interfaces = Object.keys(resourceMethods);
const groupMap: Record<string, string[]> = {};
interfaces.forEach((interfaceName) => {
resourceMethods[interfaceName].forEach((methodKey) => {
if (!usedKeys.has(methodKey)) {
usedKeys.add(methodKey);
let groupName = "";
interfaces.forEach((interfaceName) => {
if (resourceMethods[interfaceName].includes(methodKey)) {
groupName += `${interfaceName}|`;
}
});
if (!groupMap[groupName]) {
groupMap[groupName] = [];
}
groupMap[groupName].push(methodKey);
}
});
});
console.log(groupMap);
}
processTypes();

@ -1,22 +0,0 @@
import { Mixin } from "ts-mixer";
class Foo {
protected makeFoo() {
return "foo";
}
}
class Bar {
protected makeFoo() {
return "bar";
}
}
class FooBar extends Mixin(Foo, Bar) {
public makeFooBar() {
return this.makeFoo() + this.makeFoo();
}
}
const fooBar = new FooBar();
console.log(fooBar.makeFooBar());

@ -11,7 +11,8 @@
"test:watch": "jest --watch", "test:watch": "jest --watch",
"prepublishOnly": "npm run test && npm run build", "prepublishOnly": "npm run test && npm run build",
"build:ldo": "ldo build --input src/.shapes --output src/.ldo", "build:ldo": "ldo build --input src/.shapes --output src/.ldo",
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern" "lint": "eslint src/** --fix --no-error-on-unmatched-pattern",
"docs": "typedoc --plugin typedoc-plugin-markdown"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -34,7 +35,9 @@
"jest-rdf": "^1.8.0", "jest-rdf": "^1.8.0",
"ts-jest": "^29.0.2", "ts-jest": "^29.0.2",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typed-emitter": "^2.1.0" "typed-emitter": "^2.1.0",
"typedoc": "^0.25.4",
"typedoc-plugin-markdown": "^3.17.1"
}, },
"dependencies": { "dependencies": {
"@inrupt/solid-client": "^1.30.0", "@inrupt/solid-client": "^1.30.0",

@ -9,3 +9,13 @@ export * from "./resource/Leaf";
export * from "./util/uriTypes"; export * from "./util/uriTypes";
export * from "./methods"; export * from "./methods";
export * from "./requester/requests/checkRootContainer";
export * from "./requester/requests/createDataResource";
export * from "./requester/requests/deleteResource";
export * from "./requester/requests/getAccessRules";
export * from "./requester/requests/readResource";
export * from "./requester/requests/requestOptions";
export * from "./requester/requests/setAccessRules";
export * from "./requester/requests/updateDataResource";
export * from "./requester/requests/uploadResource";

@ -1,6 +1,6 @@
export type ContainerUri = `${string}/${NonPathnameEnding}`; export type ContainerUri = `${string}/${NonPathnameEnding}` & {};
export type LeafUri = export type LeafUri =
`${string}${EveryLegalPathnameCharacterOtherThanSlash}${NonPathnameEnding}`; `${string}${EveryLegalPathnameCharacterOtherThanSlash}${NonPathnameEnding}` & {};
export function isContainerUri(uri: string): uri is ContainerUri { export function isContainerUri(uri: string): uri is ContainerUri {
const url = new URL(uri); const url = new URL(uri);

@ -0,0 +1,5 @@
{
"entryPoints": ["src/index.ts"],
"out": "docs",
"allReflectionsHaveOwnDocument": true
}

@ -9,9 +9,7 @@ import { mergeDatasetChanges } from "./mergeDatasetChanges";
* the parent dataset, it will dynamically determine the correct return value for * the parent dataset, it will dynamically determine the correct return value for
* methods in real time when the method is called. * methods in real time when the method is called.
*/ */
export default class ProxyTransactionalDataset< export class ProxyTransactionalDataset<InAndOutQuad extends BaseQuad = BaseQuad>
InAndOutQuad extends BaseQuad = BaseQuad,
>
extends ExtendedDataset<InAndOutQuad> extends ExtendedDataset<InAndOutQuad>
implements implements
BulkEditableDataset<InAndOutQuad>, BulkEditableDataset<InAndOutQuad>,

@ -20,13 +20,13 @@ import type {
SubscribableDataset, SubscribableDataset,
TransactionalDataset, TransactionalDataset,
} from "./types"; } from "./types";
import ProxyTransactionalDataset from "./ProxyTransactionalDataset"; import { ProxyTransactionalDataset } from "./ProxyTransactionalDataset";
/** /**
* A wrapper for a dataset that allows subscriptions to be made on nodes to * A wrapper for a dataset that allows subscriptions to be made on nodes to
* be triggered whenever a quad containing that added or removed. * be triggered whenever a quad containing that added or removed.
*/ */
export default class WrapperSubscribableDataset< export class WrapperSubscribableDataset<
InAndOutQuad extends BaseQuad = BaseQuad, InAndOutQuad extends BaseQuad = BaseQuad,
> implements SubscribableDataset<InAndOutQuad> > implements SubscribableDataset<InAndOutQuad>
{ {

@ -1,10 +1,10 @@
import type { DatasetFactory, BaseQuad, Dataset } from "@rdfjs/types"; import type { DatasetFactory, BaseQuad, Dataset } from "@rdfjs/types";
import WrapperSubscribableDataset from "./WrapperSubscribableDataset"; import { WrapperSubscribableDataset } from "./WrapperSubscribableDataset";
/** /**
* A DatasetFactory that returns a WrapperSubscribableDataset given a generic DatasetFactory. * A DatasetFactory that returns a WrapperSubscribableDataset given a generic DatasetFactory.
*/ */
export default class WrapperSubscribableDatasetFactory< export class WrapperSubscribableDatasetFactory<
InAndOutQuad extends BaseQuad = BaseQuad, InAndOutQuad extends BaseQuad = BaseQuad,
> implements DatasetFactory<InAndOutQuad, InAndOutQuad> > implements DatasetFactory<InAndOutQuad, InAndOutQuad>
{ {

@ -1,7 +1,7 @@
import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types"; import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types";
import type { WrapperSubscribableDataset } from "."; import type { WrapperSubscribableDataset } from "./WrapperSubscribableDataset";
import { createDataset } from "@ldo/dataset"; import { createDataset } from "@ldo/dataset";
import WrapperSubscribableDatasetFactory from "./WrapperSubscribableDatasetFactory"; import { WrapperSubscribableDatasetFactory } from "./WrapperSubscribableDatasetFactory";
/** /**
* Creates a dataset factory that generates a SubscribableDataset * Creates a dataset factory that generates a SubscribableDataset
@ -21,7 +21,7 @@ export function createWrapperSubscribableDatasetFactory(): WrapperSubscribableDa
* @param quads: A dataset or array of Quads to initialize the dataset. * @param quads: A dataset or array of Quads to initialize the dataset.
* @returns Dataset * @returns Dataset
*/ */
export default function createWrapperSubscribableDataset( export function createWrapperSubscribableDataset(
quads?: Dataset<Quad> | Quad[], quads?: Dataset<Quad> | Quad[],
): WrapperSubscribableDataset<Quad> { ): WrapperSubscribableDataset<Quad> {
const wrapperSubscribableDatasetFactory = const wrapperSubscribableDatasetFactory =

@ -2,7 +2,7 @@ import type { Quad } from "@rdfjs/types";
import type { ParserOptions } from "@ldo/rdf-utils"; import type { ParserOptions } from "@ldo/rdf-utils";
import { createDatasetFromSerializedInput } from "@ldo/dataset"; import { createDatasetFromSerializedInput } from "@ldo/dataset";
import { createWrapperSubscribableDatasetFactory } from "./createWrapperSubscribableDataset"; import { createWrapperSubscribableDatasetFactory } from "./createWrapperSubscribableDataset";
import type WrapperSubscribableDataset from "./WrapperSubscribableDataset"; import type { WrapperSubscribableDataset } from "./WrapperSubscribableDataset";
/** /**
* Creates a SubscribableDataset with a string input that could be JSON-LD, Turtle, N-Triples, TriG, RDF*, or N3. * Creates a SubscribableDataset with a string input that could be JSON-LD, Turtle, N-Triples, TriG, RDF*, or N3.
@ -15,7 +15,7 @@ import type WrapperSubscribableDataset from "./WrapperSubscribableDataset";
* } * }
* @returns A dataset * @returns A dataset
*/ */
export default async function createWrapperSubscribableDatasetDataserFromSerializedInput( export async function createWrapperSubscribableDatasetFromSerializedInput(
data: string, data: string,
options?: ParserOptions, options?: ParserOptions,
): Promise<WrapperSubscribableDataset<Quad>> { ): Promise<WrapperSubscribableDataset<Quad>> {

@ -1,10 +1,10 @@
export { export {
default as createSubscribableDataset, createWrapperSubscribableDataset as createSubscribableDataset,
createWrapperSubscribableDatasetFactory as createSubscribableDatasetFactory, createWrapperSubscribableDatasetFactory as createSubscribableDatasetFactory,
} from "./createWrapperSubscribableDataset"; } from "./createWrapperSubscribableDataset";
export { default as serializedToSubscribableDataset } from "./createWrapperSubscribableDatasetFromSerializedInput"; export { createWrapperSubscribableDatasetFromSerializedInput as serializedToSubscribableDataset } from "./createWrapperSubscribableDatasetFromSerializedInput";
export { default as ProxyTransactionalDataset } from "./ProxyTransactionalDataset"; export * from "./ProxyTransactionalDataset";
export { default as WrapperSubscribableDataset } from "./WrapperSubscribableDataset"; export * from "./WrapperSubscribableDataset";
export { default as WrapperSubscribableDatasetFactory } from "./WrapperSubscribableDatasetFactory"; export * from "./WrapperSubscribableDatasetFactory";
export * from "./types"; export * from "./types";
export * from "./mergeDatasetChanges"; export * from "./mergeDatasetChanges";

Loading…
Cancel
Save