Skip to content

Commit dc217a4

Browse files
committed
rdflib-utils: add documentation
1 parent 58ab6dd commit dc217a4

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

utils/rdflib/CHANGELOG.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

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

5-
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).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
6+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## Unreleased
9+
10+
### Added
11+
12+
- [discoverType](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.ModuleSupport.html#discoverType)
613

714
## 0.2.0
815

@@ -11,16 +18,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1118
- [ModuleSupport](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.ModuleSupport.html)
1219
- [TypeIndexQuery](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.TypeIndexQuery.html)
1320
- [addInstanceToTypeIndex](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.addInstanceToTypeIndex.html)
14-
- helper functions to generate terms in common Solid namespaces:
15-
- [ldp](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.ldp.html)
16-
- [pim](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.pim.html)
17-
- [rdf](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.rdf.html)
18-
- [solid](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.solid.html)
21+
- helper functions to generate terms in common Solid namespaces:
22+
- [ldp](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.ldp.html)
23+
- [pim](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.pim.html)
24+
- [rdf](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.rdf.html)
25+
- [solid](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.solid.html)
1926

2027
### Breaking Change
2128

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

2532
## 0.1.1
2633

@@ -37,9 +44,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3744
- [fetchNode](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.fetchNode.html)
3845
- [generateId](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/index.generateId.html)
3946
- [test-support](https://solid-contrib.github.io/data-modules/rdflib-utils/modules/test_support.html):
40-
- [expectPatchRequest](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPatchRequest.html)
41-
- [expectPutEmptyTurtleFile](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPutEmptyTurtleFile.html)
42-
- [mockForbidden](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockForbidden.html)
43-
- [mockLdpContainer](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockLdpContainer.html)
44-
- [mockNotFound](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockNotFound.html)
45-
- [mockTurtleDocument](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockTurtleDocument.html)
47+
- [expectPatchRequest](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPatchRequest.html)
48+
- [expectPutEmptyTurtleFile](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.expectPutEmptyTurtleFile.html)
49+
- [mockForbidden](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockForbidden.html)
50+
- [mockLdpContainer](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockLdpContainer.html)
51+
- [mockNotFound](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockNotFound.html)
52+
- [mockTurtleDocument](https://solid-contrib.github.io/data-modules/rdflib-utils/functions/test_support.mockTurtleDocument.html)

utils/rdflib/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ export interface ModuleConfig {
1212
updater: UpdateManager;
1313
}
1414

15+
/**
16+
* Lists instances and containers found in a type index
17+
*/
1518
export interface TypeRegistrations {
1619
instanceContainers: NamedNode[];
1720
instances: NamedNode[];
1821
}
1922

23+
/**
24+
* Type registrations grouped by whether they have been discovered in private or public type index.
25+
*/
2026
export interface TypeRegistrationsByVisibility {
2127
public: TypeRegistrations;
2228
private: TypeRegistrations;

utils/rdflib/src/module/ModuleSupport.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export class ModuleSupport {
3939
return Promise.all(nodes.map((it) => this.fetchNode(it)));
4040
}
4141

42+
/**
43+
* Discover storage locations (instances or instance containers) for a given type by fetching and querying private and public type indexes
44+
* @param webId - The WebID to search for type indexes
45+
* @param typeNode - a NamedNode representing the type to discover
46+
*/
4247
async discoverType(
4348
webId: NamedNode,
4449
typeNode: NamedNode,

0 commit comments

Comments
 (0)