Skip to content

Commit

Permalink
Added dot_env_example file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fjodor van Rijsselberg authored and Fjodor van Rijsselberg committed Apr 5, 2023
1 parent 4723cdd commit 36d4af0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
14 changes: 14 additions & 0 deletions dot_env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Container setup
CONTAINER_NAME=metadata-enhancer
PORT=7070
APPLICATION_DIR=src
PYTHONPATH: "/root/src/"

# URL'S
KEYWORD_VOCABULARY_URL='https://fuseki.odissei.nl/skosmos/sparql'
VARIABLE_VOCABULARY_URL='https://fuseki.odissei.nl/skosmos/sparql'
GRLC_API_URL='https://grlc.odissei.nl/api-git/odissei-data/grlc/'

# Endpoints
KEYWORD_ENDPOINT='matchElsstTermForKeyword'
VARIABLE_ENDPOINT='getCbsVarUri'
9 changes: 6 additions & 3 deletions src/enhancers/MetadataEnhancer.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import os

import requests
from fastapi import HTTPException

from .utils import _try_for_key

GRLC_API_URL = os.environ['GRLC_API_URL']


class MetadataEnhancer:
""" A super class used for enhancing Dataverse metadata
""" A super class used for enhancing Dataverse metadata.
The MetadataEnhancer's is a class that describes the steps for enhancement.
A class that implements MetadataEnhancer will need to mainly implement the
Expand Down Expand Up @@ -75,8 +79,7 @@ def query_matched_terms(self, value_to_match: str) -> dict:
'endpoint': self.sparql_endpoint,
}

url = 'https://grlc.odissei.nl/api-git/odissei-data/grlc/' \
+ self.endpoint
url = GRLC_API_URL + self.endpoint
response = requests.get(
url,
params=params,
Expand Down

0 comments on commit 36d4af0

Please sign in to comment.