Skip to content

Commit

Permalink
feat: read-only collection
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Jan 8, 2025
1 parent 6cd2ef8 commit be60b63
Show file tree
Hide file tree
Showing 24 changed files with 42,194 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-kids-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kopflos-cms/core": patch
---

Added a `/ns.js` module which exports the kopflos namespace builder
5 changes: 5 additions & 0 deletions .changeset/wild-bees-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kopflos-cms/hydra": minor
---

Support for `hydra:Collection` resource shapes
11 changes: 11 additions & 0 deletions example/lib/plaque.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { SubjectHandler } from '@kopflos-cms/core'

export const post = (): SubjectHandler => async (req) => {
await req.env.sparql.default.stream.store.post(req.body.quadStream, {
graph: req.subject.term,
})

return {
status: 204,
}
}
10 changes: 10 additions & 0 deletions example/resources/api/index.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ PREFIX kl: <https://kopflos.described.at/>
a kl:ResourceShape ;
kl:api <> ;
sh:targetClass </api/schema/Plaque> ;
kl:handler
[
a kl:Handler ;
kl:method "POST" ;
code:implementedBy
[
a code:EcmaScriptModule ;
code:link <file:lib/plaque.js#post> ;
]
] ;
.

<#plaque.html>
Expand Down
Loading

0 comments on commit be60b63

Please sign in to comment.