Skip to content

Commit

Permalink
added always RDF
Browse files Browse the repository at this point in the history
  • Loading branch information
athalhammer committed Apr 9, 2024
1 parent 12224ac commit 0a774b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions fasterid.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ERDI8_START = "b222222222"
ERDI8_SAFE = "True"
FASTERID_FILENAME = "last-id.txt"
FASTERID_MAX_NUM = 50
FASTERID_ALWAYS_RDF = "False"
FASTERID_MAX_PREFIX_LEN = 100
FASTERID_ID_PROPERTY = "https://schema.org/identifier"
FASTERID_ID_DEFAULT_PREFIX = "https://example.org/"
Expand Down
3 changes: 2 additions & 1 deletion fasterid/fasterid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Settings(BaseSettings):
erdi8_start: str
erdi8_safe: bool
fasterid_max_num: int
fasterid_always_rdf: bool
fasterid_max_prefix_len: int
fasterid_filename: str
fasterid_id_property: str
Expand Down Expand Up @@ -68,7 +69,7 @@ async def id_generator(request: RequestModel | None = None):
try:
new = e8.increment_fancy(old, settings.erdi8_stride)
dic = {"@id": f"{request.prefix}{new}"}
if request.rdf:
if request.rdf or settings.fasterid_always_rdf:
mime = "application/ld+json"
dic[settings.fasterid_id_property] = new
id_list.append(dic)
Expand Down

0 comments on commit 0a774b8

Please sign in to comment.