From 44d829a21bff14f403f2af7e61ac2769ec1de32b Mon Sep 17 00:00:00 2001 From: filak Date: Fri, 24 Jan 2025 11:22:33 +0100 Subject: [PATCH] Version bump 1.7.0 --- flask-app/application/main.py | 2 +- flask-app/dist/instance/_data/in/README.md | 3 +- flask-app/dist/instance/_data/out/README.md | 3 +- flask-app/dist/instance/cache/README.md | 3 +- .../conf/{mesh.ttl => mesh_Jena4.ttl} | 62 +----- flask-app/dist/instance/conf/mesh_Jena5.ttl | 183 ++++++++++++++++++ flask-app/dist/instance/conf/mtw-dist.ini | 5 +- flask-app/dist/instance/logs/README.md | 3 +- flask-app/dist/instance/sessions/README.md | 3 +- flask-app/dist/instance/temp/README.md | 3 +- flask-app/instance/conf/mtw-dist.ini | 3 +- flask-app/instance/conf/mtw.ini | 2 +- flask-app/mtw-server.py | 2 +- flask-app/mtw_requirements.txt | 2 +- 14 files changed, 211 insertions(+), 68 deletions(-) rename flask-app/dist/instance/conf/{mesh.ttl => mesh_Jena4.ttl} (71%) create mode 100644 flask-app/dist/instance/conf/mesh_Jena5.ttl diff --git a/flask-app/application/main.py b/flask-app/application/main.py index 622c8c1..edcc53a 100644 --- a/flask-app/application/main.py +++ b/flask-app/application/main.py @@ -56,7 +56,7 @@ def create_app(debug=False, logger=None, port=5900, app.config.update(dict( APPLICATION_ROOT = url_prefix, APP_NAME = 'MTW', - APP_VER = '1.6.9', + APP_VER = '1.7.0', API_VER = '1.0.0', DBVERSION = 1.0, CACHE_DIR = mtu.get_instance_dir(app, 'cache'), diff --git a/flask-app/dist/instance/_data/in/README.md b/flask-app/dist/instance/_data/in/README.md index 8ded1e6..444b67f 100644 --- a/flask-app/dist/instance/_data/in/README.md +++ b/flask-app/dist/instance/_data/in/README.md @@ -1 +1,2 @@ -## Folder placeholder +# Folder placeholder + diff --git a/flask-app/dist/instance/_data/out/README.md b/flask-app/dist/instance/_data/out/README.md index 8ded1e6..444b67f 100644 --- a/flask-app/dist/instance/_data/out/README.md +++ b/flask-app/dist/instance/_data/out/README.md @@ -1 +1,2 @@ -## Folder placeholder +# Folder placeholder + diff --git a/flask-app/dist/instance/cache/README.md b/flask-app/dist/instance/cache/README.md index 8ded1e6..444b67f 100644 --- a/flask-app/dist/instance/cache/README.md +++ b/flask-app/dist/instance/cache/README.md @@ -1 +1,2 @@ -## Folder placeholder +# Folder placeholder + diff --git a/flask-app/dist/instance/conf/mesh.ttl b/flask-app/dist/instance/conf/mesh_Jena4.ttl similarity index 71% rename from flask-app/dist/instance/conf/mesh.ttl rename to flask-app/dist/instance/conf/mesh_Jena4.ttl index d4dab55..97f944e 100644 --- a/flask-app/dist/instance/conf/mesh.ttl +++ b/flask-app/dist/instance/conf/mesh_Jena4.ttl @@ -8,7 +8,7 @@ @prefix meshv: . @prefix mesht: . -### Version 1.1.1 +### Version 1.4.0 for Jena v4 ## Initialize text query [] ja:loadClass "org.apache.jena.query.text.TextQuery" . @@ -29,15 +29,15 @@ text:TextIndexES rdfs:subClassOf text:TextIndex . . # A TDB dataset used for RDF storage -<#dataset> +<#dataset> a tdb2:DatasetTDB2 ; - tdb2:location "d:/Data/jena5/databases/mesh" ; + tdb2:location "d:/Data/jena4/databases/mesh" ; . # Text index description -<#indexLucene> +<#indexLucene> a text:TextIndexLucene ; - text:directory "d:/Data/jena5/indexes/mesh" ; + text:directory "d:/Data/jena4/indexes/mesh" ; text:entityMap <#entMap> ; text:storeValues false ; ## text:analyzer[ a text:StandardAnalyzer ] ; @@ -54,53 +54,9 @@ text:TextIndexES rdfs:subClassOf text:TextIndex . text:queryParser text:AnalyzingQueryParser ; ## text:defineAnalyzers [ . . . ] ; text:multilingualSupport true ; - ## https://jena.apache.org/documentation/query/text-query.html#lists-of-indexed-properties - available since Jena 5.0 - text:propLists ( - [ text:propListProp mesht:defQuery ; - text:props ( - rdfs:label - meshv:identifier - meshv:prefLabel - meshv:altLabel - meshv:casn1_label - meshv:abbreviation - meshv:registryNumber - meshv:relatedRegistryNumber - mesht:identifier - mesht:prefLabel - mesht:altLabel - ) ; - ] - [ text:propListProp mesht:includeNotes ; - text:props ( - rdfs:label - meshv:identifier - meshv:prefLabel - meshv:altLabel - meshv:casn1_label - meshv:abbreviation - meshv:registryNumber - meshv:relatedRegistryNumber - mesht:identifier - mesht:prefLabel - mesht:altLabel - mesht:translatorsNote - mesht:annotation - mesht:historyNote - mesht:scopeNote - meshv:annotation - meshv:historyNote - meshv:note - meshv:onlineNote - meshv:publicMeSHNote - meshv:scopeNote - meshv:source - ) ; - ] - ) ; - . + . -<#entMap> +<#entMap> a text:EntityMap ; text:defaultField "ftext" ; text:entityField "uri" ; @@ -121,7 +77,7 @@ text:TextIndexES rdfs:subClassOf text:TextIndex . [ text:field "ftext" ; text:predicate meshv:note ] [ text:field "ftext" ; text:predicate meshv:onlineNote ] [ text:field "ftext" ; text:predicate meshv:publicMeSHNote ] - [ text:field "ftext" ; text:predicate meshv:source ] + # [ text:field "ftext" ; text:predicate meshv:source ] [ text:field "ftext" ; text:predicate meshv:scopeNote ] [ text:field "ftext" ; text:predicate mesht:abbreviation ] [ text:field "ftext" ; text:predicate mesht:annotation ] @@ -153,7 +109,7 @@ text:TextIndexES rdfs:subClassOf text:TextIndex . ### Translation only: ## mesht:translatorsNote -<#service_text_tdb> +<#service_text_tdb> a fuseki:Service ; rdfs:label "MeSH-Translation-service" ; fuseki:name "mesh" ; diff --git a/flask-app/dist/instance/conf/mesh_Jena5.ttl b/flask-app/dist/instance/conf/mesh_Jena5.ttl new file mode 100644 index 0000000..16aa1e5 --- /dev/null +++ b/flask-app/dist/instance/conf/mesh_Jena5.ttl @@ -0,0 +1,183 @@ +@prefix : . +@prefix rdf: . +@prefix rdfs: . +@prefix tdb2: . +@prefix ja: . +@prefix text: . +@prefix fuseki: . +@prefix meshv: . +@prefix mesht: . + +### Version 1.5.0 for Jena v5 + +## Initialize text query +[] ja:loadClass "org.apache.jena.query.text.TextQuery" . +# A TextDataset is a regular dataset with a text index. +text:TextDataset rdfs:subClassOf ja:RDFDataset . +# Lucene index +text:TextIndexLucene rdfs:subClassOf text:TextIndex . +# Elasticsearch index +text:TextIndexES rdfs:subClassOf text:TextIndex . + +## --------------------------------------------------------------- +## This URI must be fixed - it's used to assemble the text dataset. + +:text_dataset + a text:TextDataset ; + text:dataset <#dataset> ; + text:index <#indexLucene> ; + . + +# A TDB dataset used for RDF storage +<#dataset> + a tdb2:DatasetTDB2 ; + tdb2:location "d:/Data/jena5/databases/mesh" ; + . + +# Text index description +<#indexLucene> + a text:TextIndexLucene ; + text:directory "d:/Data/jena5/indexes/mesh" ; + text:entityMap <#entMap> ; + text:storeValues false ; + ## text:analyzer[ a text:StandardAnalyzer ] ; + text:analyzer [ + a text:ConfigurableAnalyzer ; + text:tokenizer text:StandardTokenizer ; + text:filters ( + text:ASCIIFoldingFilter + text:LowerCaseFilter + # text:PorterStemFilter + ) + ] ; + ## text:queryAnalyzer [ a text:KeywordAnalyzer ] ; + text:queryParser text:AnalyzingQueryParser ; + ## text:defineAnalyzers [ . . . ] ; + text:multilingualSupport true ; + ## https://jena.apache.org/documentation/query/text-query.html#lists-of-indexed-properties - available since Jena 5.0 + text:propLists ( + [ text:propListProp mesht:queryDef ; + text:props ( + rdfs:label + meshv:identifier + meshv:prefLabel + meshv:altLabel + meshv:casn1_label + meshv:abbreviation + meshv:registryNumber + meshv:relatedRegistryNumber + mesht:identifier + mesht:prefLabel + mesht:altLabel + ) ; + ] + [ text:propListProp mesht:queryAll ; + text:props ( + rdfs:label + meshv:identifier + meshv:prefLabel + meshv:altLabel + meshv:casn1_label + meshv:abbreviation + meshv:registryNumber + meshv:relatedRegistryNumber + mesht:identifier + mesht:prefLabel + mesht:altLabel + mesht:translatorsNote + mesht:annotation + mesht:historyNote + mesht:scopeNote + meshv:annotation + meshv:historyNote + meshv:note + meshv:onlineNote + meshv:publicMeSHNote + meshv:scopeNote + # meshv:source + ) ; + ] + [ text:propListProp mesht:queryNotes ; + text:props ( + mesht:translatorsNote + mesht:annotation + mesht:historyNote + mesht:scopeNote + meshv:annotation + meshv:historyNote + meshv:note + meshv:onlineNote + meshv:publicMeSHNote + meshv:scopeNote + # meshv:source + ) ; + ] + ) ; + . + +<#entMap> + a text:EntityMap ; + text:defaultField "label" ; + text:entityField "uri" ; + text:uidField "uid" ; + text:langField "lang" ; + text:graphField "graph" ; + text:map ( + [ text:field "label" ; text:predicate rdfs:label ] + [ text:field "abbreviation" ; text:predicate meshv:abbreviation ] + [ text:field "annotation" ; text:predicate meshv:annotation ] + [ text:field "historyNote" ; text:predicate meshv:historyNote ] + [ text:field "identifier" ; text:predicate meshv:identifier ] + [ text:field "prefLabel" ; text:predicate meshv:prefLabel ] + [ text:field "altLabel" ; text:predicate meshv:altLabel ] + [ text:field "casn1_label" ; text:predicate meshv:casn1_label ] + [ text:field "registryNumber" ; text:predicate meshv:registryNumber ] + [ text:field "relatedRegistryNumber" ; text:predicate meshv:relatedRegistryNumber ] + [ text:field "note" ; text:predicate meshv:note ] + [ text:field "onlineNote" ; text:predicate meshv:onlineNote ] + [ text:field "publicMeSHNote" ; text:predicate meshv:publicMeSHNote ] + # [ text:field "source" ; text:predicate meshv:source ] + [ text:field "scopeNote" ; text:predicate meshv:scopeNote ] + [ text:field "abbreviation_t" ; text:predicate mesht:abbreviation ] + [ text:field "annotation_t" ; text:predicate mesht:annotation ] + [ text:field "historyNote_t" ; text:predicate mesht:historyNote ] + [ text:field "identifier_t" ; text:predicate mesht:identifier ] + [ text:field "prefLabel_t" ; text:predicate mesht:prefLabel ] + [ text:field "altLabel_t" ; text:predicate mesht:altLabel ] + [ text:field "scopeNote_t" ; text:predicate mesht:scopeNote ] + [ text:field "translatorsNote" ; text:predicate mesht:translatorsNote ] + ) . + +### MeSH common: +## abbreviation +## annotation +## historyNote +## identifier +## prefLabel +## altLabel +## scopeNote + +### MeSH master only: +## rdfs:label +## meshv:casn1_label +## meshv:note +## meshv:onlineNote +## meshv:publicMeSHNote +## meshv:source + +### Translation only: +## mesht:translatorsNote + +<#service_text_tdb> + a fuseki:Service ; + rdfs:label "MeSH-Translation-service" ; + fuseki:name "mesh" ; + fuseki:serviceQuery "query" ; + fuseki:serviceQuery "sparql" ; + fuseki:serviceUpdate "update" ; + fuseki:serviceUpload "upload" ; + fuseki:serviceReadGraphStore "get" ; + fuseki:serviceReadWriteGraphStore "data" ; + fuseki:dataset :text_dataset ; + . + diff --git a/flask-app/dist/instance/conf/mtw-dist.ini b/flask-app/dist/instance/conf/mtw-dist.ini index 0c06ae7..0249bf6 100644 --- a/flask-app/dist/instance/conf/mtw-dist.ini +++ b/flask-app/dist/instance/conf/mtw-dist.ini @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# *** Config version 1.6.9 *** +# *** Config version 1.7.0 *** ### Important values are marked with ! ### ### ! This file MUST BE UTF-8 encoded ! ### ### ! Restart the App after modifying ! ### @@ -100,7 +100,7 @@ GCSP = {"script-src": "'self' ", CHAR_NORM_FILE = norm_chars_table.tsv.txt ### Uncomment only if using Jena +5.0 - use text:propLists defined in mesh.ttl - default: False -#USE_PROP_LISTS = True +USE_PROP_LISTS = True [worker] ### MTW Worker API settings - required ! @@ -156,4 +156,3 @@ TRX_NOTES = annotation,considerAlso,historyNote DESC_NOTES = annotation,considerAlso,historyNote,onlineNote,publicMeSHNote,translatorsNote ROLES = manager,editor,contributor,viewer,disabled,locked - diff --git a/flask-app/dist/instance/logs/README.md b/flask-app/dist/instance/logs/README.md index 8ded1e6..444b67f 100644 --- a/flask-app/dist/instance/logs/README.md +++ b/flask-app/dist/instance/logs/README.md @@ -1 +1,2 @@ -## Folder placeholder +# Folder placeholder + diff --git a/flask-app/dist/instance/sessions/README.md b/flask-app/dist/instance/sessions/README.md index 8ded1e6..444b67f 100644 --- a/flask-app/dist/instance/sessions/README.md +++ b/flask-app/dist/instance/sessions/README.md @@ -1 +1,2 @@ -## Folder placeholder +# Folder placeholder + diff --git a/flask-app/dist/instance/temp/README.md b/flask-app/dist/instance/temp/README.md index 1ba9659..072fecc 100644 --- a/flask-app/dist/instance/temp/README.md +++ b/flask-app/dist/instance/temp/README.md @@ -1 +1,2 @@ -## This is folder for temporary files +# This is folder for temporary files + diff --git a/flask-app/instance/conf/mtw-dist.ini b/flask-app/instance/conf/mtw-dist.ini index 81a54b2..0249bf6 100644 --- a/flask-app/instance/conf/mtw-dist.ini +++ b/flask-app/instance/conf/mtw-dist.ini @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# *** Config version 1.6.9 *** +# *** Config version 1.7.0 *** ### Important values are marked with ! ### ### ! This file MUST BE UTF-8 encoded ! ### ### ! Restart the App after modifying ! ### @@ -156,4 +156,3 @@ TRX_NOTES = annotation,considerAlso,historyNote DESC_NOTES = annotation,considerAlso,historyNote,onlineNote,publicMeSHNote,translatorsNote ROLES = manager,editor,contributor,viewer,disabled,locked - diff --git a/flask-app/instance/conf/mtw.ini b/flask-app/instance/conf/mtw.ini index 23c4d75..48ea444 100644 --- a/flask-app/instance/conf/mtw.ini +++ b/flask-app/instance/conf/mtw.ini @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# *** Config version 1.6.9 *** +# *** Config version 1.7.0 *** ### Important values are marked with ! ### ### ! This file MUST BE UTF-8 encoded ! ### ### ! Restart the App after modifying ! ### diff --git a/flask-app/mtw-server.py b/flask-app/mtw-server.py index ef6926b..5bc2932 100644 --- a/flask-app/mtw-server.py +++ b/flask-app/mtw-server.py @@ -14,7 +14,7 @@ DEFAULT_PREFIX = 'mtw' appname = 'mtw-server' -appdesc = 'MTW Server 1.6.9' +appdesc = 'MTW Server 1.7.0' appusage = 'Help: ' + appname + ' -h \n' appauthor = 'Filip Kriz' diff --git a/flask-app/mtw_requirements.txt b/flask-app/mtw_requirements.txt index 0a14cd1..cbc2629 100644 --- a/flask-app/mtw_requirements.txt +++ b/flask-app/mtw_requirements.txt @@ -1,4 +1,4 @@ -### Version 1.6.9 +### Version 1.7.0 ### Python 3.12 ### arrow==1.3.0 bcrypt==4.2.1 ## NOT python-bcrypt !!!