-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
4,675 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kopflos-cms/core": patch | ||
--- | ||
|
||
Revert dependency on `anylogger` to stable v1 branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kopflos-cms/express": minor | ||
--- | ||
|
||
The main export now returns and object `{ middleware: RequestHandler; instance: Kopflos }` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"kopflos": minor | ||
--- | ||
|
||
First version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oxigraph/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Kopflos example | ||
|
||
API inspired by [Read the Plaque](https://readtheplaque.com/). | ||
|
||
## Start | ||
|
||
1. Start the database: | ||
```bash | ||
docker compose up -d | ||
``` | ||
2. Start the server: | ||
```bash | ||
npx kopflos serve | ||
``` | ||
|
||
The API is running on http://localhost:1429 | ||
|
||
## Details | ||
|
||
When starting, `kopflos` automatically seeds the database wit resource from directories `resources` and | ||
`resources.dev` (configured in `kopflos.config.ts`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '2' | ||
services: | ||
oxigraph: | ||
image: ghcr.io/oxigraph/oxigraph:0.4.0-rc.1 | ||
user: root | ||
command: serve --location /data --bind 0.0.0.0:7878 | ||
ports: | ||
- 7878:7878 | ||
volumes: | ||
- ./oxigraph:/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { KopflosConfig } from '@kopflos-cms/core' | ||
|
||
export default <KopflosConfig> { | ||
deploy: ['resources', 'resources.dev'], | ||
baseIri: 'http://localhost:1429', | ||
apiGraphs: ['http://localhost:1429/api'], | ||
sparql: { | ||
default: { | ||
endpointUrl: 'http://localhost:7878/query?union-default-graph', | ||
updateUrl: 'http://localhost:7878/update', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "example", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"start": "kopflos serve" | ||
}, | ||
"dependencies": { | ||
"kopflos": "*" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
example/resources.dev/plaque/newton-s-apple-tree-monash-university.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
PREFIX schema: <http://schema.org/> | ||
|
||
<> | ||
a </api/schema/Plaque> ; | ||
schema:name "Newton's Apple Tree Monash University" ; | ||
schema:image | ||
[ | ||
schema:url | ||
<http://lh3.googleusercontent.com/9plKip3uL4bOocjMGJA1qX5lXfDpYpy5uNJgW5wf8NjMbzlgjggDtZwcJLoQbyzaIlEfZaF-aDtHRLMv36ZvcRkz5g7F5qiW0gQOA_-1_A> | ||
] ; | ||
schema:contributor | ||
[ | ||
schema:name "@wadekelly" ; | ||
schema:url <https://twitter.com/wadekelly> ; | ||
] ; | ||
schema:geo [ | ||
schema:latitude "-37.909878" ; | ||
schema:longitude "145.132809" ; | ||
] ; | ||
schema:text """ | ||
NEWTON'S APPLE | ||
Newton's Apple tree, | ||
the Flower of Kent variety, | ||
was planted in 1975 and is | ||
a cutting from the original tree | ||
from which Sir Isaac Newton | ||
reportedly observed an | ||
apple fall, prompting him to | ||
formulate his theories of | ||
motion and gravity, one of the | ||
most remarkable insights in | ||
human history. | ||
"""; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
PREFIX kl: <https://kopflos.described.at/> | ||
|
||
<> | ||
a kl:Api ; | ||
kl:resourceLoader kl:OwnGraphLoader ; | ||
. | ||
|
||
<#entrypoint> | ||
a kl:ResourceShape ; | ||
kl:api <> ; | ||
sh:targetClass </api/schema/Plaque> ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
|
||
<Plaque> | ||
a rdfs:Class ; | ||
. |
Oops, something went wrong.