Skip to content

Commit 9994c34

Browse files
committed
Update various places in the specification
1 parent 837b8f1 commit 9994c34

1 file changed

Lines changed: 73 additions & 16 deletions

File tree

SPECIFICATION.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ SPDX-FileContributor: David Pape
2020

2121
## Introduction
2222

23-
TODO: What is this document?
23+
**TODO:** What is this document?
2424

25-
TODO: What is Software CaRD?
25+
**TODO:** What is Software CaRD?
2626

2727
[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.
2828

@@ -52,7 +52,7 @@ All code examples are written in the following formats/languages:
5252

5353
RDF examples use the following namespace prefixes which are omitted for brevity:
5454

55-
TODO: Remove the namespaces we don't need.
55+
**TODO:** Remove the namespaces we don't need.
5656

5757
```turtle
5858
@prefix codemeta: <https://doi.org/10.5063/schema/codemeta-2.0#> .
@@ -78,7 +78,8 @@ Static page infrastructures such as "pages" provided by code forges may be used
7878
Content negotiation may be offered but is not required.
7979
If provision on the web is not possible or desired, files may be used instead.
8080

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, ...)
8283

8384
### Policy Description
8485

@@ -87,32 +88,88 @@ The software publication metadata to be validated using Software CaRD policies m
8788
Any of the established serialization formats for RDF (XML, JSON-LD, Turtle, ...) may be used.
8889
The metadata should mainly be based on Codemeta.
8990

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?
112+
`xsd:string`, `xsd:boolean`, `xsd:decimal`, `xsd:float`, `xsd:double`, `xsd:dateTime`, `xsd:time`, `xsd:date`, `xsd:anyURI`,
113+
but not `xsd:duration`, `xsd:gYearMonth`, `xsd:gYear`, `xsd:gMonthDay`, `xsd:gDay`, `xsd:gMonth`, `xsd:hexBinary`, `xsd:base64Binary`, `xsd:NOTATION`?
114+
What about `xsd:QName`?
91115

92-
TODO: Parameterization mechanism
116+
```turtle
117+
scex:licenses a sc:Parameter ;
118+
sc:parameterOuterType rdf:List ;
119+
sc:parameterInnerType xsd:string ;
120+
sc:parameterConfigPath "suggested_licenses" ;
121+
sc:parameterDefaultValue ( "https://spdx.org/licenses/Apache-2.0" "https://spdx.org/licenses/MIT" ) .
122+
```
123+
124+
### Validation Process
125+
126+
**TODO:** Parameterization placeholder replacements mechanism
127+
128+
**TODO:** Explain explicitly which aspects of the SHACL and SHACL Advanced specs may be used (e.g. `owl:imports`, SPARQL, JavaScript, Custom Constraint Components, ...)
93129

94-
TODO: Software CaRD namespaces and what to put in them.
130+
### Report Generation
95131

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???`
97135

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.
99138

100139
### Configuration
101140

102-
The configuration follows the structure defined in the JSON Schema below.
141+
The configuration follows the structure of the example below.
103142
Configuration files may be written in any file format that can reproduce this schema (e.g. JSON, YAML, TOML, ...).
104143

105-
NOTE: A validator for a variety of formats can be found at <https://www.npmjs.com/package/pajv>
144+
```toml
145+
[policies.authors]
146+
source = "https://software-metadata.pub/software-card-policies/example-policies/policies/authors-affiliation.ttl"
147+
148+
[policies.description]
149+
source = "https://software-metadata.pub/software-card-policies/example-policies/policies/description-parameterizable.ttl"
150+
parameters = {description_min_length = 10}
151+
152+
[policies.licenses]
153+
source = "https://software-metadata.pub/software-card-policies/example-policies/policies/licenses-parameterizable.ttl"
154+
155+
[policies.licenses.parameters]
156+
suggested_licenses = [
157+
"https://spdx.org/licenses/Apache-2.0",
158+
"https://spdx.org/licenses/GPL-3.0-or-later"
159+
]
160+
```
161+
162+
The key of each entry in the `policies` table/dictionary/map may be used to indicate problems to the user.
106163

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>
108165

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
110167

111-
### Example Policies and Configurations
168+
**TODO:** Add examples for simple policies, parameterizable policies, and config files
112169

113-
TODO: Add examples for simple policies, parameterizable policies, and config files
170+
## Example Implementation
114171

115-
### Example / Reference Implementation
172+
**TODO:** Call this "Example" or "Reference"?
116173

117174
An example implementation of a validator for Software CaRD policies can be found at <https://github.com/softwarepub/software-card-policies>.
118175
Its latest version can be installed as a command line tool `sc-validate` using:

0 commit comments

Comments
 (0)