Skip to content

Commit

Permalink
fix: custom vocab and person url scheme for v12
Browse files Browse the repository at this point in the history
custom vocabs can't share pid types with existing vocabs under v12 I guess, the site would not build with our
programs custom vocab using `pid-type: sub` but now you can do `pid-type: prog`
also for the url scheme for person ids, we can just import it from RDM_RECORDS_IDENTIFIERS_SCHEMES rather than
recreate it

closes #28
  • Loading branch information
phette23 committed Aug 9, 2024
1 parent a505319 commit d3afef5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
8 changes: 2 additions & 6 deletions app_data/vocabularies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ subjects:
# only contains CCA right now
affiliations:
pid-type: aff
schemes:
- id: ROR
name: Research Organization Registry
uri: "https://ror.org/"
data-file: vocabularies/affiliations.yaml
data-file: vocabularies/affiliations.yaml
names:
pid-type: names
data-file: vocabularies/names.yaml
programs:
pid-type: sub
pid-type: prog
data-file: vocabularies/programs.yaml
14 changes: 4 additions & 10 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,16 @@ COMMUNITIES_IDENTITIES_CACHE_REDIS_URL = "redis://localhost:6379/1"
# can add custom fields to communities, too
# https://inveniordm.docs.cern.ch/customize/custom_fields/communities/

# Trying to allow email as an identifier for names.yaml
# We don't have ORCID, etc. for our users, let URLs be identifiers
# https://discord.com/channels/692989811736182844/1212764629604769792
# ! https://github.com/cca/cca_invenio/issues/28
from idutils import is_url
from invenio_rdm_records.config import RDM_RECORDS_IDENTIFIERS_SCHEMES
from invenio_rdm_records.config import RDM_RECORDS_PERSONORG_SCHEMES
from invenio_vocabularies.config import VOCABULARIES_NAMES_SCHEMES

url_scheme = {
"label": _("URL"),
"validator": is_url,
"datacite": "URL",
}

# We capitalize URL b/c name of scheme, _not_ its label, appears on deposit form once
RDM_RECORDS_PERSONORG_SCHEMES["URL"] = url_scheme
VOCABULARIES_NAMES_SCHEMES["URL"] = url_scheme
RDM_RECORDS_PERSONORG_SCHEMES["url"] = RDM_RECORDS_IDENTIFIERS_SCHEMES["url"]
VOCABULARIES_NAMES_SCHEMES["url"] = RDM_RECORDS_IDENTIFIERS_SCHEMES["url"]

# Invenio-Records-Resources
# =========================
Expand Down

0 comments on commit d3afef5

Please sign in to comment.