aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-06-27 07:47:19 +0200
committerJonas Smedegaard <dr@jones.dk>2024-06-27 07:47:19 +0200
commit595fc44b8ba3dfa6ef484b02d2d6466adcc82478 (patch)
tree7be076b4d77f48a951adcbab279bfb94a69a7fc6
parentf86e2555c42c0afbe4b34797b4de1a772fe1d5e0 (diff)
render turtle-formattet ontology
-rw-r--r--Makefile39
-rw-r--r--learn/index.qmd60
-rw-r--r--styles/sdml.scss10
3 files changed, 89 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 29b14da..b0518e5 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,17 @@ TIDY_MARKDOWN = worlding
export HEDGEDOC_COOKIES_FILE = $(CURDIR)/cookies.txt
export HEDGEDOC_SERVER = https://pad.degrowth.net/
+get_title = $(shell \
+ roqet -q -i sparql \
+ -e 'SELECT ?s ?o WHERE { ?s <http://www.w3.org/2004/02/skos/core#prefLabel> ?o}' \
+ -D $(1) \
+ | grep -Po -m1 '#>, o=string[()]"\K[^"]+')
+get_desc = $(shell \
+ roqet -q -i sparql \
+ -e 'SELECT ?s ?o WHERE { ?s <http://purl.org/dc/elements/1.1/description> ?o }' \
+ -D $(1) \
+ | grep -Po '#>, o=string[()]"\K[^"]+')
+
all: preview
preview:
@@ -33,7 +44,8 @@ publish:
rsync -avH --delete-after _site/ $(BASE_SSH)
prepare: \
- $(patsubst %,learn/%.qmd,core $(ONTOLOGIES_LEARN)) \
+ $(patsubst %,learn/%_sdm.qmd,core $(ONTOLOGIES_LEARN)) \
+ $(patsubst %,learn/%_ttl.qmd,core $(ONTOLOGIES_LEARN)) \
$(patsubst %,learn/$(ONTOLOGIES_VERSION)/%.ttl,core $(ONTOLOGIES_LEARN)) \
$(foreach ext,svg tex,learn/rdfs.$(ext)) \
$(foreach dia,tentacular trap all,$(foreach ext,svg tex,learn/$(dia)_rdfs.$(ext)))
@@ -48,17 +60,32 @@ learn/$(ONTOLOGIES_VERSION)/%.ttl: learn/%.ttl
-e 's,\n\s*owl:imports\s[^\n]+;(?=\n),,g;' \
< $< > $@
-learn/%.qmd: learn/$(ONTOLOGIES_VERSION)/%.ttl
- sdml highlight --output-format html -i learn/$*.sdm -o learn/_$*.html
- $(eval title = $(shell roqet -q -i sparql -e 'SELECT ?s ?o WHERE { ?s <http://www.w3.org/2004/02/skos/core#prefLabel> ?o}' -D $< | grep -Po -m1 '#>, o=string[()]"\K[^"]+'))
- $(eval desc = $(shell roqet -q -i sparql -e 'SELECT ?s ?o WHERE { ?s <http://purl.org/dc/elements/1.1/description> ?o }' -D $< | grep -Po '#>, o=string[()]"\K[^"]+'))
+learn/%_sdm.qmd: learn/$(ONTOLOGIES_VERSION)/%.ttl
+ sdml highlight --output-format html -i learn/$*.sdm -o learn/_$*_sdm.html
+ $(eval title = $(call get_title,$<))
+ $(eval desc = $(call get_desc,$<))
@echo '---' > $@
@echo 'title: $(title)' >> $@
@echo 'subtitle: SDML source' >> $@
@echo '---' >> $@
@echo '$(desc)' >> $@
@echo >> $@
- @echo '{{< include _$*.html >}}' >> $@
+ @echo '{{< include _$*_sdm.html >}}' >> $@
+
+learn/%_ttl.qmd: learn/%.sdm
+# sdml convert -f rdf -i learn/$*.sdm | ansifilter --html --fragment --ignore-csi -o learn/_$*_ttl.html
+ sdml convert -f rdf -i learn/$*.sdm | ansifilter --html --fragment -o learn/_$*_ttl.html
+ $(eval title = $(call get_title,learn/$(ONTOLOGIES_VERSION)/$*.ttl))
+ $(eval desc = $(call get_desc,learn/$(ONTOLOGIES_VERSION)/$*.ttl))
+ @echo '---' > $@
+ @echo 'title: $(title)' >> $@
+ @echo 'subtitle: Turtle format' >> $@
+ @echo '---' >> $@
+ @echo '$(desc)' >> $@
+ @echo >> $@
+ @echo '<pre><code class="turtle">' >> $@
+ @echo '{{< include _$*_ttl.html >}}' >> $@
+ @echo '</code></pre>' >> $@
cal-all: cal-fetch cal-render cal-publish
diff --git a/learn/index.qmd b/learn/index.qmd
index 95e9810..aae4063 100644
--- a/learn/index.qmd
+++ b/learn/index.qmd
@@ -1,9 +1,19 @@
---
title: Læringsontologi
listing:
- - id: articles
+ - id: sdml
contents:
- - "*.qmd"
+ - "*_sdm.qmd"
+ sort-ui: false
+ filter-ui: false
+ max-items: 99
+ type: table
+ fields: [title]
+ field-display-names:
+ title: "Komponent"
+ - id: turtle
+ contents:
+ - "*_ttl.qmd"
sort-ui: false
filter-ui: false
max-items: 99
@@ -19,10 +29,52 @@ lightbox:
css-class: "my-css-class"
---
-:::{#articles}
+Dette er en ontologi om læring,
+baseret på teorien om tentakulær læring [@Schraube2024].
+
+## Kode
+
+Ontologien er formuleret
+i sproget [Web Ontology Language (OWL)][OWL],
+som er en udvidelse af [Resource Description Framework (RDF)][RDF].
+
+[OWL]: <https://da.wikipedia.org/wiki/Web_Ontology_Language>
+ "Wikipedia: Vidensrepræsentationssproget Web Ontology Language"
+
+[RDF]: <https://da.wikipedia.org/wiki/Resource_Description_Framework>
+ "Wikipedia: Vidensrepræsentationssproget Resource Description Framework"
+
+:::{#turtle}
+:::
+
+## Kildekode
+
+Ontologien er dannet fra kildekode
+skrevet i sproget [Simple Domain Modeling Language (SDML)][SDML].
+
+[SDML]: <https://sdml.io/>
+ "Domænemodelleringssproget Simple Domain Modeling Language"
+
+:::{#sdml}
+:::
+
+Udviklingen af ontologien er opsummeret i en [ændringslog](CHANGELOG.md).
+
+## Diagrammer
+
+::: {layout-ncol=3}
+
+![Generel læring [rdfs2dot]](rdfs){group="gallery"}
+
+![Tentakulær læring [rdfs2dot]](tentacular_rdfs){group="gallery"}
+
+![Faldgruber [rdfs2dot]](trap_rdfs){group="gallery"}
+
:::
-[Ændringslog](CHANGELOG.md).
+![Generel og tentakulær læring og faldgruber [rdfs2dot]](all_rdfs){group="gallery"}
+
+### Tidlige skitser
::: {layout-ncol=3}
diff --git a/styles/sdml.scss b/styles/sdml.scss
index 592a598..0c46ff8 100644
--- a/styles/sdml.scss
+++ b/styles/sdml.scss
@@ -1,15 +1,5 @@
@mixin sdml {
-pre code.sdml {
- font-family: "InconsolataN",monospace;
-// font-size: .9em;
-// font-weight: 300;
-// line-height: 1.4;
- padding: .6em;
- border: 1px solid #e1e4e5;
- white-space: pre;
-}
-
pre code.sdml span.comment {
color: #949494;
font-style: italic;