Skip to content

Commit 7a48810

Browse files
authored
Update user-guide.md
- Add JSON code highlighting to all JSON snippets - Replace a deprecated license ID (`GPL-3.0`) in Array example with one of the updated ones (`GPL-3.0-or-later`) - Add a link to git tag in the release candidate reference recommendation
1 parent 2899878 commit 7a48810

1 file changed

Lines changed: 13 additions & 18 deletions

File tree

content/user-guide.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ title: user guide
77

88
You can use the [codemeta-generator](https://codemeta.github.io/codemeta-generator/) directly at <https://codemeta.github.io/codemeta-generator/>
99

10-
## Creating A CodeMeta Instance File Manually
10+
## Creating a CodeMeta instance file manually
1111

1212
A CodeMeta instance file describes the metadata associated with a software object using JSON's linked data (JSON-LD) notation. A codemeta file can contain any of the properties described on the [CodeMeta terms page](/terms/). Most codemeta files are called `codemeta.json` by convention.
1313

14-
Here is an example of a basic `codemeta.json` that you can put at the root of a Github repo ([link to full example](https://github.com/ropensci/codemetar/blob/master/codemeta.json)):
14+
Here is an example of a basic `codemeta.json` that you can put at the root of a GitHub repo ([link to full example](https://github.com/ropensci/codemetar/blob/master/codemeta.json)):
1515
```json
1616
{
1717
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
@@ -27,7 +27,7 @@ Here is an example of a basic `codemeta.json` that you can put at the root of a
2727

2828
When creating a CodeMeta document, note that they contain JSON name ("property" in linked-data), value pairs where the values can be simple values, arrays or JSON objects. A simple value is a number, string, or one the literal values *false*, *null* *true*, for example:
2929

30-
```
30+
```json
3131
"name" : "R Interface to the DataONE REST API"
3232
```
3333

@@ -37,13 +37,13 @@ There must be a comma between of these key-value pairs, and no comma at the end
3737

3838
A JSON array is surrounded by the characters `[` and `]`, and can contain multiple values separated by commas:
3939

40-
```
40+
```json
4141
"keywords": [ "data sharing", "data repository", "DataONE" ]
4242
```
4343

4444
As with any JSON documents, you can add line breaks between values for improved quality. For example, the former key-value pair is this is equivalent to:
4545

46-
```
46+
```json
4747
"keywords": [
4848
"data sharing",
4949
"data repository",
@@ -53,9 +53,9 @@ As with any JSON documents, you can add line breaks between values for improved
5353

5454
All fields that accept a value of a given type accept an array of values of this type, and vice-versa. For example, a software with two licenses could have this attribute:
5555

56-
```
56+
```json
5757
"license": [
58-
"https://spdx.org/licenses/GPL-3.0",
58+
"https://spdx.org/licenses/GPL-3.0-or-later",
5959
"https://spdx.org/licenses/BSD-3-Clause"
6060
]
6161
```
@@ -64,7 +64,7 @@ All fields that accept a value of a given type accept an array of values of this
6464

6565
Some properties, such as `author`, can refer to other JSON objects surrounded by curly braces and can contain other JSON values or objects, for example:
6666

67-
```
67+
```json
6868
"author": {
6969
"@id": "http://orcid.org/0000-0003-0077-4738",
7070
"@type": "Person",
@@ -81,7 +81,7 @@ The [terms page](/terms/) indicates these node types.
8181

8282
The "author" JSON object illustrates the use of the JSON-LD keyword "@id", which is used to associate an IRI with the JSON object. Any such node object can be assigned an `@id`, and we may use the `@id` to refer to this same object (the person, Peter), elsewhere in the document; e.g. we can indicate the same individual is also the `maintainer` by adding:
8383

84-
```
84+
```json
8585
"maintainer": "http://orcid.org/0000-0003-0077-4738"
8686
```
8787

@@ -129,7 +129,6 @@ JSON-LD operations can later *expand* this reference and *embed* the full inform
129129
}
130130
```
131131

132-
133132
### Nesting objects
134133

135134
We saw before a simple (root) SoftwareSourceCode object:
@@ -203,23 +202,19 @@ because in the latter, `"https://cran.r-project.org"` is the `"url"` of `rmarkdo
203202

204203
## The context
205204

206-
Every CodeMeta document must refer to the context file *codemeta.jsonld*, for example via a URL. This indicates that all terms in the document should be interpreted in the "context" of CodeMeta. Most terms are chosen to match the equivalent terms in <http://schema.org>, but CodeMeta provides a few additional terms not found in <http://schema.org> which may be helpful for software projects. CodeMeta also restricts the context to use only those <https://schema.org> terms that are explicitly listed on ther [terms](/terms/) page. Users wanting to include additional terms must extend the context (see [developer-guide](/developer-guide/)).
207-
205+
Every CodeMeta document must refer to the context file *codemeta.jsonld*, for example via a URL. This indicates that all terms in the document should be interpreted in the "context" of CodeMeta. Most terms are chosen to match the equivalent terms in <http://schema.org>, but CodeMeta provides a few additional terms not found in <http://schema.org> which may be helpful for software projects. CodeMeta also restricts the context to use only those <https://schema.org> terms that are explicitly listed on ther [terms](/terms/) page. Users wanting to include additional terms must extend the context (see [developer-guide](/developer-guide/)).
208206

209207
The context file may be modified and updated in the future, if new JSON properties are added or existing ones modified.
210208
The CodeMeta GitHub repository defines tags to allow specific versions of a file to be referenced, and assigns
211209
*digital object identifiers*, or DOIs, to each release tag. Please use the [appropriate release](https://github.com/codemeta/codemeta/releases) of the CodeMeta schema in order to refer to the
212210
appropriate context file, e.g.
213211

214-
215-
```
212+
```json
216213
"@context": "https://doi.org/10.5063/schema/codemeta-2.0"
217214
```
218215

219-
Release candidate versions may be referred to consistently using their git tag for the raw version, e.g. <https://raw.githubusercontent.com/codemeta/codemeta/2.0-rc/codemeta.jsonld>. *Please do not refer to the raw GitHub URL for the master branch*, as this is subject to change and will not guarantee a stable metadata file.
220-
221-
216+
Release candidate versions may be referred to consistently using their [git tag](https://github.com/codemeta/codemeta/tags) for the raw version, e.g. <https://raw.githubusercontent.com/codemeta/codemeta/2.0-rc/codemeta.jsonld>. *Please do not refer to the raw GitHub URL for the master branch*, as this is subject to change and will not guarantee a stable metadata file.
222217

223-
## Testing An Instance file
218+
## Testing an instance file
224219

225220
Our [codemeta-generator](https://codemeta.github.io/codemeta-generator/) can also check a codemeta.json file you wrote is valid. To do that, copy-paste your code in the bottom box, and click "Validate codemeta.json".

0 commit comments

Comments
 (0)