Skip to content

Commit 9c1a70a

Browse files
chore: make targets for adding metadata (DSP-1289) (#1810)
* chore: add make targets for adding metadata * chore: remove obsolete make calls * chore(make): add metadata to projects on `make stack-up` * chore(make): move metadata to separate stack-up target * Update Makefile Co-authored-by: Ivan Subotic <400790+subotic@users.noreply.github.com>
1 parent 6a13852 commit 9c1a70a

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

‎Makefile‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ stack-up: docker-build env-file ## starts the knora-stack: fuseki, sipi, redis,
112112
docker-compose -f docker-compose.yml up -d
113113
$(CURRENT_DIR)/webapi/scripts/wait-for-knora.sh
114114

115+
.PHONY: stack-up-with-metadata
116+
stack-up-with-metadata: stack-up metadata ## starts stack and adds metadata
117+
115118
.PHONY: stack-up-fast
116119
stack-up-fast: docker-build-knora-api-image env-file ## starts the knora-stack by skipping rebuilding most of the images (only api image is rebuilt).
117120
docker-compose -f docker-compose.yml up -d
@@ -292,6 +295,30 @@ init-db-test-from-staging: db_staging_dump.trig init-db-test-empty ## init local
292295
@curl -X POST -H "Content-Type: application/sparql-update" -d "DROP ALL" -u "admin:test" "http://localhost:3030/knora-test"
293296
@curl -X POST -H "Content-Type: application/trig" --data-binary "@${CURRENT_DIR}/db_staging_dump.trig" -u "admin:test" "http://localhost:3030/knora-test"
294297

298+
.PHONY: metadata
299+
metadata: metadata-standard metadata-minimal metadata-maximal ## add three example metadata sets
300+
301+
.PHONY: metadata-standard
302+
metadata-standard: ## add pseudo-realistic metadata set to anything project
303+
@echo $@
304+
@mkdir -p .tmp
305+
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata.ttl -o .tmp/metadata.ttl -s
306+
@curl -X PUT -u root@example.com:test -H "Content-Type: text/turtle" -T ".tmp/metadata.ttl" "localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F0001" -s -o /dev/null
307+
308+
.PHONY: metadata-minimal
309+
metadata-minimal: ## add minimal metadata set to images project
310+
@echo $@
311+
@mkdir -p .tmp
312+
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata-minimal.ttl -o .tmp/metadata.ttl -s
313+
@curl -X PUT -u root@example.com:test -H "Content-Type: text/turtle" -T ".tmp/metadata.ttl" "localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F00FF" -s -o /dev/null
314+
315+
.PHONY: metadata-maximal
316+
metadata-maximal: ## add maximal metadata set to dokubib project
317+
@echo $@
318+
@mkdir -p .tmp
319+
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata-maximal.ttl -o .tmp/metadata.ttl -s
320+
@curl -X PUT -u root@example.com:test -H "Content-Type: text/turtle" -T ".tmp/metadata.ttl" "localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F0804" -s -o /dev/null
321+
295322
#################################
296323
## Other
297324
#################################

‎docs/05-internals/development/building-and-running.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ $ make stack-up-fast
6969
7070
which starts the knora-stack by skipping rebuilding most of the images (only api image is rebuilt).
7171
72+
To work on Metadata, use
73+
74+
```
75+
$ make stack-up-with-metadata
76+
```
77+
78+
which will put three example metadata sets to the projects `anything`, `images` and `dokubib`.
79+
This data can then be consumed from `localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F0001`, `localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F00FF` and `localhost:3333/v2/metadata/http%3A%2F%2Frdfh.ch%2Fprojects%2F0804`.
80+
7281
## Managing Containers in Docker Dashboard
7382
7483
The Docker Desktop is installed on your computer during the installation of docker, it enables easy management of docker

0 commit comments

Comments
 (0)