https://github.com/communitysolidserver/predicate-cardinalities-component
A component for the Community Solid Server that allows to expose a view containing the predicate cardinalities in the pod.
https://github.com/communitysolidserver/predicate-cardinalities-component
Last synced: about 1 year ago
JSON representation
A component for the Community Solid Server that allows to expose a view containing the predicate cardinalities in the pod.
- Host: GitHub
- URL: https://github.com/communitysolidserver/predicate-cardinalities-component
- Owner: CommunitySolidServer
- Created: 2023-08-30T13:46:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T10:36:30.000Z (over 2 years ago)
- Last Synced: 2025-02-07T06:44:25.562Z (about 1 year ago)
- Language: TypeScript
- Size: 188 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Predicate Cardinalities Component
This repository contains an external component that can be injected into the [Community Solid Server (CSS)](https://github.com/CommunitySolidServer/CommunitySolidServer/).
It allows to expose a view containing the predicate cardinalities in the pod.
## How it works
For each pod, the pod's root container contains a triple to indicate where the predicate cardinalities view is located.
This triple has the following form:
```
<> .
```
The view is thus located in the `.well-known/.predicate-cardinalities` location.
On startup, the component will check if the predicate cardinalities cache already exists and if not, will calculate the cardinalities over the entire pod.
Currently, only public readable resources are taken into account.
That is such that the view can be exposed publicly without leaking private information.
When the cardinalities view is requested, it is dynamically generated from the cache.
This cache is updated periodically, and only if one or multiple resources (or its ACL files) have been modified since the last update.
To change the update interval, change the `updateInterval` variable in the configuration of the component.
The default is set to `600000` milliseconds, or 10 minutes.
## Vocabulary
The vocabulary used in the view is the [VoID Vocabulary](https://www.w3.org/TR/2011/NOTE-void-20110303/).
Structure of the view:
```turtle
@prefix void: .
<{podBase}> a void:Dataset ;
void:propertyPartition [
void:property <{predicate}> ;
void:triples <{cardinality}>
] .
```
## Running the server
Clone this repository, then install the packages
```bash
npm i
```
Build the project
```bash
npm run build
```
To run the server with your current folder as storage, use:
```bash
npm run start
```