Skip to content

Commit

Permalink
serialization update
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Jul 9, 2024
1 parent 7f8bb34 commit 81cd339
Show file tree
Hide file tree
Showing 29 changed files with 1,847,111 additions and 361,143 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build-site:
python scripts/make-xml-versions.py
python scripts/generate-serializations.py
20 changes: 3 additions & 17 deletions content/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,9 @@ title: Tools and Downloads
The Brick ontology is distributed as a set of [Turtle][15] files.
Turtle is a compact textual format that is understood by most Semantic Web tools.

- **Latest Stable Version (1.4.0)**:
- **v1.4.0**: [Brick.ttl][37]: Brick classes and tagsets

- **Latest Build**:
- [Brick.ttl][28]: The most recent build of Brick as of 2am UTC every day. Contains the latest changes, but also the latest bugs. Helpful for development; for stability, use the stable version linked above.

- **Old Versions**:
- **v1.3.0**: [Brick.ttl][36]: Brick classes and tagsets
- **v1.2.1**: [Brick.ttl][35]: Brick classes and tagsets
- **v1.2.0**: [Brick.ttl][33]: Brick classes and tagsets
- **v1.1.1**: [Brick.ttl][32]: Brick classes and tagsets
- **v1.1.0**: [Brick.ttl][27]: Brick classes and tagsets
- **Old Version (1.0.3) -- Not supported**:
- [Brick.ttl][1]: Brick classes and tagsets
- [BrickFrame.ttl][2]: Brick relationship definitions
- [BrickTag.ttl][3]: Brick tags (internal)
- [BrickUse.ttl][4]: Brick "uses" relationships (internal)


{{< releases "table table-striped table-bordered flex" "width: 100%" >}}

## Brick Tools
---
Expand Down
70 changes: 70 additions & 0 deletions data/releases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"version": "latest",
"release_date": "Nightly",
"downloads": {
"Turtle": "https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl"
},
"changelog": "https://github.com/BrickSchema/Brick/compare/v1.4.0...nightly"
},
{
"version": "1.4.0",
"release_date": "2024-04-15",
"downloads": {
"Turtle": "/schema/1.4/Brick.ttl",
"RDF/XML": "/schema/1.4/Brick",
"JSON-LD": "/schema/1.4/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.4.0"
},
{
"version": "1.3.0",
"release_date": "2022-10-12",
"downloads": {
"Turtle": "/schema/1.3/Brick.ttl",
"RDF/XML": "/schema/1.3/Brick",
"JSON-LD": "/schema/1.3/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.3.0"
},
{
"version": "1.2.1",
"release_date": "2021-08-12",
"downloads": {
"Turtle": "/schema/1.2.1/Brick.ttl",
"RDF/XML": "/schema/1.2.1/Brick",
"JSON-LD": "/schema/1.2.1/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.2.1"
},
{
"version": "1.2.0",
"release_date": "2021-02-19",
"downloads": {
"Turtle": "/schema/1.2/Brick.ttl",
"RDF/XML": "/schema/1.2/Brick",
"JSON-LD": "/schema/1.2/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.2.0"
},
{
"version": "1.1.1",
"release_date": "2020-01-22",
"downloads": {
"Turtle": "/schema/1.1.1/Brick.ttl",
"RDF/XML": "/schema/1.1.1/Brick",
"JSON-LD": "/schema/1.1.1/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.1.1"
},
{
"version": "1.1.0",
"release_date": "2020-07-10",
"downloads": {
"Turtle": "/schema/1.1/Brick.ttl",
"RDF/XML": "/schema/1.1/Brick",
"JSON-LD": "/schema/1.1/Brick.jsonld"
},
"changelog": "https://github.com/BrickSchema/Brick/releases/tag/v1.1.0"
}
]
2 changes: 2 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ post = '<i class="fa fa-external-link" aria-hidden="true"></i>'
[mediaTypes]
[mediaTypes.'text/turtle']
suffixes = ['ttl']
[mediaTypes.'application/json']
suffixes = ['jsonld']
28 changes: 28 additions & 0 deletions layouts/shortcodes/releases.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<table class="{{ .Get 0 }}" style="{{ .Get 1 }}">
<thead>
<tr>
<th>Version</th>
<th>Release Date</th>
<th style="width: 290px;">Downloads</th>
<th>Changelog</th>
</tr>
</thead>
<tbody>
{{ with .Site.Data.releases }}
{{ range . }}
<tr>
<td>{{ .version }}</td>
<td>{{ .release_date }}</td>
<td>
<ul>
{{ range $key, $value := .downloads }}
<li><a href="{{ $value }}">{{ $key }}</a></li>
{{ end }}
</ul>
</td>
<td><a href="{{ .changelog }}">Changelog</a></td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
7 changes: 7 additions & 0 deletions layouts/shortcodes/table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ $htmlTable := .Inner | markdownify }}
{{ $class := .Get 0 }}
{{ $style := .Get 1 }}
{{ $old := "<table>" }}
{{ $new := printf "<table class=\"%s\" style=\"%s\">" $class $style}}
{{ $htmlTable := replace $htmlTable $old $new }}
{{ $htmlTable | safeHTML }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
g = rdflib.Graph()
g.parse(filename, format='turtle')
g.serialize(filename.rstrip('.ttl'), format='xml')
print('Wrote XML version of', filename, 'to', filename.rstrip('.ttl'))

# save a jsonld version too
g.serialize(filename.replace('ttl', 'jsonld'), format='json-ld')
print(f'Wrote {filename} to {filename.rstrip(".ttl")}')
Loading

0 comments on commit 81cd339

Please sign in to comment.