Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make targets for adding metadata (DSP-1289) #1810

Merged
merged 8 commits into from Feb 4, 2021
27 changes: 27 additions & 0 deletions Makefile
Expand Up @@ -112,6 +112,9 @@ stack-up: docker-build env-file ## starts the knora-stack: fuseki, sipi, redis,
docker-compose -f docker-compose.yml up -d
$(CURRENT_DIR)/webapi/scripts/wait-for-knora.sh

.PHONY: stack-up-with-metadata
stack-up-with-metadata: stack-up metadata ## starts stack and adds metadata

.PHONY: stack-up-fast
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).
docker-compose -f docker-compose.yml up -d
Expand Down Expand Up @@ -292,6 +295,30 @@ init-db-test-from-staging: db_staging_dump.trig init-db-test-empty ## init local
@curl -X POST -H "Content-Type: application/sparql-update" -d "DROP ALL" -u "admin:test" "http://localhost:3030/knora-test"
@curl -X POST -H "Content-Type: application/trig" --data-binary "@${CURRENT_DIR}/db_staging_dump.trig" -u "admin:test" "http://localhost:3030/knora-test"

.PHONY: metadata
metadata: metadata-standard metadata-minimal metadata-maximal ## add three example metadata sets

.PHONY: metadata-standard
metadata-standard: ## add pseudo-realistic metadata set to anything project
@echo $@
@mkdir -p .tmp
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata.ttl -o .tmp/metadata.ttl -s
@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

.PHONY: metadata-minimal
metadata-minimal: ## add minimal metadata set to images project
@echo $@
@mkdir -p .tmp
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata-minimal.ttl -o .tmp/metadata.ttl -s
@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

.PHONY: metadata-maximal
metadata-maximal: ## add maximal metadata set to dokubib project
@echo $@
@mkdir -p .tmp
@curl https://raw.githubusercontent.com/dasch-swiss/dsp-ontologies/main/example/example-metadata-maximal.ttl -o .tmp/metadata.ttl -s
@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

#################################
## Other
#################################
Expand Down
9 changes: 9 additions & 0 deletions docs/05-internals/development/building-and-running.md
Expand Up @@ -69,6 +69,15 @@ $ make stack-up-fast

which starts the knora-stack by skipping rebuilding most of the images (only api image is rebuilt).

To work on Metadata, use

```
$ make stack-up-with-metadata
```

which will put three example metadata sets to the projects `anything`, `images` and `dokubib`.
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`.

## Managing Containers in Docker Dashboard

The Docker Desktop is installed on your computer during the installation of docker, it enables easy management of docker
Expand Down