diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 00000000..261eeb9e
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
index 9214112a..b56c90f9 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
TLA web frontend.
-Copyright (C) 2019-2023 Berlin-Brandenburgische Akademie der Wissenschaften
+Copyright (C) 2019-2024 Berlin-Brandenburgische Akademie der Wissenschaften
## Usage
diff --git a/src/main/java/tla/web/config/SentenceSearchProperties.java b/src/main/java/tla/web/config/SentenceSearchProperties.java
index e0b6c00b..7acc8558 100644
--- a/src/main/java/tla/web/config/SentenceSearchProperties.java
+++ b/src/main/java/tla/web/config/SentenceSearchProperties.java
@@ -17,5 +17,7 @@
@ModelClass(Sentence.class)
@ConfigurationProperties(prefix = "search.sentence")
public class SentenceSearchProperties extends SearchProperties {
+
+
private Map> contextInformation;
}
\ No newline at end of file
diff --git a/src/main/java/tla/web/model/CorpusObject.java b/src/main/java/tla/web/model/CorpusObject.java
index 966cac23..4b0ac0ac 100644
--- a/src/main/java/tla/web/model/CorpusObject.java
+++ b/src/main/java/tla/web/model/CorpusObject.java
@@ -54,33 +54,10 @@ public List getDate(){
public List getDateComment() {
if (this.dateComment == null) {
- this.dateComment = extractDateComment(this);
+ this.dateComment = extractMultilineText(this.getPassport(), PASSPORT_PROP_DATECOMMENT);
}
return this.dateComment;
}
-
- private static List extractDateComment(CorpusObject corpusobj) {
- List dateComment = new ArrayList<>();
- try {
- corpusobj.getPassport().extractProperty(
- PASSPORT_PROP_DATECOMMENT
- ).forEach(
- node -> dateComment.addAll(
- Arrays.asList(
- // .replaceAll("(\\r?\\n|^)[\\s\\-]+", "$1").replaceAll("\\r?\\n[\\r?\\n\\s]*", "||").split("\\|\\|")
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- para -> para.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract dating comment from object "+corpusobj.getId());
- }
- return dateComment;
- }
// Synonyms
@@ -135,41 +112,10 @@ private static List extractSynonymGroups(CorpusObject corpusobj) {
public List getBibliography() {
if (this.bibliography == null) {
- this.bibliography = extractBibliography(this);
+ this.bibliography = extractMultilineText(this.getPassport(), PASSPORT_PROP_BIBL);
}
return this.bibliography;
}
-
- /**
- * Extract bibliographic information from coprus object passport.
- *
- * Bibliography is being copied from the bibliography.bibliographical_text_field
- * passport field. The value(s) found under that locator are split at line breaks \r\n.
- *
- * @param corpusobj The corpus object instance from whose passport the bibliography is to be extracted.
- * @return List of textual bibliographic references or an empty list
- */
- protected static List extractBibliography(CorpusObject corpusobj) {
- List bibliography = new ArrayList<>();
- try {
- corpusobj.getPassport().extractProperty(
- PASSPORT_PROP_BIBL
- ).forEach(
- node -> bibliography.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- bibref -> bibref.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract bibliography from object "+corpusobj.getId());
- }
- return bibliography;
- }
// Object origin Find-spot
@@ -221,27 +167,7 @@ public static List extractThsEntries(Passport passport, String
}
return result;
}
-
- private static List extractComment(Passport passport, String searchString) {
- List comment = new ArrayList<>();
- try {
- passport.extractProperty(searchString).forEach(
- node -> comment.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- para -> para.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract "+searchString);
- }
- return comment;
- }
-
+
public static ObjectReference extractObjectReference(Passport passport) {
ObjectReference object=null;
try{
@@ -418,33 +344,11 @@ private static List extractInvNos(CorpusObject corpusobj) {
public List getProtocol() {
if (this.protocol == null) {
- this.protocol = extractProtocol(this);
+ this.protocol = extractMultilineText(this.getPassport(), PASSPORT_PROP_PROTOCOL);
}
return this.protocol;
}
-
- private static List extractProtocol(CorpusObject corpusobj) {
- List protocol = new ArrayList<>();
- try {
- corpusobj.getPassport().extractProperty(
- PASSPORT_PROP_PROTOCOL
- ).forEach(
- node -> protocol.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- bibref -> bibref.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract protocol from object "+corpusobj.getId());
- }
- return protocol;
- }
-
+
// Description
public static final String PASSPORT_PROP_DESCR = "definition.main_group";
@@ -499,32 +403,10 @@ private static Passport extractDescription(CorpusObject corpusobj) { //only one
public List getFileComment() {
if (this.fileComment == null) {
- this.fileComment = extractFileComment(this);
+ this.fileComment = extractMultilineText(this.getPassport(), PASSPORT_PROP_FILECOMMENT);
}
return this.fileComment;
}
-
- private static List extractFileComment(CorpusObject corpusobj) {
- List fileComment = new ArrayList<>();
- try {
- corpusobj.getPassport().extractProperty(
- PASSPORT_PROP_FILECOMMENT
- ).forEach(
- node -> fileComment.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- bibref -> bibref.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract file comment from object "+corpusobj.getId());
- }
- return fileComment;
- }
// Object description
///////////////////////////
@@ -601,7 +483,7 @@ public List getTechnique() {
public List getMaterialityComment() {
if (this.materialityComment == null) {
- this.materialityComment = extractComment(this.getPassport(), PASSPORT_PROP_OBJ_TECH_COMMENT);
+ this.materialityComment = extractMultilineText(this.getPassport(), PASSPORT_PROP_OBJ_TECH_COMMENT);
}
return this.materialityComment;
}
@@ -637,7 +519,7 @@ public List getCulturalContext() {
public List getContextComment() {
if (this.contextComment == null) {
- this.contextComment = extractComment(this.getPassport(), PASSPORT_PROP_OBJ_ARCH_COMMENT);
+ this.contextComment = extractMultilineText(this.getPassport(), PASSPORT_PROP_OBJ_ARCH_COMMENT);
}
return this.contextComment;
}
diff --git a/src/main/java/tla/web/model/Lemma.java b/src/main/java/tla/web/model/Lemma.java
index 21b80550..deccd792 100644
--- a/src/main/java/tla/web/model/Lemma.java
+++ b/src/main/java/tla/web/model/Lemma.java
@@ -14,6 +14,7 @@
import lombok.experimental.SuperBuilder;
import lombok.extern.slf4j.Slf4j;
import tla.domain.dto.LemmaDto;
+import tla.domain.dto.LemmaDto.TimeSpan;
import tla.domain.model.Language;
import tla.domain.model.Script;
import tla.domain.model.meta.BTSeClass;
@@ -22,228 +23,179 @@
import tla.web.model.meta.BackendPath;
import tla.web.model.parts.GlyphsLemma;
import tla.web.model.parts.Token;
-import tla.web.model.parts.extra.AttestedTimespan;
+
@Slf4j
@Getter
@Setter
-@SuperBuilder
@NoArgsConstructor
@BackendPath("lemma")
@TLADTO(LemmaDto.class)
@BTSeClass("BTSLemmaEntry")
public class Lemma extends BTSObject {
- /**
- * The passport locator where bibliographical information should be stored.
- */
- public static final String PASSPORT_PROP_BIBL = "bibliography.bibliographical_text_field";
-
- @Setter(AccessLevel.NONE)
- private List bibliography;
-
- @Singular
- private SortedMap> translations;
-
-
- private SortedMap> transcription;
-
- @Singular
- private List words;
-
- private GlyphsLemma glyphs;
-
- @Singular
- private List attestations;
-
- /**
- * first and last year
- */
- private AttestedTimespan.Period timespan;
-
- /**
- * compute sum of sentence counts across all nested attestation timespans.
- */
- public Long getAttestationCount() {
- return this.attestations.stream().mapToLong(
- timespan -> timespan.getTotal().getSentences()
- ).sum();
- }
-
- /**
- * Determines the language phase this lemma belongs to
- */
- public Script getDictionaryName() {
- return Script.ofLemmaId(this.getId());
- }
-
- /**
- * Extract hieroglyphs from lemma words.
- * Return null if only empty hieroglyphs can be found.
- *
- * @return List of all lemma word hieroglyphs, or null if there are no hieroglyphs at all
- */
- public GlyphsLemma getHieroglyphs()
-
- {
- if (this.getDictionaryName().equals(Script.HIERATIC)) {
- //System.out.println ("Glyphs Lemma"+ this.getGlyphs().getMdcCompact());
- //System.out.println ("Unicode Lemma"+ this.getGlyphs().getUnicode());
- return this.getGlyphs();
- }
- else return null;
-
- }
- /*public List getHieroglyphs() {
- if (this.getDictionaryName().equals(Script.HIERATIC)) {
-
- List hieroglyphs = this.getWords().stream().map(
- Token::getGlyphs
- ).collect(
- Collectors.toList()
- );
- return (hieroglyphs.stream().allMatch(
- glyphs -> glyphs == null || glyphs.isEmpty()
- )) ? null : hieroglyphs;
- }
-
-
- return null;
- }*
- /* public List getHieroglyphs() {
- if (this.getDictionaryName().equals(Script.HIERATIC)) {
- return getGlyphs();
- }
- return null;
-
- }*/
-
-
- /**
- * Returns a list of bibliographic references extracted from this lemma's
- * bibliography.bibliographical_text_field passport field.
- *
- * @see {@link #extractBibliography(Lemma)}
- */
- public List getBibliography() {
- if (this.bibliography == null) {
- this.bibliography = extractBibliography(this);
- }
- return this.bibliography;
- }
-
- /**
- * Extract bibliographic information from lemma passport.
- *
- * Bibliography is being copied from the bibliography.bibliographical_text_field
- * passport field. The value(s) found under that locator are split at semicolons ";".
- *
- * @param lemma The Lemma instance from whose passport the bibliography is to be extracted.
- * @return List of textual bibliographic references or an empty list
- */
- private static List extractBibliography(Lemma lemma) {
- List bibliography = new ArrayList<>();
- try {
- lemma.getPassport().extractProperty(
- PASSPORT_PROP_BIBL
- ).forEach(
- node -> bibliography.addAll(
- Arrays.asList(
- node.getLeafNodeValue().split(";")
- ).stream().map(
- bibref -> bibref.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // log.debug("INFO: could not extract bibliography from lemma {}", lemma.getId());
- }
- return bibliography;
- }
-
- // Description
-
- public static final String PASSPORT_PROP_DESCR = "definition.main_group.definition";
-
- @Setter(AccessLevel.NONE)
- private List description;
-
- public List getDescription() {
- if (this.description == null) {
- this.description = extractDescription(this);
- }
- return this.description;
- }
-
- private static List extractDescription(Lemma lemma) {
- List description = new ArrayList<>();
- try {
- lemma.getPassport().extractProperty(
- PASSPORT_PROP_DESCR
- ).forEach(
- node -> description.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- descr -> descr.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract description from lemma "+lemma.getId());
- }
- return description;
- }
-
- // File comment
-
- public static final String PASSPORT_PROP_FILECOMMENT = "definition.main_group.comment";
-
- @Setter(AccessLevel.NONE)
- private List fileComment;
-
- public List getFileComment() {
- if (this.fileComment == null) {
- this.fileComment = extractFileComment(this);
- }
- return this.fileComment;
- }
-
- private static List extractFileComment(Lemma lemma) {
- List fileComment = new ArrayList<>();
- try {
- lemma.getPassport().extractProperty(
- PASSPORT_PROP_FILECOMMENT
- ).forEach(
- node -> fileComment.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- comment -> comment.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract file comment from lemma "+lemma.getId());
- }
- return fileComment;
- }
-
- /**
- * Checks whether there is an annotation or two among a lemma's relations.
- */
- public boolean isAnnotated() {
- return this.getRelations().values().stream().anyMatch(
- refs -> refs.stream().anyMatch(
- ref -> ref.getEclass().equals("BTSAnnotation")
- )
- );
- }
+ /**
+ * The passport locator where bibliographical information should be stored.
+ */
+ public static final String PASSPORT_PROP_BIBL = "bibliography.bibliographical_text_field";
+
+ @Setter(AccessLevel.NONE)
+ private List bibliography;
+
+ @Singular
+ private SortedMap> translations;
+
+ private SortedMap> transcription;
+
+ @Singular
+ private List words;
+
+ private GlyphsLemma glyphs;
+
+ private int attestedSentencesCount;
+
+ private TimeSpan timeSpan;
+
+ /**
+ * Determines the language phase this lemma belongs to
+ */
+ public Script getDictionaryName() {
+ return Script.ofLemmaId(this.getId());
+ }
+
+ /**
+ * Extract hieroglyphs from lemma words. Return null if only empty hieroglyphs
+ * can be found.
+ *
+ * @return List of all lemma word hieroglyphs, or null if there are no
+ * hieroglyphs at all
+ */
+ public GlyphsLemma getHieroglyphs()
+
+ {
+ if (this.getDictionaryName().equals(Script.HIERATIC)) {
+ // System.out.println ("Glyphs Lemma"+ this.getGlyphs().getMdcCompact());
+ // System.out.println ("Unicode Lemma"+ this.getGlyphs().getUnicode());
+ return this.getGlyphs();
+ } else
+ return null;
+
+ }
+ /*
+ * public List getHieroglyphs() { if
+ * (this.getDictionaryName().equals(Script.HIERATIC)) {
+ *
+ * List hieroglyphs = this.getWords().stream().map( Token::getGlyphs
+ * ).collect( Collectors.toList() ); return (hieroglyphs.stream().allMatch(
+ * glyphs -> glyphs == null || glyphs.isEmpty() )) ? null : hieroglyphs; }
+ *
+ *
+ * return null; }* /* public List getHieroglyphs() { if
+ * (this.getDictionaryName().equals(Script.HIERATIC)) { return getGlyphs(); }
+ * return null;
+ *
+ * }
+ */
+
+ /**
+ * Returns a list of bibliographic references extracted from this lemma's
+ * bibliography.bibliographical_text_field passport field.
+ *
+ * @see {@link #extractBibliography(Lemma)}
+ */
+ public List getBibliography() {
+ if (this.bibliography == null) {
+ this.bibliography = extractBibliography(this);
+ }
+ return this.bibliography;
+ }
+
+ /**
+ * Extract bibliographic information from lemma passport.
+ *
+ * Bibliography is being copied from the
+ * bibliography.bibliographical_text_field passport field. The
+ * value(s) found under that locator are split at semicolons ";".
+ *
+ * @param lemma The Lemma instance from whose passport the bibliography is to be
+ * extracted.
+ * @return List of textual bibliographic references or an empty list
+ */
+ private static List extractBibliography(Lemma lemma) {
+ List bibliography = new ArrayList<>();
+ try {
+ lemma.getPassport().extractProperty(PASSPORT_PROP_BIBL)
+ .forEach(node -> bibliography.addAll(Arrays.asList(node.getLeafNodeValue().split(";")).stream()
+ .map(bibref -> bibref.strip()).collect(Collectors.toList())));
+ } catch (Exception e) {
+ // log.debug("INFO: could not extract bibliography from lemma {}",
+ // lemma.getId());
+ }
+ return bibliography;
+ }
+
+ // Description
+
+ public static final String PASSPORT_PROP_DESCR = "definition.main_group.definition";
+
+ @Setter(AccessLevel.NONE)
+ private List description;
+
+ public List getDescription() {
+ if (this.description == null) {
+ this.description = extractDescription(this);
+ }
+ return this.description;
+ }
+
+ private static List extractDescription(Lemma lemma) {
+ List description = new ArrayList<>();
+ try {
+ lemma.getPassport().extractProperty(PASSPORT_PROP_DESCR)
+ .forEach(node -> description.addAll(
+ Arrays.asList(node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|"))
+ .stream().map(descr -> descr.strip()).collect(Collectors.toList())));
+ } catch (Exception e) {
+ // System.out.println("INFO: Could not extract description from lemma
+ // "+lemma.getId());
+ }
+ return description;
+ }
+
+ // File comment
+
+ public static final String PASSPORT_PROP_FILECOMMENT = "definition.main_group.comment";
+
+ @Setter(AccessLevel.NONE)
+ private List fileComment;
+
+ public List getFileComment() {
+ if (this.fileComment == null) {
+ this.fileComment = extractFileComment(this);
+ }
+ return this.fileComment;
+ }
+
+ private static List extractFileComment(Lemma lemma) {
+ List fileComment = new ArrayList<>();
+ try {
+ lemma.getPassport().extractProperty(PASSPORT_PROP_FILECOMMENT)
+ .forEach(node -> fileComment.addAll(
+ Arrays.asList(node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|"))
+ .stream().map(comment -> comment.strip()).collect(Collectors.toList())));
+ } catch (Exception e) {
+ // System.out.println("INFO: Could not extract file comment from lemma
+ // "+lemma.getId());
+ }
+ return fileComment;
+ }
+
+ /**
+ * Checks whether there is an annotation or two among a lemma's relations.
+ */
+ public boolean isAnnotated() {
+ return this.getRelations().values().stream()
+ .anyMatch(refs -> refs.stream().anyMatch(ref -> ref.getEclass().equals("BTSAnnotation")));
+ }
}
diff --git a/src/main/java/tla/web/model/Text.java b/src/main/java/tla/web/model/Text.java
index 6d1d83d3..9b96497f 100644
--- a/src/main/java/tla/web/model/Text.java
+++ b/src/main/java/tla/web/model/Text.java
@@ -3,17 +3,21 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.SortedMap;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
+import lombok.Singular;
import tla.domain.dto.TextDto;
+import tla.domain.model.Language;
import tla.domain.model.ObjectReference;
import tla.domain.model.Passport;
import tla.domain.model.meta.BTSeClass;
import tla.domain.model.meta.TLADTO;
+import tla.web.model.CorpusObject.SynonymGroup;
import tla.web.model.Sentence.DatePair;
import tla.web.model.meta.BackendPath;
@@ -36,12 +40,20 @@ public class Text extends CorpusObject {
public static final String PASSPORT_PROP_COMMENTSCRIPT ="text.textual_metadata.comment_on_script";
public static final String PASSPORT_PROP_TEXTTYPE ="text.textual_metadata.texttype";
public static final String PASSPORT_PROP_SECINSCRIPTION ="text.textual_metadata.secondary_inscription";
+
+ public static final String PASSPORT_PROP_TRANSLITERATION = "definition.main_group.transliteration";
+ public static final String PASSPORT_PROP_LEMMATIZATION = "definition.main_group.lemmatization";
+ public static final String PASSPORT_PROP_GRAMMATICAL_ENCODING = "definition.main_group.grammatical_encoding";
+ public static final String PASSPORT_PROP_HIEROGLYPHIC_ENCODING = "definition.main_group.hieroglyphic_encoding";
+ public static final String PASSPORT_PROP_HIEROGLYPHS_SEQUENTIAL = "definition.main_group.hieroglyphs_sequential";
+ public static final String PASSPORT_PROP_TRANSLATIONS = "definition.main_group.translations";
-
- //TODO pr�fen ob doppelt, da bereits in CorpusObject.java
+ //TODO prüfen ob doppelt, da bereits in CorpusObject.java
public static final String PASSPORT_PROP_ORIGPLACE ="find_spot.find_spot.place.place";
public static final String PASSPORT_PROP_ISORIG ="find_spot.find_spot.place.is_origin";
public static final String PASSPORT_PROP_PRESLOC ="present_location.location.location";
+
+
@Setter(AccessLevel.NONE)
private List bibliography;
@Setter(AccessLevel.NONE)
@@ -61,7 +73,7 @@ public class Text extends CorpusObject {
@Setter(AccessLevel.NONE)
private ObjectReference texttype;
@Setter(AccessLevel.NONE)
- private String secinscription;
+ private Boolean secinscription;
@Setter(AccessLevel.NONE)
private Listorigplace;
@Setter(AccessLevel.NONE)
@@ -69,22 +81,53 @@ public class Text extends CorpusObject {
@Setter(AccessLevel.NONE)
private List presloc;
+ @Setter(AccessLevel.NONE)
+ private List transliteration_by;
+ @Setter(AccessLevel.NONE)
+ private List lemmatization;
+ @Setter(AccessLevel.NONE)
+ private List grammatical_encoding;
+ @Setter(AccessLevel.NONE)
+ private List hieroglyphic_encoding;
+ @Setter(AccessLevel.NONE)
+ private String hieroglyphs_sequential;
+ @Setter(AccessLevel.NONE)
+ private List translations;
+
+ public static class TranslationGroup {
+ private String language;
+ private List translation;
+
+ public TranslationGroup(Passport passport) {
+ this.language = extractString(passport, "language");
+ this.translation = extractMultilineText(passport, "translation");
+ }
+
+ public String getLanguage() {
+ return this.language;
+ }
+
+ public List getTranslation() {
+ return this.translation;
+ }
+ }
+
/* public String getOneSentence() {
return this.getSentence().get(0).getTranscription().getUnicode();
}
*/
public List getBibliography() {
if (this.bibliography == null) {
- this.bibliography = this.extractBibliography(this);
+ this.bibliography = extractMultilineText(this.getPassport(), PASSPORT_PROP_BIBL);
}
return this.bibliography;
}
//TODO prüfen auf schematischeren Weg
public boolean isEmptyTextualMetadata(){
-this.textualMetadata = extractString(this, "text.textual_metadata");
-if (this.textualMetadata == null) { return true;}
-else { return false;}
+ this.textualMetadata = extractString(this.getPassport(), "text.textual_metadata");
+ if (this.textualMetadata == null) { return true;}
+ else { return false;}
}
//TODO Check if generic function could replace extractLanguage
@@ -105,28 +148,28 @@ public ObjectReference getSkript() {
public String getEgytextname() {
if (this.egytextname == null) {
- this.egytextname = extractString(this, PASSPORT_PROP_EGYTEXTNAME);
+ this.egytextname = extractString(this.getPassport(), PASSPORT_PROP_EGYTEXTNAME);
}
return this.egytextname;
}
public String getCommentlanguage() {
if(this.commentlanguage == null) {
- this.commentlanguage = extractString(this, PASSPORT_PROP_COMMENTLANGUAGE);
+ this.commentlanguage = extractString(this.getPassport(), PASSPORT_PROP_COMMENTLANGUAGE);
}
return this.commentlanguage;
}
public String getCommenttexttype() {
if (this.commenttexttype == null) {
- this.commenttexttype = extractString(this,PASSPORT_PROP_COMMENTTEXTTYPE);
+ this.commenttexttype = extractString(this.getPassport(),PASSPORT_PROP_COMMENTTEXTTYPE);
}
return this.commenttexttype;
}
public String getCommentscript() {
if(this.commentscript == null) {
- this.commentscript = extractString(this,PASSPORT_PROP_COMMENTSCRIPT );
+ this.commentscript = extractString(this.getPassport(),PASSPORT_PROP_COMMENTSCRIPT );
}
return this.commentscript;
}
@@ -138,9 +181,9 @@ public ObjectReference getTexttype(){
return this.texttype;
}
- public String getSecinscription() {
+ public Boolean getSecinscription() {
if(this.secinscription == null) {
- this.secinscription = extractString(this,PASSPORT_PROP_SECINSCRIPTION);
+ this.secinscription = Boolean.parseBoolean(extractString(this.getPassport(),PASSPORT_PROP_SECINSCRIPTION));
}
return this.secinscription;
}
@@ -163,12 +206,68 @@ public List getPresloc() {
public String getIsorig() {
if (this.isorig == null) {
this.isorig = extractIsOrigPlace(this);
- }
-
+ }
return this.isorig;
}
+
+ public List getTransliteration_by() {
+ if (this.transliteration_by == null) {
+ this.transliteration_by = extractMultilineText(this.getPassport(), PASSPORT_PROP_TRANSLITERATION);
+ }
+ return this.transliteration_by;
+ }
-
+ public List getLemmatization() {
+ if (this.lemmatization == null) {
+ this.lemmatization = extractMultilineText(this.getPassport(), PASSPORT_PROP_LEMMATIZATION);
+ }
+ return this.lemmatization;
+ }
+
+ public List getGrammatical_encoding() {
+ if (this.grammatical_encoding == null) {
+ this.grammatical_encoding = extractMultilineText(this.getPassport(), PASSPORT_PROP_GRAMMATICAL_ENCODING);
+ }
+ return this.grammatical_encoding;
+ }
+
+ public List getHieroglyphic_encoding() {
+ if (this.hieroglyphic_encoding == null) {
+ this.hieroglyphic_encoding = extractMultilineText(this.getPassport(),PASSPORT_PROP_HIEROGLYPHIC_ENCODING);
+ }
+ return this.hieroglyphic_encoding;
+ }
+
+ public Boolean isHieroglyphs_sequential(){
+ return this.getHieroglyphs_sequential().equalsIgnoreCase("true");
+ }
+
+ public String getHieroglyphs_sequential() {
+ if (this.hieroglyphs_sequential == null) {
+ this.hieroglyphs_sequential = extractString(this.getPassport(),PASSPORT_PROP_HIEROGLYPHS_SEQUENTIAL);
+ }
+ return this.hieroglyphs_sequential;
+ }
+
+ public List getTranslations() {
+ if(this.translations == null) {
+ this.translations = extractGroups(this.getPassport(), PASSPORT_PROP_TRANSLATIONS);
+ }
+ return this.translations;
+ }
+
+
+
+ //TODO generic
+ private static List extractGroups(Passport passport, String searchString) {
+ List groups = new ArrayList();
+ try {
+ passport.extractProperty(searchString)
+ .forEach(node -> groups.add(new TranslationGroup(node)));
+ } catch (Exception e) {
+ }
+ return groups;
+ }
//Extracts a single ObjectReference (Ths-Entry) from the first found passport according to searchString
private static ObjectReference extractObjectReference(Text text, String searchString) {
@@ -183,7 +282,7 @@ private static ObjectReference extractObjectReference(Text text, String searchSt
}
//Function to return a List of names form a passport Array
- //TODO think of move to passport.java
+ //TODO think of move to passport.java ; also a copy in BTSObject.java (why is it not inherited properly?)
private static List extractNamesOfArray(Text text, String searchField) {
List values = new ArrayList<>();
try {
@@ -195,28 +294,8 @@ private static List extractNamesOfArray(Text text, String searchField) {
// System.out.println("could not extract" + searchField + "from text {} "+text.getId());
}
return values;
- }
-
- //Function to return a string from passport. Takes value from element number position
- //TODO think of move to passport.java
- private static String extractString(Text text, String searchField, Integer number) {
- String value = new String();
- try {
- List pass = text.getPassport().extractProperty(searchField);
- value = pass.get(number).toString();
- }catch (Exception e) {
- // System.out.println("could not extract " + searchField + " from text {} "+text.getId());
- }
- return value;
- }
-
- //Function to return a string from passport with default number 0. Takes value from first element
- private static String extractString(Text text, String searchField) {
- return extractString( text, searchField, 0);
- }
-
-
-
+ }
+
//TODO prüfen auf unnötig
private static String extractIsOrigPlace(Text text) {
String isOrigPl = new String();
@@ -282,8 +361,4 @@ private static List extractDate(Text text) {
}
return datierung;
}
-
-
-
-
-}
+}
\ No newline at end of file
diff --git a/src/main/java/tla/web/model/ThsEntry.java b/src/main/java/tla/web/model/ThsEntry.java
index d4d1e04c..6e362c7c 100644
--- a/src/main/java/tla/web/model/ThsEntry.java
+++ b/src/main/java/tla/web/model/ThsEntry.java
@@ -14,9 +14,11 @@
import tla.domain.dto.ThsEntryDto;
import tla.domain.model.Language;
import tla.domain.model.ObjectPath;
+import tla.domain.model.Passport;
import tla.domain.model.meta.BTSeClass;
import tla.domain.model.meta.Hierarchic;
import tla.domain.model.meta.TLADTO;
+import tla.web.model.CorpusObject.SynonymGroup;
import tla.web.model.meta.BTSObject;
import tla.web.model.meta.BackendPath;
//import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -34,43 +36,77 @@ public class ThsEntry extends BTSObject implements Hierarchic {
private SortedMap> translations;
private List paths;
-
- // Description
+
+ //
+ public static String extractValue(Passport passport, String searchString) {
+ String result=null;
+ try{
+ result = passport.extractProperty(searchString).get(0).getLeafNodeValue();
+ }catch(Exception e) {
+ // System.out.println("INFO: Could not extract " + searchString);
+ }
+ return result;
+ }
- public static final String PASSPORT_PROP_DESCR = "definition.main_group.definition";
+ // Synonyms
+
+ public static final String PASSPORT_PROP_SYNONYMGROUP = "synonyms.synonym_group";
@Setter(AccessLevel.NONE)
- private List description;
+ private List synonymGroups;
+
+ public static class SynonymGroup{
+ public SynonymGroup(Passport passport) {
+ this.language = extractValue(passport, "language");
+ this.synonym = extractValue(passport, "synonym");
+ }
+ private String language;
+ private String synonym;
+
+ public String getSynonym() {
+ return this.synonym;
+ }
+
+ public String getLanguage() {
+ return this.language;
+ }
+ }
- public List getDescription() {
- if (this.description == null) {
- this.description = extractDescription(this);
+ public List getSynonymGroups() {
+ if (this.synonymGroups == null) {
+ this.synonymGroups = extractSynonymGroups(this);
}
- return this.description;
+ return this.synonymGroups;
}
- private static List extractDescription(ThsEntry thsEntry) {
- List description = new ArrayList<>();
+ private static List extractSynonymGroups(ThsEntry thsentry) {
+ List synonymGroups = new ArrayList<>();
try {
- thsEntry.getPassport().extractProperty(
- PASSPORT_PROP_DESCR
+ thsentry.getPassport().extractProperty(
+ PASSPORT_PROP_SYNONYMGROUP
).forEach(
- node -> description.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- descr -> descr.strip()
- ).collect(
- Collectors.toList()
- )
- )
+ node -> synonymGroups.add(new SynonymGroup(node))
);
} catch (Exception e) {
- // System.out.println("INFO: Could not extract description from thesaurus entry "+thsEntry.getId());
+ // System.out.println("INFO: Could not extract synonyms from object "+corpusobj.getId());
}
- return description;
+ return synonymGroups;
}
+
+ // Description
+ public static final String PASSPORT_PROP_DESCR = "definition.main_group.definition";
+
+ @Setter(AccessLevel.NONE)
+ private List description;
+
+ public List getDescription() {
+ if (this.description == null) {
+ this.description = extractMultilineText(this.getPassport(), PASSPORT_PROP_DESCR);
+ }
+ return this.description;
+ }
+
// File comment
public static final String PASSPORT_PROP_FILECOMMENT = "definition.main_group.comment";
@@ -80,31 +116,9 @@ private static List extractDescription(ThsEntry thsEntry) {
public List getFileComment() {
if (this.fileComment == null) {
- this.fileComment = extractFileComment(this);
+ this.fileComment = extractMultilineText(this.getPassport(), PASSPORT_PROP_FILECOMMENT);
}
return this.fileComment;
}
-
- private static List extractFileComment(ThsEntry thsEntry) {
- List fileComment = new ArrayList<>();
- try {
- thsEntry.getPassport().extractProperty(
- PASSPORT_PROP_FILECOMMENT
- ).forEach(
- node -> fileComment.addAll(
- Arrays.asList(
- node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").split("\\|\\|")
- ).stream().map(
- comment -> comment.strip()
- ).collect(
- Collectors.toList()
- )
- )
- );
- } catch (Exception e) {
- // System.out.println("INFO: Could not extract file comment from thesaurus entry "+thsEntry.getId());
- }
- return fileComment;
- }
}
\ No newline at end of file
diff --git a/src/main/java/tla/web/model/meta/BTSObject.java b/src/main/java/tla/web/model/meta/BTSObject.java
index 1326f53b..809ccc12 100644
--- a/src/main/java/tla/web/model/meta/BTSObject.java
+++ b/src/main/java/tla/web/model/meta/BTSObject.java
@@ -1,7 +1,12 @@
package tla.web.model.meta;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -14,7 +19,7 @@
@Setter
@SuperBuilder
@NoArgsConstructor
-public abstract class BTSObject extends TLAObject {
+public class BTSObject extends TLAObject { // earlier: abstract
private Passport passport;
@@ -27,5 +32,62 @@ public abstract class BTSObject extends TLAObject {
private String name;
private TreeMap> externalReferences;
+
+ public static final String PASSPORT_PROP_METADATA_EDITING = "definition.main_group.metadata_editing";
+
+ @Setter(AccessLevel.NONE)
+ private List metadata_editing;
+ public List getMetadata_editing() {
+ if (this.metadata_editing == null) {
+ this.metadata_editing = extractMultilineText(this.getPassport(),PASSPORT_PROP_METADATA_EDITING);
+ }
+ return this.metadata_editing;
+ }
+
+ //Function to return a string from passport with default number 0. Takes value from first element
+ //TODO think of move to passport.java
+ protected static String extractString(Passport passport, String searchField) {
+ return extractString( passport, searchField, 0);
+ }
+
+ //Function to return a string from passport. Takes value from element number position
+ //TODO think of move to passport.java
+ protected static String extractString(Passport passport, String searchField, Integer number) {
+ String value = new String();
+ try {
+ List pass = passport.extractProperty(searchField);
+ value = pass.get(number).toString();
+ }catch (Exception e) {
+ // System.out.println("could not extract " + searchField + " from text {} "+text.getId());
+ }
+ return value;
+ }
+
+ /**
+ * Extract multiline text field information from BTSObject passport.
+ *
+ * The value(s) found under that locator are split at line breaks \r\n.
+ */
+ //Function to return a list of string from passport. Concats value from all elements
+ //TODO think of move to passport.java
+ protected static List extractMultilineText(Passport passport, String searchField) {
+ List stringList = new ArrayList<>();
+ try {
+ passport.extractProperty(searchField).forEach(
+ node -> stringList.addAll(
+ Arrays.asList(
+ node.getLeafNodeValue().replaceAll("\\s*\\r?\\n", "||").replaceAll("\\-+ ", "– ").split("\\|\\|")
+ ).stream().map(
+ para -> para.strip()
+ ).collect(
+ Collectors.toList()
+ )
+ )
+ );
+ } catch (Exception e) {
+ // System.out.println("INFO: Could not extract "+searchString+" from "+this.getId());
+ }
+ return stringList;
+ }
}
diff --git a/src/main/java/tla/web/mvc/LemmaController.java b/src/main/java/tla/web/mvc/LemmaController.java
index 241885e8..cb594f51 100644
--- a/src/main/java/tla/web/mvc/LemmaController.java
+++ b/src/main/java/tla/web/mvc/LemmaController.java
@@ -22,7 +22,6 @@
import tla.web.model.meta.ObjectDetails;
import tla.web.model.meta.SearchResults;
import tla.web.model.meta.TemplateModelName;
-import tla.web.model.ui.AttestationTimeline;
import tla.web.service.LemmaService;
import tla.web.service.ObjectService;
diff --git a/src/main/java/tla/web/mvc/ObjectController.java b/src/main/java/tla/web/mvc/ObjectController.java
index d9f6e458..9e920c16 100644
--- a/src/main/java/tla/web/mvc/ObjectController.java
+++ b/src/main/java/tla/web/mvc/ObjectController.java
@@ -240,11 +240,13 @@ public String getSingleObjectDetailsPage(@PathVariable String id, Model model) {
)
)
);
+ // buttons for the frontend
this.addHideableProperties(model);
this.addHideablesTextsentencesProperties(model);
this.addHideable1LemmaProperties(model);
this.addShowableProperties(model);
this.addHideable2LemmaProperties(model);
+ // data available for the frontend
model.addAttribute("obj", container.getObject());
model.addAttribute("passport", getPassportPropertyValues(container));
model.addAttribute("caption", getService().getLabel(container.getObject()));
@@ -277,9 +279,9 @@ public String getSearchResultsPage(
//else if (!params.get("sort").contains("sortKey")) params.set("sort","sortKey_asc");
// System.out.println("Submitted Form class "+form.getClass().toString());
- if( form.getClass().toString().contains("LemmaSearch"))
+ if( form.getClass().toString().contains("LemmaSearch")) //TODO verschieben in LemmaController
if (form.getSort()==null) form.setSort("sortKey_asc");
-
+
log.info("Submitted search form: {}", tla.domain.util.IO.json(form));
log.info("URL params: {}", params);
SearchResults results = this.getService().search(form, Integer.parseInt(page)); // TODO validate page
@@ -295,22 +297,21 @@ public String getSearchResultsPage(
)
)
);
+ // buttons for the frontend
this.addHideableProperties(model);
- this.addHideablesTextsentencesProperties(model);
+ this.addHideablesTextsentencesProperties(model); // TODO: macht das hier Sinn?
this.addShowableProperties(model);
this.addHideable1LemmaProperties(model);
this.addHideable2LemmaProperties(model);
+ // data available for the frontend
model.addAttribute("objectType", getTemplatePath());
model.addAttribute("searchResults", results.getObjects());
if (results.getQuery().getSort()==null ) results.getQuery().setSort("sortKey_asc");
-
model.addAttribute("searchQuery", results.getQuery());
- // System.out.println("Sort "+results.getQuery().getSort());
model.addAttribute("facets", results.getFacets());
model.addAttribute("page", results.getPage());
model.addAttribute("pagination", new Pagination(results.getPage()));
model = extendSearchResultsPageModel(model, results, form);
- // System.out.println("Search "+ String.format("%s/search", getTemplatePath()));
return String.format("%s/search", getTemplatePath());
}
diff --git a/src/main/java/tla/web/mvc/SearchController.java b/src/main/java/tla/web/mvc/SearchController.java
index 35fb72e8..03a38f0e 100644
--- a/src/main/java/tla/web/mvc/SearchController.java
+++ b/src/main/java/tla/web/mvc/SearchController.java
@@ -50,7 +50,7 @@ public class SearchController {
private String defaultForm;
// public static final List SEARCH_FORMS = List.of("lemma-quick", "lemma", "sentence");
- public static final List SEARCH_FORMS = List.of("lemma", /*"sentence", "text", "object",*/ "collocation", "lemma-id", "token-id", "sentence-id", "text-id", "object-id", "ths-id");
+ public static final List SEARCH_FORMS = List.of("lemma", "collocation", /*"sentence",*/ "text", /*"object",*/ "lemma-id", "token-id", "sentence-id", "text-id", "object-id", "ths-id");
@ModelAttribute("allScripts")
public Script[] getAllScripts() {
@@ -101,7 +101,7 @@ public String mainSearchPage(
);
if (sentenceForm.getTokens() == null || sentenceForm.getTokens().isEmpty()) {
sentenceForm.setTokens(
- List.of(new TokenSpec(), new TokenSpec())
+ List.of(new TokenSpec(), new TokenSpec(), new TokenSpec())
);
}
model.addAttribute(
diff --git a/src/main/java/tla/web/mvc/SentenceController.java b/src/main/java/tla/web/mvc/SentenceController.java
index 0ff549aa..e7cdd0d9 100644
--- a/src/main/java/tla/web/mvc/SentenceController.java
+++ b/src/main/java/tla/web/mvc/SentenceController.java
@@ -51,6 +51,11 @@ public class SentenceController extends HierarchicObjectController getService() {
return service;
}
+
+ @ModelAttribute("sortOrders")
+ public List getSortOrders() {
+ return searchConfig.getSortOrders();
+ }
@Override
public List> createObjectPathLinks(Hierarchic object) {
@@ -78,7 +83,19 @@ public String getSearchResultsPage(
@RequestParam MultiValueMap params,
Model model
) {
+ if (form.getSort()==null) form.setSort("context.notBefore_asc");
model.addAttribute("contextInformation", searchConfig.getContextInformation());
+ int tokenCount = 0;
+ tokenCount = form.getTokens().size();
+ int[] lemmaIDs= new int[tokenCount];
+ for (int i = 0; i < tokenCount; i++) {
+ try {
+ lemmaIDs[i] = Integer.parseInt(form.getTokens().get(i).getLemma().getId());
+ }
+ catch(Exception e) {
+ }
+ }
+ model.addAttribute("lemmaIDs", lemmaIDs);
return super.getSearchResultsPage(form, page, params, model);
}
@@ -108,12 +125,13 @@ public String getSentenceForToken(@PathVariable String id, Model model) {
BreadCrumb.of("/sentence/" + sentenceID,
String.format("caption_details_%s", getTemplatePath())),
BreadCrumb.of(String.format("caption_details_%s", "token"))));
-
+ // buttons in the frontend
this.addHideableProperties(model);
this.addHideablesTextsentencesProperties(model);
this.addHideable1LemmaProperties(model);
this.addShowableProperties(model);
this.addHideable2LemmaProperties(model);
+ // data available for the frontend
model.addAttribute("obj", container.getObject());
model.addAttribute("passport", getPassportPropertyValues(container));
model.addAttribute("caption", getService().getLabel(container.getObject()));
@@ -123,6 +141,4 @@ public String getSentenceForToken(@PathVariable String id, Model model) {
model = extendSingleObjectDetailsModel(model, container);
return "token/details";
}
-
-
}
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index ad6b1e9a..69181a6f 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -25,7 +25,7 @@ tla:
hieratic_hieroglyphic: https://aaew.bbaw.de/tla/servlet/GetWcnDetails?u=guest&f=0&l=0&wn={id}&db=0
demotic: https://aaew.bbaw.de/tla/servlet/GetWcnDetails?u=guest&f=0&l=0&wn={id}&db=1
demotic_texts: https://aaew.bbaw.de/tla/servlet/GetTextDetails?u=guest&f=0&l=0&tc={id}&db=1
- id-pattern: ^-?[1-9][0-9]*$
+ id-pattern: ^-?[1-9][0-9/]*$
aegyptiaca:
default-format: https://aegyptiaca.uni-muenster.de/Record/{id}
bm:
@@ -109,19 +109,18 @@ search:
- timeSpan.begin_desc
- timeSpan.end_asc
- timeSpan.end_desc
+ # buttons
hideable1-lemma-properties:
hieroglyphs: []
lemma-id: []
wordClass: []
-
- hideable2-lemma-properties:
- attested-timespan: []
- bibliography: []
-
showable-properties:
de: []
en: []
fr: []
+ hideable2-lemma-properties:
+ attested-timespan: []
+ bibliography: []
word-classes:
excl_names: []
excl_namestitlesepithets: []
@@ -186,6 +185,12 @@ search:
lemma: []
sentence:
+ sort-orders:
+ - context.notBefore_asc
+ - context.notBefore_desc
+ - context.notAfter_asc
+ - context.notAfter_desc
+ # Buttons for sentence display?
hideable-properties:
hieroglyphs: []
switchannotation:
@@ -196,8 +201,8 @@ search:
- linguisticglossing
translation: []
dating: []
- texteditor: []
-
+ texteditor: []
+ # Buttons for sentences in cotext?
hideable-textsentences-properties:
hieroglyphs: []
switchannotation:
diff --git a/src/main/resources/i18n/messages_de.properties b/src/main/resources/i18n/messages_de.properties
index f67d2fb7..cb8c4255 100644
--- a/src/main/resources/i18n/messages_de.properties
+++ b/src/main/resources/i18n/messages_de.properties
@@ -3,8 +3,8 @@ date_not_edited=kein Datum eingegeben
tla_Title=Thesaurus Linguae Aegyptiae
tla_Editor=Tonio Sebastian Richter & Daniel A. Werning im Auftrag der Berlin-Brandenburgischen Akademie der Wissenschaften und Hans-Werner Fischer-Elfert & Peter Dils im Auftrag der Sächsischen Akademie der Wissenschaften zu Leipzig
-tla_version=2.1.2
-tla_ReleaseDate=24.11.2023
+tla_version=2.1.3
+tla_ReleaseDate=16.5.2024
tla_corpusversion=18
tla_corpusdate=24.11.2023
@@ -27,13 +27,14 @@ msg_loading_sentences=Lade Sätze...
msg_loading_sentences_browser=Wir arbeiten daran, die Performance dieser Seite zu verbessern.
msg_more_metadata=Wenige weitere Metadaten in einer zukünftigen Version der TLA-Web-Applikation.
msg_hieroglyph_search=Eine Hieroglyphensuche wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie hier.
-msg_collocation_search=Es können aktuell nur zwei verschiedene Lemmata gesucht werden. Eine Kollokationssuche >mit definiertem Lemma-Abstand wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie hier.
+msg_collocation_search=Es können aktuell nur zwei oder drei verschiedene Lemmata gesucht werden. Eine Kollokationssuche mit definiertem Lemma-Abstand wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie hier.
msg_occurences_sorting=Möglichkeiten die Ergebnisliste zu sortieren werden in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden.
msg_sentences_page=Eine Seite mit der Sequenz von Sätzen des Textes wird aktuell für eine nächste Version der TLA-Web-Applikation programmiert. Den Entwicklungsplan finden Sie hier.
-msg_pid_variant_warning=Achtung: Aus technischen Gründen können für Satzlesungsvarianten keine individuellen permanenten IDs gearantiert werden. Die Zitation erfolgt daher nur über die Basis-Satz-ID inkl. aller Varianten.
+msg_pid_variant_warning=Achtung: Aus technischen Gründen können für Satzlesungsvarianten keine individuellen permanenten IDs garantiert werden. Die Zitation erfolgt daher nur über die Basis-Satz-ID inkl. aller Varianten.
msg_sentence_comments=In einer zukünftigen Version der TLA-Webanwendung werden auch die Referenzbereiche der Kommentare und Annotationen zu Sätzen angezeigt werden, d.h. auf welche Teile des Satzes sich der Kommentar/die Annotation jeweils bezieht. Den Entwicklungsplan finden Sie hier.
msg_sending_comments=Die Funktion Kommentare zu senden ist noch nicht implementiert.
msg_related_with_invalid_names=Auf den Inhalt dieses Kommentars/dieser Annotation können wir aktuell noch nicht zugreifen:
+msg_search_for_texts=Als Übergangslösung suchen Sie bitte nach Texten und Objekten in dieser PDF-Datei.
citeas_heading=Bitte zitieren als
citeas_website_heading=Bitte zitieren Sie dieses Webangebot als
@@ -271,6 +272,8 @@ review_state_published-obsolete=Obsolet
review_state_published-awaiting-verification=Verifizierung steht aus
artificially_aligned=Hieroglyphen künstlich angeordnet
+sentences_abbreviation=Sätze
+
state_of=Stand
created_before_BTS3=vor Juni 2015 (1992–2015)
@@ -286,6 +289,14 @@ object_property_editors=unter Mitarbeit von
object_property_editors_created=Datensatz erstellt
object_property_editors_updated=letzte Revision
object_property_review_state=Redaktionsstatus
+object_property_metadata_editing=Metadatenerstellung
+object_property_protocol=Datensatz-Protokoll
+object_property_transliteration_by=Texttranskription
+object_property_translation_by=Textübersetzung
+object_property_lemmatization=Textlemmatisierung
+object_property_grammatical_encoding=Grammatische Annotation
+object_property_hieroglyphic_encoding=Hieroglypheneingabe
+object_property_isHieroglyphs_sequential=Hieroglyphen ohne Anordnung (d.h. rein sequentiell) eingegeben
object_property_annotations=Kommentare
object_property_annotation=Kommentar
object_property_translation=Übersetzung
@@ -313,11 +324,10 @@ object_property_is_model=Ist ein Model
object_property_is_imitation=Ist eine Imitation
object_property_is_miniature=Ist eine Miniatur
object_property_is_skeuomorph=Ist ein Skeuomorph
-object_property_protocol=Datensatz-Protokoll
object_property_description=Beschreibung
object_property_reconstructed=Ist rekonstruiert
object_property_file_comment=Datensatz-Kommentar
-object_property_synonyms=Weitere Bezeichnungen
+object_property_synonyms=Weitere Bezeichnungen / Übersetzungen
object_property_owner=Besitzer
object_property_context=Kultureller Kontext
object_property_context_comment=Kommentar zum kulturellen Kontext
@@ -443,7 +453,8 @@ form_label_ths-id-search=Thesaurus-ID nachschlagen
form_label_lemma-search=Lemma suchen
form_label_collocation-search=Lemmata-Kollokation suchen
form_label_sentence-search=Sätze suchen
-form_label_text-search=Texte suchen
+form_label_text-search=Texte/Objekte suchen
+form_label_object-search=Objekte suchen
field_label_lemma_id=Lemma-ID
field_label_sentence_id=Satz-ID
@@ -548,6 +559,11 @@ field_value_label_sort_by_timeSpan.end_asc_type_lemma=Belegzeit, Ende (aufst.)
field_value_label_sort_by_timeSpan.end_desc_type_lemma=Belegzeit, Ende (abst.)
field_value_label_sort_by_root_asc_type_lemma=Wurzel
+field_value_label_sort_by_context.notBefore_asc_type_sentence=Datierungszeitspanne, Anfang (aufsteigend)
+field_value_label_sort_by_context.notBefore_desc_type_sentence=Datierungszeitspanne, Anfang (absteigend)
+field_value_label_sort_by_context.notAfter_asc_type_sentence=Datierungszeitspanne, Ende (aufsteigend)
+field_value_label_sort_by_context.notAfter_desc_type_sentence=Datierungszeitspanne, Ende (absteigend)
+
button_label_clear_form=Alles löschen
button_label_some-id_search=ID nachschlagen
button_label_lemma-id_search=ID nachschlagen
@@ -559,6 +575,8 @@ button_label_token-id_search=ID nachschlagen
button_label_lemma_search=Lemma suchen
button_label_collocation_search=Kollokation suchen
button_label_sentence_search=Belegstellensuche
+button_label_text_search=PDF öffnen
+button_label_object_search=Objekte suchen
button_label_modify_search=Suche modifizieren
button_label_hide_property_lemma-id=Lemma-ID
button_label_hide1Lemma_property_lemma-id=Lemma-ID
diff --git a/src/main/resources/i18n/messages_en.properties b/src/main/resources/i18n/messages_en.properties
index 471173d3..dc181f64 100644
--- a/src/main/resources/i18n/messages_en.properties
+++ b/src/main/resources/i18n/messages_en.properties
@@ -3,8 +3,8 @@ date_not_edited=no date edited
tla_Title=Thesaurus Linguae Aegyptiae
tla_Editor=Tonio Sebastian Richter & Daniel A. Werning on behalf of the Berlin-Brandenburgische Akademie der Wissenschaften and Hans-Werner Fischer-Elfert & Peter Dils on behalf of the Sächsische Akademie der Wissenschaften zu Leipzig
-tla_version=2.1.2
-tla_ReleaseDate=11/24/2023
+tla_version=2.1.3
+tla_ReleaseDate=5/16/2023
tla_corpusversion=18
tla_corpusdate=11/24/2023
@@ -27,13 +27,14 @@ msg_loading_sentences=Loading sentences...
msg_loading_sentences_browser=We are struggling to improve the performance of this page.
msg_more_metadata=Few more metadata in a future version of the TLA web app.
msg_hieroglyph_search=Hieroglyph search yet to be implemented for a future version of the TLA web app. For the development plan, see here.
-msg_collocation_search=Only two different lemmata can currently be searched for. A collocation search with defined lemma distance will be implemented in a future version of the TLA web app. For the development plan, see here.
+msg_collocation_search=Only two or three different lemmata can currently be searched for. A collocation search with defined lemma distance will be implemented in a future version of the TLA web app. For the development plan, see here.
msg_occurences_sorting=Possibilities to sort the results list will be added in a future version of the TLA web application.
msg_sentences_page=A page that displays the sequence of sentences of the text is currently being implemented for a future release of the TLA web app. For the development plan, see here.
msg_pid_variant_warning=Attention: For technical reasons, no permanent IDs can be assigned to individual sentence reading variants. Therefore, the citation is only via the base sentence ID incl. all variants.
msg_sentence_comments=A future release of the TLA web app will also indicate the scope of authors’ comments or annotations, i.e., which parts of the sentence a comment/annotation refers to. For the development plan, see here.
msg_sending_comments=The function of sending comments is not yet implemented.
msg_related_with_invalid_names=We are yet unable to access the content of this comment/annotation:
+msg_search_for_texts=As a temporary solution, please search for texts and objects in this PDF file.
citeas_heading=Please cite as
citeas_website_heading=Please cite this website as
@@ -60,7 +61,7 @@ button_copy_ID=Copy ID
button_copy_URL=Copy URL
button_copy_MdC=Copy MdC
button_copy_unicode=Copy Unicode
-button_sentence_page=Go to/quote sentence
+button_sentence_page=Go to/cite sentence
button_sentence_in_text_start=Text sentence no.
button_sentence_in_text_end=in cotext
button_sentence_in_text_warning=Jump target position currently approximate.
@@ -271,6 +272,8 @@ review_state_published-obsolete=Obsolete
review_state_published-awaiting-verification=Verification pending
artificially_aligned=Glyphs artificially arranged
+sentences_abbreviation=sent.
+
state_of=State of
created_before_BTS3=before June 2015 (1992–2015)
@@ -288,6 +291,14 @@ object_property_editors_updated=latest revision
object_property_review_state=Editorial state
object_property_annotations=Comments
object_property_annotation=Comment
+object_property_metadata_editing=Metadata editing
+object_property_protocol=File protocol
+object_property_transliteration_by=Text transliteration
+object_property_translation_by=Text translation
+object_property_lemmatization=Text lemmatization
+object_property_grammatical_encoding=Grammatical annotation
+object_property_hieroglyphic_encoding=Editing of hieroglpyhs
+object_property_isHieroglyphs_sequential=Hieroglyphs encoded without arrangement (pure sequence)
object_property_translation=Translation
object_property_script= Script
object_property_date= Dating
@@ -313,11 +324,10 @@ object_property_is_model=Is a model
object_property_is_imitation=Is an imitation
object_property_is_miniature=Is a miniature
object_property_is_skeuomorph=Is a skeuomorph
-object_property_protocol=File protocol
object_property_description=Description
object_property_reconstructed=Is reconstructed
object_property_file_comment=File comments
-object_property_synonyms=Further designations
+object_property_synonyms=Further designations / translations
object_property_owner=Owner
object_property_context=Cultural context
object_property_context_comment=Comment on cultural context
@@ -443,7 +453,8 @@ form_label_ths-id-search=Look up thesaurus ID
form_label_lemma-search=Search for lemma
form_label_collocation-search=Search for lemma collocation
form_label_sentence-search=Search for sentences
-form_label_text-search=Search for texts
+form_label_text-search=Search for texts/objects
+form_label_object-search=Search for objects
field_label_lemma_id=Lemma ID
field_label_sentence_id=Sentence ID
@@ -548,6 +559,11 @@ field_value_label_sort_by_timeSpan.end_asc_type_lemma=Attestation time, end (asc
field_value_label_sort_by_timeSpan.end_desc_type_lemma=Attestation time, end (desc.)
field_value_label_sort_by_root_asc_type_lemma=Root
+field_value_label_sort_by_context.notBefore_asc_type_sentence=Dating time span, start (asc.)
+field_value_label_sort_by_context.notBefore_desc_type_sentence=Dating time span, start (desc.)
+field_value_label_sort_by_context.notAfter_asc_type_sentence=Dating time span, end (asc.)
+field_value_label_sort_by_context.notAfter_desc_type_sentence=Dating time span, end (desc.)
+
button_label_clear_form=Clear all
button_label_some-id_search=Look up ID
button_label_lemma-id_search=Look up ID
@@ -559,6 +575,8 @@ button_label_token-id_search=Look up ID
button_label_lemma_search=Search for lemma
button_label_collocation_search=Search for collocation
button_label_sentence_search=Search text corpus
+button_label_text_search=Open PDF
+button_label_object_search=Search for objects
button_label_modify_search=Modify Search
button_label_hide_property_lemma-id=Lemma ID
button_label_hide1Lemma_property_lemma-id=Lemma ID
diff --git a/src/main/resources/pages/de/help/sentence-search-results.html b/src/main/resources/pages/de/help/sentence-search-results.html
index 17f6f627..c066f0d8 100644
--- a/src/main/resources/pages/de/help/sentence-search-results.html
+++ b/src/main/resources/pages/de/help/sentence-search-results.html
@@ -73,9 +73,15 @@
Text-Editor:innen
Sortierung
-
- (Sorting being implemented.)
-
+
+
Mit diesem Auswahlmenü können Sie die Sortierung der Ergebnisliste ändern. Grundsätzlich gibt es die Möglichkeit, auf- und absteigend nach folgenden Kriterien zu sortieren:
+
+
Datierungszeitspanne, Anfang (terminus ante quem non)
+
Datierungszeitspanne, Ende (terminus post quem non)
+
+
Bei der Sortierung nach Datierungsgrenzen werden Texte/Sätze ohne Datierung (aktuell noch unsortiert) am Ende der Liste eingereit.
+
Die Grundeinstellung ist „Belegzeit, Anfang (aufsteigend)‟.
Sie können einzelne Datensätze, aber nicht ganze Teilkorpora dieser Website für akademische Forschungszwecke kopieren und zitieren.
- Wir bereiten derzeit eine Rohdatenpublikation des wissenschaftlichen Inhalts vor, die unter einer freien Lizenz veröffentlicht werden soll. Diese finden Sie verlinkt auf der Seite aaew.bbaw.de/daten-veroeffentlichungen.
+
Sie können einzelne Datensätze, aber nicht ganze Teilkorpora oder größere Textmengen (> 10 Webseiten) dieser Website für akademische Forschungszwecke kopieren und wörtlich zitieren.
+ Wir bereiten schrittweise weitere Rohdatenpublikation des wissenschaftlichen Inhalts vor, die dann unter einer freien Lizenz veröffentlicht werden. Diese finden Sie verlinkt auf der Seite aaew.bbaw.de/daten-veroeffentlichungen.
+
Mit möglichen individuellen Anfragen bzgl. der Rohdaten wenden Sie sich bitte an Daniel Werning.
Implementierung der Webseite
Bezüglich des Designs dieser Webseite, wie es sich maßgeblich aus der tla-styles.css ergibt, behalten wir uns die Nutzungsrechte vor.
Zur Lizenzierung des für die Wiedergabe von Hieroglyphen in Unicode verwendeten Fonts EgyptianHiero siehe github.com/MKilani/Djehuty.