File tree Expand file tree Collapse file tree
docs/reference-implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,18 +7,19 @@ Library
77
88The reference implementation can also be used as a Python library for integration into
99other tools.
10- E.g., to "parameterize" a graph which contains `sc:Parameter ` objects, you can use the
10+ E.g., to "parameterize" a graph which contains `` sc:Parameter ` ` objects, you can use the
1111following snippet:
1212
13- ```python
14- from rdflib import Graph
15- from software_card_policies.data_model import parameterize_graph
13+ .. code :: python
14+ :caption: Graph parameterization using the library.
1615
17- policy_graph = Graph() # the graph containing policies with parameter placeholders
18- config_parameters = {} # the values to override the placeholders
16+ from rdflib import Graph
17+ from software_card_policies.data_model import parameterize_graph
1918
20- parameterized_graph = parameterize_graph(policy_graph, config_parameters)
21- ` ``
19+ policy_graph = Graph() # the graph containing policies with parameter placeholders
20+ config_parameters = {} # the values to override the placeholders
21+
22+ parameterized_graph = parameterize_graph(policy_graph, config_parameters)
2223
2324 The full validator implementation based on the library can be found in
2425``software_card_policies.__main__ ``.
Original file line number Diff line number Diff line change @@ -8,15 +8,14 @@ Validator
88The validator can be run using the ``software-card-validate `` command which is
99equivalent to ``python -m software_card_policies ``.
1010
11- Basic usage:
11+ .. code :: bash
12+ :caption: Basic usage.
1213
13- ```bash
14- software-card-validate --config config.toml metadata.ttl
15- ` ``
14+ software-card-validate --config config.toml metadata.ttl
1615
17- This will:
16+ This example will:
1817
19- 1. Load policies specified in `config.toml `
18+ 1. Load policies specified in `` config.toml ` `
20192. Resolve any parameters from the configuration
21- 3. Validate the metadata in `metadata.ttl ` using the given policies
20+ 3. Validate the metadata in `` metadata.ttl ` ` using the given policies
22214. Print a validation report
You can’t perform that action at this time.
0 commit comments