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

LMB-1232 | Manage a concept-scheme with their concepts #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

JonasVanHoof
Copy link
Collaborator

@JonasVanHoof JonasVanHoof commented Feb 26, 2025

Description

We want this service to manage concept-schemes with their concepts.

How to test

  1. look for implemations for a concept
  2. look for implemations for a concept-scheme
  3. delete concepts
  4. delete conceptscheme with concepts

Links to other PR's

Debug compose

services:
  concept-scheme:
    image: semtech/mu-javascript-template:latest
    restart: 'no'
    labels:
      - 'logging=true'
    environment:
      - NODE_ENV=development
      - NO_BABEL_NODE=true
    ports:
      - '8083:80'
      - '9230:9229'
    volumes:
      - ./:/app
      # ignore app/dist because this is where we map the built files to, otherwise we get an infinite loop of creating files (on mac)
      - /app/dist
      - ./dist:/usr/src/dist
    networks:
      - debug
networks:
  debug:
    external: true

@JonasVanHoof JonasVanHoof marked this pull request as ready for review February 27, 2025 10:10
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>

SELECT DISTINCT ?concept ?implementation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you only seem to be interested in whether an implementation exists, this query is inefficient and will return duplicate concepts if the concept is used multiple times.
You should do an aggregate query with a sample() function

const conceptUris = (await getConceptsInConceptScheme(conceptSchemeUri)).map(
(concept) => concept.uri,
);
await deleteConceptsWithImplementations(conceptUris);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your query will become quite large if there are e.g. 1000s of values in the concept scheme (unlikely but not impossible for our usecase)
better to have a query that deletes the concepts without specifying their values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants