You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SPECIFICATION.md
+73-16Lines changed: 73 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,9 @@ SPDX-FileContributor: David Pape
20
20
21
21
## Introduction
22
22
23
-
TODO: What is this document?
23
+
**TODO:** What is this document?
24
24
25
-
TODO: What is Software CaRD?
25
+
**TODO:** What is Software CaRD?
26
26
27
27
[Software CaRD](https://helmholtz-metadaten.de/en/inf-projects/softwarecard) (`ZT-I-PF-3-080`) is funded by the Initiative and Networking Fund of the Helmholtz Association in the framework of the Helmholtz Metadata Collaboration.
28
28
@@ -52,7 +52,7 @@ All code examples are written in the following formats/languages:
52
52
53
53
RDF examples use the following namespace prefixes which are omitted for brevity:
@@ -78,7 +78,8 @@ Static page infrastructures such as "pages" provided by code forges may be used
78
78
Content negotiation may be offered but is not required.
79
79
If provision on the web is not possible or desired, files may be used instead.
80
80
81
-
TODO: Mention here which features we expect the used SHACL impwlementation to have?
81
+
**SHACL Features:**
82
+
**TODO:** Mention here which features we expect the used SHACL implementation to have? (`owl:imports`, SPARQL, JavaScript, Custom Constraint Components, ...)
82
83
83
84
### Policy Description
84
85
@@ -87,32 +88,88 @@ The software publication metadata to be validated using Software CaRD policies m
87
88
Any of the established serialization formats for RDF (XML, JSON-LD, Turtle, ...) may be used.
88
89
The metadata should mainly be based on Codemeta.
89
90
90
-
TODO: SHACL shapes for CodeMeta software metadata
91
+
**Namespaces:**
92
+
The `sc:` namespace is used to provide essential Software CaRD features.
93
+
Examples (e.g. policies, data) may be provided in `scex:`.
94
+
`scimpl:` is reserved for implementation details and may only be used in the internal data model of the validator.
95
+
96
+
**Policies:**
97
+
Policies may consist of one or more SHACL shapes.
98
+
Any object (i.e. the third value in a triple) in their description may be replaced by a `sc:Parameter`.
99
+
100
+
**Parameterization Placeholders:**
101
+
Instances of `sc:Parameter` describe placeholders for configurable values.
102
+
A `sc:Parameter` describes the value it represents by its inner and outer type as shown in the example below.
103
+
The outer type (akin to cardinality/container) may be `sc:Scalar` if the placeholder represent a single value, or one of `rdf:List`, `rdf:Seq`, `rdf:Bag`, `rdf:Alt`, if it represents a container.
104
+
The inner type may be `rdfs:Resource`, or any [primitive data type from `xsd:`](https://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes) (such as `xsd:integer`, `xsd:boolean`, `xsd:string`, ...).
105
+
If it is `rdfs:Resource`, any associated values are assumed to be references.
106
+
If it is a primitive data type, the values are assumed to be literals of that type.
107
+
`sc:parameterConfigPath` is a string that specifies where in the config file the configured value for this placeholder can be found.
108
+
`sc:parameterDefaultValue` specifies a default value to be used when no value is configured.
109
+
The default value has to match the inner and outer type of the parameter.
110
+
111
+
**TODO:****All** primitive datatypes is probably a bit much. Which ones do we want to allow?
**TODO:** Explain explicitly which aspects of the SHACL and SHACL Advanced specs may be used (e.g. `owl:imports`, SPARQL, JavaScript, Custom Constraint Components, ...)
93
129
94
-
TODO: Software CaRD namespaces and what to put in them.
130
+
### Report Generation
95
131
96
-
TODO: Explain explicitly which aspects of the SHACL and SHACL Advanced specs may be used (e.g. `owl:imports`, SPARQL, JavaScript, ...)
132
+
**Report Output Format:**
133
+
Reports must be valid SHACL validation reports (`sh:ValidationReport`).
134
+
**TODO:** If a default value of a policy is overridden, this must be added to the report as `sc:DefaultValueOverridden???`
97
135
98
-
TODO: Output format? What kinds of violations (severities? messages?) are part of the validation report?
136
+
**Report Presentation:**
137
+
The validation report may be presented to the user in a friendlier way, e.g. (formatted or plain) text, markup (HTML, Markdown), graphical visualization, etc.
99
138
100
139
### Configuration
101
140
102
-
The configuration follows the structure defined in the JSON Schema below.
141
+
The configuration follows the structure of the example below.
103
142
Configuration files may be written in any file format that can reproduce this schema (e.g. JSON, YAML, TOML, ...).
104
143
105
-
NOTE: A validator for a variety of formats can be found at <https://www.npmjs.com/package/pajv>
The key of each entry in the `policies` table/dictionary/map may be used to indicate problems to the user.
106
163
107
-
TODO: Add schema
164
+
**TODO:** Provide a JSON Schema? A validator for a variety of formats can be found at <https://www.npmjs.com/package/pajv>
108
165
109
-
TODO: Add an example policy configuration that uses some parameters. If possible, show how to configure a policy that was already given above.
166
+
## Example Policies and Configurations
110
167
111
-
### Example Policies and Configurations
168
+
**TODO:** Add examples for simple policies, parameterizable policies, and config files
112
169
113
-
TODO: Add examples for simple policies, parameterizable policies, and config files
170
+
## Example Implementation
114
171
115
-
### Example / Reference Implementation
172
+
**TODO:** Call this "Example" or "Reference"?
116
173
117
174
An example implementation of a validator for Software CaRD policies can be found at <https://github.com/softwarepub/software-card-policies>.
118
175
Its latest version can be installed as a command line tool `sc-validate` using:
0 commit comments