Skip to content

Commit

Permalink
Include code for prefix use in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Sep 30, 2024
1 parent 6eea293 commit 3ce9c0a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions _pages/create/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ The `examples.yaml` file in `my-building-block` can be used as a template.

## Prefixes

Optionally, you can add a `prefixes` entry at the top level (alongside `examples:`) or inside a specific snippet,
Optionally, you can add a `prefixes` entry at the top level (alongside `examples:`) or inside a specific example,
with a dictionary of prefix-to-URI mappings, allowing you to omit those prefixes when used in JSON, JSON-LD and
Turtle examples, but that will be used when semantically uplifting the snippets.
Turtle examples, but that will be used when semantically uplifting the snippets:

```yaml
prefixes:
# Default prefixes for all examples
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
examples:
- title: Example with prefixes
prefixes:
ex: http://example.com/
snippets:
- language: turtle
code: |
ex:a rdfs:label "A" .
```

0 comments on commit 3ce9c0a

Please sign in to comment.