Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/api_reference/datadoc/dictutils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# dictutils

::: tripper.datadoc.dictutils
10 changes: 0 additions & 10 deletions docs/datadoc/customisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,11 @@ The `__init__()` method of the [TableDoc] class takes a `context` argument with
The value of the `context` argument is the same as for the `@context` key of a [Python dict].


User-defined resource types
---------------------------
TODO

Extending the list of predefined [resource types] it not implemented yet.

Since JSON-LD is not designed for categorisation, new resource types should not be added in a custom JSON-LD context.
Instead, the list of available resource types should be stored and retrieved from the knowledge base.



[With custom context]: #with-custom-context
[User-defined keywords]: #user-defined-keywords
[Python dict]: #python-dict
[resource types]: introduction.md#resource-types
[Documenting a resource]: documenting-a-resource.md
[Search for and fetching resources]: fetching-resources-from-a-triplestore.md
[predefined prefixes]: prefixes.md
Expand Down
27 changes: 24 additions & 3 deletions docs/datadoc/documenting-a-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ We therefore have to define them explicitly

```

!!! Warning

Prefixes and keywords shares the same namespace and must therefore be distinct.

This is a concequence of JSON-LD and cannot be changed by Tripper.
A good rule of thumb is to write keywords out as full words and use short abberiviations (about 2-5 characters) for prefixes.


!!! note "Side note"

This dict is actually a [JSON-LD] document with an implicit context.
Expand Down Expand Up @@ -129,11 +137,18 @@ It is also possible to document multiple resources as a Python dict.

Unlike the single-resource dict representation, the multi-resource dict representation is not valid (possible incomplete) JSON-LD.

This dict representation accepts the following keywords:
The root of this dict representation accepts the following keywords:

- **domain**: Optional name of one of more domains to load keywords for.
Defaults to "default".
- **keywordfile**: Optional YAML file with keyword definitions to parse.
May also be an URI in which case it will be accessed via HTTP GET.
- **@context**: Optional user-defined context to be appended to the documentation of all resources.
- **base**: Base IRI against which to resolve relative IRIs.
- **prefixes**: A dict mapping namespace prefixes to their corresponding URLs.
- **datasets**/**distributions**/**accessServices**/**generators**/**parsers**/**resources**: A list of valid [single-resource](#single-resource-dict) dict of the given [resource type](introduction.md#resource-types).
- **\<Class\>**: Class name followed by a list of valid [single-resource](#single-resource-dict) dicts for the specified class.
The class name must be defined by the **domain**, in a **keywordfile** or in a custom **@context**.
The "[default](keywords.md)" **domain** already include many common classes, like *[Resource]*, *[Dataset]*, *[Distribution]*, *[DataService]*, *[Agent]*...

See [semdata.yaml] for an example of a [YAML] representation of a multi-resource dict documentation.

Expand Down Expand Up @@ -191,7 +206,7 @@ The below example shows how to save all datasets listed in the CSV file [semdata
... "sample": "https://he-matchmaker.eu/sample/",
... "mat": "https://he-matchmaker.eu/material/",
... "dm": "http://onto-ns.com/meta/characterisation/0.1/SEMImage#",
... "parser": "http://sintef.no/dlite/parser#",
... "par": "http://sintef.no/dlite/parser#",
... "gen": "http://sintef.no/dlite/generator#",
... },
... )
Expand Down Expand Up @@ -222,3 +237,9 @@ The below example shows how to save all datasets listed in the CSV file [semdata
[TableDoc]: ../api_reference/datadoc/tabledoc.md/#tripper.datadoc.tabledoc.TableDoc
[semdata.yaml]: https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/input/semdata.yaml
[semdata.csv]: https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/input/semdata.csv

[Resource]: https://emmc-asbl.github.io/tripper/latest/datadoc/keywords/#properties-on-resource
[DataSet]: https://emmc-asbl.github.io/tripper/latest/datadoc/keywords/#properties-on-dataset
[Distribution]: https://emmc-asbl.github.io/tripper/latest/datadoc/keywords/#properties-on-distribution
[DataService]: https://emmc-asbl.github.io/tripper/latest/datadoc/keywords/#properties-on-dataservice
[Agent]: https://emmc-asbl.github.io/tripper/latest/datadoc/keywords/#properties-on-agent
13 changes: 0 additions & 13 deletions docs/datadoc/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ The figure below shows illustrates how a dataset is documented in a triplestore.
![Documentation of a dataset](https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/docs/figs/dataset-Dataset.png)


Resource types
--------------
The [tripper.datadoc] module include the following set of predefined resource types:

- **dataset**: Individual of [dcat:Dataset] and [emmo:Dataset].
- **distribution**: Individual of [dcat:Distribution].
- **accessService**: Individual of [dcat:AccessService].
- **generator**: Individual of [oteio:Generator].
- **parser**: Individual of [oteio:Parser].
- **resource**: Any other documented resource, with no implicit type.

Future releases will support adding custom resource types.



[tripper.datadoc]: https://emmc-asbl.github.io/tripper/latest/datadoc/introduction
Expand Down
Loading