diff --git a/flask-app/application/__init__.py b/flask-app/application/__init__.py index bfb834a..b8c0c7f 100644 --- a/flask-app/application/__init__.py +++ b/flask-app/application/__init__.py @@ -49,7 +49,7 @@ def __call__(self, environ, start_response): app.config.update(dict( APP_NAME = 'MTW', - APP_VER = '1.4.8', + APP_VER = '1.4.9', API_VER = '1.0.0', DBVERSION = 1.0, TEMP_DIR = mtu.get_instance_dir(app, 'temp'), diff --git a/flask-app/application/templates/snips/search-form.html b/flask-app/application/templates/snips/search-form.html index e3b0df7..19476b3 100644 --- a/flask-app/application/templates/snips/search-form.html +++ b/flask-app/application/templates/snips/search-form.html @@ -3,7 +3,7 @@
+ name="q" value="{{ session.get('q','') }}" required autofocus>
{{ hits_cnt }} diff --git a/flask-app/application/templates/sparql/exports/lookups_base.sparql b/flask-app/application/templates/sparql/exports/lookups_base.sparql index 01f0d85..b4b5dfb 100644 --- a/flask-app/application/templates/sparql/exports/lookups_base.sparql +++ b/flask-app/application/templates/sparql/exports/lookups_base.sparql @@ -2,7 +2,7 @@ {% include 'sparql/_namespaces.sparql' %} -SELECT ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?nlm ?rn ?cas +SELECT ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?est ?nlm ?rn ?cas (GROUP_CONCAT(DISTINCT ?trns ; separator='~') AS ?trn) (GROUP_CONCAT(DISTINCT ?pac ; separator='~') AS ?pa) (GROUP_CONCAT(DISTINCT ?bd ; separator='~') AS ?btd) @@ -14,6 +14,7 @@ WHERE { ?d meshv:identifier ?dui . ?d meshv:active ?active . ?d meshv:dateCreated ?crt . + ?d meshv:dateEstablished ?est . OPTIONAL { ?d meshv:treeNumber ?tree . ?tree rdfs:label ?trns @@ -47,5 +48,5 @@ WHERE { OPTIONAL { ?c meshv:registryNumber ?rn } OPTIONAL { ?c meshv:casn1_label ?cas } } -GROUP BY ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?nlm ?rn ?cas +GROUP BY ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?est ?nlm ?rn ?cas ###LIMIT 100 diff --git a/flask-app/application/utils.py b/flask-app/application/utils.py index 69ca099..6f7d3d6 100644 --- a/flask-app/application/utils.py +++ b/flask-app/application/utils.py @@ -358,6 +358,10 @@ def getLookupJson(lookups, export): if crt: d['crt'] = crt + est = item.get('est') + if est: + d['est'] = est + for t in terms: if t: d['xtr'].append( t.replace('[OBSOLETE]','').strip() ) diff --git a/flask-app/mtw-server.py b/flask-app/mtw-server.py index 6cab799..bd9963d 100644 --- a/flask-app/mtw-server.py +++ b/flask-app/mtw-server.py @@ -9,7 +9,7 @@ from waitress import serve appname = 'mtw-server' -appdesc = 'MTW Server 1.4.8' +appdesc = 'MTW Server 1.4.9' appusage = 'Help: ' + appname + ' -h \n' appauthor = 'Filip Kriz' diff --git a/flask-app/mtw_requirements.txt b/flask-app/mtw_requirements.txt index 86c93dd..e73decf 100644 --- a/flask-app/mtw_requirements.txt +++ b/flask-app/mtw_requirements.txt @@ -1,32 +1,34 @@ -### Version 1.4.8 +### Version 1.4.9 ### Python 3.8+ ### -arrow==1.2.2 +arrow==1.2.3 bcrypt==3.2.0 # NOT python-bcrypt !!! -cachelib==0.6.0 +cachelib==0.9.0 certifi==2022.12.7 -cffi==1.15.0 +cffi==1.15.1 diff_match_patch==20200713 -Flask==2.0.3 -Flask-Babel==2.0.0 -Flask-Caching==1.10.1 -Flask-Paranoid==0.2.0 -Flask-SeaSurf==0.3.1 +Flask==2.2.2 +Flask-Babel==3.0.0 +Flask-Caching==2.0.2 +Flask-Paranoid==0.3.0 +Flask-SeaSurf==1.1.1 Flask-Session==0.4.0 ### (optional) For SameSite cookie attribute support use: # https://github.com/filak/flask-session # - copy the files to: application\custom\flask_session flask-talisman==1.0.0 -itsdangerous==2.1.1 -Jinja2==3.0.3 +itsdangerous==2.1.2 +Jinja2==3.1.2 pyuca==1.2 -requests==2.27.1 +requests==2.28.2 requests_futures==1.0.0 +setuptools==66.0.0 ### (optional) If deploying with Waitress (https://github.com/Pylons/waitress): waitress==2.1.2 -Werkzeug==2.0.3 +Werkzeug==2.2.2 +wheel==0.38.4 ### (optional) If building for Windows: -pyinstaller==4.10 +pyinstaller==5.7.0 ## Install pywin32 -pywin32==304 +pywin32==305 ## and run AS Admin (!): ## python venv\Scripts\pywin32_postinstall.py -install diff --git a/sparql/exports/lookups_base.sparql b/sparql/exports/lookups_base.sparql index 828850b..fd28218 100644 --- a/sparql/exports/lookups_base.sparql +++ b/sparql/exports/lookups_base.sparql @@ -8,7 +8,7 @@ PREFIX text: PREFIX meshx: PREFIX mesht: -SELECT ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?nlm ?rn ?cas +SELECT ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?est ?nlm ?rn ?cas (GROUP_CONCAT(DISTINCT ?trns ; separator='~') AS ?trn) (GROUP_CONCAT(DISTINCT ?pac ; separator='~') AS ?pa) (GROUP_CONCAT(DISTINCT ?bd ; separator='~') AS ?btd) @@ -21,12 +21,14 @@ WHERE { #BIND(mesh:Q000009 as ?d) #BIND(mesh:D002493 as ?d) #BIND(mesh:D005123 as ?d) - BIND(mesh:D018806 as ?d) + #BIND(mesh:D018806 as ?d) + BIND(mesh:D023482 as ?d) ?d rdf:type ?dtype . FILTER(?dtype IN(meshv:TopicalDescriptor,meshv:GeographicalDescriptor,meshv:PublicationType,meshv:CheckTag,meshv:Qualifier)) ?d meshv:identifier ?dui . ?d meshv:active ?active . ?d meshv:dateCreated ?crt . + ?d meshv:dateEstablished ?est . OPTIONAL { ?d meshv:treeNumber ?tree . ?tree rdfs:label ?trns @@ -60,5 +62,5 @@ WHERE { OPTIONAL { ?c meshv:registryNumber ?rn } OPTIONAL { ?c meshv:casn1_label ?cas } } -GROUP BY ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?nlm ?rn ?cas +GROUP BY ?dui ?cui ?dtype ?den ?trx ?notrx ?active ?crt ?est ?nlm ?rn ?cas ###LIMIT 100