-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Docs #264
Improve Docs #264
Conversation
In
I think the details how to do this should be covered by the DSP-API docs. I usually delete all the volumes. I believe there is a problem with stopping the db container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what are we doing with links? Is it better to link at all or do not link to do not mess up with versions? I would link - here is why.
README.md
Outdated
For the public API, see <https://dasch-swiss.github.io/dsp-js-lib>. | ||
For design documentation, see file `design-documentation.md`. | ||
## Developing DSP-JS-LIB | ||
See `contribution.md`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my point of every comment suggesting the link. Linking makes life way easier. One just can click to open in external tab and keep read the docs.
Could we try to find a general solution for this? Other repos will need that too and it should be handled in a consistent manner so all fits together in the end. How about tomorrow after the meeting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my side it looks ok now. So we can move the links topic to another task, talking about it first, like suggested.
Shall I schedule a meeting for tomorrow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making our docs great again!
README.md
Outdated
|
||
Below you may find a minimal example in TypeScript for the process of the user login. | ||
Make sure that `rxjs` is installed in the required major version 6 with the framework you are using, e.g. Angular. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Make sure that your version of 'rxjs' is major version 6 with..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 12cd1f1
README.md
Outdated
|
||
We recommend to install this library through NPM. This will make sure that all dependencies are installed. | ||
At the moment, this library depends on `rxjs`, `json2typescript`, and `jsonld`. | ||
Consult the API docs for more details about the available endpoints.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have two periods here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 12cd1f1
README.md
Outdated
console.log(res); | ||
}, | ||
(error) => { | ||
// for some reason, the request failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if, for some reason, the request failed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 12cd1f1
contribution.md
Outdated
|
||
## Introduction | ||
|
||
The purpose of this library is facilitating the use of [DSP-API (Knora)](https://www.knora.org) in web client development. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The purpose of this library is to facilitate the use of..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 8a12b84
contribution.md
Outdated
|
||
1. `npm run peer-deps`: Installs the project's peer dependencies. Peer dependencies are not installed with `npm install`, but have to be met before building or running the tests. | ||
1. `npm run test`: Runs the library's tests defined in `./karma.conf.js`. | ||
1. `npm run prepare-dev-publication`: prepares a dev version of the library **before** building it. The dev version contains code to create mocked data to be used in unit test of projects using DSP-JS-LIB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unit test" should be plural
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 8a12b84
design-documentation.md
Outdated
|
||
DSP-API System endpoints inform about DSP-API's status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly sure what this is trying to say, perhaps "DSP-API System endpoints provide information about DSP-API's status."?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in cc70b8e
design-documentation.md
Outdated
|
||
The Knora Admin API is used to administrate projects in Knora. This also includes management of users and groups as well as permissions. | ||
The Knora API relies on JSON as an exchange format. | ||
The `HealthEndpointSystem` returns DSP-API's health status including information about the is version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"about the version"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in cc70b8e
design-documentation.md
Outdated
|
||
`ResourcesConversionUtil` handles the conversion of one or several resources serialized as JSON-LD to an array of `ReadResource`. | ||
`ResourcesConversionUtil` creates an array of `ReadResource` from JSON-LD representing resource instances, | ||
automatically adding ontology information such as resource class labels and labels from list nodes that are referred to from list values. | ||
It does so by using `OntologyCache` and `ListNodeCache`, minimizing the requests to the Knora API to obtain the necessary information. | ||
It does so by using `OntologyCache` and `ListNodeCache`, minimizing the requests to DSP-API to obtain the necessary information. | ||
|
||
`ResourcesConversionUtil.createReadResourceSequence` is a public method that takes JSON-LD representing zero, one or more resources and returns an array of `ReadResource`. For each resource serialized as JSON-LD, `ResourcesConversionUtil.createReadResource` is called to do the conversion to a `ReadResource`. As a first step, `ResourcesConversionUtil.createReadResource` determines the resource's type (its class). Then, the definition for this class is requested from `OntologyCache`. The class definition contains information such as the class's label, cardinalities for properties and the definitions of those properties. The cardinalities are required to distinguish between system properties and properties that are defined in a project ontology. Each property value serialized as JSON-LD is converted to a `ReadValue` if there exists a cardinality for it for the resource class at hand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"zero, one, or more" - the additional comma makes it easier to comprehend
the sentence at the end
"Each property value serialized as JSON-LD is converted to a ReadValue
if a cardinality for it exists for the resource class at hand."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in cc70b8e
design-documentation.md
Outdated
|
||
### Generic Cache | ||
|
||
`GenericCache` is an abstract and generic class. The generic type is the type of object that is going to be cached, e.g., an `ReadOntology`. The key is the IRI of the object that is cached. `GenericCache` ensures that a specific element is only requested once from Knora also if several asynchronous for the same element are performed. `GenericCache` also resolves dependencies of an element that is being requested, but in a non blocking ay, i.e. the requested element is returned immediately it is ready while the dependencies are still being resolved. | ||
`GenericCache` is an abstract and generic class. The generic type is the type of object that is going to be cached, e.g., an `ReadOntology`. The key is the IRI of the object that is cached. `GenericCache` ensures that a specific element is only requested once from DSP-API also if several asynchronous for the same element are performed. `GenericCache` also resolves dependencies of an element that is being requested, but in a non blocking ay, i.e. the requested element is returned immediately it is ready while the dependencies are still being resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"GenericCache
ensures that a specific element is only requested once from DSP-API if several asynchronous for the same element are performed." - remove "also"
"but in a non-blocking way, i.e. the requested element is returned immediately when it is ready while the dependencies are still being resolved."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in cc70b8e
test-framework/README.md
Outdated
|
||
Then, open the root directory of the library in the terminal and run | ||
Then switch to the directory `./test-framework`. | ||
From this directory, run the follwoing scripts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in cc70b8e
after discussion with @kilchenmann and @mpro7: I will add links to the Markdown files and add a section in the README saying that these links always point to the latest version of the file, not necessarily the version / release the user is currently using. |
GitHub docs suggest to use relative links: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-readmes#relative-links-and-image-paths-in-readme-files however, I am not sure how this looks on npm |
I checked https://www.npmjs.com/package/rxjs and I figured that relative links are rewritten so they point to the location on GitHub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice :)
resolves DSP-1050
This PR reorganises the docs:
README.md
(project root): brief introduction to DSP-JS-LIB and shows how to use itcontribution.md
: information for developersdesign-documentation.md
: design and architecturetest-framework/README.md
: how to run the test Angular app and how to run E2E testThe API docs have been improved and can be generated locally by running
npm run builddocs
.This PR adds the
@category
tag to classes, interfaces, and namespaces so that the API docs are organised by different sections:It would be nice to exclude the "Internal" category for the published API docs. I requested this feature.