Skip to content

Commit

Permalink
rdflib-utils: add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo-v committed Jul 25, 2024
1 parent 58ab6dd commit 3f843be
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
36 changes: 22 additions & 14 deletions utils/rdflib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All notable changes to this module will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Added

- [discoverType](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.ModuleSupport.html#discoverType)

## 0.2.0

Expand All @@ -11,16 +19,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [ModuleSupport](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.ModuleSupport.html)
- [TypeIndexQuery](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.TypeIndexQuery.html)
- [addInstanceToTypeIndex](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.addInstanceToTypeIndex.html)
- helper functions to generate terms in common Solid namespaces:
- [ldp](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.ldp.html)
- [pim](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.pim.html)
- [rdf](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.rdf.html)
- [solid](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.solid.html)
- helper functions to generate terms in common Solid namespaces:
- [ldp](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.ldp.html)
- [pim](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.pim.html)
- [rdf](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.rdf.html)
- [solid](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.solid.html)

### Breaking Change

- [generateId](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/identifier.generateId.html): Moved to submodule

- [generateId](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/identifier.generateId.html):
Moved to submodule

## 0.1.1

Expand All @@ -37,9 +45,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [fetchNode](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.fetchNode.html)
- [generateId](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.generateId.html)
- [test-support](https://solid-contrib.github.io/data-modules/rdflib-utils/modules/test_support.html):
- [expectPatchRequest](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPatchRequest.html)
- [expectPutEmptyTurtleFile](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPutEmptyTurtleFile.html)
- [mockForbidden](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockForbidden.html)
- [mockLdpContainer](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockLdpContainer.html)
- [mockNotFound](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockNotFound.html)
- [mockTurtleDocument](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockTurtleDocument.html)
- [expectPatchRequest](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPatchRequest.html)
- [expectPutEmptyTurtleFile](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPutEmptyTurtleFile.html)
- [mockForbidden](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockForbidden.html)
- [mockLdpContainer](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockLdpContainer.html)
- [mockNotFound](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockNotFound.html)
- [mockTurtleDocument](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockTurtleDocument.html)
6 changes: 6 additions & 0 deletions utils/rdflib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ export interface ModuleConfig {
updater: UpdateManager;
}

/**
* Lists instances and containers found in a type index
*/
export interface TypeRegistrations {
instanceContainers: NamedNode[];
instances: NamedNode[];
}

/**
* Type registrations grouped by whether they have been discovered in private or public type index.
*/
export interface TypeRegistrationsByVisibility {
public: TypeRegistrations;
private: TypeRegistrations;
Expand Down
5 changes: 5 additions & 0 deletions utils/rdflib/src/module/ModuleSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export class ModuleSupport {
return Promise.all(nodes.map((it) => this.fetchNode(it)));
}

/**
* Discover storage locations (instances or instance containers) for a given type by fetching and querying private and public type indexes
* @param webId - The WebID to search for type indexes
* @param typeNode - a NamedNode representing the type to discover
*/
async discoverType(
webId: NamedNode,
typeNode: NamedNode,
Expand Down

0 comments on commit 3f843be

Please sign in to comment.