commit 308cb0b226b0949d130cfb335c72d47f3f89ad0e Author: xiaoxue Date: Sun May 24 23:07:33 2026 +0800 同步完整源码 - 2026-05-24 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a323917 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +text=auto eol=lf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..ec534b2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: ['https://www.paypal.me/MMandalka'] diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7462a39 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,42 @@ +[submodule "src/solr-php-ui"] + path = src/solr-php-ui + url = https://github.com/opensemanticsearch/solr-php-ui.git +[submodule "src/open-semantic-etl"] + path = src/open-semantic-etl + url = https://github.com/opensemanticsearch/open-semantic-etl.git +[submodule "src/solr-ontology-tagger"] + path = src/solr-ontology-tagger + url = https://github.com/opensemanticsearch/solr-ontology-tagger.git +[submodule "src/open-semantic-visual-graph-explorer"] + path = src/open-semantic-visual-graph-explorer + url = https://github.com/opensemanticsearch/open-semantic-visual-graph-explorer.git +[submodule "src/open-semantic-search-apps"] + path = src/open-semantic-search-apps + url = https://github.com/opensemanticsearch/open-semantic-search-apps.git +[submodule "src/open-semantic-entity-search-api"] + path = src/open-semantic-entity-search-api + url = https://github.com/opensemanticsearch/open-semantic-entity-search-api.git +[submodule "src/solr-relevance-ranking-analysis"] + path = src/solr-relevance-ranking-analysis + url = https://github.com/opensemanticsearch/solr-relevance-ranking-analysis.git +[submodule "src/solr.deb"] + path = src/solr.deb + url = https://github.com/opensemanticsearch/solr.deb.git +[submodule "src/tika-server.deb"] + path = src/tika-server.deb + url = https://github.com/opensemanticsearch/tika-server.deb.git +[submodule "src/tika-python"] + path = src/tika-python + url = https://github.com/chrismattmann/tika-python.git +[submodule "src/cytoscape.js"] + path = src/cytoscape.js + url = https://github.com/cytoscape/cytoscape.js.git +[submodule "src/cytoscape.js-panzoom"] + path = src/cytoscape.js-panzoom + url = https://github.com/cytoscape/cytoscape.js-panzoom.git +[submodule "src/spacy-services.deb"] + path = src/spacy-services.deb + url = https://github.com/opensemanticsearch/spacy-services.deb.git +[submodule "src/solr-synonames"] + path = src/solr-synonames + url = https://github.com/opensemanticsearch/solr-synonames.git diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 0000000..c52d35d --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,13 @@ +Package: open-semantic-search +Version: 21.12.25 +Section: misc +Priority: optional +Architecture: all +Depends: default-jre-headless(>=0), lsb-release(>=0), libjs-jquery(>=0), curl(>=0), apache2(>=0), libapache2-mod-php(>=0), php(>=0), php-xml(>=0), php-bcmath(>=0), libapache2-mod-wsgi-py3(>=0), python3-django(>=0), python3-mysqldb(>=0), python3-pycurl(>=0), python3-rdflib(>=0), python3-requests(>=0), python3-openssl(>=0), python3-pysolr(>=0), python3-dateutil(>=0), python3-lxml(>=0), python3-feedparser(>=0), poppler-utils(>=0), pst-utils(>=0), python3-pyinotify(>=0), python3-nltk(>=0), python3-pip(>=0), python3-dev(>=0), build-essential(>=0), libssl-dev(>=0), libffi-dev(>=0), rabbitmq-server(>=0), tesseract-ocr(>=0), tesseract-ocr-all(>=0), hunspell-de-de-frami, hunspell-hu +Installed-Size: 100 +Maintainer: Markus Mandalka +Homepage: https://opensemanticsearch.org/ +Description: Search engine + Solr PHP UI is a user interface to search in a Solr index. + Open Semantic ETL index your files to Solr. + Solr search server will manage the index and will do the searching. diff --git a/DEBIAN/postinst b/DEBIAN/postinst new file mode 100644 index 0000000..147127b --- /dev/null +++ b/DEBIAN/postinst @@ -0,0 +1,5 @@ +#!/bin/sh +# postinst script for opensemanticsearch + +# call postinst scripts (extracted to opt) of the main components + diff --git a/DEBIAN/prerm b/DEBIAN/prerm new file mode 100644 index 0000000..7fcb27a --- /dev/null +++ b/DEBIAN/prerm @@ -0,0 +1,21 @@ +#!/bin/sh + +systemctl disable opensemanticetl-filemonitoring +systemctl stop opensemanticetl-filemonitoring + +systemctl disable opensemanticetl +systemctl stop opensemanticetl + +systemctl disable tika +systemctl stop tika + +systemctl disable spacy +systemctl stop spacy + +systemctl disable flower +systemctl stop flower + +systemctl disable solr +systemctl stop solr + +exit 0 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0465def --- /dev/null +++ b/Dockerfile @@ -0,0 +1,127 @@ +FROM debian:bullseye + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get install --no-install-recommends --yes \ + apache2 \ + libapache2-mod-php \ + libapache2-mod-wsgi-py3 \ + libjs-jquery \ + php \ + php-xml \ + php-bcmath \ + librabbitmq4 \ + python3-django \ + python3-pycurl \ + python3-rdflib \ + python3-sparqlwrapper \ + python3-sqlparse \ + python3-requests \ + python3-pysolr \ + python3-dateutil \ + python3-lxml \ + python3-feedparser \ + python3-celery \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + python3-dev \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# install django-import-export +RUN pip3 install --no-cache-dir py2neo && \ + pip3 install --no-cache-dir warcio && \ + pip3 install --no-cache-dir mkdocs && \ + pip3 install --no-cache-dir mkdocs-mermaid2-plugin + +COPY ./src/tika-python/tika /usr/lib/python3/dist-packages/tika +COPY ./src/open-semantic-etl/src /usr/lib/python3/dist-packages/ +COPY ./src/open-semantic-etl/src/tesseract-ocr-cache /usr/lib/python3/dist-packages/ +COPY ./src/open-semantic-etl/etc /etc/ + +# +# Include docs +# + +COPY ./docs /usr/share/doc/open-semantic-search/docs +COPY mkdocs.yml /usr/share/doc/open-semantic-search/ + +RUN mkdocs build --config-file /usr/share/doc/open-semantic-search/mkdocs.yml + +# +# Include solr-php-ui +# + +COPY ./src/solr-php-ui/etc /etc + +COPY ./src/solr-php-ui/src /usr/share/solr-php-ui/ + +# This directory will provide initial content to the configuration volume: +RUN mv /usr/share/solr-php-ui/config /usr/share/solr-php-ui/etc-volume + +# link from renamed php directory to the configuration volume: +RUN ln -s /etc/solr-php-ui /usr/share/solr-php-ui/config + +# +# Include Solr Relevance Ranking Analysis Tool +# + +COPY ./src/solr-relevance-ranking-analysis/src/solr_relevance_ranking_analysis /var/lib/opensemanticsearch/solr_relevance_ranking_analysis + +# +# Include Open Semantic Search Apps +# + +COPY ./src/open-semantic-search-apps/src /var/lib/opensemanticsearch/ +COPY ./src/open-semantic-search-apps/etc /etc/ +COPY ./src/open-semantic-search-apps/var /var/ + +# +# Gather the initial content for the volumes +# + +RUN mv /var/opensemanticsearch /var/lib/opensemanticsearch/var-volume +RUN mv /etc/opensemanticsearch /var/lib/opensemanticsearch/etc-volume + +# +# Include Open Semantic Entity Search API +# + +# include Django app +COPY ./src/open-semantic-entity-search-api/src/entity_rest_api /var/lib/opensemanticsearch/entity_rest_api +# include libraries +COPY ./src/open-semantic-entity-search-api/src/entity_import /usr/lib/python3/dist-packages/entity_import +COPY ./src/open-semantic-entity-search-api/src/entity_linking /usr/lib/python3/dist-packages/entity_linking +COPY ./src/open-semantic-entity-search-api/src/entity_manager /usr/lib/python3/dist-packages/entity_manager + +# +# Include Open Semantic Visual Linked Data Explorer +# + +COPY ./src/open-semantic-visual-graph-explorer/src /var/lib/opensemanticsearch/ + +# and its base / dependencies cytoscape.js and cytoscape.js-panzoom +COPY ./src/cytoscape.js/dist /var/lib/opensemanticsearch/visual_graph_explorer/static/ +COPY ./src/cytoscape.js-panzoom/cytoscape-panzoom.js /var/lib/opensemanticsearch/visual_graph_explorer/static/ +COPY ./src/cytoscape.js-panzoom/cytoscape.js-panzoom.css /var/lib/opensemanticsearch/visual_graph_explorer/static/ +COPY ./src/cytoscape.js-panzoom/font-awesome-4.0.3 /var/lib/opensemanticsearch/visual_graph_explorer/static/ + +# Include Solr-Ontology-Tagger +COPY ./src/solr-ontology-tagger/src /usr/lib/python3/dist-packages/ + +# export static files to directory for webserver +RUN python3 /var/lib/opensemanticsearch/manage.py collectstatic --noinput + +# enable apache2 module for Django +RUN a2enmod wsgi + +# Reverse proxy for Flower task management web ui +COPY ./src/flower/etc/apache2 /etc/apache2 +COPY ./src/flower/etc/flower /etc/flower +RUN a2enmod proxy && \ + a2enmod proxy_http + +COPY ./docker-entrypoint.sh / +RUN chmod 755 /docker-entrypoint.sh + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfile-cron b/Dockerfile-cron new file mode 100644 index 0000000..6bc0a90 --- /dev/null +++ b/Dockerfile-cron @@ -0,0 +1,13 @@ +FROM debian:bullseye + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get install --no-install-recommends --yes cron curl \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +COPY src/open-semantic-search-apps/etc/cron.d/open-semantic-search /etc/cron.d/open-semantic-search + +RUN adduser --system --group --disabled-password opensemanticetl \ + && sed -i s/localhost/apps/ /etc/cron.d/open-semantic-search + +CMD ["cron", "-f"] diff --git a/Dockerfile-test b/Dockerfile-test new file mode 100644 index 0000000..b31f31b --- /dev/null +++ b/Dockerfile-test @@ -0,0 +1,6 @@ +FROM mcr.microsoft.com/playwright:focal + +RUN npm install jest --global +RUN npm install playwright + +COPY ./test / diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3aaa8a3 --- /dev/null +++ b/README.md @@ -0,0 +1,168 @@ +# Open Semantic Search +https://opensemanticsearch.org + +Open Semantic Search is: +- an integrated search server, +- ETL framework for document processing (crawling, text extraction, text analysis, named entity recognition and OCR for images and embedded images in PDF), +- search user interfaces, text mining, text analytics and search apps for fulltext search, faceted search, exploratory search and knowledge graph search + +# Documentation + +This README.md is documentation for software developers. + +## Documentation for users and admins + +The [documentation for users and admins](docs/doc/README.md) is included in the software packages/images and linked in the search user interface (Menu "Help"). + +## Software architecture + +You can find the [documentation of the search engine architecture in `docs/doc/modules/README.md`](docs/doc/modules/README.md). + +## Documentation format + +This integrated HTML [documentation](https://opensemanticsearch.org/doc/search/) is generated by the static site generator [MkDocs](https://www.mkdocs.org/) with the config file [`mkdocs.yml`](mkdocs.yml). + +The source of the documentation (Markdown format) and the charts ([mermaid](https://mermaid-js.github.io/mermaid/) format) is editable in the directory [`docs`](docs). + +# Build + +How to build the deb package for installation on Debian or Ubuntu server or the docker images for running in Docker containers: + +## Clone git repositories +Clone the repository including the dependencies: + +``` +git clone --recurse-submodules --remote-submodules https://github.com/opensemanticsearch/open-semantic-search.git +cd open-semantic-search +``` + +## Build deb package + +To build a `deb` package for *Debian GNU/Linux* or *Ubuntu Linux*, call the build script [build-deb](build-deb) as user root (change user by `su` or `sudo su`): + +``` +./build-deb +``` + +## Build Desktop Search VM + +How to build an *Open Semantic Desktop Search* Appliance for *VirtualBox* is documented in +[`src/open-semantic-desktop-search/README.md`](src/open-semantic-desktop-search/README.md). + +## Build docker images + +Build the Docker images using the default docker-compose config [docker-compose.yml](docker-compose.yml): + +``` +docker-compose build +``` + +## Run docker containers + +After these builds all the Docker images/dependencies/services can be started together by docker-compose with the config file [docker-compose.yml](docker-compose.yml). + +You can start the whole environment by running: + +``` +docker-compose up +``` + +which will expose the web user interface on port `8080`. + +You can browse the Open Semantic Search user interface in your favourite browser by this URL: + +`http://localhost:8080/search/` + + +# Automated tests + +For CI/CD there are some different automated tests: + + +## Integration tests + +Since the [submodule Open Semantic ETL](src/open-semantic-etl) uses and needs different powerful services like [Solr](src/solr.deb), [spaCy-services](src/spacy-services.deb) or [Tika-Server](src/tika-server.deb) by HTTP and REST-API, many automated tests run as integration tests within the docker-compose environment configured in [docker-compose.etl.test.yml](docker-compose.etl.test.yml) so these services are available while running the unittests and integration tests. + +``` +docker-compose -f docker-compose.etl.test.yml build +docker-compose -f docker-compose.etl.test.yml up +``` + + +## End to end tests + +Some automated integration tests and end-to-end (E2E) tests within a web browser controlled by the browser automation framework [Playwright](https://playwright.dev/) and the node.js / javascript based test framework [JEST](https://jestjs.io/). + +You can extend the automated tests in [test/test.js](test/test.js) + +They run by the docker image [Dockerfile-test](Dockerfile-test) and need the services of the docker-compose environment [docker-compose.test.yml](docker-compose.test.yml): + +``` +docker-compose -f docker-compose.test.yml build +docker-compose -f docker-compose.test.yml up +``` + + +# Dependencies + +Dependencies are resolved automatically by building or by installation of the Debian or Ubuntu packages or by building the Docker images. + +Documentation on this dependencies which may help debugging dependency hell issues or installations in other environments: + + +## Build dependencies on Source code (GIT) + +Dependencies on other Git repositories / submodules of components like Open Semantic ETL are defined in the Git config file [.gitmodules](.gitmodules) + +The submodules will be checked out automatically to the subdirectory [src](src), if you check out this repository by git in recursive mode. + + +## Packaging dependencies of Java archives (JAR) + +The submodules [src/tika-server.deb](src/tika-server.deb) and [src/solr.deb](src/solr.deb) need the JAR of [Apache Tika-Server](https://tika.apache.org/) and [Apache Solr](https://solr.apache.org/). + +If not there, they will be downloaded from Apache Software Foundation by wget in the [build-deb](build-deb) script or the submodules Dockerfile. + + +## Installation dependencies on Debian/Ubuntu packages (DEB) + +Dependencies of tools and libraries, which are available in the Debian or Ubuntu package repositories, are defined in the section Depends of the deb package config file [DEBIAN/control](DEBIAN/control) + + +## Installation dependencies on Python packages (PIP) + +Dependencies of Python libraries which are not available as packages of the Linux distribution but in Python Package Index (PyPI), are defined in + +[src/open-semantic-etl/src/opensemanticetl/requirements.txt](src/open-semantic-etl/src/opensemanticetl/requirements.txt) + +This dependencies will be installed automatically on installation of the Debian/Ubuntu packages by the DEBIAN/postinst script of the Debian/Ubuntu packages or by docker build configured by Dockerfile by + +``` +pip3 install -r /usr/lib/python3/dist-packages/opensemanticetl/requirements.txt +``` + +# Contributors + +Most contributors are not shown by the Github user interface as "*Contributors*" of this repository, +since this main repository is structured by [Git submodules](.gitmodules) like [*Open Semantic ETL*](https://github.com/opensemanticsearch/open-semantic-etl) +and other modules, which are managed in separated Git(hub) repositories. + +So thanks to all (current and former) contributors: + +- Markus Mandalka (@mandalka) +- @g-braeunlich +- @maehr +- @sdinten +- @wsldankers +- @rivimey +- @rbussche +- @mosea3 +- @bhelou +- @hpiedcoq +- @andreclinio +- @agharbeia +- @ciyer +- @davidshq +... + +Feel free to extend if you contributed/supported/sponsored in different forms. diff --git a/build-deb b/build-deb new file mode 100644 index 0000000..7defc68 --- /dev/null +++ b/build-deb @@ -0,0 +1,222 @@ +#!/bin/bash + +PACKAGE=open-semantic-search.deb +BUILDDIR=/tmp/open-semantic-search-$$.deb +INCLUDE_PACKAGES="solr.deb tika-server.deb spacy-services.deb open-semantic-etl solr-php-ui open-semantic-search-apps solr-synonames flower" + +# Change dir to src dir (for the case this build script is started from other dir) +cd "$(dirname "$0")" + +echo "Building ${PACKAGE} in temp directory ${BUILDDIR}" +mkdir ${BUILDDIR} +mkdir ${BUILDDIR}/opt + +cp -a DEBIAN ${BUILDDIR}/ + + +# +# Include Debian subpackages metadata and install scripts +# + +for INCLUDE_PACKAGE in $INCLUDE_PACKAGES ; do + + echo "Including ${INCLUDE_PACKAGE}" + + # Append conffiles names from the included package to our conffiles info + [ -f src/${INCLUDE_PACKAGE}/DEBIAN/conffiles ] && cat src/${INCLUDE_PACKAGE}/DEBIAN/conffiles >> ${BUILDDIR}/DEBIAN/conffiles + + # Copy postinst files, which will be called from our postint script + if [ -f src/${INCLUDE_PACKAGE}/DEBIAN/postinst ] + then + + cp src/${INCLUDE_PACKAGE}/DEBIAN/postinst ${BUILDDIR}/opt/postinst.${INCLUDE_PACKAGE} + + # Add call to postinst script + cat << EOF >> ${BUILDDIR}/DEBIAN/postinst + + if [ -f /opt/postinst.${INCLUDE_PACKAGE} ] + then + if /opt/postinst.${INCLUDE_PACKAGE} + then + rm /opt/postinst.${INCLUDE_PACKAGE} + else + exit 1 + fi + fi +EOF + + + fi + +done + +mkdir -p ${BUILDDIR}/usr/lib/python3/dist-packages + +# +# Include Open Semantic ETL +# + +cp -a src/open-semantic-etl/etc ${BUILDDIR}/ +cp -a src/open-semantic-etl/usr ${BUILDDIR}/ +cp -a src/open-semantic-etl/src/opensemanticetl ${BUILDDIR}/usr/lib/python3/dist-packages/ +cp -a src/open-semantic-etl/src/tesseract-ocr-cache/tesseract_cache ${BUILDDIR}/usr/lib/python3/dist-packages/ +cp -a src/open-semantic-etl/src/tesseract-ocr-cache/tesseract_fake ${BUILDDIR}/usr/lib/python3/dist-packages/ +mkdir -p ${BUILDDIR}/var/opensemanticsearch/media/thumbnails +mkdir -p ${BUILDDIR}/var/cache/tesseract + +# +# Include flower +# + +cp -a src/flower/etc ${BUILDDIR}/ + + +# +# Include Open Semantic Search Apps +# + +cp -a src/open-semantic-search-apps/etc ${BUILDDIR}/ +cp -a src/open-semantic-search-apps/var ${BUILDDIR}/ +mkdir -p ${BUILDDIR}/var/lib/opensemanticsearch/ +cp -a src/open-semantic-search-apps/src/* ${BUILDDIR}/var/lib/opensemanticsearch/ + +# +# Include docs +# + +mkdir -p ${BUILDDIR}/usr/share/doc/open-semantic-search +cp -a docs ${BUILDDIR}/usr/share/doc/open-semantic-search/ +cp mkdocs.yml ${BUILDDIR}/usr/share/doc/open-semantic-search/ + +mkdocs build --config-file ${BUILDDIR}/usr/share/doc/open-semantic-search/mkdocs.yml + +# +# Include solr-php-ui +# +cp -a src/solr-php-ui/etc ${BUILDDIR}/ + +mkdir -p ${BUILDDIR}/usr/share/solr-php-ui/ +cp -a src/solr-php-ui/src/* ${BUILDDIR}/usr/share/solr-php-ui/ + +# Move config from php directory config to systems config directory /etc +mv ${BUILDDIR}/usr/share/solr-php-ui/config/* ${BUILDDIR}/etc/solr-php-ui + +# link from deleted php directory to this new config destination +rmdir ${BUILDDIR}/usr/share/solr-php-ui/config +ln -s /etc/solr-php-ui/ ${BUILDDIR}/usr/share/solr-php-ui/config + + +# +# Include solr.deb +# + +# read $SOLR_VERSION and $SOLR_URL from config file solr-version.env + +source src/solr.deb/solr-version.env + +# if not yet there, download Solr binary release +if [ ! -f "src/solr.deb/usr/src/solr-$SOLR_VERSION.tgz" ]; then + mkdir src/solr.deb/usr + mkdir src/solr.deb/usr/src + echo "Downloading Solr" + wget -P src/solr.deb/usr/src/ $SOLR_URL +fi + +cp -a src/solr.deb/etc ${BUILDDIR}/ +cp -a src/solr.deb/var ${BUILDDIR}/ +cp -a src/solr.deb/usr ${BUILDDIR}/ + + +# +# Include solr-synonames +# + +mkdir -p ${BUILDDIR}/usr/share/synonames +cp src/solr-synonames/aleph-elasticsearch/synonames.txt ${BUILDDIR}/usr/share/synonames/ +cp src/solr-synonames/synonames2solr.py ${BUILDDIR}/usr/lib/python3/dist-packages/ + + +# +# Include tika-server.deb +# + +# read $TIKA_VERSION and $TIKA_URL from config file tika-version.env +source src/tika-server.deb/tika-version.env + +# if not yet there, download Tika-server binary release +if [ ! -f "src/tika-server.deb/usr/share/java/tika-server-standard-$TIKA_VERSION.jar" ]; then + echo "Downloading Tika" + wget -P src/tika-server.deb/usr/share/java/ $TIKA_URL +fi + +cp -a src/tika-server.deb/etc ${BUILDDIR}/ + +mkdir -p ${BUILDDIR}/usr/share/java/ +cp src/tika-server.deb/usr/share/java/tika-server-standard-$TIKA_VERSION.jar ${BUILDDIR}/usr/share/java/ + +ln -s tika-server-standard-$TIKA_VERSION.jar ${BUILDDIR}/usr/share/java/tika-server-standard.jar + + +# set rights +chown -R root:root ${BUILDDIR}/ +chmod g+r ${BUILDDIR}/usr/share/java/tika-server* +chmod o+r ${BUILDDIR}/usr/share/java/tika-server* + + +# +# Include python-tika since no official Debian package yet +# + +# copy python-tika library to created python libraries directory +cp -a src/tika-python/tika ${BUILDDIR}/usr/lib/python3/dist-packages/ + +# +# Include Open Semantic Entity Search API +# + +cp -a src/open-semantic-entity-search-api/src/entity_import ${BUILDDIR}/usr/lib/python3/dist-packages/ +cp -a src/open-semantic-entity-search-api/src/entity_linking ${BUILDDIR}/usr/lib/python3/dist-packages/ +cp -a src/open-semantic-entity-search-api/src/entity_manager ${BUILDDIR}/usr/lib/python3/dist-packages/ +cp -a src/open-semantic-entity-search-api/src/entity_rest_api ${BUILDDIR}/var/lib/opensemanticsearch/ +cp -a src/open-semantic-entity-search-api/src/solr/* ${BUILDDIR}/var/solr/data/ + +# +# Include spacy-services.deb +# + +cp -a src/spacy-services.deb/etc ${BUILDDIR}/ +cp -a src/spacy-services.deb/src/spacy-services ${BUILDDIR}/usr/lib/python3/dist-packages/ + + +# +# Include Solr Relevance Ranking Analysis Tool +# + +cp -a src/solr-relevance-ranking-analysis/src/solr_relevance_ranking_analysis ${BUILDDIR}/var/lib/opensemanticsearch/ + + +# +# Include Open Semantic Visual Linked Data Explorer +# + +cp -a src/open-semantic-visual-graph-explorer/src/* ${BUILDDIR}/var/lib/opensemanticsearch/ + +# and its base / dependencies cytoscape.js and cytoscape.js-panzoom +mkdir ${BUILDDIR}/var/lib/opensemanticsearch/visual_graph_explorer/static/ +cp -a src/cytoscape.js/dist/* ${BUILDDIR}/var/lib/opensemanticsearch/visual_graph_explorer/static/ +cp -a src/cytoscape.js-panzoom/cytoscape-panzoom.js ${BUILDDIR}/var/lib/opensemanticsearch/visual_graph_explorer/static/ +cp -a src/cytoscape.js-panzoom/cytoscape.js-panzoom.css ${BUILDDIR}/var/lib/opensemanticsearch/visual_graph_explorer/static/ +cp -a src/cytoscape.js-panzoom/font-awesome-4.0.3 ${BUILDDIR}/var/lib/opensemanticsearch/visual_graph_explorer/static/ + +# +# Include Solr-Ontology-Tagger +# + +cp -a src/solr-ontology-tagger/src/* ${BUILDDIR}/usr/lib/python3/dist-packages/ + + +# +# Build deb +# + +dpkg -b ${BUILDDIR} ${PACKAGE} diff --git a/docker-compose.etl.test.yml b/docker-compose.etl.test.yml new file mode 100644 index 0000000..29c6457 --- /dev/null +++ b/docker-compose.etl.test.yml @@ -0,0 +1,84 @@ +version: '3' +services: + + # system under test (sut) + sut: + image: opensemanticsearch/open-semantic-etl + command: /usr/lib/python3/dist-packages/opensemanticetl/testdata/run_integrationtests.sh + build: + context: src/open-semantic-etl/ + depends_on: + - apps + - rabbitmq + - solr + - tika + - tika-fakecache + - spacy-services + environment: + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_METADATA_SERVER=http://apps/search-apps/annotate/json + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + - OPEN_SEMANTIC_ETL_TIKA_SERVER_FAKECACHE=http://tika-fakecache:9998 + - OPEN_SEMANTIC_ETL_SPACY_SERVER=http://spacy-services:8080 + - OMP_THREAD_LIMIT=1 + volumes: + - test_cache_tesseract:/var/cache/tesseract + + apps: + image: opensemanticsearch/open-semantic-search + build: + context: . + depends_on: + - rabbitmq + - solr + - tika + environment: + - SOLR_PHP_UI_SOLR_HOST=solr + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + - OPEN_SEMANTIC_ETL_TIKA_SERVER_FAKECACHE=http://tika-fakecache:9998 + # uncomment next two lines, if you want access the web UI at host port 8080 + # ports: + # - "8080:80" + + solr: + image: opensemanticsearch/solr + build: + context: src/solr.deb/ + # uncomment next two lines, if you want access the Solr API and admin UI on host IP + # ports: + # - "8983:8983" + + tika: + image: opensemanticsearch/tika-server + build: + context: src/tika-server.deb/ + environment: + - OMP_THREAD_LIMIT=1 + - TIKA_CONFIG=/etc/tika/tika-config-cache.xml + volumes: + - test_cache_tesseract:/var/cache/tesseract + + tika-fakecache: + image: opensemanticsearch/tika-server + build: + context: src/tika-server.deb/ + environment: + - OMP_THREAD_LIMIT=1 + - TIKA_CONFIG=/etc/tika/tika-config-fakecache.xml + volumes: + - test_cache_tesseract:/var/cache/tesseract + + spacy-services: + image: opensemanticsearch/spacy-services + build: + context: src/spacy-services.deb/src/spacy-services/ + + rabbitmq: + image: rabbitmq + + +volumes: + test_cache_tesseract: diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..70c1b6d --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,61 @@ +version: '3' +services: + sut: + build: + context: . + dockerfile: Dockerfile-test + command: jest test + depends_on: + - apps + + apps: + image: opensemanticsearch/open-semantic-search + build: + context: . + depends_on: + - rabbitmq + - solr + - tika + environment: + - SOLR_PHP_UI_SOLR_HOST=solr + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + + etl: + image: opensemanticsearch/open-semantic-etl + build: + context: src/open-semantic-etl/ + depends_on: + - apps + - rabbitmq + - solr + - tika + - spacy-services + environment: + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_METADATA_SERVER=http://apps/search-apps/annotate/rdf?uri=[uri] + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + - OPEN_SEMANTIC_ETL_SPACY_SERVER=http://spacy-services:8080 + - OMP_THREAD_LIMIT=1 + + solr: + image: opensemanticsearch/solr + build: + context: src/solr.deb/ + + tika: + image: opensemanticsearch/tika-server + build: + context: src/tika-server.deb/ + environment: + - OMP_THREAD_LIMIT=1 + + spacy-services: + image: opensemanticsearch/spacy-services + build: + context: src/spacy-services.deb/src/spacy-services/ + + rabbitmq: + image: rabbitmq diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..053c278 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,134 @@ +version: '3' +services: + + apps: + image: opensemanticsearch/open-semantic-search + build: + context: . + depends_on: + - rabbitmq + - solr + - tika + volumes: + - config_etl:/etc/opensemanticsearch + - config_solr-php-ui:/etc/solr-php-ui + # Django sqlite DB for settings and thesaurus + - data_db:/var/opensemanticsearch/db + # Ontologies uploaded to Django web app and thumbnails generated by ETL + - data_media:/var/opensemanticsearch/media + environment: + - SOLR_PHP_UI_SOLR_HOST=solr + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + - OPEN_SEMANTIC_ETL_TIKA_SERVER_FAKECACHE=http://tika-fakecache:9998 + - OPEN_SEMANTIC_ETL_SPACY_SERVER=http://spacy-services:8080 + - OPEN_SEMANTIC_ETL_NEO4J_HOST=neo4j + - FLOWER_URL=http://flower:5555/flower + env_file: + - neo4j.env + ports: + - "8080:80" + + etl: + image: opensemanticsearch/open-semantic-etl + build: + context: src/open-semantic-etl/ + depends_on: + - apps + - rabbitmq + - solr + - tika + - tika-fakecache + - spacy-services + environment: + - OPEN_SEMANTIC_ETL_MQ_BROKER=amqp://rabbitmq + - OPEN_SEMANTIC_ETL_METADATA_SERVER=http://apps/search-apps/annotate/json + - OPEN_SEMANTIC_ETL_SOLR=http://solr:8983/solr/ + - OPEN_SEMANTIC_ETL_TIKA_SERVER=http://tika:9998 + - OPEN_SEMANTIC_ETL_TIKA_SERVER_FAKECACHE=http://tika-fakecache:9998 + - OPEN_SEMANTIC_ETL_SPACY_SERVER=http://spacy-services:8080 + - OPEN_SEMANTIC_ETL_NEO4J_HOST=neo4j + - OMP_THREAD_LIMIT=1 + env_file: + - neo4j.env + volumes: + # read only (:ro), since workers don't need to change the config (is done only by admin or web ui in container apps) + - config_etl:/etc/opensemanticsearch:ro + # write access to persistent thumbnails dir + - data_media:/var/opensemanticsearch/media + - cache_tesseract:/var/cache/tesseract + + solr: + image: opensemanticsearch/solr + build: + context: src/solr.deb/ + environment: + - SOLR_LOCAL_HOST=0.0.0.0 + volumes: + - data_solr:/var/solr + + # uncomment next two lines, if you want access the Solr API and admin UI on host IP + #ports: + # - "8983:8983" + + tika: + image: opensemanticsearch/tika-server + build: + context: src/tika-server.deb/ + environment: + - OMP_THREAD_LIMIT=1 + - TIKA_CONFIG=/etc/tika/tika-config-cache.xml + volumes: + - cache_tesseract:/var/cache/tesseract + + tika-fakecache: + image: opensemanticsearch/tika-server + build: + context: src/tika-server.deb/ + environment: + - OMP_THREAD_LIMIT=1 + - TIKA_CONFIG=/etc/tika/tika-config-fakecache.xml + volumes: + - cache_tesseract:/var/cache/tesseract + + spacy-services: + image: opensemanticsearch/spacy-services + build: + context: src/spacy-services.deb/src/spacy-services/ + + rabbitmq: + image: rabbitmq + + flower: + image: mher/flower + environment: + - CELERY_BROKER_URL=amqp://rabbitmq + - FLOWER_PORT=5555 + - FLOWER_URL_PREFIX=flower + depends_on: + - rabbitmq + + neo4j: + image: neo4j + restart: always + env_file: + - neo4j.env + volumes: + - data_neo4j:/data + + # Cron service to enable crawlers to start + cron: + image: opensemanticsearch/cron + build: + context: . + dockerfile: Dockerfile-cron + +volumes: + config_etl: + config_solr-php-ui: + data_db: + data_media: + data_neo4j: + data_solr: + cache_tesseract: diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..59097a0 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# docker-entrypoint for opensemanticsearch/open-semantic-search + +OPEN_SEMANTIC_SEARCH_VERSION="21.12.28" +echo $OPEN_SEMANTIC_SEARCH_VERSION > /etc/opensemanticsearch/version + +cp -na /var/lib/opensemanticsearch/etc-volume/. /etc/opensemanticsearch/ +cp -na /var/lib/opensemanticsearch/var-volume/. /var/opensemanticsearch/ + +# Copy default config from php directory config to systems config directory /etc +cp -na /usr/share/solr-php-ui/etc-volume/. /etc/solr-php-ui/ + +# allow Django running in apache2 context to write facets config +chgrp www-data /etc/opensemanticsearch/facets +chmod g+rw /etc/opensemanticsearch/facets + +# allow Django running in apache2 context to write ETL config +chgrp www-data /etc/opensemanticsearch/etl-webadmin +chmod g+rw /etc/opensemanticsearch/etl-webadmin + +# allow Django running in apache2 context to write OCR dictionary +chown www-data:www-data /etc/opensemanticsearch/ocr/dictionary.txt +chmod o+r /etc/opensemanticsearch/ocr/dictionary.txt + +# allow Django running in apache2 context to write UI config +chgrp www-data /etc/solr-php-ui/config.webadmin.php +chmod g+rw /etc/solr-php-ui/config.webadmin.php +chgrp www-data /etc/solr-php-ui/config.facets.php +chmod g+rw /etc/solr-php-ui/config.facets.php + +# create or upgrade DB +mkdir -p /var/opensemanticsearch/db +python3 /var/lib/opensemanticsearch/manage.py migrate + +# allow Django running in apache2 context to read and write the database +chown -R www-data:www-data /var/opensemanticsearch + +# but others should not be able to read DB entries +chmod -R o-rwx /var/opensemanticsearch/db + +# write Open Semantic ETL config and Solr PHP UI config by settings of web admin ui / in Django DB +python3 /var/lib/opensemanticsearch/manage.py configs + +# setup facets/classes in Open Semantic ETL config and index entities in Open Semantic Entity Search API +python3 /var/lib/opensemanticsearch/manage.py entities + +# Start apache2 +/usr/sbin/apache2ctl -D FOREGROUND diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..e55a025 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,173 @@ +--- +title: Open-Source Search Engine with Apache Lucene / Solr +authors: + - Markus Mandalka +--- + +# Open-Source Search Engine with Apache Lucene / Solr + +*Provides integrated research tools for easier searching, monitoring, analytics, discovery & text mining (of heterogenous & large document sets & news) with free software on your own server.* + + + +### Search engine (Fulltext search) + + +[Easy full text search](../doc/search) across multiple data sources and many different file formats. Just enter a search query (which can include [powerful search operators](../doc/search/operators)) and navigate through the results. + + + + +### Thesaurus & Grammar (Semantic search) + + +Based on a [thesaurus](../doc/datamanagement/thesaurus) the multilingual semantic search engine will find [synonyms, hyponyms and aliases](../doc/search/fuzzy#synonyms), too. Using heuristics for [grammar rules like stemming](../doc/search/fuzzy#stemming) it can find other word forms, too. + + + + +### Interactive filters (Faceted search) + + + +Easy navigation through many results with [interactive filters](../doc/search#faceted_search) (faceted search) which aggregate an overview over and interactive filters for (meta) data like authors, organizations, persons, places, dates, products, tags or document types. + + + + + +### Exploration, browsing & preview (Exploratory search) + + + +Explore your data or search results with an [overview of aggregated search results](../doc/search#faceted_search) by different facets with [named entities (i.e. file paths, tags, persons, locations, organisations or products)](../doc/datamanagement/thesaurus), while browsing with comfortable navigation through search results or document sets. +View previews (i.e. PDF, extracted Text, Table rows or Images). +Analyze or review document sets by preview, extracted text or [wordlists for textmining](../doc/analytics/textmining). + + + + + +### Collaborative annotation & tagging (Social search & collaborative filtering) + + + +[Tag your documents with keywords, categories, names or text notes](../doc/datamanagement/annotation "Tagging and annotation") that are not included in the original content to find them better later (document management & knowledge management) or in other research or search contexts or to be able to filter annotated or tagged documents by interactive filters (faceted search). + +Or evaluate, value or assess or filter documents (i.e. for validation or collaborative filtering). + + + + + +### Data Visualization (Dataviz) + + + +Visualizing data such as: +- document dates as [trend charts](../doc/analyze/trend) +- [text analysis](../doc/analyze/textmining) as [word clouds](../doc/analyze/words) +- [connections and networks in visual graph view](../doc/analytics/graph) +- view results with [geodata as interactive maps](../doc/analytics/map). + + + + + +### Monitoring: Alerts & Watchlists (Newsfeeds) + + + +Stay informed via watchlists for: +- news alerts from media monitoring +- activity streams of new or changed documents on file shares + +You can subscribe to searches and filters as RSS-Newsfeed and get notifications when there are changed or new documents, news or search results for your keywords, search context or filter. + + + + + + + +### Supports different file formats + + +Open Semantic Search can help you index and search your data whether you are working with: +- [structured data like databases, tables or spreadsheets](../doc/search/table) +- [unstructured data like text documents](../doc/analytics/textmining) +- E-Mails +- even scanned legacy documents +- text files +- Microsoft Office, OpenOffice, and LibreOffice docuemnts including Excel and Calc +- PDF +- CSV +- Images (photos, pictures, JPG, TIFF) +- Videos + +And that isn't all, see a full list of [supported file formats](http://tika.apache.org/1.13/formats.html). + + + + + +### Supports multiple data sources + + +You can find all your data in one place. Search many different [data sources](../doc/admin/connectors) like [files and folders, file server, file shares](../connector/files), [databases](../connector/db), websites, Content Management Systems, [RSS-Feeds](../doc/datamanagement/rss) and more. + +The Connectors and Importers of the [Extract Transform Load (ETL) framework for Data Integration](../etl) connect and combine multiple data sources and, as an integrated [document analysis and data enrichment](../doc/data_enrichment) framework, it enhances the data with the analysis results of diverse analytics tools. + + + + + +### Automatic text recognition + + + +[Optical character recognition (OCR) or automatic text recognition for images](../doc/admin/config/ocr) and text content stored in graphical format like scanned legacy documents, screenshots or photographed documents in the form of image files or embedded in PDF files. + + + + + + + +--- + + + +## Open-Source enterprise search and information retrieval technology based on interoperable open standards + + + +### Mobile (Responsive Design) + + + +Open Semantic Search can be used with every desktop (Linux, Windows or Mac) and web browser. With its [responsive design](http://foundation.zurb.com "Powered by Zurb Foundation") and open standards like HTML5 it is possible to search with tablets, smartphones and other mobile devices as well. + + + + + +### Metadata management (RDF) + + +Structure your research, investigation, navigation, document sets, collections, metadata forms or notes in a Semantic Wiki, Drupal or another content management system (CMS) or with an innovative annotation framework with taxonomies and custom fields for tagging documents, annotations, linking relationships, mapping and structured notes. You can integrate powerful and flexible metadata management or annotation tools using interoperable open standards like the Resource Description Framework (RDF) and the Simple Knowledge Organization System ([SKOS](https://www.w3.org/TR/skos-primer)). + + + + + +### Filesystem monitoring + + + +Using [file monitoring](../trigger/filemonitoring), new or changed files are indexed within seconds without requiring frequent recrawls (which is not possible often if there are many files). +Colleagues are able to find new data immediately without (often forgotten) uploads to a data or document management system (DMS) or filling out a data registration form for each new or changed document or dataset in a data management system, data registry or digital asset management (DAM) system. + + + + diff --git a/docs/connector/db/README.md b/docs/connector/db/README.md new file mode 100644 index 0000000..625a72e --- /dev/null +++ b/docs/connector/db/README.md @@ -0,0 +1,43 @@ +--- +title: Full text search, faceted search & textmining in a database (SQL DB) +authors: + - Markus Mandalka +--- + +# Full text search, faceted search & textmining in a database (SQL DB) + + +## Connectors for Relational Database Management Systems (RDBMS) & Structured Query Lanaguage (SQL) to Solr or Elastic Search + + +To be able to use simple and powerful [search user interfaces (UI)](../../doc/search) for [full text search](../../doc/search), faceted search, semantic search and ontology or thesaurus based [text mining](../../doc/analytics/textmining) research tools (on structured data from fields of a SQL database), import their tables to the search index: + +## Index SQL databases like MySQL or Postgresql + + +There are multiple ways (open source connectors) for importing SQL databases like MySQL, MariaDB, PostgreSQL and other SQL databases based on Structured Query Language (SQL) or supported by Open Database Connectivity (ODBC) or Java DataBase Connectivity (JDBC) to an Apache Solr index: + +## Import SQL database to Solr search index + + +Free Software for indexing SQL to Apache Solr: +* [Apache Manifold JDBC Connector](http://manifoldcf.apache.org/release/trunk/en_US/end-user-documentation.html#jdbcrepository) +* [Apache Nifi](https://nifi.apache.org/) - Read from `ExecuteSQL` and write to Solr index +* Setup the built in [RDBMS data import handler](http://wiki.apache.org/solr/DataImportHandler#Usage_with_RDBMS) for your database +* Export your database to a CSV format and use the build in the CSV import of Solr +* Write a short Python script for database import based on [Open Semantic ETL](../../etl) with a concrete SQL query, write the columns to the `data` variable (data type is a Python dictionary i.e. `data['columnname'] = columnvalue`) and export/write it to the index by calling `etl.process(data=data)` +* Other [Extract Transform Load (ETL) - Frameworks](../../etl) like Talend Open Studio + + +## Import SQL database to Elastic Search index + + +Free Software for indexing SQL to Elastic Search: +* [Apache Manifold JDBC Connector](http://manifoldcf.apache.org/release/trunk/en_US/end-user-documentation.html#jdbcrepository) +* [Apache Nifi](https://nifi.apache.org/) - Read from `ExecuteSQL` and write to Elastic Search index +* [Elastic search JDBC Importer](https://github.com/jprante/elasticsearch-jdbc) +* Export your database to a CSV format and use the build in CSV import of Solr +* Write a short Python script for database import based on [Open Semantic ETL](../../etl) with a concrete SQL query, write the columns to the `data` variable (data type is a Python dictionary i.e. `data['columnname'] = columnvalue`) and export/write it to the index by calling `etl.process(data=data)` +* Other [Extract Transform Load (ETL) - Frameworks](../../etl) like Talend Open Studio + + diff --git a/docs/connector/files/README.md b/docs/connector/files/README.md new file mode 100644 index 0000000..b1374c6 --- /dev/null +++ b/docs/connector/files/README.md @@ -0,0 +1,52 @@ +--- +title: Crawl and index files, file folders or file servers +authors: + - Markus Mandalka +--- + +# Crawl and index files, file folders or file servers + + +## How to index files like Word documents, PDF files and whole document folders to Apache Solr or Elastic Search? + +This connector and command line tools crawl and index directories and files from your filesystem and index it to [Apache Solr](../../etl/export/solr) or [Elastic Search](../../etl/elasticsearch) for [full text search](../../doc/search) and [text mining](../../doc/analytics/textmining). + +If you use Linux that means you can crawl whatever is mountable to Linux into an Apache Solr or Elastic Search index or into a triplestore. + +## Index different file system types to Solr or Elastic Search + +This can be a hard disk or: +- partitions formatted with *fat*, *ext3*, *ext4* +- a file server connected via *ntfs* +- file shares like *smb* or even *sshfs* or *sftp* on servers +- private file sharing services like Seafile or OwnCloud on your own servers +- Dropbox, Amazon or other storage services in the cloud. + +## Data enrichment by different data analytic tools + +This connector integrates enhanced data enrichment and data analysis plugins like automatic text recognition (OCR) for images and photos (i.e. as files like PNG, JPG, GIF ...) or inside PDFs (i.e.scanned Documents) using Tesseract OCR. + +## Usage + +Index a file or directory: + +### Web admin interface + +Using the web admin interface +* Open the page *Files* +* Enter *filename* to the form +* Press button "crawl" + +### Command line + +Using the command line interface (CLI): +`opensemanticsearch-index-file *filename*` + +### API + +Using the REST-API: +`http://127.0.0.1/search-apps/api/index-file?uri=*/home/opensemanticsearch/readme.txt*` + +## Config + +Config file for indexing files: `*/etc/opensemanticsearch/connector-files*` diff --git a/docs/connector/files/pdf/README.md b/docs/connector/files/pdf/README.md new file mode 100644 index 0000000..3ebbbaf --- /dev/null +++ b/docs/connector/files/pdf/README.md @@ -0,0 +1,59 @@ +--- +title: Index PDF files for search and text mining with Solr or Elastic Search +authors: + - Markus Mandalka +--- + +# Index PDF files for search and text mining with Solr or Elastic Search + + +## How to index a PDF file or many PDF documents for full text search and text mining + + + +You can [search](../../../doc/search) and do [textmining](../../../doc/analytics/textmining) with the content of many PDF documents, since the content of PDF files is extracted and text in images were recognized by optical character recognition (OCR) automatically. + +## Indexing a PDF file to the Solr or Elastic Search + + +Therefore you have to index the PDF documents or file directories or file shares that contain PDF documents to the Solr or Elastic Search server index: + +### Desktop search + + +If you use [Open Semantic Desktop Search](../../../doc/desktop_search), just copy the PDF files to a directory that is indexed automatically or add the directory with the PDF files to shared folders for indexing and restart the virtual machine or press the "Index" button within the VM. + +### File monitoring + + +If you use an file share where [file monitoring](../../../trigger/filemonitoring) is active, just copy the PDF files to an monitored folder or file directory and wait, until they are indexed automatically. + +### Web admin interface + + + +Using the web admin interface +* Open the page *Files* +* Enter *filename* of the PDF file to the form +* Press button "crawl" + + +### Command line + + +Using the command line interface (CLI): +`opensemanticsearch-index-file *filename*` +### API + + +Using the REST-API within your tools, script or within your browser: +`http://127.0.0.1/search-apps/api/index-file?uri=*/home/opensemanticsearch/document.pdf*` +## Indexing a folder with PDF files to the Solr or Elastic Search + + +You can index whole folders with PDF documents to Apache Solr or Elastic Search the same way. Just use the name of the file directory or folder instead of a single file name. + +## Config + + +Config file for indexing files: `*/etc/opensemanticsearch/connector-files*` \ No newline at end of file diff --git a/docs/connector/hypothesis/README.md b/docs/connector/hypothesis/README.md new file mode 100644 index 0000000..5aefaef --- /dev/null +++ b/docs/connector/hypothesis/README.md @@ -0,0 +1,44 @@ +--- +title: Import Hypothesis web annotations, tags & documents to Solr and Elastic Search +authors: + - Markus Mandalka +--- + +# Import Hypothesis web annotations, tags & documents to Solr and Elastic Search + + +## Integration of Hypothesis with Solr & Elastic Search + +The [integrated Open Source visual annotation tool](../../doc/datamanagement/annotation/hypothesis) [Hypothesis](https://hypothes.is) provides a powerful visual user interface for (collaborative) web annotation and tagging by human editors (including teams and groups) that supports not only tagging documents and adding page notes, but allows you to annotate documents and web pages within the text, even for single words, names, parts of sentences, sentences or paragraphs. + +## Import annotations and tags from Hypothesis for semantic search, faceted search, analytics & textmining + +By the **web user interface** for **configuration of datasources** in the **tab Hypothesis** you can easily **setup the import / indexing of annotations, tags and annotated documents from the Hypothesis API** to the Solr or Elasticsearch search index for data enrichment of indexed documents in search index by hypothesis annotations and tags: + +![](../../screenshots/hypothesis_import.png) + +If you want to import private annotations, you must setup your private API token. You can find it in the settings menu "developer" when logged in to hypothes.is: + +![](../../screenshots/hypothesis_config.png) + +## Filters + +In the tab filter(s) you can set from which user or group annotations should be imported. If you are using the public hypothesis web service, you must set such a filter to prevent import of all public annotations from all users of the web service. + +## Full text search in document content with annotations and text + +After setup of Hypothesis as a datasource and the first run of the import you can search with full text search the full document content combined/enriched with your notes and tags. + +## Faceted search and interactive filters by Hypothesis tags + +Additionally you get interactive filters for faceted search, text analytics and text mining by your hypothes.is tags. + +## Automatic named entity recognition / named entity extraction for tagged or annotated documents and web pages + +Additionally automatic analysis like Named Entity Recognition / automatic extraction of persons, organizations and places by machine learning will be done automatically for documents and web pages you tagged with Hypothesis. + +## Limitations + +Since Hypothesis doesn't support an export to standards like RDF (yet?), there is another plugin for the hypothesis API. The plugin is in early development, so there are some limitations yet: + +Until implementation of API paging within the next weeks, the plugin imports only the last 200 annotations per user or group. So you have to set the delta time to a period where your last annotations are within this limit. diff --git a/docs/connector/rdf/README.md b/docs/connector/rdf/README.md new file mode 100644 index 0000000..a90b5c0 --- /dev/null +++ b/docs/connector/rdf/README.md @@ -0,0 +1,55 @@ +--- +title: How to index Linked Data from Resource Description Framework (RDF) to Solr or Elastic Search +authors: + - Markus Mandalka +--- + +# How to index Linked Data from Resource Description Framework (RDF) to Solr or Elastic Search + + +## Import and index linked data from semantic knowledge graph for full text search, faceted search and text mining + +The open source extract transform load (ETL) plugin `enhance_rdf` is for granular indexing of Resource Description Framework (RDF) knowledge graphs. It is a data enrichment plugin for RDF files or a RDF connector for SPARQL endpoints or triplestores. + +Since files in [Resource Description Framework (RDF)](https://www.w3.org/RDF/) format are a structured graph and more like a dataset or database with multiple or many different entries than a single document, it doesn't extract and index a RDF file as one whole single file or standard document files. + +It is indexing the RDF data more granular by distinguishing different entities or RDF subjects: + +## Aggregates RDF triples to Solr or Elastic search documents + +For each entity or RDF subject in all RDF triples it generates a searchable semi-structured (for faceted search) but text based (for full text search) document with the content type *[knowledge graph](../../doc/search/graph)*. + +In other words it creates for each entity or subject from the RDF graph a database row with columns for each property containing all readable and searchable text. + +Therefore it indexes each URI/subject as a Solr or Elastic Search document with its properties (RDF predicates) as facets/fields/database columns and its objects (RDF objects) as values. + +## Transform references like URIs to human readable and searchable labels + +For full text search capabilities this ETL plugin transforms referenced URIs to their label(s), i.e. from properties like [`rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label) or [SKOS labels](https://www.w3.org/TR/skos-reference/#labels) from a [Simple Knowledge Organisation System (SKOS) based thesaurus](../../doc/datamanagement/thesaurus). + +## User interfaces for full text search, faceted search, fuzzy search & text analysis in linked data knowledge graphs + +So you can easily use [search user interfaces (UI) for full text search, interactive filters (faceted search) & text mining on Resource Description Framework (RDF) knowledge graphs](../../doc/search/graph) + +## How to import and index a linked data graph from a file in a Resource Description Framework (RDF) + +The RDF enhancer plugin (free open source software) is enabled if not disabled by exclude `enhance_rdf` from `config['plugins']`. + +**Index the RDF file** by one of the following methods or tools for [indexing files](../files): +* copy it to a folder that is configured for indexing in your desktop search environment +* copy it to a folder with active file monitoring +* use the [command line tool `opensemanticsearch-index-file`](../../doc/admin/cmd) +* or call the [file indexing API](../files) in a scheduler like Cron or from your own tools and scripts + +## How to import and index linked data from a graph database or triple store (SPARQL) + +Use the command line tool `etl\sparql` to import graphs or parts of graphs from triple stores like Apache Jena using SPARQL queries. + +`opensemanticsearch-index-sparql *endpoint* "*SPARQL query*"` + +## Open Source tools for import RDF to Solr or Elastic Search + +Alternate free software and open source tools for import of RDF data or SPARQL results to [Solr](../../etl/export/solr) or [Elastic Search](../../etl/export/elasticsearch): +* [SolrRDF](https://github.com/agazzarini/SolRDF) - Solr plugin for RDF +- [Elastic Search River for RDF](https://github.com/eea/eea.elasticsearch.river.rdf) +- [Elastic Search Plugin for importing RDF from Apache Jena](https://github.com/jprante/elasticsearch-plugin-rdf-jena) diff --git a/docs/connector/rss/README.md b/docs/connector/rss/README.md new file mode 100644 index 0000000..97b2a94 --- /dev/null +++ b/docs/connector/rss/README.md @@ -0,0 +1,42 @@ +--- +title: RSS-Feed or Newsfeed +authors: + - Markus Mandalka +--- + +# RSS-Feed or Newsfeed + + +Indexing a RSS-Newsfeed to Solr. + +Will download and index the linked websites or documents, not only the content of the rss (often only teaser). + + +## Usage + + +### Using the web user interface *RSS-Feed manager* + + +If you want to manage many feeds and import feeds periodically, you might want to use the [web user interface RSS-Feed manager](../../doc/datamanagement/rss). + +### Using the web admin interface + + +* Open the page *RSS-Feeds* +* Enter the URL of the feed to the form +* Press button "crawl" + + +### Using the commandline + + +`opensemanticsearch-index-rss *http://www.opensemanticsearch.org/feed*` +### Using the REST-API + + +`http://127.0.0.1/search-apps/api/index-rss?uri=*http://www.opensemanticsearch.org/feed*` +## Alternates + + +You can use Apache ManifoldCF to import RSS-Feeds into to Solr. \ No newline at end of file diff --git a/docs/connector/scraper/README.md b/docs/connector/scraper/README.md new file mode 100644 index 0000000..0dc0497 --- /dev/null +++ b/docs/connector/scraper/README.md @@ -0,0 +1,31 @@ +--- +title: Web scraping: Extract structured data from websites +authors: + - Markus Mandalka +--- + +# Web scraping: Extract structured data from websites + + +## Import structured data scraped from websites to the search server + + +[This connector](http://searchhub.org/2013/06/13/indexing-web-sites-in-solr-with-python/) integrates the Open-Source Scraping-Framework [Scrapy](http://www.scrapy.org), a Python framework for ETL (Extract, transform and load) to build a customized crawler, parser, data scraper and converter for extracting structured data from websites. + +This is for websites which don't yet offer their data in structured open standard formats (like RDF, XML, JSON or CSV for which there are comfortable and easy to use connectors yet), so we have to extract all data from HTML pages with a more complicated individual scraper. + +## Where to write the data: Solr dynamic fields + + +If you don't want to use standard fields like title, author and content you don't have to change the config file schema.xml (which defines the fields of the Solr index). + +Our Solr server is preconfigurated with [dynamic fields](https://cwiki.apache.org/confluence/display/solr/Dynamic+Fields) so that you can fill standard fields like title or content or additional dynamic fields like *yourfield\_b* for one boolean, *yourfield\_bs* for booleans, *yourfield\_s* for a string and *yourfield\_ss* for some strings or *yourfield\_t* for a text or *yourfield\_tt* for some texts to be filled with data. + +Have a look at `schema.xml` or managed-schema to see all possible data types of dynamic fields, like boolean, string, dates, text and so on. + +## Enable new fields or facets in the user interface + + +If you did not use preconfigurated fields like tags (fieldname is *tag\_ss*) and want to use them not only to find data but as interactive filters (facets) for the navigation: + +To enable your own additional fields as facets (interactive filters) in the user interface just [map the technical Solr fieldnames to user friendly labels in the config of the user interface with the option *$cfg[facet]*](../../doc/admin/config). \ No newline at end of file diff --git a/docs/connector/web/README.md b/docs/connector/web/README.md new file mode 100644 index 0000000..d3a1cbd --- /dev/null +++ b/docs/connector/web/README.md @@ -0,0 +1,43 @@ +--- +title: Crawler for indexing websites +authors: + - Markus Mandalka +--- + +# Crawler for indexing websites + + +## Index a single Webpage + + +You can index a single webpage (or image or pdf file on a webserver, including automatic text recognition by OCR, if enabled in the connector config `/etc/opensemanticsearch/connector-web`): + +### Start indexing by web interface + + +To start indexing a single web page via the web interface (i.e. *http://localhost/search/admin/crawl*): + +Just write the url into the uri field and submit the form. + +### Command line tool + + +Or use or integrate (i.e. in a crontab or in your own scripts) this command line tool: +`opensemanticsearch-index-web *http://www.opensemanticweb.org/*` + +### REST-API + + +Using the REST-API: +`http://127.0.0.1/search-apps/api/index-web?uri=*http://www.opensemanticsearch.org/*` + +## Crawl whole websites or parts of a website + + +You can index a whole website with the web crawler module of Apache ManifoldCF. + +With its web interface you can setup a homepage, a sitemap or a RSS-Feed as the start point and set how deep the crawl should be. + +Its possible to setup rules which parts to crawl and which to exclude. + +Another software for crawling a website is Scrapy (see [documentation on using Scrapy with Open Semantic Search](../scraper/README.md)). \ No newline at end of file diff --git a/docs/dev/README.md b/docs/dev/README.md new file mode 100644 index 0000000..fd21184 --- /dev/null +++ b/docs/dev/README.md @@ -0,0 +1,52 @@ +--- +title: Development of free open source search engine software +authors: + - Markus Mandalka +--- + +# Development of free open source search engine software + + +## Free Software + +Open Semantic Search is Open Source software based on Apache Lucene / Solr Enterprise Search and Python. You are allowed to read, to change and to extend the source code. + +## Source code + +The source code is included within the packages. + +There is a [git repository on Github](https://github.com/opensemanticsearch). + +## Contact the developers + +Contant interested free software developers directly: + +E-Mail: info ät opensemanticsearch.org + +Communicate to or work on the open source software project on Github: + +[Open Semantic Search project on Github](https://github.com/opensemanticsearch) + +## Architecture + +* [Software architecture: Components, services, modules and plugins](../doc/modules) + +## Search or read data for additional applications + +If you use Solr as your database or index, use the [Rest-API of Solr](http://lucene.apache.org/solr/quickstart.html#searching) for searching or / and getting data in XML or [JSON](https://cwiki.apache.org/confluence/display/solr/Using+JavaScript) format or use [Solr Client APIs](https://cwiki.apache.org/confluence/display/solr/Client+APIs) to get data with your favorite programming language. + +Or if you use a triple store as database use its standard SPARQL interface. + +## Libraries for different programming languages + +* [Libraries, bindings, and modules that exist for the explicit purpose of integrating Solr with other applications or programming languages](https://cwiki.apache.org/confluence/display/solr/IntegratingSolr) + +## Data enrichment and data analysis plugins + +* [Development of own Solr plugins](https://cwiki.apache.org/confluence/display/solr/SolrPlugins) +* [Development of own data enrichment plugins](enhancer) +* [Development of own data enrichment plugins with Python](enhancer/python) + +## Roadmap + +[Plans for the future](roadmap). \ No newline at end of file diff --git a/docs/dev/enhancer/README.md b/docs/dev/enhancer/README.md new file mode 100644 index 0000000..e2fdd43 --- /dev/null +++ b/docs/dev/enhancer/README.md @@ -0,0 +1,15 @@ +--- +title: Developing own data analysis and data enrichment plugins +authors: + - Markus Mandalka +--- + +# Developing data analysis and data enrichment plugins + +There are different ways to [enrich data](../../doc/data_enrichment "Document processing, contet analysis and data enrichment pipeline") with custom enhancer plugins: + +* Write your own [data enrichment plugin for our connectors with a few lines of Python](python) code for our Open Semantic ETL framework. +* Data enrichment web service or API: Develop or use a web service or REST-API for additional data or analytics and read the results with our [RDF enhancer](../../enhancer/rdf) or call such a webservice in a custom Python data enrichment plugin. +* If you use Solr as your database or index, develop a [Plugin for the Solr Update Processor (i.e. in Javascript or in Java)](http://searchhub.org/2013/06/27/poor-mans-entity-extraction-with-solr/) +* Write your own [enhancer engine for Apache Stanbol](http://stanbol.apache.org/docs/trunk/components/enhancer/) in Java +* Write analysis or data enrichment in whatever programming language you use, read needed data from Solr, Elastic Search or SPARQL interface with programming libraries or tools of your choice and write your results into the index or database yourself, for example using the update mechanism (instead of an overwriting insert command) in Solr extending the existing document with additional values or fields / facets / properties instead of overwriting it with new values. diff --git a/docs/dev/enhancer/python/README.md b/docs/dev/enhancer/python/README.md new file mode 100644 index 0000000..2cc4dff --- /dev/null +++ b/docs/dev/enhancer/python/README.md @@ -0,0 +1,180 @@ +--- +title: How to develop your own Python plugin for data enrichment +authors: + - Markus Mandalka +--- + +# How to develop your own Python plugin for data enrichment + +## Example + +* Add a new python file to the enhancer directory +* Enable this plugin in your connector and +* Implement the object *myOwnEnhancerName* the function `process` with the parameters `parameters` and `data` which +* reads some parameters from variable parameters and +* write to the variable data to index your results: + +Example: + + +```python +import etl + +class myOwnEnhancerName(object): + + def process ( parameters={}, data={} ): + + # do some analyses, i.e. with text + uri\_length = len ( parameters['id'] ) + + #write some analysis results to the index into a facet + etl.append(data, facet='uri\_length\_i', values=uri\_length) + + #return results + return parameters, data +``` + +## Plugin directory + +Save your enhancer `*myOwnEnhancerName*.py` into the subdir `etl` of your in python library directory (i.e. `/usr/lib/python2.7/`). + +## Config + +Add your enhancer to the enhancer chain in the config of your connector(s), which shall enhance their data with it: + +### Enable your data enrichment plugin + +Add the plugin name to the config of the connector, for example in `/etc/opensemanticsearch/connector-files`: + +`config['plugins'].append('*myOwnEnhancerName*')` + +### Custom config options for your plugin + +Optionally you can add your own config options, so you have more flexibility, because not everything has to be hard coded in your plugin. + +Example + +`config['myOwnEnhancerName'] = 'Own Enhancer'` + +Your plugin can read this config options from the variable [`parameters`](#parameters). + +## Variables + +### Read / set parameters from/to the variable `parameters` + +The variable `parameters` contains the config and some analysis results from enrichment plugins running before so you can use now as parameter for your plugin. + +For example you can run your plugin only for certain document types or mime types or run a language detection plugin before you use its result as a parameter for an OCR plugin. + +Example data: + +```python +print parameters +``` + +``` +{ + 'id: 'file:///documents/document.pdf', + 'content_type': 'application/pdf' +} +``` + +### Write results and values for indexing to the variable `data` + +The variable `data` is for adding facets and values to the index. + +To save and index your plugin's results, just add them to the variable `data`. + +Example: +```python +data['tags'] = 'myTopic' +data['location'] = 'Berlin' +``` + +So the variable `data` will look like this after running some enhancer plugins: + + +```python +print data +``` + +``` +{ + 'content_type': 'application/pdf', + 'filesize': 12345, + 'tags': {'Open Source', 'Free software'}, + 'email_ss': { 'info@opensemanticsearch.org', 'support@opensemanticsearch.org' } +} +``` + +## Functions + +### Process + +Implement the function `process` with the parameters `parameters` and `data`. + +If the plugin is enabled, this function will be called by the connector before indexing the document. + +```python +# ... + def process ( parameters={}, data={} ): + # do some analyses, i.e. with text + textsize = parameters[text'].size + + #write some analysis results to the index into a facet + opensemanticsearch\_connector.append(data, facet='textsize', values=textsize) + + #return + return parameters, data +``` + +You can use all Python functions and libraries for very easy or very complex analysis. + +### Append data + +Since if there are values for the same facet before because of another plugin running before and with the first example how to write results to the variable data, you would overwrite existing data and for adding data easier, you can use the function `etl.append` to add additional values from your analysis results to the index: + +`etl.append(data=data, facet = 'email', values = 'info@opensemanticsearch.org')` + +The parameter `values` can be a value like a integer or a string or multiple values as a python list. + +### Abort processing + +To abort further processing and final indexing you can set +`parameters['break'] = True` + +You can develop additional filters like, for example, the existing URL blacklist filter. + +## Another example plugin using regular expressions + +Here an example, how to extract the email-adresses and store it to the facet email with just a few lines of python code to enable exploratory search, interactive filters and aggregated overviews for email-addresses, too. Its only an programming example, since [extracting regular expressions](../../../enhancer/regex) is a standard plugin and to extract email-adresses its default config. + + +```python +# Data enrichment plugin for extracting email-adresses +# Extracting email adresses and write them to facet email\_ss + +# import the connector, so we can add our analysis to the indexed document +import opensemanticsearch\_connector + +# import python module for regular expressions +import re + +class enhance\_email(object): + def process ( parameters={}, data={} ): + + # regular expression matching email-adresses + regex = r'[\w\.-]+@[\w\.-]+' + + # facet / column where to store/index it + facet = "email" + + # find all emailadresses with a regular expression + matches = re.findall(regex, parameters['text']) + + if matches: + # add the list matches to the facet + opensemanticsearch\_connector.append(data, facet, matches) + + return parameters, data +``` \ No newline at end of file diff --git a/docs/doc/README.md b/docs/doc/README.md new file mode 100644 index 0000000..0c296fd --- /dev/null +++ b/docs/doc/README.md @@ -0,0 +1,53 @@ +--- +title: Documentation +authors: + - Markus Mandalka +--- + +# Documentation + + +## Documentation for users + + +### Usage + + +* [How to search and how to sort, explore and filter search results](search/README.md) + +* [Search operators](search/operators/README.md) + +* [Tagging and annotation](datamanagement/annotation/README.md) + +* [Adding structure for exploratory search, aggregated overviews and interactive filters with facets and named entities](datamanagement/README.md) + +* [(Fuzzy) Search for many entries with a list](search/list/README.md) + + +## Documentation for admins + + +### Getting started + +Quick start tutorial: + +[How to getting started](tutorial/README.md) + + +### Installation + +[How to install the search engine](admin/install/README.md) + +### Configuration + +[Configuration of the search engine](admin/config/README.md) + +### Administration + +[Administration of the search engine](admin/README.md) + +## Documentation for admins and developers + +### Modules + +* [Architecture and modules](modules/README.md) diff --git a/docs/doc/admin/README.md b/docs/doc/admin/README.md new file mode 100644 index 0000000..b92c195 --- /dev/null +++ b/docs/doc/admin/README.md @@ -0,0 +1,40 @@ +--- +title: Administration +authors: + - Markus Mandalka +--- + +# Administration + + +## Ingestion and indexing + +You can start import and indexing tasks + +* via web admin interface in the menu "*Datasources*" +* via [REST-API](rest-api/README.md) or +* via [command line interface (CLI)](cmd/README.md) + + +## Logging + +Where you find logs: + +[Logfiles](config/log/README.md) + + +## Task queue + +How to manage and monitor running imports, crawls and tasks: + +[Task queue management and monitoring](queue/README.md) + + +## Data storage + +Where you find stored data: + +[Data storage](storage/README.md) + + + diff --git a/docs/doc/admin/client/README.md b/docs/doc/admin/client/README.md new file mode 100644 index 0000000..da966fa --- /dev/null +++ b/docs/doc/admin/client/README.md @@ -0,0 +1,19 @@ +--- +title: Client integration +authors: + - Markus Mandalka +--- + +# Client integration + +## Browser integration + +To spare some seconds to call the search engine bookmark to get the search interface you can easily integrate the search with the web browser search field (i.e. Mozilla Firefox, Internet Explorer, Chrome or Opera) via the OpenSearch standard. + +## Desktop integrated search + +If you use Unity or Gnome as your Linux Desktop, you can integrate search results to the search lenses, so can search by pressing just a key and it will be fully integrated with your desktop instead of having to start a client or browser and call the URL. + +## Filemanager + +If you don't use [filesystem monitoring](../../../trigger/filemonitoring) for indexing all changes automatically, it is possible to integrate to start indexing files easily and comfortable with the context menu of your standard filemanager (i.e. Explorer in Windows or Nautilus in Debian or Ubuntu Linux). diff --git a/docs/doc/admin/cmd/README.md b/docs/doc/admin/cmd/README.md new file mode 100644 index 0000000..fd14f20 --- /dev/null +++ b/docs/doc/admin/cmd/README.md @@ -0,0 +1,84 @@ +--- +title: Command line interface (CLI) +authors: + - Markus Mandalka +--- + +# Command line interfaces (CLI) + +*Administration of Open Semantic Search via command line interface (CLI):* + +## Task queue + +Command line interfaces for managing tasks: + +[Task queue management](../queue/README.md) + + +## Indexing files + +### Index a file + +`opensemanticsearch-index-file filename` + +### Index directories + +`opensemanticsearch-index-dir directoryname` + +### Monitor files and directories + +Index changed files in realtime (no expensive recrawl needed): + +`opensemanticsearch-filemonitoring filename` + +Or monitor and index all new and changed files in a directory recursively (including subdirectories): + +`opensemanticsearch-filemonitoring directorynamename` + +### Monitor directories automatically + +If you installed the module `opensemanticsearch-trigger-filemonitoring-daemon` it will start automatically while booting and monitor all directories and files set in the config file `/etc/opensemanticsearch/filemonitoring`. + +# Indexing Newsfeeds + +## RSS-Newsfeeds + +Index full feed from RSS (download and index all articles linked in a RSS-Newsfeed). + +`opensemanticsearch-index-rss http://www.opensemanticsearch.org/feed` + +# Delete from index + +The delete tool will only delete data in the index once, so after new indexing or recrawl the deleted documents will be indexed again. + +If you want to exclude documents from indexing, you should use blacklisting instead. + +## Delete a web page from index + +`opensemanticsearch-delete http://www.opensemanticsearch.org/` + +## Delete a file from index + +`opensemanticsearch-delete file:///directory/file` + +## Empty the index + +Empty the index to get a new or empty index without indexed documents: + +`opensemanticsearch-delete --empty` + +# Start or stop services + +If you installed the Debian or Ubuntu packages, the services are started while booting automatically. + +They can be controlled via the linux command service: + +## Solr index service + +Start: + +`service solr start` + +Stop: + +`service solr stop` diff --git a/docs/doc/admin/config/README.md b/docs/doc/admin/config/README.md new file mode 100644 index 0000000..83b6d28 --- /dev/null +++ b/docs/doc/admin/config/README.md @@ -0,0 +1,137 @@ +--- +title: Config +authors: + - Markus Mandalka +--- + +# Config + +Standard installations and most parts should be usable out of the box without further configuration. + +Many config options are set by a web user interface in the menu *Configuration*: + +![](../../../screenshots/config.png) + +In most cases you don't have to configure complex (partially outdated) config file options described below: + +# Search server + +## Language of the index + +If your language is not english and you don't use a localized package or virtual machine: + +Most important because not changeable for yet indexed documents is to [change the language for stemming](stemming) before indexing documents. + +# User interface + +## Config file + +The config file of the user interface is ***/etc/solr-php-ui/config.php*** + +## Language of the user interface + +The default language is english. + +To switch the language of the user interface to german set the option ***$language*** to *de* + +``` +# Set language to german +$language = "de";` + +# Scheduler: Starting (re)crawls automatically +``` + +If you don't use [filemonitoring](../../../trigger/filemonitoring) (and even then you should sometimes recrawl, if something failed or was changed at a bad moment), you should recrawl data sources from time to time automatically. + +If you use our connectors and want the most flexibility then use Cron and add a Cronjob using our [command line tools](../cmd) into a Crontab or you can call our [webservice (REST-API)](../rest-api) from a script or another webservice (i.e. webcron). + +# File indexer + +## Config file + +The config file for indexing files is ***/etc/opensemanticsearch/connector-files***. + +There you can enable OCR for images, like described below: + +# Data enrichment: Enrich content + +[Enhancers enrich the content with additional data, metadata or analytics](../../data_enrichment) (i.e. tags, OCR or named entity extraction), which helps to find better the original content, to filter or to navigate. + +## OCR (automatic text recognition in graphical formats) + +Automatic text recognition (OCR) is off by default, because it slows down indexing. It uses many processor ressources and will need many seconds for each graphic file. + +### Enable OCR + +(OCR is enabled by default in the virtual machine packages like Open Semantic Desktop Search or Open Semantic Search Appliance) + +Install the package tesseract-ocr (included in your Linux distribution): +`apt-get install tesseract-ocr` + +If you enabled OCR, should enable OCR for images inside PDF files, too, since many PDF files are scans and do contain much text data only as graphics: + +Add (uncomment) the PDF OCR Plugin:: +``` +#Enable OCR for images inside PDF files + +config['plugins'].append('enhance_pdf_ocr') +``` + +### OCR language + +Setting OCR language to an other language than english: +1. Install the tesseract language package (for german: `tesseract-ocr-deu`). See the list of available languages for [Debian](https://packages.debian.org/search?keywords=tesseract-ocr) or [Ubuntu](http://packages.ubuntu.com/search?keywords=tesseract-ocr). +2. set option `ocr_language` to the language of your documents. Default is *eng* for english (in tesseract its *eng*, not *en*!). For german set *deu* (in tesseract its not *de*!): +``` +# language for automatic text recognition (ocr) +#config['ocr_lang'] = "eng" +config['ocr_lang'] = "deu" +``` + +Or set the OCR language to multiple languages, which are used in your documents: +``` +# language for automatic text recognition (ocr) +config['ocr_lang'] = "eng+deu" +``` + +## Enrich with metadata from RDF sources (Resource Desciption Framework) + +In `/etc/opensemanticsearch/enhancer-rdf` you can configure servers or services for metadata (like annotations or tagging) which is accessable as open standard RDF (Ressource Description Framework) and map them to Solr fields or facets. + +## Adding custom fields / custom facets + +To be able to use external, independent and modular tools and components writing directly to the Solr index, there is more than one place to configure mappings of new fields: +* Your metadata plattform (i.e. [Drupal](../../../enhancer/rdf-drupal)) where you edit them or a scraping plattform where you read them saving the data in fields with fieldnames +* the connectors / importers and enhancers which read this data from the (meta) data source and write it to Solr +* and the user interface which reads this fields from Solr and shows them under a human readable label to the user. + + +You can configure additional facets (interactive filters): + +### Mapping from database fields or RDF properties to custom fields / custom facets in Solr within the connector / importer / enhancer + +Config in which Solr-fields to write the additional data from the (meta)datasource: + +If you use a RDF datasource, find out the name / URI (in semantic Web and RDF the "field name" is an url, too) of the external fields (i.e. a standard fields (like *Dublin core* metadata standard fields) or a [custom field in Drupal](../../../enhancer/rdf-drupal)). + +Add this external fieldnames or uris mapping them to a internal Solr field (standard fields, standard facets or [additional custom facets](../../../enhancer/rdf)) in */etc/solr/enancer-rdf*. + +Example:`config['meta_property2facet'] = { + 'http://purl.org/dc/terms/location': 'location_ss', + 'http://semantic-mediawiki.org/swivt/1.0#specialProperty_dat': 'meta_date_dts' +}` +### Enable additional Solr custom fields / custom facets in the user interface + + + +Config which of this new or additional Solr-fields should be shown in the user interface and under which caption: + +Use the option *$cfg[facets]* in *config/config.php* to add custom facets in the user interface: +Setup additional Solr-fields (i.e. filled from below configurated connectors / importers or [enhancers](../../modules#enhancer) like additional [RDF Metadata](../../../enhancer/rdf) sources (i.e. your tagging and anntoation metadata server) or [fields in which you write scraped data](../../../solr-connector-scrapy)) and map them a human readable title / label. + +Example: +``` +// Additional facets (f.e. fields imported by a connector or enhancer which should be shown as interactive filter in the sidebar) +$cfg['facets']['yourfacet_s'] = array ('label'=>'Additional own facet'); +$cfg['facets']['anotherfacet_s'] = array ('label'=>'Another additonal facet'); +``` diff --git a/docs/doc/admin/config/blacklist/README.md b/docs/doc/admin/config/blacklist/README.md new file mode 100644 index 0000000..42ec15e --- /dev/null +++ b/docs/doc/admin/config/blacklist/README.md @@ -0,0 +1,111 @@ +--- +title: Blacklists and whitelists +authors: + - Markus Mandalka +--- + +# Blacklists and whitelists + +## Exclude URLs, domains, paths, files, file types or plugins from indexing to Solr or Elastic Search + +Entries in a blacklist or matching a pattern like prefixes (i.e. domains or file directories) or suffixes (i.e. a file suffix like `.css`) won't be indexed for search. + +So you can exclude spam or not relevant formats like CSS files. For example you might want to not index stylesheets (if you are not a web developer who might want to search for them). + +## Blacklist format: One entry per line + +A blacklist is a plain text file containing one blacklist entry per line. + +There are different blacklists for different forms of blacklisting: + +## Exclude webpages or filenames by URLs + +To exclude a webpage or a file, add the full URL or full filename to the default URL-Blacklist `/etc/opensemanticsearch/blacklist/blacklist-url` + +## Exclude domains or paths by prefixes + +To exclude whole domains, subdomains, paths or subpaths, add the domain or path to the default prefix-Blacklist `/etc/opensemanticsearch/blacklist/blacklist-url-prefix` + +## Exclude file extensions by suffixes + +To exclude suffixes like some file extensions, just add the suffix like `.css` to the default suffix-Blacklist `/etc/opensemanticsearch/blacklist/blacklist-url-suffix` + +## Exclude URIs matching text patterns by regular expressions + +To exclude all URIs matching a text pattern (regular expression) just add the regular expression to the default regex-Blacklist `/etc/opensemanticsearch/blacklist/blacklist-url-regex` + +## Whitelist: Include even if matching a blacklisted pattern + +URLs in a whitelist will be indexed, even if blacklisted because they matched a blacklisted domain, prefix, suffix or pattern. + +The configuration works the same way in config files `/etc/opensemanticsearch/blacklist/whitelist-url` and so on ... + +## Configure additional blacklists (for divided or shared blacklists) + +If you want to use multiple blacklists for easier management of many blacklisted entries or to share blacklists or parts of your blacklists with other people, organizations or a closed or open data community, you can use and add more than the default blacklists: + +To add another blacklist of URLs or filenames just add to the config in `/etc/opensemanticsearch/etl` or in the config of the special connector +`config['blacklist'].append('/etc/opensemanticsearch/blacklist/blacklist-url-anOwnList')` + +To add another blacklist of Domains or directories just add to the config in `/etc/opensemanticsearch/etl` or in the config of the special connector +`config['blacklist_prefix'].append('/etc/opensemanticsearch/blacklist/blacklist-url-prefix-anOwnList')` + +To add another blacklist of file endings just add to the config in `/etc/opensemanticsearch/etl` or in the config of the special connector +`config['blacklist_suffix'].append('/etc/opensemanticsearch/blacklist/blacklist-url-suffix-anOwnList')` + +To add another blacklist of regular expressions just add to the config in `/etc/opensemanticsearch/etl` or in the config of the special connector +`config['blacklist_regex'].append('/etc/opensemanticsearch/blacklist/blacklist-url-suffix-anOwnList')` + +## Blacklisting on plugin level + +Blacklists can be configured only for certain plugins. + +So blacklisting documents, paths, file endings or content types only affects certain plugins or data enrichment or data analysis or document processing chain steps. + +So the blacklisted documents, paths, file endings or content types will be processed by all other plugins and indexed, but they would not be processed, enriched or analysed by the defined plugin. + +These config files work the same way as the standard blacklist config file types described above. So you can blacklist some files (URLs), paths (URL-prefixes) or file endings (URL suffixes). + +But they are only active for the defined plugin by the path name inside the config path `/etc/opensemanticsearch/blacklist`, which has to match the plugin file name. + +### Blacklisting URLs, file names (URLs), paths (URL prefixes), file endings (URL suffixes) on plugin level + +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-url* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-url-prefix* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-url-suffix* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-url-regex* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-url* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-url-prefix* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-url-suffix* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-url-regex* + +### Blacklist content types on plugin level + +Important: This means not file endings (which would be url-suffix) but the content type guessed by Tikas document analysis! +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-contenttype* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-contenttype-prefix* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-contenttype-suffix* +* */etc/opensemanticsearch/blacklist/pluginname/blacklist-contenttype-regex* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-contenttype* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-contenttype-prefix* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-contenttype-suffix* +* */etc/opensemanticsearch/blacklist/pluginname/whitelist-contenttype-regex* + +### Example + +For example if you don't want to handle Open Document files which are extracted with Tika yet additionally as ZIP archive which it technically is and which would be extracted to index each file inside this ZIP archive, you can blacklist this content type for the Unzip plugin: + +Therefore add to the config in `/etc/opensemanticsearch/blacklist/enhance_zip/blacklist-contenttype-prefix`: +`application/vnd.oasis.opendocument.` + +Another possibility would be to blacklist the `.odt` suffix for the ZIP plugin `enhance_zip`: + +Therefore add to the config in `/etc/opensemanticsearch/blacklist/enhance_zip/blacklist-url-suffix` + +``` +.odt +.ODT +.Odt +``` + +Since this is preconfigured in the default setup and config file, you don't have to add this manually, but it is an example how more complex blacklisting on plugin level works. diff --git a/docs/doc/admin/config/log/README.md b/docs/doc/admin/config/log/README.md new file mode 100644 index 0000000..7e7bc9c --- /dev/null +++ b/docs/doc/admin/config/log/README.md @@ -0,0 +1,72 @@ +--- +title: Open Semantic Search logfiles +authors: + - Markus Mandalka +--- + +# Logfiles + +Locations of the log files: + +## Webserver + +Logfile of your Apache webserver for PHP based Search UI, Django based Open Semantic Search apps and some HTTP/REST APIs: + +`/var/log/apache2/access.log` + +If something went wrong you find more info in + +`/var/log/apache2/error.log`. + + +## Open Semantic ETL + +Full logs are written with prefix `etl_task` to the logfile + +`/var/log/syslog` + +The last log entries of Open Semantic ETL can be seen by command + +``` +service opensemanticetl status +``` + +## Apache Tika + +Logs of the main component Apache Tika for text extraction from files are written as java to the logfile + +`/var/log/syslog` + +The last log entries of Apache Tika can be seen by command + +``` +service tika status +``` + +and + +``` +service tika-fake-ocr status +``` + + +## Apache Solr search server + +Logfile of Apache Solr: + +`/var/solr/logs/solr.log` + +### Solr admin web interface + +You can use the Solr admin interface (`http://localhost:8983/solr/`) by using the menu option "Logging" (`http://localhost:8983/solr/#/~logging`) to see the last error messages. + + +## Verbosity + +### Open Semantic ETL + +To be verbose while crawling, text extraction and data analysis, set the config option `config['verbose'] = True` in the config file `/etc/opensemanicsearch/etl` or in the special config file of a connector to log more info. + +### Solr PHP UI + +Config `cfg['debug'] = true;` in the config file of the User interface to see, what was communicated to and from Solr. diff --git a/docs/doc/admin/config/named_entity_recognition/README.md b/docs/doc/admin/config/named_entity_recognition/README.md new file mode 100644 index 0000000..dcf4d30 --- /dev/null +++ b/docs/doc/admin/config/named_entity_recognition/README.md @@ -0,0 +1,58 @@ +--- +title: Named Entity Recogniton (NER) +authors: + - Markus Mandalka +--- + +# Named Entity Recogniton (NER) + + +## Automatic Named Entity Recognition by machine learning (ML) for automatic classification and annotation of text parts + + + +There are models trained with existing annotations of a large text corpus, so after that they can predict / guess if a part of a sentence is a name of a person, a name of an organization, a verb or a place. + +## Named Entities Recognition with Stanford Named Entitiy Recognizer (Stanford NER) + + +Despite Stanford NER is integrated and configured out of the box, automatic Named entities recognition needs many resources (mainly CPU time and RAM) while anylsis on document import or data enrichment, so you have to switch it on manually or you can only enrich some important documents or texts with such an automatic text analysis. + +To setup the automatic [named entity recognition with Stanford Named Entitiy Recognizer (NER)](../../../../enhancer/named_entitiy_recognition/stanford_named_entity_recognizer). + + +## Setting language model + + +## How to improve Named Entities Extraction + + +In many cases such Named Entity Recognition (NER) heuristics and machine learning works, but not all. + +To get the most analysis with less manual effort for meta data management, you can combine all methods and tools: Own domain knowledge by managing named entities manually and integrate, import or enrich with external knowledge or open data, extracting structured data with text patterns by regex and machine learning. + +### Train the machine learning model + + + +You can train the machine learning model with additional structure or annotations to get better. + +## Combine recognized Named Entities with results of additional methods like thesaurus of domain knowledge, lists of names, open data and precise rules + + + +But often rules more precise, especially for new or not very popular names. + +The problem with rules or the Named Entities manager is, that you have to know and manage all this names. + +Importing A list or ontology + + + +If a named +you can define precise +Text patterns by regular expressions i.e. for a special currency or for scanned forms. + +You can add names +You can add rules by queries + diff --git a/docs/doc/admin/config/ocr/README.md b/docs/doc/admin/config/ocr/README.md new file mode 100644 index 0000000..30ecf1c --- /dev/null +++ b/docs/doc/admin/config/ocr/README.md @@ -0,0 +1,124 @@ +--- +title: Automatic text recognition (OCR) for Solr or Elastic Search +authors: + - Markus Mandalka +--- + +# Automatic text recognition (OCR) for Solr or Elastic Search + + +## Automatic text recognition in images or scanned documents by Optical Character Recognition (OCR) + + +Text stored in image formats like JPG, PNG, TIFF or GIF (i.e. scans, photos or screenshots) can not be found by standard full text search. So this enhancer enriches meta data of images like filename, format and size with results from automatic text recognition or optical character recognition (OCR) by free open source software like [Tesseract OCR](https://github.com/tesseract-ocr). + +Since many information is not searchable by full text search because its in graphical formats embedded in PDF documents (i.e. scans or screenshots instead of text format), the enhancer extracts images from PDF files for automatic text recognition (OCR), too. + +## Enable OCR + + +(OCR is enabled by default in the virtual machine packages like Open Semantic Desktop Search or Open Semantic Search Appliance) + +Install the package tesseract-ocr (included in your Linux distribution): +`apt-get install tesseract-ocr` + +If you enabled OCR, should enable OCR for images inside PDF files, too, since many PDF files are scans and do contain much text data only as graphics: + +## OCR of images embedded within PDF documents + + + +Add (uncomment) the PDF OCR plugin to enable OCR for images or scanned documents within PDF files: +`#Enable OCR for images inside PDF files +config['plugins'].append('enhance_pdf_ocr')` +## How to optimize OCR settings to improve OCR results + + +You can optimize OCR results to find more by different ways, which you can combine for optimal OCR results: + +## Scanning resolution + + +If scanning documents yourself, scan or store the images with a higher resolution, so the OCR can analyse more details of the characters. + +## Language of dictionary + + + +Since OCR uses a language specific dictionary, set the OCR language to your language or to multiple languages, which are used in your documents. + +Setting OCR language to an other language than english: +1. Install the tesseract language package (for german: *tesseract-ocr-deu*). See the list of available languages for [Debian](https://packages.debian.org/search?keywords=tesseract-ocr) or [Ubuntu](http://packages.ubuntu.com/search?keywords=tesseract-ocr). +2. set option *ocr\_language* to the language of your documents. Default is *eng* for english (in tesseract its *eng*, not *en*!). For german set *deu* (in tesseract its not *de*!): +`# language for automatic text recognition (ocr) +#config['ocr_lang'] = "eng" +config['ocr_lang'] = "deu"` + +Or set the OCR language to multiple languages, which are used in your documents: +`# language for automatic text recognition (ocr) +config['ocr_lang'] = "eng+deu"` + +## Additional custom OCR dictionary entries from Thesaurus and Ontologies + + +By the coming out of the box integration with the Tesseract OCR user word list or custom dictionary, your Concepts, words and names of named entities like organizations, places, locations or persons that are important for you so you added them to your [thesaurus](../../../datamanagement/thesaurus) or which are included in [lists of names or ontologies](../../../datamanagement/ontologies) (for example lists of names of relevant persons from internal meta data sources or from open data sources like [Wikidata](../../../datamanagement/opendata#wikidata)) you defined for faceted search/interactive filters and/or analytics/aggregated overviews are recognized better by OCR of scanned documents, too. + +Therefore your additional domain knowledge / vocabulary from thesaurus, lists and ontologies is used additional to the OCR dictionary by Tesseract option `--user-words /etc/opensemanticsearch/ocr/dictionary.txt`. + +Since in many scanned legacy files on paper names are fully written in uppercase, this autogenerated custom OCR dictionary / OCR wordlist includes the uppercase variant of each word, too. + +So you should consider to rebuild your index / reindex important files by force (so they are analyzed again & reindexed even if yet in index) after adding very important concepts or names to thesaurus or ontologies. + +## Rotation and deskewing low quality scans before OCR + + +Many documents are scanned skew. + +Additional deskewing of such low quality scans by [Scantailor](http://scantailor.org) before OCR can improve the OCR results. + +Install Scantailor: +`apt-get install scantailor` + +Enable additional optimization with Scantailor before OCR by adding uncomment the descewing plugin to your ETL config `/etc/opensemanticsearch/etl`: +`config['plugins'].append('enhance_ocr_descew')` + +In default configuration the descewing plugin is disabled because it needs more time and CPU resources while indexing documents with images. + +## Combining OCR results of multiple OCR tools + + +No OCR engine is perfect. + +So in some research projects we used for example Abby Finereader to OCR the images in PDFs additionally to the integrated Open Source OCR Software Tesseract. + +Each of them recognized words or names the other software failed. By combining and indexing both OCR results for the same document, we could find many documents more. + +Therefore the Open Semantic ETL framework of Open Semantic Search is able to combine or unify and index analysis results of multiple analysis or OCR tools or OCR parameters for the same document or image. + +## Train characters and fonts + + +You can train the OCR with the special fonts used in your documents to improve the machine learning model for recognition of characters of this fonts. + +## How to manage OCR failures + + +### Handle OCR errors by collaborative tagging and annotation + + +For single documents with OCR errors you can add [annotations or tags](../../../datamanagement/annotation) with the words that were recognized wrong by the OCR engine, so the search engine can find them despite this OCR errors because of the tags or annotations written correct. + +### Manage OCR errors in thesaurus (Hidden labels) + + + +Manage common OCR errors for all documents and new documents by [Thesaurus entries for management of OCR errors (Hidden labels)](../../../datamanagement/thesaurus#hiddenlabel) + +The [recommender can analyse the corpus for typos/OCR errors](../../../datamanagement/thesaurus/recommender) of a thesaurus entry and recommends such misspellings for adding to the thesaurus as hidden label by one click. + + + +## More information about improving OCR quality + + +[Improving the quality of the output of Tesseract OCR](https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality) \ No newline at end of file diff --git a/docs/doc/admin/config/password/README.md b/docs/doc/admin/config/password/README.md new file mode 100644 index 0000000..3c32af0 --- /dev/null +++ b/docs/doc/admin/config/password/README.md @@ -0,0 +1,56 @@ +--- +title: Password protection +authors: + - Markus Mandalka +--- + +# Password protection + + +If the following config files do not exist (which is the case after standard installation), there is open access for all without a password so everybody can find and read all indexed data and everyone can change, add or delete metadata configurations. + +## How to set up a password + + + +To manage users and passwords for access to the search engine and for access to the management tools in a seperate other config file use the Apache webserver standard tool `htpasswd`: + +# Access to the search engine + + +Password protection for search users is configured in the config file `/etc/solr-php-ui/.htpasswd`. +If this config file does not exist (which is the case after standard installation), there is open access for all without a password. + +## Create password config file and add an user + + +Create the password config file and add an user: +`htpasswd -c /etc/solr-php-ui/.htpasswd *username*` +## Add another user(s) or change passwords + + +Since the config file now exists, add users or change passwords: +`htpasswd /etc/solr-php-ui/.htpasswd *username*` +# Access to the management tools + + + +Password protection for the management tools for datasources and metadata management (i.e. thesaurus or ontologies) is configured in the config file `/etc/opensemanticsearch-django-webapps/.htpasswd`. + +If this config file does not exist (which is the case after standard installation), there is open access for all without a password or with the search engine password, if one is set. + +## Create password config file and add an user + + +Create the password config file and add an user: +`htpasswd -c /etc/opensemanticsearch-django-webapps/.htpasswd *username*` +## Add another user(s) or change passwords + + +Since the config file now exists, add users or change passwords: +`htpasswd /etc/opensemanticsearch-django-webapps/.htpasswd *username*` +# Django admin + +The admin access for Django Web UI or facet configs can be set +within the directory `/var/lib/opensemanticsearch` by +`python3 manage.py createsuperuser` \ No newline at end of file diff --git a/docs/doc/admin/config/scheduler/README.md b/docs/doc/admin/config/scheduler/README.md new file mode 100644 index 0000000..f63da04 --- /dev/null +++ b/docs/doc/admin/config/scheduler/README.md @@ -0,0 +1,26 @@ +--- +title: Scheduling (Cron) +authors: + - Markus Mandalka +--- + +# Scheduling (Cron) + + +## Cron + + +If you use our connectors, just add Cron jobs using the command line tools the standard Linux way. + +## Preconfigured cron jobs + + +### Import RSS feeds + + +With the next version with integrated user interfaces for data import there will be a preconfigured Cron job that will look every minute for RSS feeds where the configured delta time is over, to import them again. + +## Apache ManifoldCF + + +If you use ManifoldCF connectors, you have to schedule them in the user interface of ManifoldCF, which has its own scheduler. \ No newline at end of file diff --git a/docs/doc/admin/config/stemming/README.md b/docs/doc/admin/config/stemming/README.md new file mode 100644 index 0000000..4dc820f --- /dev/null +++ b/docs/doc/admin/config/stemming/README.md @@ -0,0 +1,70 @@ +--- +title: Finds more with grammar rules (Stemming) +authors: + - Markus Mandalka +--- + +# Finds more with grammar rules (Stemming) + + +Considering grammar rules the search engine will find more. + +So if you search for *company corruption* you will find *companies corrupted*, too, even if for stupid computers this are different words or strings. + +## Reducing words to their root form (stemming) + +That works because a stemming algorithm reduces words to their root form. + +For example the stemmer cuts suffixes like *-ing* or *-ed* or plural-*s*, so the search engine can find more forms of a word. + +So the words *corrupt*, *corrupted* and *corruption* will be indexed and searched all only with their root form *corrupt*. + +Preconfigurated stemming + +The search engine packages are preconfigurated to stemming with following grammar out of the box for documents which language is autodetected by OpenNLP integrated in Apache Tika: +* English (EN) +* Spanish (ES) +* German / Deutsch (DE) +* French / Francais (FR) +* Portuguese (PT) +* Dutch (NL) +* Italian (IT) +* Czech (CZ) +* Romanian (RO) +* Russian (RU) +* Arabic (AR) +* Persian (FA) + + + +More languages can be configured out of the box on demand (by the way would be nice, if you could donate us an translation of the search UI, too). + + +Change the stemmer +There is no perfect stemming algorithm for all situations but different more or less working stemming algorithms and implementations (stemmers). + +To switch to a more or less aggressive stemmer, edit the field definition of your language fields. + +For English grammar the field names are: `text_en` and `synonyms_en`, for German grammar the field names are `text_de` and `synonyms_de` and so on. + +Learn more about stemming algorithms, free open source stemmers and their configuration: + +[Stemming algorithms](https://en.wikipedia.org/wiki/Stemming) +[Choosing a stemmer](https://www.elastic.co/guide/en/elasticsearch/guide/current/choosing-a-stemmer.html) +[Stemming for Solr](https://wiki.apache.org/solr/LanguageAnalysis#Stemming) +[Stemming for Elastic Search](https://www.elastic.co/guide/en/elasticsearch/guide/current/stemming.html +) +Thesaurus (dictionary of linked words) and other ontologies (Linked Data) + +Another feature to find more is to use a [thesaurus (a connected dictionary or a network of linked words or concepts)](../../../datamanagement/thesaurus) or other [ontologies (linked data structures)](../../../datamanagement/ontologies). + +So for example the search engine can consider irregular verbs (for example *went* is not *go* with a suffix) and other irregular word forms, too. + +Additionally you will be able to find not only different forms of the same words but additionally connected words like synonyms or hyponyms. + +For example if you search for *purple* you would find *violet*, too. + +An out of the box integration of a dictionary and thesaurus based on open data from [Wiktionary](https://www.wiktionary.org/) (the dictionary of Wikipedia) could be released next, if enough donations for that. + +Please [donate](../../../../donate) with the subject Wiktionary for an earlier out of the box integration or if needed earlier, ask us for the config steps to setup this for your language (while setup you need a triplestore yet). + diff --git a/docs/doc/admin/config/synonyms/README.md b/docs/doc/admin/config/synonyms/README.md new file mode 100644 index 0000000..a4f5cef --- /dev/null +++ b/docs/doc/admin/config/synonyms/README.md @@ -0,0 +1,18 @@ +--- +title: Setup of synonyms and aliases +authors: + - Markus Mandalka +--- + +# Setup of synonyms and aliases + + +You can setup synonyms, aliases or alternate names with the web user interface [thesaurus manager](../../../datamanagement/thesaurus). + +Just add a name or concept with the synonym as an alias or import a thesaurus or ontology with synonyms to the [ontologies manager](../../../datamanagement/ontologies). + +After that the module [SKOS to Solr](../../../../skos2solr) adds all alternate SKOS labels or aliases from thesaurus entries as synonym for their prefered labels to the synonym config file for [Solr synonym filter](https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-SynonymFilter). + +Please donate so we can integrate (technically existing) features with open data from Wiktionary, so most synonyms and more forms of irregular verbs ("went" is not only "go" with a suffix) will be preconfigured out of the box. + + diff --git a/docs/doc/admin/connectors/README.md b/docs/doc/admin/connectors/README.md new file mode 100644 index 0000000..fb97233 --- /dev/null +++ b/docs/doc/admin/connectors/README.md @@ -0,0 +1,53 @@ +--- +title: Crawl, import and load data or ingest documents into the search index (Connectors & ETL) +authors: + - Markus Mandalka +--- + +# Crawl, import and load data or ingest documents into the search index (Connectors & ETL) + + +## Crawler, connectors, data importer, data integration, document ingestion, transformation and converter + +We provide some light weight import / index tools / connectors i.e. for files and directories based on our [open source framework for data integration, data extraction, data analysis and data enrichment](../../../etl). + +Since our open architecture is based on Solr with its open REST-API for which there are many powerful libraries for all programming languages and open standards for linked data and semantic web, you can use all other powerful frameworks, programming languages or services for crawling, ETL or web scraping which are interoperable with Solr or some open standards for databases (f.e. SQL) or data integration (f.e. RDF). + +For most cases there are many ready to use connectors for standard imports yet: + +## [Connector Files (filesystem and directories)](../../../connector/files) + +Crawl and index directories, files and documents into Solr. Including automatic textrecognition (OCR) support for images and grafical formats included in PDF documents (i.e. scans) + +[Learn more](../../../connector/files) ... + + +## [Connector RSS (RSS-Feed)](../../../connector/rss) + +Indexes Webpages from a RSS-Newsfeed + +[Learn more](../../../connector/rss) ... + +## [Connector Web (HTTP)](../../../connector/web) + +Crawl and index Websites into Solr index. + +[Learn more](../../../connector/web) ... + + +## [Connector DB (SQL, MySQL, Postgresql)](../../../connector/db) + + +Index SQL databases like MySQL or PostgreSQL into Solr. + +[Learn more](../../../connector/db) ... + + + +## [Connector Scraper (Web scraping)](../../../connector/scraper) + + +ETL and webscraping framework to crawl, extract, transform and load structured data from websites (scraping). + +[Learn more](../../../connector/scraper) ... + diff --git a/docs/doc/admin/install/README.md b/docs/doc/admin/install/README.md new file mode 100644 index 0000000..9d513a0 --- /dev/null +++ b/docs/doc/admin/install/README.md @@ -0,0 +1,21 @@ +--- +title: Installation +authors: + - Markus Mandalka +--- + +# Installation + +# Installation on a desktop computer, laptop or notebook running on Linux, Windows or Mac (desktop search) + +Single desktop users can use the preconfigured toolbox bundle and virtual machine [Open Semantic Desktop Search](../../desktop_search). + +# Docker + +Coming soon. + +# Installation on a Linux server or VM (organizations or research teams) + +Installation on a Linux server for social search or collaborative research for an organizations or a research team: + +[Install Open Semantic Search on a Ubunto or Debian GNU/Linux server](search_server). diff --git a/docs/doc/admin/install/desktop_search/README.md b/docs/doc/admin/install/desktop_search/README.md new file mode 100644 index 0000000..a62bf31 --- /dev/null +++ b/docs/doc/admin/install/desktop_search/README.md @@ -0,0 +1,93 @@ +--- +title: How to install Open Semantic Desktop Search +authors: + - Markus Mandalka +--- + +# How to install Open Semantic Desktop Search + +## Dependencies + +If not yet there download and install the following virtual machine host (available for free for *Windows*, *Mac* and *Linux*) + +* [*Virtual Box*](https://www.virtualbox.org) + + +## Installation + +* [Download the virtual machine image *Open Semantic Desktop Search*](../../../../download#desktop_search) +* Start *Virtual Box* +* In the menu "*File*" start the option "*Import Appliance*". +* Choose the downloaded appliance file and start the import + + +## Configuration of document folders + +Edit the settings of the new virtual machine (choose the virtual machine in the left sidebar and click the "*settings*" button in the top bar). + +Add **shared folders** with **documents**: + +![](../../../../screenshots/shared_folders.png) + +You can add one shared folder or multiple shared folders pointing to local folders on your harddisk to point to your documents, that should be indexed, searched and analysed. + +Activate the option *Auto-mount*. + +This folder(s) can be set read only, so you cannot accidently delete important documents because not familiar with the new user interfaces and desktop environment. + + +## Automatic indexing of new documents on virtual machine startup + +On startup of the virtual machine all (new) documents in the configured shared folders will be indexed. + + +## Desktop search usage + +After the files have been indexed you can [search and analyse documents with Open Semantic Desktop Search](../../../desktop_search/README.md). + + +## External index (optionally) + +If you want to store the index in a directory or filesystem outside the Virtual Machine, because the default size of the image is too small for your index, you can add a shared folder named `index` (activate the option *Auto-mount*). + +Don't set this folder to read only, since the search engine has to store the index in it. + + +## System access and default passwords + +### User + +The default password of the default user is empty and the GUI is configured for automatic login. + + +### Root access + +If you want full root access to the Linux System, for example to install additional packages or to change [config files](../../config/README.md): + +Since as admin you have control of the virtual machine host and you have full access to the virtual machines data and so there is no root password. + +#### Terminal + +So in the terminal app you can get full root access by following command: + +``` +su +``` + +#### Console + +Or just login as root without password on the virtual machine console: + +Press CTRL-Right and F3 at once to get to the console. + +Login as `root` without password. + +Set a root password: +`passwd` + +Exit the console: +`exit` + +Return to Gnome GUI: + +Press CTRL-Right and F2 at once. diff --git a/docs/doc/admin/install/search_server/README.md b/docs/doc/admin/install/search_server/README.md new file mode 100644 index 0000000..47e7292 --- /dev/null +++ b/docs/doc/admin/install/search_server/README.md @@ -0,0 +1,68 @@ +--- +title: How to install Open Semantic Search Server +authors: + - Markus Mandalka +--- + +# How to install Open Semantic Search Server + +## Open Semantic Desktop Search + +If you are a user and want only search for yourself, you maybe want to use the [Open Semantic Desktop Search virtual machine](../../../desktop_search), which is easier to install for single end users. + +## Open Semantic Search Server + +How to setup a search engine on an intranet server running on an existing Debian GNU/Linux or Ubuntu Linux (web)server or within an existing virtual machine running a Debian GNU/Linux or Ubuntu guest: + +### Debian GNU/Linux + +1. [Download](../../../../download) the packages and modules you want to use +2. Get admin or super user (root): `su` +3. Install the packages: `dpkg --install open-semantic-search-server*.deb` +4. Install the dependencies: `apt-get -f install` + +### Ubuntu Linux + +1. [Download](../../../../download) the packages and modules you want to use +2. Install the package and its dependencies: `sudo apt install ./open-semantic-search-server*.deb` +3. After installation stops continue by typing in a `q` to end showing a status message of Solr installation script + +## Index some files + +Index some files (i.e. the documentation directory of Linux): +`opensemanticsearch-index-dir /usr/share/doc` + +## Search + +Open your browser and call the new alias `/search` on your Apache webserver i.e.: + +`http://localhost/search` + +Enter a [search query](../../../search/operators/README.md) and enjoy the [user interface for navigation, faceted search, exploratory search, interactive filters, analytics and visualizations](../../../search/README.md). + +## Config + +Set [config options by the web admin interface](../../config/README.md). + +### Secure access + +If you don't secure the used Apache webserver or this web application, all who can access your computers IP have full access to the search engine and so access to all indexed contents, too. + +With its API and web apps in `/search-apps` it is possible to index data or tag documents. + +If you don't want to secure the whole Apache web server (for example limit access to localhost or add a password protection with htaccess), you should limit access to the search in `/etc/solr-php-ui/apache.conf` and limit access to the REST-API and web apps in `/etc/opensemanticsearch-django-webapps/apache.conf` ... + +The initial password for the Django admin interface (i.e. for adding tags that are usable for documents tagging) is `live` + + +### URL Mapping + +If you want to setup a **document search based on local files as a website** with documents stored as local files in a local directory where users don't have access to your files and directories via the filesystem (`file://`) you can setup a mapping to another protocol (`http://`) and a directory where the files are available on your webserver. + +You can set the config option for mapping in `/etc/opensemanticsearch/connector-files`, where you can find the explanation on how to do it. + +### More config options + +You will find other flexible options in the **config files** of other modules in `/etc/opensemanticsearch/`. + +[Learn more ...](../../config/README.md) \ No newline at end of file diff --git a/docs/doc/admin/optimize/README.md b/docs/doc/admin/optimize/README.md new file mode 100644 index 0000000..a32bcd7 --- /dev/null +++ b/docs/doc/admin/optimize/README.md @@ -0,0 +1,70 @@ +--- +title: Scaling and increasing performance by parallel processing, server clusters & buffers for writing +authors: + - Markus Mandalka +--- + +# Scaling and increasing performance by parallel processing, server clusters & buffers for writing + +## How to index, search and explore big data faster by scaling and optimizing data processing + +This is a tutorial on how to index very large document sets faster to enable faster search or analysis. This tutorial is not about [how to analyse, search, explore & filter big document collections](../../search). + +## Indexing only filenames for (very fast) exploration and filtering by filenames + +First index only the filenames, which doesn't take much time. You can explore, filter and find the most interesting paths or filenames without wating for completition of a full run maybe indexing long time many directories and files, that are not so interesting and for example start first processing of very interesting parts. + +Therefore first run indexing using only with the `enhance_path` plugin: +`opensemanticsearch-index-file --plugins enhance_path dirname` + +This will be very fast, because only indexing the paths and file names without extraction of other metadata or content. + +After you are able to search all existing filenames you can first or additionally (parallel) index very interesting paths or files. + +## Doing expensive tasks like optical character recognition (OCR) later by disabling expensive data enrichment plugins for the first indexing run + +Data enrichment with OCR needs a lot of time and CPU ressources for only some percent of additional content. + +So you might want to disable OCR and do a first full indexing without OCR to be able to search & analyze most parts of your data much earlier and meanwhile running a second forced indexing with OCR in the backround (after activating OCR again or based on an additional config file), later or at night. + +So you can do a first run or standard runs without OCR: + +Therefore disable OCR in `/etc/opensemanticsearch/etl` and in your Tika config (inside `/usr/share/java/tika-server.jar`) or just temporarily deinstall `tesseract-ocr`. + +### Second run with enabled OCR +Enable OCR in your configs again. + +If you just deinstalled `tesseract-ocr`, don't forget to install this package and your additional OCR language packages (for example `tesseract-ocr-deu` for german) again. + +Force a second run with +`opensemanticsearch-index-dir --force *dirname*` + +Or enrich yet indexed data with the OCR plugin from time to time or after indexing by running the data enrichment tool for only the OCR plugin, so other plugins have not to run again. + +## Parallel processing of data extraction and data enrichment + +If there is more than one processor available, tasks like extracting text from documents and OCR will be calculated by parallel processing for multiple files simultanously so that all available processors will be used. + +So if working within a virtual machine (like for example Open Semantic Desktop Search), don't forget to set up more or all processors for the virtual machine settings (in the vertical tab *System* and horizontal tab *Processor*). + +You can even use additional computers for a machine cluster, so multiple processors on multiple computers will be used. + +## Parallel processing of indexing and search with server cluster for the index (Solr cluster) + +Too many or too slow searches? + +You can scale the Solr index from a single Solr index server and search server to a search cluster (Solr cloud) on multiple servers to share the load of many searches. + +## ETL cluster for extracting text and OCR + +Too slow while indexing too many documents? + +With additional servers with installations of Open Semantic ETL for time intensive data processing or document processing like text extraction or OCR, if you give them access to the files and to your index server. + +Hint: preconfigurated Solr is open only from localhost, so open the Port for the other workers of your ETL cluster. + +Or if you use Hadoop, you can index files parallel using the whole Hadoop cluster with [Map Reduce Indexer Tool](http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/search_mapreduceindexertool.html#csug_topic_6_1). + +## Donate + +You can [donate to the open source project](../../../donate) to get an optimized version and simple user interfaces for indexing faster (for example fast indexing without OCR with one click and doing OCR later while you are able to search in most data much sooner or easy to handle packages for setting up a cluster).` \ No newline at end of file diff --git a/docs/doc/admin/queue/README.md b/docs/doc/admin/queue/README.md new file mode 100644 index 0000000..0db4d02 --- /dev/null +++ b/docs/doc/admin/queue/README.md @@ -0,0 +1,39 @@ +--- +title: Task queue management and monitoring +authors: + - Markus Mandalka +--- + +# Task queue management + +The task queue for the ETL workers is managed by *Celery* in a [*RabbitMQ*](https://packages.debian.org/de/bullseye/rabbitmq-server) queue. + + +## Command line interface (CLI) + +So you can use the [queue management tools of *RabbitMQ*](https://docs.celeryproject.org/en/stable/userguide/monitoring.html#rabbitmq) and [queue management tools of *Celery*](https://docs.celeryproject.org/en/stable/userguide/monitoring.html). + + +## Status of file imports in search user interface + +If this feature is not disabled by config, the status of file imports and OCR tasks is shown in the search user interface: + +![](../../../screenshots/prioritize-import.png) + +While the file import is running, you can yet search by filenames and prioritize the import of certain files by click on "*Prioritize import*". + + +## Web user interface for task management (Flower web UI) + +You can monitor and manage the ETL task queue for document processing by [*Celery Flower*](https://docs.celeryproject.org/en/stable/userguide/monitoring.html#flower-real-time-celery-web-monitor) web user interface (UI): + +A link to the *Flower* instance on your host (f.e. `http://localhost/flower`) is available in the search user interface in the menu "*Datasources*" as "*Show running and open imports and analysis tasks (ETL tasks)*". + +![](../../../screenshots/flower.png) + + +## Priorities + +By the config file `/etc/opensemanticsearch/task_priorities` you can set priorities by file extension types like `.pdf`. + +As default this option is set to process documents like PDF or DOC before images like JPG and files like `.exe` last. diff --git a/docs/doc/admin/rest-api/README.md b/docs/doc/admin/rest-api/README.md new file mode 100644 index 0000000..55c4a93 --- /dev/null +++ b/docs/doc/admin/rest-api/README.md @@ -0,0 +1,41 @@ +--- +title: REST API +authors: + - Markus Mandalka +--- + +# REST API + + +Application programming interface (API) available via generic HTTP waiting for another (web) service or software demanding for an action like crawling a directory or a webpage or indexing changed data (i.e. directly started after data change by a [trigger](../../modules#trigger) of the CMS) and starting this actions. + +## Crawling directories + + +Crawl a directory and all subdirectories and index all files: +`http://127.0.0.1/search-apps/api/index-dir?uri=/usr/share/doc` +## Index a file + + +Index a single file: +`http://127.0.0.1:/search-apps/api/index-file?uri=/home/opensemanticsearch/readme.txt` +## Index a web page + + +Index a single web page: +`http://127.0.0.1:/search-apps/api/index-web?uri=http://www.opensemanticsearch.org/` +## Index a RSS-Feed + + +Index each webpage from a RSS-Newsfeed: +`http://127.0.0.1:/search-apps/api/index-rss?uri=http://www.opensemanticsearch.org/feed` +## Delete a file or document from index + + +Delete a webpage or removed document file from index: +`http://127.0.0.1:/search-apps/api/delete?uri=file:///home/user/Documents/document.doc` +## Search or read data + + + +We won't reinvent all wheels, so use the [Rest-API of Solr](http://lucene.apache.org/solr/quickstart.html#searching) for searching or / and getting data in XML or [JSON](https://cwiki.apache.org/confluence/display/solr/Using+JavaScript) format or use [Solr Client APIs](https://cwiki.apache.org/confluence/display/solr/Client+APIs) to get data with your favorite programming language. diff --git a/docs/doc/admin/scale/README.md b/docs/doc/admin/scale/README.md new file mode 100644 index 0000000..8146486 --- /dev/null +++ b/docs/doc/admin/scale/README.md @@ -0,0 +1,91 @@ +--- +title: Scaling and increasing performance by parallel processing, server clusters & buffers for writing +authors: + - Markus Mandalka +--- + +# Scaling and increasing performance by parallel processing, server clusters & buffers for writing + + +## How to index, search and explore big data faster by scaling and optimizing data processing + + +This is a tutorial how to index very large document sets faster technically to enable faster search or analysis. So this tutorial is not about [how to analyse, search, explore & filter big document collections](../../search). + +## Indexing only filenames for (very fast) exploration and filtering by filenames + + + +First index only the filenames, which doesn't need much time. So you can explore, filter and find the most interesting paths or filenames without wating for completition of a full run maybe indexing long time many directories and files, that are not so interesting and for example start first processing of very interesting parts. + +Therefore first run indexing using only with the `enhance_path` plugin: +`opensemanticsearch-index-file --plugins enhance_path *dirname* + +This will be very fast, because only indexing the paths and file names without extraction of other metadata or content. + +After you are able to search all existing filenames you can first or additionally (parallel) index very interesting paths or files. + + +## Doing expensive tasks like optical character recognition (OCR) later by disable expensive data enrichment plugins for first indexing run) + + + +Data enrichment with OCR needs very much time and CPU ressources for only some percent of additional content. + +So you might want to disable OCR and do a first full indexing without OCR to be able to search & analyze most parts of your data much earlier and meanwhile running a second forced indexing with OCR in the backround (after activating OCR again or based on an additional config file), later or at night. + +So you can do a first run or standard runs without OCR: + +Therefore disable OCR in /etc/opensemanticsearch/etl and in your Tika config (inside /usr/share/java/tika-server.jar) or just temporary deinstall tesseract-ocr. + + +### Second run with enabled OCR + + +Enable OCR in your configs again. + +If you just deinstalled tesseract-ocr, dont forget to install this package and your additional OCR language packages (for example tesseract-ocr-deu for german) again. + +Force a second run with +`opensemanticsearch-index-dir --force *dirname*` + +Or enrich yet indexed data with the OCR plugin from time to time or after indexing by running the data enrichment tool for only the OCR plugin, so other plugins have not to run again. + + + +## Parallel processing of data extraction and data enrichment + + + + +If there is more than one processor available, tasks like extracting text from documents and OCR will be calculated by parallel processing for multiple files simultanously so that all available processors will be used. + +So if working within a virtual machine (like for example Open Semantic Desktop Search), don't forget to set up more or all processors for the virtual machine settings (in the vertical tab *System* and horizontal tab *Processor*) + +You can even use additional computers to a machine cluster, so multiple processors on multiple computers will be used. + +## Parallel processing of indexing and search with server cluster for the index (Solr cluster) + + + +Too many or too slow searches? + +You can scale the Solr index from a single Solr index server and search server to a search cluster (Solr cloud) on multiple servers to share the load of many searches. + +## ETL cluster for extracting text and OCR + + + +Too slow while indexing too many documents? + +With additional servers with installations of Open Semantic ETL for time intensive data processing or document processing like text extraction or OCR, if you give them access to the files and to your index server. + +Hint: preconfigurated Solr is open only from localhost, so open the Port for the other workers of your ETL cluster. + +Or if you use Hadoop, you can index files parallel using the whole Hadoop cluster with [Map Reduce Indexer Tool](http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/search_mapreduceindexertool.html#csug_topic_6_1). + + +## Donate + + +You can [donate to the open source project](../../../donate) to get an optimized version and simple user interfaces for indexing faster (for example fast indexing without OCR with one click and doing OCR later while you are able to search in most data much sooner or easy to handle packages for setting up a cluster).` \ No newline at end of file diff --git a/docs/doc/admin/storage/README.md b/docs/doc/admin/storage/README.md new file mode 100644 index 0000000..6ecf4ed --- /dev/null +++ b/docs/doc/admin/storage/README.md @@ -0,0 +1,52 @@ +--- +title: Data storage locations +authors: + - Markus Mandalka +--- + +# Data storage locations + +In which paths and directories Open Semantic Search stores your data: + + +## Logfiles + +See separated [documentation of logs](../config/log/README.md). + + +## Database (Open Semantic Search Apps) + +The *Django* database of the search apps with your thesaurus, ontologies, facets config and your config by web (Admin UI) is stored in a **SQLite DB** in +`/var/opensemanticsearch/db/` + +Uploaded Ontologies files and Lists are stored in +`/var/opensemanticsearch/media/ontologies/` + + +## Search index (Solr) + +The *Apache Solr* search indexes are stored in + +`/var/solr/data/` + +The document index is located in + +`/var/solr/data/opensemanticsearch/` + +The entities index of *Open Semantic Entity Search API* is located in + +`/var/solr/data/opensemanticsearch-entities/` + + +## Tasks queue (RabbitMQ) + +The *RabbitMQ* task queue is stored in the standard location of the [Debian Package `rabbitmq-server`](https://packages.debian.org/de/bullseye/rabbitmq-server): + +`/var/lib/rabbitmq/` + + +## OCR cache (Tesseract-OCR-Cache) + +The OCR cache containing the plain texts of images in documents that had been processed by *Tesseract-OCR-Cache* is stored in + +`/var/cache/tesseract/` diff --git a/docs/doc/admin/twitter/README.md b/docs/doc/admin/twitter/README.md new file mode 100644 index 0000000..afc2489 --- /dev/null +++ b/docs/doc/admin/twitter/README.md @@ -0,0 +1,80 @@ +--- +title: Suchmaschine für Twitter: Tweets indexieren +authors: + - Markus Mandalka +--- + +# Suchmaschine für Twitter: Tweets indexieren + + +## Twitter indexieren + + +Einzelne Abrufe von Twitter (per Cron auch zu gewünschten Zeiten und / oder in gewünschten Abständen durchführbar): + +### Tweets von NutzeInnen indexieren, denen Sie folgen + + + +Indexiert Tweets aller Twitter-Accounts, denen gefolgt wird: + +``` + +solr\_indextwitter + +``` + +### Tweets eines Nutzers indexieren + + +Indexiert alle Tweets des Accounts *@opensemsearch* (seine und von diesem retweetete) + +``` + +solr\_indextwitter --timeline @opensemsearch + +``` + +### Hashtag indexieren + + +Sucht und indexiert Tweets mit dem Hashtag *#opensemanticsearch*, auch wenn den AutorInnen nicht gefolgt wird: + +``` + +solr\_indextwitter --search #opensemanticsearch + +``` + +### Tweets mit Suchwort indexieren + + +Sucht und indexiert Tweets, in denen das Suchwort *test* enthalten ist, auch wenn den AutorInnen nicht gefolgt wird: + +``` + +solr\_indextwitter --search test + +``` + +## Twitter Stream indexieren + + +Der durchgängig laufende Daemon fragt nicht einnmalig oder in bestimmten Zeitabständen regelmässig die neuesten Tweets bei Twitter ab, sondern schaltet mittels *Twitter Stream API* auf dauerhaften Empfang. Twitter sendet dann neue Tweets sobald sie veröffentlicht werden, so dass diese sofort indexiert werden. + +``` + +solr\_indextwitter --stream + +``` + + +So werden neben aller abonnierten Twitter-Accounts in der eigenen Timeline zusätzlich weitere Suchworte monitored: + +``` + +solr\_indextwitter --stream --search #hashtagX,#hashtagY,keywordX,keywordY,keywordZ + +``` + +Die Suchworte werden mit dem Parameter *--search* angegeben, ansonsten werden die Suchworte aus der Suchmaschinenkonfiguration (siehe Datenquellen) verwendet. diff --git a/docs/doc/analytics/README.md b/docs/doc/analytics/README.md new file mode 100644 index 0000000..d485d3e --- /dev/null +++ b/docs/doc/analytics/README.md @@ -0,0 +1,91 @@ +--- +title: Analyze and explore (Analytics, Exploratory Search, Text Mining, Topic Modeling and Datavisualization) +authors: + - Markus Mandalka +--- + +# Analyze and explore (Analytics, Exploratory Search, Text Mining, Topic Modeling and Datavisualization) + + +## How to analyze, explore and datamine big document sets by Exploratory Search, Faceted Search, Entity Extraction and Text Mining (Datamining by Text Analysis, Natural Language Processing, Machine Learning and Clustering) + + + +There are user interfaces and views (just press the button/switch to the tab) for the following analysis and exploration for the results of a search query / search context or if no search query or filter is set, for all indexed documents: + +## Aggregated overview (who, when, where, what, how often) + + +[Aggregated overview and named entities](../search#faceted_search) in the right sidebar shows you: Who? Which organizations? What? Where? When? In how many documents? + +![](../../screenshots/faceted_search.png) + +## Preview extracted text of document content + + +The preview shows the extracted text of a document. Search context like the search query or active filters are marked within the content, so you can see fast whats important for you and why this document matched your query. + +## Visualize locations occur in documents on Interactive map + + +By the view / tab "Map" you can analyze visual which locations occur in the documents of your search results: + + +[![](../../screenshots/map.png)](map) + + +. + +## Networks, relations and connections (graph) + + +The [graph view](graph) generates data visualizations of networks, connections and relations between named entities like persons, organizations or tags from the content of your documents. + +![](../../screenshots/graph.png) + +## Trend chart datavisualization (how many documents when) + + +[Trend chart](../analyze/trend): When how many results or documents? + +![](../../screenshots/trend.png) + +## Table (all fields/columns/facets, minimum and maximum) + + +The [Tables view](../search/table) shows and can sort fields and get the maximum value and minimum value, the average and the median of each field/column + + +![](../../screenshots/table.gif) + +## Word list and word cloud (words) + + +[Word list and word cloud](words): Most used words, concept or names + + +[![](../../screenshots/wordcloud.png)](words) + +## Text mining and topic modeling (content analysis) + + +[Text analysis, text mining, document mining and words](textmining): What is the content about? + + +[![](../../screenshots/WordTree.jpg)](textmining) + +## Similarity and differences (text comparision and overrepresented terms) + + + +Please donate: + + +Show differences and focal points, core areas and key aspects by comparing word frequencies to find out what concepts or entities are overrepresented in documents in comparison to other documents or text corpus. + +Compare two texts / versions to show differences or same/copied passages. + +Connected words / Co-occurrences (N-Grams like Bigrams or Trigrams) + +Search with a whole document or text as a search query: +Find similar text or documents about the same topics by klicking on "more of that". diff --git a/docs/doc/analytics/email/README.md b/docs/doc/analytics/email/README.md new file mode 100644 index 0000000..1e69076 --- /dev/null +++ b/docs/doc/analytics/email/README.md @@ -0,0 +1,65 @@ +--- +title: Emails and file attachments in Outlook mailbox files (PST) +authors: + - Markus Mandalka +--- + +# Emails and file attachments in Outlook mailbox files (PST) + + +## Extract mailbox files mail by mail + + +The plugin *Enhancer Outlook mailbox* will index *Microsoft Outlook* mailboxes (*PST* files) not only as one file but each included email for each (using the tool [readpst](https://packages.debian.org/jessie/pst-utils)). + +## How to index Microsoft Outlook mailbox files + + + +Just index the Microsoft Outlook file (.pst) like other files or documents: + +For example copy it to the documents directory of Open Semantic Desktop search and start "Index documents". +Or use the "Index for search" in your file managers context menu. +Or copy the file to a filemonitored directory of your file server. +Or start a crawl of this file or its directory by Web user interface or command line tool. + +After some time of data analysis and indexing you can use [fulltext search, filter and analyze](../../search) included emails for each, not only the mailbox file itself as a whole. + + +![](../../../screenshots/search_email.png) + +## File attachments + + + +Mail attachments will be indexed, too. + +All data enrichment or data analysis plugins like OCR run for content of file attachments, too. + +So you can search, filter and analyse the content of mail attachments, too. + + +## Aggregated overview for analysis and Interactive filters + + + + +Since the meta data like email-adresses will be available for each mail, you can use [aggregated overviews and interactive filters (facets)](../../search#faceted_search) like "Message from" or "Message to" for indexed emails to find or filter the email you search for faster. + + + + +Network visualization for visual analysis +So you can [visualize the network with the graph view](../../analyze/graph) to overview who is connected and to see who wrote whom how often. + + + + +Roadmap + +Next steps todo (please [donate for further development](../../../donate)): + +Aggregated overview and interactive filter for domains + +So you can overview, analyze, filter and visualize which organization mailed with which how often, not only for special email-adresses or people. + diff --git a/docs/doc/analytics/graph/README.md b/docs/doc/analytics/graph/README.md new file mode 100644 index 0000000..11fa6c5 --- /dev/null +++ b/docs/doc/analytics/graph/README.md @@ -0,0 +1,147 @@ +--- +title: Network analysis: Graph visualization for discovery and exploration of connections & relations +authors: + - Markus Mandalka +--- + +# Network analysis: Graph visualization for discovery and exploration of connections & relations + + +## Visualization of relations and connections between entities like persons or organizations within and across documents (co-occurrences of named entities) + + +The graph/network analysis view shows you the direct and indirect relations, connections and networks between [named entities like persons, organizations or main concepts](../../datamanagement/named_entity_recognition) which occur together (co-occurences) in your content, datasources and documents or are connected in your Linked Data Knowledge Graph. + +![](../../../screenshots/visual_graph_explorer.png) +## Color map and statistics of entity types/classes + + + +The statistics and color map in the bar shows you how many entities of each class are loaded to the graph visualization and which colors they have in the graph visualization. + +## Size of entities/nodes: How many documents contain the entity + + + +The size of the entity circle / node visualizes how many documents contain this entity. + +## Size of connections / edges: Co-occurences of connected entities in documents + + +The edge / connection width is visualizing in how many documents both connected entities occur together. + +## Extend: Load more entities & connections + + +The graph shows you some first entities, which are extracted from documents matching your search query or connected to the entity you started to search for/from. + +On this base you can extend the graph by additional connections and entities: + +By a click on a entity or node more connections from / to this entity from / to other named entities (maybe yet not in the graph visualization) are loaded. + +## Document based graph exploration by augmentation of connections with documents + + + +A click on a connection / edge with the connection type / property "Documents (co-occurence)" shows you in how many and which documents the connected entities occur together. + +![](../../../screenshots/document_graph.png) + +In the tab "List" you see a list of documents in which both connected entities occur. + +In the tab "Preview" you can preview the full text and metadata of a single document. + +In the tab "Entities" you get an aggregated overview of other named entities within this documents or by other options in the sub menu "Analyze" you can analyze or filter this documents . + +## Graph visualization and graph analysis by full-text search + + +You can start a graph visualization from full text search (not only for entities, but for keywords in your documents, too) in the search user interface. + +Therefore do a full text search and click on the view "Connections (Graph)" in tab/menu analysis. + +![](../../../screenshots/graph_search.png) + +There you can set which types (classes) of entities and connections (properties) to use for graph analysis and graph visualization and with how many of each entities to start with. + +By click on the button "Visualize graph" you open the graph explorer and can extend the graph by clicking an entity / node. + +## Thesaurus or Ontology based entity graph exploration by concepts (SKOS & RDF) + + +If you set up a thesaurus or an ontology, the linked concepts of your thesaurus or the selected ontology are shown in the graph, too, so additionally to occuring entities like people, organizations and locations you can explore by concepts from your thesaurus in the content, too. + + +## Limitations + + +This is a first alpha release with some bugs and limitations. + +There is not an user interface control element for setting limits how many connections should be loaded at once, which can cause problems if you enable entities from Named Entity Recognition by machine learning (since that results in many false positives) or using very generic thesauri. + +In future releases there will be a sepraration of properties for Named Entitiy Recognition by Machine Learning and Named Entity Extraction by your thesaurus or tags and an user interface element for showing and setting custom limits for extending single entities / loading their connections. + +## Automatic extraction of named entities from documents (Named Entity Extraction) + + + +Open Semantic Search or Open Semantic ETL extracts named entities defined in your thesaurus, ontologies or lists of names or recognized by Named Entity Recognition by machine learning automatically. + +## Named entities like persons, organizations or places + + +[![](../../../screenshots/facets.png)](../../../screenshots/faceted_search.png) + +Extracted named entities like persons, organizations or locations (Named entity extraction) are used for [structured navigation, aggregated overviews and interactive filters (faceted search)](../../search#faceted_search) and to be able to get leads for connections and networks because you can analyze which persons, organizations or places occor together in how many documents. + +## Automatic Named Entity Recognition by machine learning (ML) for automatic classification and annotation of text parts + + + +Additionally to known [named entities in a thesaurus](../../datamanagement/thesaurus) or [imported ontologies](../../datamanagement/ontologies) other data analysis plugins integrate Named Entity Recognition (NER) by [spaCy](https://spacy.io) and/or [Stanford Named Entities Recognizer (Stanford NER)](http://nlp.stanford.edu/software/CRF-NER.shtml). + +## Named Entity Extraction of yet unknown entities or names + + +So by integration of machine learning for analysing the structure of the text and classifying parts/words of the sentences to categories like person, location or organization, many yet unknown named entities can be extracted, which aren't configured or listed yet in the thesaurus or a list of names or ontology. + +Therefore it uses models trained with existing annotations of a large text corpus, so after that they can "predict" or better: guess by probability if a part of a sentence is a name of a person, a name of an organization, a verb or a place. + +## Find more by combination with thesaurus and ontologies + + + +Since no machine learning algorithm and machine learning model is perfect, the search engine combines the analysis with other methods and data which is curated by human editors. + +Therefore you can add important names, aliases and alternate labels to the [thesaurus](../../datamanagement/thesaurus), so the search engine will extract them even if the named entities recognition fails. + +You don't have to add each name yourself: + +By the [ontologies manager](../../datamanagement/ontologies) you can [import thousands of names from Open Data like Wikidata](../../datamanagement/opendata/wikidata) which offers an universal structured database with names of people like for example [lists of names of politicians and members of parliament(s)](../../datamanagement/opendata/wikidata#politics). + +## Improve OCR results + + +Additional entities in the thesaurus are added to the [OCR dictionary and so they are found better in scanned documents by the automatic OCR integration](../../datamanagement/ocr) for example for images of scanned pages of legacy documents within PDF files. + +## Manual tagging and annotation + + +Since no automatic analysis and automatic tagging or annotation is perfect you can [tag manually documents by the semantic tagger](../../datamanagement/annotation) or [annotate visual parts/words/names/paragraphs/senteces within documents by Hypothesis annotator](../../datamanagement/annotation/hypothesis). + +## Open Source tool, web app and web user interface (UI) for discovery, exploration and visualization of a graph + + + +The integrated Open Source software [Open Semantic Visual Linked Data Knowledge Graph Explorer](../../../graph-explorer) is a web app providing user interfaces (UI) to discover, explore and visualize linked data in a graph for visualization and exploration of direct and indirect connections between entities like people, organizations and locations in your Linked Data Knowledge Graph. + + +## Neo4J browser + + +Alternate you can use the Neo4j browser by Cypher graph query language: + +![](../../../screenshots/graph.png) + + +Therefore enable the Open Source ETL plugin for integration with the [Neo4j](https://neo4j.com) graph database in the config. \ No newline at end of file diff --git a/docs/doc/analytics/law/README.md b/docs/doc/analytics/law/README.md new file mode 100644 index 0000000..af30c1e --- /dev/null +++ b/docs/doc/analytics/law/README.md @@ -0,0 +1,116 @@ +--- +title: Automatic extraction of law codes and law clauses +authors: + - Markus Mandalka +--- + +# Automatic extraction of law codes and law clauses + + +How to extract, analyze, sort, structure and filter your documents and large document collections by **legal codes** and **law clauses** with free **Open Source natural language processing (NLP) tools** and **Open Data legal thesaurus** extracted and imported from **Wikidata knowledge graph**. + +## Aggregated overviews and interactive filters (Faceted search) for your documents by legal codes and law clauses + + + +Open Semantic Search provides law code extraction, analysis, aggregated overviews and interactive filters (Faceted search) for your documents by extracted law codes and law clauses out of the box. + +![](../../../screenshots/law-code.png) + +This is based on analysis results of specialized Open Source ETL plugin for analysis of law clauses by extraction of text patterns by regular expressions (regex) and law codes by dictionary based named entity extraction and entity linking of an integrated legal ontology of law codes, a domain knowledge SKOS thesaurus extracted from the open knowledge graph / ontology Wikidata (open data): + + +# Open Legal tech: How to extract legal codes and law clauses by Open Source NLP tools and Open Data from Wikidata + + + +This documentation describes how this legal codes and law clause extraction works in detail and how you can [blacklist custom law code labels or aliases, which are too ambiguous](#blacklist) in your documents context. + + +## Open Source ETL plugin for textmining of structured legal data from full text of documents + + + +The [Open Semantic ETL (extracts documents full text to more structured data and search index)](https://github.com/opensemanticsearch/open-semantic-etl) open source [plugin "extract law"](https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_extract_law.py) is based on and combines multiple natural language processing (NLP) and textmining methods to extract, aggregate and normalize **law codes** and **law clauses** in multiple variants from the full texts of your documents: + + +## Extract law clauses by Regex (text pattern based extraction) + + + +One main step is to extract law clauses like *§ 123* from the document text with a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression) for the [Python Regex library *re*](https://docs.python.org/3/library/re.html). + + +## Extract law codes by thesaurus (dictionary based named entity extraction) + + + +Another main step is to extract law code labels (f.e. "Civil code", "Strafgesetzbuch" or "Bürgerliches Gesetzbuch" or their aliases like "STGB" or "BGB") by our integrated law codes thesaurus. + +This Simple Knowledge Organization System (SKOS) standard based thesaurus of law codes is an export of results of a [Wikidata SPARQL query for labels, synonyms and alternate labels of law codes](#sparqlquery) extracted from the Wikidata knowledge graph / ontology. + +Since this SKOS thesaurus of law codes is preconfigured in [Ontology Manager](../../datamanagement/ontologies) (Python/Django UI for import data from SPARQL/RDF to Solr Texttagger) of the semantic search engine, this step was yet done by the ETL plugin for dictionary/thesaurus/ontology based extraction of labels of entities from full text by [OpenRefine Reconciliation API Standard](https://reconciliation-api.github.io/specs/0.1/) based [Open Semantic Entity Search API](https://github.com/opensemanticsearch/open-semantic-entity-search-api), Solr providing a REST-API for managing this entities with labels and entity IDs/URIs in a Solr index and [Solr text tagger](https://lucene.apache.org/solr/guide/8_0/the-tagger-handler.html), a Finite State Transducer (FST) based dictionary matcher REST-API to extract this indexed labels / substrings from full text. + + + +## Open data from Wikidata knowledge graph + + + +For getting the [open data list / thesaurus of law code labels and their alternate labels/aliases](https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/var/opensemanticsearch/media/ontologies/law_codes.rdf) we [query, extract and import Open Data of entities from Wikipedia from the the free universal knowledge graph Wikidata](../../datamanagement/opendata/wikidata) by the following **SPARQL query** returning RDFS labels and SKOS thesaurus alternate labels: + + +``` +PREFIX skos: +CONSTRUCT { + ?uri rdfs:label ?label ; + skos:prefLabel ?prefLabel ; + skos:altLabel ?altLabel . +} + +WHERE { + + ?uri p:P31/ps:P31/wdt:P279* wd:Q922203. + + OPTIONAL { + ?uri rdfs:label ?label . + } + OPTIONAL { + ?uri skos:prefLabel ?prefLabel . + } + OPTIONAL { + ?uri skos:altLabel ?altLabel . + } +} +``` + + +So we get relevant law code labels like "Strafgesetzbuch" (German penal code) and aliases or alternate labels like "STGB" which is an abbreviation for "Strafgesetzbuch" (German penal code). + +![](../../../screenshots/law-codes-sparql.png) +## Combine law codes and law clauses to law code clauses + + + +As last main step both approaches are combined: + +The law plugin checks if there are combinations of extracted law codes with extracted law clauses, so we get law code clauses like "§123 civil code" for the facet "Law code clause". + + +## Normalization of law codes + + + +Alternate names are normalized to the preferred label of the entity / law code, so f.e. *§123 STGB* in a text will be added to the interactive filter in a normalized form "§123 Strafgesetzbuch", so if you overview or filter by the facet/interactive filter like "Law code", you will get documents with all variants. + + + +## Reduce false positives + + + +Some alternate names of law codes are too general or too ambiguous. + +For example the alias "CC" of the law code "Civil code" is used with another meaning in many other contexts (f.e. in many emails as abbreviation of "carbon copy (CC)" function). + +So this alias *CC* is listed in the blacklist [`/etc/opensemanticsearch/blacklist/enhance_extract_law/blacklist-lawcode-if-no-clause`](https://github.com/opensemanticsearch/open-semantic-etl/blob/master/etc/opensemanticsearch/blacklist/enhance_extract_law/blacklist-lawcode-if-no-clause) so the law code "Civil code" will be only added to the facet "Law codes" if the occuring alias CC is used combined with a law clause like *§ 123 CC* or *CC § 123* but not if only the alias "CC" is in the text, while if the preferred label "Civil code" is in the text without such a law clause, it will be added to the facet "Law codes", because this label is not blacklisted. diff --git a/docs/doc/analytics/map/README.md b/docs/doc/analytics/map/README.md new file mode 100644 index 0000000..31047ed --- /dev/null +++ b/docs/doc/analytics/map/README.md @@ -0,0 +1,42 @@ +--- +title: Interactive map of documents or search results +authors: + - Markus Mandalka +--- + +# Interactive map of documents or search results + + +## Visualize locations occur in documents on Interactive map + + +By the view / tab "Map" you can analyze visual which locations occur in the documents of your search results: + + +![](../../../screenshots/map.png) + +## Openstreetmap + + +Open Data from [Openstreetmap](https://openstreetmap.org) is used to show the map. +The extraction and mapping of documents to locations (data enrichment of your documents by geodata) is done on your local computer, not by a cloud service. + + +## Add geodata to Thesaurus + + +Therefore there will be an UI adding geodata to your locations of interest that you can manage with the thesaurus manager. + +## Open Data for Geodata by ontologies with geo coordinates + + +You don't have to manage each town of your country yourself: + +Thanks to open standards for the Semantic Web you can import open data ontologies like for example Wikidata location data like the towns of your country with geo coordinates to your linked data knowledge graph by [ontologies manager](../../datamanagement/ontologies). + +## Open Source user interfaces out of the box + + +Thanks to a client ordering this features as open source software, there will be an easy UI for setup that after the [Open Semantic Entity Search API](https://github.com/opensemanticsearch/open-semantic-entity-search-api) is released as open source. + +If you are interested to alpha & beta test such features before that, please write an email. \ No newline at end of file diff --git a/docs/doc/analytics/money/README.md b/docs/doc/analytics/money/README.md new file mode 100644 index 0000000..0b505c7 --- /dev/null +++ b/docs/doc/analytics/money/README.md @@ -0,0 +1,85 @@ +--- +title: Automatic extraction of law codes and law clauses +authors: +- Markus Mandalka +--- + +# Automatic extraction of money and currencies + +Open Semantic Search extracts amounts of money from text to the facet "Money" and currencies to the facet "Currencies". +For example text parts of your documents like "*100 dollars*", "*1,000$*", "*$ 100.50*" or "*100 USD*" are extracted to the facet "Money". + +So you can overview (facets) and drill down / filter your search results to documents concerning money. + + +## Open Source ETL money extraction plugin + +For that purpose the [Open Semantic ETL (extracts documents full text to more structured data and search index)](https://github.com/opensemanticsearch/open-semantic-etl) open source [plugin "extract money"](https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_extract_money.py) is based on and combines multiple natural language processing (NLP) and textmining methods like ontology / SKOS thesaurus / dictionary based entity extraction and regular expressions (regex) for extraction of numbers with (fully integrated) open data from the free knowledge graph Wikidata to extract money amounts and currencies in multiple variants from the full texts of your documents. + +So by this dictionary- and text-pattern (Regex)-based approach it often extracts additional structured information concerning money where the [machine learning approach by Named Entity Recognition (NER)](../../datamanagement/named_entity_recognition/README.md) failed on prediction of the NER class money. + + +## Currency signs + +The plugin is configured with [currency signs](https://www.wikidata.org/wiki/Q308229) like for example the [Dollar currency sign](https://www.wikidata.org/wiki/Q11110) $ or the [Euro currency sign](https://www.wikidata.org/wiki/Q18100) €. +![](currency-sign-euro.png) + +## Currency labels + +Another main approach is the extraction of currency labels (f.e. "Dollar", "Euro" and their aliases like "US Dollar", "USD" or "EUR") by our integrated currencies thesaurus. + +This Simple Knowledge Organization System (SKOS) standard based thesaurus of currencies is an export of results of a [Wikidata SPARQL query for labels, synonyms and alternate labels of currencies](#sparql-query) extracted from the Wikidata knowledge graph / ontology. + +![](currency-euro.png) + + +## Extract currency labels and aliases by thesaurus (dictionary based named entity extraction) + +Since this SKOS thesaurus of currencies is preconfigured in [Ontology Manager](../../datamanagement/ontologies) (Python/Django UI for import data from SPARQL/RDF to Solr Texttagger) of the semantic search engine, this step was yet done by the ETL plugin for dictionary/thesaurus/ontology based extraction of labels of entities from full text by [OpenRefine Reconciliation API Standard](https://reconciliation-api.github.io/specs/0.1/) based [Open Semantic Entity Search API](https://github.com/opensemanticsearch/open-semantic-entity-search-api), Solr providing a REST-API for managing these entities with labels and entity IDs/URIs in a Solr index and [Solr text tagger](https://lucene.apache.org/solr/guide/8_0/the-tagger-handler.html), a Finite State Transducer (FST) based dictionary matcher REST-API to extract this indexed labels / substrings from full text. + + +### Knowledge Graph based on Open Data from Wikidata + +The used currency ontology includes different currency labels and aliases like "US dollar", "EUR" or "Euros": + +![](currency-labels.png) + +For getting the [open data list / thesaurus of currency labels and their alternate labels/aliases](https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/var/opensemanticsearch/media/ontologies/currencies.rdf) we [query, extract and import Open Data of entities from Wikipedia from the the free universal knowledge graph Wikidata](../../datamanagement/opendata/wikidata) by the following **SPARQL query** returning RDFS labels and SKOS thesaurus alternate labels: + + + +#### SPARQL query + +Get labels from all instances of type **currency** (Wikidata Entity [`Q8142`](https://www.wikidata.org/wiki/Q8142)) + +``` +PREFIX skos: +CONSTRUCT { + ?uri rdfs:label ?label ; + skos:prefLabel ?prefLabel ; + skos:altLabel ?altLabel . +} + +WHERE { + + ?uri p:P31/ps:P31/wdt:P279* wd:Q8142. + + OPTIONAL { + ?uri rdfs:label ?label . + } + OPTIONAL { + ?uri skos:prefLabel ?prefLabel . + } + OPTIONAL { + ?uri skos:altLabel ?altLabel . + } +} +``` + + +## Extraction combines numbers with currency signs or currency labels to facet money + +As last step all approaches are combined by a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression) +which matches numbers which are combined with extracted currency label before or after a number (text pattern based extraction). + +So from this [Regex](https://docs.python.org/3/library/re.html) matches we get money like "100 dollars" for the facet "Money". diff --git a/docs/doc/analytics/money/currency-euro.png b/docs/doc/analytics/money/currency-euro.png new file mode 100644 index 0000000..ed4c9ea Binary files /dev/null and b/docs/doc/analytics/money/currency-euro.png differ diff --git a/docs/doc/analytics/money/currency-labels.png b/docs/doc/analytics/money/currency-labels.png new file mode 100644 index 0000000..2309488 Binary files /dev/null and b/docs/doc/analytics/money/currency-labels.png differ diff --git a/docs/doc/analytics/money/currency-sign-euro.png b/docs/doc/analytics/money/currency-sign-euro.png new file mode 100644 index 0000000..dca7d65 Binary files /dev/null and b/docs/doc/analytics/money/currency-sign-euro.png differ diff --git a/docs/doc/analytics/textmining/README.md b/docs/doc/analytics/textmining/README.md new file mode 100644 index 0000000..e0a20e6 --- /dev/null +++ b/docs/doc/analytics/textmining/README.md @@ -0,0 +1,165 @@ +--- +title: Text mining, text analytics and content analysis +authors: + - Markus Mandalka +--- + +# Text mining, text analytics and content analysis + + +## Text data mining (TDM) by text analysis, information extraction, document mining, text comparison, text visualization and topic modelling + + + +The search engine extracts automatically texts of different file formats and uses [grammar rules (stemming)](../../admin/stemming) to index and find different word forms. + +On this base and index you can search, review, filter, analyze and mine content with different text mining, analysis, extraction, data mining and clustering methods. + +So you can use the search engine not only for information retrieval by full text search to search and find known issues or to get structured data from unstructured data sources or texts by information extraction. It can be used as integrated text mining toolbox for text datamining (TDM) for semi-automated or automated text analysis, document mining, text comparision, text visualization and topic modelling to get useful analysis results even of unknown data sources. + + +## Search and filter the interesting documents + + +If you don't want to analyze all indexed documents, you can [search and filter the context](../../search) you want to mine and analyze. + +## Words: Word list and word cloud + + + +The view *Words* (option of the tab/button *Analyze*) shows you the words which are contained in the most documents of the results of your search context (documents matching your search query and filters). + +If you do not enter a search query and don't use a filters it shows the words which are contained in the most of all indexed documents. + + +![](../../../screenshots/wordcloud.png) + + +The number shows you how many documents (matching your search query and filters or if no search query or filter of all documents) use this word. + +If you click on a word, this word will be added as an additional filter. + +The words are visualiszed as a word cloud. The more documents containing the word, the bigger it is in the visualization + + +## Aggregated overviews of extracted structured informations, named entities and concepts for exploratory search (thesaurus based, ontonologies based and machine learning for automatic classification based faceted search) + + + +![](../../../screenshots/facets.png) + +With the [**faceted search** you can see an aggregated overview for the different facets](../../search#faceted_search) like paths, concepts, persons, locations or organzations showing, how many documents matching the named entities. + +This structure will be generated and facets/fields are valued with data from the following analysis: + +* Lists of Named Entities: Listed known [named entities like organizations, persons, locations or concepts. They can be [managed in plaintext lists, databases, ontologies, thesauri or in the [thesaurus user interface](../../datamanagement/thesaurus) for dictionary based or thesaurus based text mining and thesaurus based faceted search](../../datamanagement/ontologies)](../../datamanagement/thesaurus) +* Annotation & Tagging: [Tags from (collaborative) annotations and tagging](../../datamanagement/annotation) +* Text patterns (Regular Expressions): Extraction of structured data or data enrichment with [text patterns (regular expressions) can extract informations like email-adresses or amounts of money. They are added to facets like Email adresses, From:, To: or money.](../../../enhance/regex) +* [Named entity extraction or Named entity recognition (NER)](../../admin/config/named_entity_recognition) of even yet unknown entities like persons, organizations or locations by automatic classification of this text parts by machine learning on an annotated training corpus model +. + + +## Topic modelling (clustering and differences) + + +Please [donate](../../../donate) so we can implement this sooner): + +Topic modelling (clusters of topics what about documents are) + +What are the contents about? What are the most common topics in the whole, selected or filtered document set? + +Coocuration (Connected words): Which words occure together (Bigrams/Trigrams/N-Grams)? + +What is special in comparision with another text or document set ? See "Compare text or part of the corpus with other text or part of corpus". + +## Similarity ("more like this") + + + +Please [donate](../../../donate) so we can implement this sooner): + +Search with a whole document or text as a search query: + +If not yet, index your document which should be used as search query. + +Search for that document (i.e. by filename). + +Find similar text or documents about the same topics by clicking on "more like this". + + +## Direct text comparision: Differences of two text versions (visualization of added, deleted or copy pasted parts) + + + +Compare two texts / versions to show differences or same/copied passages or deleted or added words. + +Please [donate](../../../donate) so we can implement this sooner: + + +## Document set comparision (show differences like overrepresented terms) + + + +Please [donate](../../../donate) so we can implement this sooner: + +Special focus of a text or document set (text corpora) by comparision with other text or document set (text corpora). + +Show differences and focal points, core areas and key aspects by comparing word frequencies to find out what concepts or entities are overrepresented in documents in comparison to other documents or text corpus. + +## Extract text patterns with Regular Expressions (RegEx) + + +You can extract some structured data i.e. for aggregated overviews, interactive navigation and interactive filters (faceted search), data analysis and data visualization from unstructured text by extraction of the interesting text parts to structured flields, properties or facets by defining [text patterns with regular expressions (RegEx)](../../../enhancer/regex) or own [regular expressions based enhancer plugins](../../../dev/enhancer/python#regex) +## Advanced text analysis, text mining, document mining and text visualizations + + + +Advanced features like clustering and network analysis and advanced visualizations need more CPU load, more parameters and knowledge and specialized tools for different analysis, so you have to start them manually for your documents or for special search context. + +![](../../../screenshots/WordTree.jpg) + +But many advanced text mining tools support only few document formats and data formats and do not optical character recognition (OCR) automatically. + +Since this free software is interoperable open source software and uses open standards you are free to integrate additional data enrichment or data analysis plugins or to use other specialized tools additionally and based on the (exportable) text extraction, data enrichment, search and filter results of the search engine. + +## How to explore and analyse a document collection with external text mining tools? + + +After automatic extracting, indexing, analysis (i.e. optical character recognition by OCR engines) and enriching (i.e. with Named Entities or extraction of email-addresses) you can do an advanced text analysis, text mining and document mining with this special tools based on an export of all data or an export of search results or filtered results: + +* [Search and filter/drill down](../../search) the interesting document set (or do not, if you want to analyze all documents) +* Export this search results to a CSV file. Select the interesting fields like *id*, *title*, persons, organzations and mainly the fields *content* and *ocr\_t* +* Import the CSV in [other open source text mining tools](#alternates) and use the extracted text data with natural language processing (NLP) or machine learning (ML), named entities recognition (NER) or classification libraries until some of its advances machine learning [methods for text mining](https://en.wikipedia.org/wiki/Text_mining) are integrated into the user interfaces +* Use their advanced features and views, for example different [views from Jigsaw](http://www.cc.gatech.edu/gvu/ii/jigsaw/views.html) + + +## Free Software and Open Source text analytics and text mining toolkits and platforms or text mining solutions + + +Alternate Free Software and Open Source text analytics and text mining toolkits or text mining platforms: + +### Text mining platforms + + +* [Gate](https://gate.ac.uk/) - General architecture for text engineering + + +### Open source components for natural language processing (NLP), clustering and classification (machine learning) + + +Open source frameworks & programming libraries or APIs for natural language processing (NLP), clustering and classification (machine learning): +* [Apache Solr](http://lucene.apache.org/solr/) (Java based REST-API) +* Elastic search +* [Apache UIMA](https://uima.apache.org/) - Unstructured Information Management Architecture for information extraction +* [DKPro](https://dkpro.github.io/) - Text mining framework (Java and UIMA) +* [OpenNLP](http://opennlp.apache.org/) - Command line tools and Java library +* [Python Natural Language Toolkit (NLTK)](http://www.nltk.org/) - Natural language processing library (Python) +* [Gensim](http://radimrehurek.com/gensim/) - Topic modelling programming library (Python) +* [Mallet](http://mallet.cs.umass.edu) (Java) +* Apache Mahout (Java) +* Apache Spark (Java, but APIs for Pyton, too) +* Apache Stanbol + + + +More: [Text Analysis Portal for Research](http://tapor.ca/) or in [Wikipedia list of text mining software](https://en.wikipedia.org/wiki/List_of_text_mining_software) \ No newline at end of file diff --git a/docs/doc/analytics/trend/README.md b/docs/doc/analytics/trend/README.md new file mode 100644 index 0000000..5d7c7e1 --- /dev/null +++ b/docs/doc/analytics/trend/README.md @@ -0,0 +1,16 @@ +--- +title: Trend chart +authors: + - Markus Mandalka +--- + +# Trend chart + + +Trend chart will show you many of the search results or matching documents occure when on which date like year, month, day or hour. + +Just click on the button *Trend chart* in the tab/button *Analyze*. + + +![](../../../screenshots/trend.png) + diff --git a/docs/doc/analytics/words/README.md b/docs/doc/analytics/words/README.md new file mode 100644 index 0000000..b88a0f9 --- /dev/null +++ b/docs/doc/analytics/words/README.md @@ -0,0 +1,26 @@ +--- +title: Word cloud and word list +authors: + - Markus Mandalka +--- + +# Word cloud and word list + + +## Words: Word list and word cloud + + + +The view *Words* (option of the tab/button *Analyze*) shows you the words which are contained in the most documents of the results of your search context: + + +![](../../../screenshots/wordcloud.png) + + +The number shows you how many documents (matching your search query and filters or if no search query or filter of all documents) use this word. + +If you click on a word, this word will be added as an additional filter. + +The words are visualiszed as a word cloud. The more documents containing the word, the bigger it is in the visualization + + diff --git a/docs/doc/data_enrichment/README.md b/docs/doc/data_enrichment/README.md new file mode 100644 index 0000000..d358ef6 --- /dev/null +++ b/docs/doc/data_enrichment/README.md @@ -0,0 +1,75 @@ +--- +title: Data enrichment & content enrichment: Merge data & combine data analysis & document analysis tools (Enhancer) +authors: + - Markus Mandalka +--- + +# Data enrichment & content enrichment: Merge data & combine data analysis & document analysis tools (Enhancer) + +## Combining and merging multiple data sources & analytics of multiple content analysis and document analysis tools + +Data enrichment is done by modular **document analysis, content analysis or data enrichment plugins** managed with our lightweight, flexible, extendable and interoperable [open source ETL (extract, transform, load) and data enrichment framework and toolset](../../open-semantic-etl) for **document processing, automated content analysis and media analysis, merge and data enrichment pipelines**. + +## Document processing, data integration, content analysis, content enrichment and data enrichment pipeline (Enhancement chain) + +The document processing pipeline or chain is a list of data enrichment plugins (enhancer), which will be run for each document to enrich, analyse or link them with additional data or analysis. + +A part of the default [document processing pipeline configuration](#config) is for example: +* Extract text (enhance-text) +* OCR images (enhance-ocr) +* Adding annotations and tags (enhance-rdf) +* Indexing to database and/or search index (f.e. Solr or Elastic Search) + +## Semantic data enrichment plugins + +Such modular data enrichment plugins (enhancer) will enhance or enrich the content with additional meta data or analytics. + +For example the plugins for [named entities recognition](../datamanagement/named_entities) or [automatic text recognition (OCR) for image files](../../enhance/ocr). + +You can analyze your data with internal [webservices (or if you don't need privacy with external webservices or "the cloud")](../../open-semantic-etl#enrichment-webservices) or with your favorite programming language in a [custom data enrichment plugin](../../dev/enhancer). + +## Configuration of a custom document processing, content analysis and data enrichment pipeline + +The pipeline or the enabled plugins are configured for all data sources in `/etc/opensemanticsearch/connector` or can be overwritten or extended for each data source or connector in their specialized configs like `connector-files`. + +The analysis chain is run in order, since some plugins depend on data analysis of other plugins. + +You can add additional or new data enrichment plugins to `config['plugins']`. + +Or you can overwrite this config option to define a custom data enrichment pipeline with only a few needed plugins. + +## Enrich parts, enrich later, add additional enrichments, update data enrichments or distributed data enrichment + +The tool `opensemanticsearch-enrich` can run data enrichment parts or plugins which are not enabled in your default document processing pipe later or from time to time. + +For example sometimes its better to index all documents without OCR in the short term and after that to do the OCR of the documents with images which will take a long time. So the users are able to search in most documents and text, not having to wait until only a few parts and only for a few documents like some text in images are recognized in a long time process first before other documents after them are indexed, which takes only very little time, because there are no images. + +Or you can do expensive data enrichment like OCR at night or on low server load or distribute this work on different processors (parallel processing) or servers (cluster) or web services (cloud). + +Another possibility is to enrich with tools or webservices that improved or updated their results because of better analytics quality or more available data from time to time to integrate newer data or analytics results. + +Or to enrich later with an additional webservice, without having to run the full document processing chain again. + +Or if a webservice was not available while indexing to enrich data with its analytics later. + +You can run the tool from REST-API or on the command line: +`opensemanticsearch-enrich --plugins *pluginname*` + +Optionally you can add a search query or filter query, so only the interesting or important data or document(s) will get enriched: +`opensemanticsearch-enrich --plugins *pluginname* *query*` + +## Integration of other frameworks for data integration for data warehouse or for extraction, transformation and load (ETL) + +There are powerful [open source ETL frameworks](../../etl#projects) (extraction, transformation and load) for data integration, mapping, filtering and transformation for data warehousing with powerful features and graphical user interfaces (GUI). + +## Linked Data with open Semantic Web Standards + +Modern Semantic Web and Linked Data standard formats help you to [integrate linked open data to improve data analysis, navigation and filtering](../datamanagement/opendata). + +## Enrich your data with free databases and Open Data + +You can enrich your data with many free knowledge bases like WikiData (the structured database of Wikipedia) by using its lists of names or structures for analytics or import a Wiktionary as a thesaurus to find more verb forms especially of irregular verbs or synonyms. + +## Data integration and data enrichment frameworks + +Learn more about [Semantic Web, Linked Data, data integration, data analysis and data enrichment frameworks](../../etl). \ No newline at end of file diff --git a/docs/doc/datamanagement/README.md b/docs/doc/datamanagement/README.md new file mode 100644 index 0000000..93f0cb7 --- /dev/null +++ b/docs/doc/datamanagement/README.md @@ -0,0 +1,57 @@ +--- +title: Structuring data and documents: Metadata management of Names & Concepts by Lists, Vocabulary, Thesaurus and Ontologies and Named Entity Recognition +authors: + - Markus Mandalka +--- + +# Structuring data and documents: Metadata management of Names & Concepts by Lists, Vocabulary, Thesaurus and Ontologies and Named Entity Recognition + + +## Structure data, filters, navigation and aggregated overviews by Lists, Dictionaries, Vocabularies, Taxonomies, Mindmaps, Thesaurus (SKOS) and Graphs (Ontologies) for filtering, clustering and aggregating your documents + + + +You can structure, cluster and filter your data by different methods and structured data like lists of names or concepts (named entities) or ontologies based on named entities: + +## Named Entities: Names of people, organizations, places or concepts + + + +Named Entities are for example of people of interests, organizations like companies, places like town names or important concepts or words. +You can manage Named Entities (Names, Concepts, Persons, Places, Locations) name by name in the [Thesaurus](thesaurus). + +Named entities recognition adds some unknown entities by machine learning. + +## Container formats for lists of named entities, vocabularies or ontologies + + +Multiple such named entities can be stored and organized in [Dictionaries, Vocabularies, Databases, Lists or Ontologies](ontologies) + +So you can import external data sources with many named entities by the [Lists, Vocabularies & Ontologies manager](ontologies). + + +## Structure + + +Based on such named entities or categories you can structure your documents with such names by the following methods: + +Categories, groups or lists (Classification / tagging / categorizing / classifying by being on a [list or ontology](ontologies), [Tagging by rules and queries](rules) or clustering by machine learning) + +Hierarchies, Trees or Mindmaps (Taxonomies) + +Network or graph of concepts / words (Connected words and concepts in Thesaurus) +Open standard format: Simple Knowledge Organization System (SKOS) + +Example data: Custom domain thesaurus or linked open data from Wiktionary + +Other domain specific or private Ontologies +Open standard format: RDFS or OWL + +[Manual tagging and annotation](annotation) + +Tagging by machine learning (Automatic classification or clustering) + +Links (Connections) or Networks + + [Rules](rules) +[Grammar rules and grammar heuristics (Stemming)](../search/fuzzy#stemming) diff --git a/docs/doc/datamanagement/annotation/README.md b/docs/doc/datamanagement/annotation/README.md new file mode 100644 index 0000000..b544164 --- /dev/null +++ b/docs/doc/datamanagement/annotation/README.md @@ -0,0 +1,96 @@ +--- +title: Annotation and tagging +authors: + - Markus Mandalka +--- + +# Annotation and tagging + + +If a name and no of its aliases or a word and no of its synonyms is not contained in the document, that doesn't mean, that the document is not important for this topic. + +If you tag a document with a tag (f.e. a name of a person, organization, location or a concept or word), this document will be found on further queries with this word(s) even if this word(s) is/are not contained in the document or would be not recognized by automatic text analysis. + +## Why (collaborative) tagging and (collaborative) annotations by (teams of) human editors? + + + +Even if text mining and text analytics technology like automatic [named entity recognition of persons, organizations or places](../named_entity_recognition) and interactive filters and automatic topic detection by thesaurus for content analysis is very helpful to automate much of the editors work, no automatic text analysis, [OCR](../ocr) or machine learning model is perfect. + +## Human knowledge better than artificial intelligence, OCR and automatic ranking algorithms + + +So as specialists, domain experts or thinking human you and your team can add words, interpretations, qualitative values or structure that can not be analysed automatically because there is no data enrichment or automatic analysis plugin for that issue or its automatic analysis is not good enough, since computers are dump and can not understand or decide every context. + + +## Find, analyze and filter tagged documents by faceted search + + + +Additionally, tags will be used for [faceted search and exploratory search like like aggregated overviews and interactive filters for navigation](../../search#faceted_search), too, so you get an overview and you can find and filter or drill down tagged documents faster and with more comfort. + + + +![](../../../screenshots/facets.png) + +## Your research team or users will find yet analysed and tagged documents despite codes, euphemism and lies + + +If a name and no of its aliases or a word and no of its synonyms is not contained in the document, it doesn't mean, that the document is not important for the topic. For example corrupt companies or politicians wont write the word corruption into their documents, even if the document is a evidence of corruption. + +If you tag a document with a tag (f.e. a name of a person, organization, location or a concept or word), this document will be found on further queries with this word(s) even if this word(s) is/are not contained in the document. + +## Connect knowledge + + +![](../../../screenshots/graph.png) + +Maybe you search for a connection of two special topics, for example for racism in an organization. + +Your search would find anything. + +Maybe a specialist tags a document with the tag racism because he knows, that a special code is for racism. + +Maybe another specialist has an idea about members of the organization and tags the document with the organization. + +Now you will find the document if you search for that organization in context with topic, even if the specialists added their knowledge for only one topic or domain without deeper knowledge about the other one. + + +## How to tag or annotate a document? + + +* Just click *"Tagging and annotation"* for this document in the search results to annotate this document. + +![](../../../screenshots/tagging.png) +* Add tags (f.e. concepts, persons, organizations or locations) or write some free text into the notes field. + +![](../../../screenshots/annotation.png) +* Save the annotation. This will trigger to index the document again, so some seconds later this document is findable and filterable in the tagged context(s), too. + + +## Visual annotations + + +If you want to annotate visual and only parts within documents or web pages, you can use [Hypothesis annotation tools for visual annotations and tagging](hypothesis). + +[![](../../../screenshots/hypothesis.png)](hypothesis) +## Automated tagging and automated annotation + + +Such manually tagging by human editors, teams or groups is for documents that doesn't contain the tag (or another word or query or aliases) within the content, so that a human has to classify it to this additional context(s). + +If you want to tag documents i.e. with Tags like organizations, persons, locations or aliases that are in the text for sure without potential technical problems (works only if for sure if without OCR errors, typos or alternate and/or yet unknown labels or codes), you can add this tag or name to the [Thesaurus or Named Entities Manager](../thesaurus) which will tag all documents containing the name, concept or query automatically and for new documents, too. + + +![](../../../screenshots/named_entities_manager.png) + +## Alternate annotation tools for semantic annotations + + +You can integrate enhanced annotation tools for semantic annotations, which can not only tag whole documents but even parts of them: +* [Neonion](http://neonion.org/) +* [Pundit](http://www.thepund.it/) +* [Hypothesis](http://hypothes.is/) +* [AnnotatorJS](http://annotatorjs.org/) + + diff --git a/docs/doc/datamanagement/annotation/hypothesis/README.md b/docs/doc/datamanagement/annotation/hypothesis/README.md new file mode 100644 index 0000000..f06aa15 --- /dev/null +++ b/docs/doc/datamanagement/annotation/hypothesis/README.md @@ -0,0 +1,34 @@ +--- +title: Visual Annotations, Web Annotation and Tagging +authors: + - Markus Mandalka +--- + +# Visual Annotations, Web Annotation and Tagging + + +## Integration with Open Source annotation tool Hypothesis + + +The integrated **Open Source visual annotation tool** [Hypothesis](https://hypothes.is) provides an powerful **visual user interface** for **(collaborative) web annotation and tagging** by human editors, teams and groups that supports not only to tag documents and add page notes, but allows you to **annotate documents and web pages within the text**, even for single words, names, parts of sentences, sentences or paragraphs. +[![](../../../../screenshots/hypothesis.png)](https://hypothes.is) + +To [improve search, textanalytics & textmining and connect knowledge by annotations of human editors](#annotate), the open source search engine offers an easy to use [web user interface for setup an import and indexing of hypothesis annotations, tags and documents](../../../../connector/hypothesis#import). + +## Why (collaborative) tagging and (collaborative) annotations by (teams of) human editors? + + +If a name and no of its aliases or a word and no of its synonyms is not contained in the document content or metadata it can not be found. But that doesn't mean, that the document or web page is not important for this topic. + +Even if text mining and text analytics technology like automatic [named entity recognition of persons, organizations or places](../../named_entity_recognition) and interactive filters and automatic topic detection by thesaurus for automatic content analysis is very helpful to automate much of the researcher(s) and editor(s) work, no automatic text analysis, [OCR](../../ocr), automatic tagging of topics or concepts by thesaurus and no machine learning mode is perfect and computers are dumb or/and often have to few data about all context to judge about ambigous data or meaning of texts. + +So additionally to automatic text analysis, good search results needs manual annotations by human editors or together in teams to improve of search results, find important and relevant documents, for [easier filtering](#filter), verification and classification and together [connect different knowledge of (interdisciplinary) teams](#connect_knowledge). + + +## Search finds more by combining / data enrichment of content with tags and annotations + + + +If you tag a document or web page with a tag (f.e. a name of a person, organization, location or a concept or word), this document will be found on further queries with this word(s) even if this word(s) is/are not contained in the document or would be not recognized by automatic text analysis. + +![](../../../../screenshots/search.png) \ No newline at end of file diff --git a/docs/doc/datamanagement/db/README.md b/docs/doc/datamanagement/db/README.md new file mode 100644 index 0000000..e5220eb --- /dev/null +++ b/docs/doc/datamanagement/db/README.md @@ -0,0 +1,10 @@ +--- +title: Named Entities in Relational Databases (SQL DB) +authors: + - Markus Mandalka +--- + +# Named Entities in Relational Databases (SQL DB) + + +Please donate: How to setup a relational database with fields as lists for Named Enties for faceted search and named entities extraction. \ No newline at end of file diff --git a/docs/doc/datamanagement/named_entity_recognition/README.md b/docs/doc/datamanagement/named_entity_recognition/README.md new file mode 100644 index 0000000..2fa0582 --- /dev/null +++ b/docs/doc/datamanagement/named_entity_recognition/README.md @@ -0,0 +1,54 @@ +--- +title: Automatic extraction of named entities like persons, organizations or locations by named entity recognition +authors: + - Markus Mandalka +--- + +# Automatic extraction of named entities like persons, organizations or locations by named entity recognition + + +## How to automatically extract named entities like persons, organizations or locations by machine learning for named entity recognition + + +[![](../../../screenshots/facets.png)](../../../screenshots/faceted_search.png) + +Extracted named entities like persons, organizations or locations (Named entity extraction) are used for [structured navigation, aggregated overviews and interactive filters (faceted search)](../../search#faceted_search) and to be able to get leads for connections and networks because you can analyze which persons, organizations or places occor together in how many documents. + +## Automatic Named Entity Recognition by machine learning (ML) for automatic classification and annotation of text parts + + + +Additionally to known [named entities in a thesaurus](../thesaurus) or [imported ontologies](../ontologies) other data analysis plugins integrate Named Entity Recognition (NER) by [spaCy](https://spacy.io) and/or [Stanford Named Entities Recognizer (Stanford NER)](http://nlp.stanford.edu/software/CRF-NER.shtml). + +## Named Entity Extraction of yet unknown entities or names + + +So by integration of machine learning for analysing the structure of the text and classifying parts/words of the sentences to categories like person, location or organization, many yet unknown named entities can be extracted, which aren't configured or listed yet in the thesaurus or a list of names or ontology. + +Therefore it uses models trained with existing annotations of a large text corpus, so after that they can "predict" or better: guess by probability if a part of a sentence is a name of a person, a name of an organization, a verb or a place. + +## Find more by combination with thesaurus and ontologies + + + +Since no machine learning algorithm and machine learning model is perfect, the search engine combines the analysis with other methods and data which is curated by human editors. + +Therefore you can add important names to the [thesaurus](../thesaurus), so the search engine will extract them even if the named entities recognition fails. + +You don't have to add each name yourself: + +By the [ontologies manager](../ontologies) you can [import thousands of names from Open Data like Wikidata](../opendata/wikidata) which offers an universal structured database with names of people like for example [lists of names of politicians and members of parliament(s)](../opendata/wikidata#politics). + + +## Configuration of the Spacy NER plugin + + +The SpaCy Named Entity Recognition NER plugin is enabled by default, if not disabled because not needed or because of performance issues. + +The NER plugin is configured with language specific classifiers for English, German, Spanish, Portuguese, French, Dutch and Italian. + +## Configuration of the Stanford NER plugin + + + +The [Stanford Named Entitiy Recognizer (NER) plugin](../../../enhancer/named_entitiy_recognition/stanford_named_entity_recognizer) can be enabled instead or additional and is configured with language specific classifiers for English, German and Spanish. diff --git a/docs/doc/datamanagement/ocr/README.md b/docs/doc/datamanagement/ocr/README.md new file mode 100644 index 0000000..210c8d6 --- /dev/null +++ b/docs/doc/datamanagement/ocr/README.md @@ -0,0 +1,116 @@ +--- +title: How to optimize and improve Optical Character Recognition results (OCR) +authors: + - Markus Mandalka +--- + +# How to optimize and improve Optical Character Recognition results (OCR) + + +## Automatic text recognition in images or scanned documents by Optical Character Recognition (OCR) + + +Text stored in image formats like JPG, PNG, TIFF or GIF (i.e. scans, photos or screenshots) can not be found by standard full text search. So this enhancer enriches meta data of images like filename, format and size with results from automatic text recognition or optical character recognition (OCR) by free open source OCR software like [Tesseract](https://github.com/tesseract-ocr). + +Since many information is not searchable by full text search because its in graphical formats embedded in PDF documents or Powerpoint presentations (i.e. screenshots instead of text format), the enhancer extracts images from PDF files for automatic text recognition (OCR), too. + + +## Enable OCR + + +OCR is enabled by default in the Debian and Ubuntu packages and the virtual machine packages like Open Semantic Desktop Search or Open Semantic Search Appliance. If you build your search engine from the open source code [enable OCR by installing the open source software Tesseract OCR](../../admin/config/ocr#tesseract). + +If you disabled/enabled OCR, you should disable/enable OCR for images within PDF files, too, since many PDF files are scans and do contain much text data only as graphics. + +## How to optimize OCR settings to improve OCR results + + +You can optimize OCR to find more by different ways, which you can combine for optimal OCR results with fewer OCR failures: + +## Scanning resolution + + +If scanning documents yourself, scan or store the images with a higher resolution, so the OCR can analyse more details of the characters. + +## Language of dictionary + + + +Since OCR uses a language specific dictionary, [set the OCR language to your language or to multiple languages](../../admin/config/ocr#lang), which are used in your documents. + + +## Additional custom OCR dictionary entries from Thesaurus and Ontologies + + + +Fully integrated out of the box in next open source release: + +Concepts, words and names of named entities like organizations, places, locations or persons that are important for you so you added them to your [thesaurus](../thesaurus) or which are included in [lists of names or ontologies](../ontologies) (for example lists of names of relevant persons from internal meta data sources or from open data sources like [Wikidata](../opendata#wikidata)) you defined for faceted search/interactive filters and/or analytics/aggregated overviews are recognized better by OCR of scanned documents, too. + +Therefore your additional domain knowledge / vocabulary from thesaurus, lists and ontologies is used additional to the OCR language specific dictionary of Tesseract OCR. + +Since in many scanned legacy files on paper names are fully written in uppercase, this autogenerated custom OCR dictionary / OCR wordlist includes the uppercase variant of each word, too. + +So you should consider to rebuild your index / reindex important files by force (so they are analyzed again & reindexed, even if yet in index) after adding very important words or names to the thesaurus or provided by (new or changed) ontologies. + +## Disable usage of dictionaries and word lists + + +OCR results for unknown names which are not in such managed lists or dictionaries are better, if using dictionaries and lists is switched off. + +If you have enough CPU resources while indexing, you can combine results of both settings to index more names or words from scanned documents in correct spelling, since the search engine will find all results of both different and technically opponent OCR strategies. + +## Automatic deskewing and rotation of low quality scans before OCR + + +Many documents are scanned skew. + +Automatic deskewing of such low quality scans by [Scantailor](http://scantailor.org) before OCR can improve the OCR results. + +Therefore the [Scantailor plugin](../../admin/config/ocr#scantailor) is enabled, if not disabled because of performance isssues. + +## Training characters and fonts + + +You can train the OCR engine with the special fonts used in your documents to improve the machine learning model for recognition of characters of this fonts. + + +## How to manage OCR errors and fails + + +Despite all that optimization, automatic character recognition can fail and OCR errors like wrong recognized words or names occur. + +Therefore there are integrated tools for manual handling and management of OCR failures on document level for single documents or on meta level for all documents: + +### Handle OCR failures by collaborative tagging and annotation + + +For single documents with OCR failures you can add [annotations or tags](../annotation) with the words that were recognized wrong by the OCR engine, so the search engine can find them despite this OCR errors because of the tags or annotations written correct. + +### Manage OCR failures by thesaurus (Hidden labels) + + + +Manage common OCR failures for all documents by [Thesaurus entries for management of OCR errors (Hidden labels)](../thesaurus#hiddenlabel) + +Since you handle this OCR failure on meta level, the correction can be applied automatically to new documents with the same wrong recognized words or names. + +The [recommender can analyse the corpus for typos/OCR errors](../thesaurus/recommender) of a thesaurus entry and recommends such misspellings for adding to the thesaurus as hidden label by one click. + + +## Combining OCR results of multiple OCR tools + + +No OCR engine is perfect. + +So in some projects we used for example Abby Finereader to OCR the images in PDFs and additionally to the integrated Tesseract OCR. Each of them recognized words or names, on which the other OCR software failed. Because that combined and indexed both OCR results for the same document, we could find many documents more. + +The Open Semantic ETL framework is able to combine or unify and index analysis results of multiple analysis or OCR tools or OCR parameters for the same document or image. + + + +## More information about improving OCR quality + + +* [Improving the quality of the output of Tesseract OCR](https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality) +* [Koordinierungsprojekt zur Weiterentwicklung von OCR Verfahren](http://ocr-d.de/) \ No newline at end of file diff --git a/docs/doc/datamanagement/ontologies/README.md b/docs/doc/datamanagement/ontologies/README.md new file mode 100644 index 0000000..78b96ba --- /dev/null +++ b/docs/doc/datamanagement/ontologies/README.md @@ -0,0 +1,75 @@ +--- +title: Manage Lists, Dictionaries, Vocabularies & Thesauri (Ontologies) +authors: + - Markus Mandalka +--- + +# Manage Lists, Dictionaries, Vocabularies & Thesauri (Ontologies) + + +## Management of Lists of names or concepts, dictionaries, vocabularies, thesauri or ontologies for faceted search and ontology based text mining & document analysis + + + +If there is an existing list, dictionary, vocabulary or thesaurus or if the entries are available in other structured format like an semantic web ontology yet i.e. from other tools or some [open data sources](../opendata), you don't need to [enter or manage manually each named entity like persons, organizations, locations or important words or concepts to your own thesaurus](../thesaurus) to be able to use them for [analytics, navigation, aggregated overview and interactive filters](../../search#faceted_search). + +You can integrate or import additional, existing, shared or external list of names, thesauri, dictionaries, vocabularies or ontologies: + + +## Import external lists of names, thesaurus or ontologies + + + +Just click on "Import List of Names, Thesaurus or Ontology" and upload an file or reference to an file or web resource. + +![](../../../screenshots/import_ontology.png) + + +After klicking on "save" new documents will be analyzed by this thesaurus, ontology or list. + +After klicking on "Apply" all old documents will be tagged with this ontology, too. + +## Interactive filters and analytics by aggregated overview (Faceted search) + + +Use the search user interface and see the new search facet with the ontology or list name where you can see which names or concepts occur in how much documents and click on the name or concept to filter the results to documents where this name or concept occurs. + +[Learn more about faceted search.](../../search#faceted_search) +## Formats + + + +The formats will be autodetected: + +### Plain text lists + + +This list can be a plain text file with one name in each line. + +The charset / encoding should be autodetected. + +In cases the autodetection doesn't work correct for some old standards or local charsets, convert/export your data with the universal charset `UTF-8` first. + + +### Ontologies and Thesauri + + +Or it can be an ontology in the open standards Resource Description Format (RDF), Simple Knowledge Organisation System (SKOS) or OWL. + +Turtle format will follow (until then you can convert that to RDF format using a standard triplestore). + +If you want only to import one language of a multilingual thesaurus or ontology, you can use a standard triplestore to filter the thesaurus using a SPARQL query to select only labels in your favorite language and use/import only that part of the graph. + +### Spreadsheets and Tables (Excel or Open Office or Libreoffice Calc) + + +You can use data from tables or spreadsheets like Excel or Open Office Calc or Libre Office Calc or even columns from databases, too when there maybe will be an automatic import plugin for lists in this format, too (please donate). + +Meanwhile you have to convert tables or databases which are not in RDF format or plain text format yet to plain text lists manually: +* Open the data with Excel or OpenOffice or Libreoffice Calc. +* Select the column with the names +* Copy the column with the names (click Edit > Copy in the main menu or press CTRL & c) +* Open a new table +* Paste that column with the names (click Edit > Paste in the main menu or press CTRL & v) +* Save the new table with only this column in CSV format. Since the table has only one column, you will get a plain text list file. +* Upload or reference this export file like described for open semantic web formats or plaintext lists. diff --git a/docs/doc/datamanagement/opendata/README.md b/docs/doc/datamanagement/opendata/README.md new file mode 100644 index 0000000..5106327 --- /dev/null +++ b/docs/doc/datamanagement/opendata/README.md @@ -0,0 +1,106 @@ +--- +title: How to integrate Open Data to enhance semantic search, data analysis, text mining & document analysis +authors: + - Markus Mandalka +--- + +# How to integrate Open Data to enhance semantic search, data analysis, text mining & document analysis + + +## How data enrichment with Linked Open Data (LOD) from Open Access databases helps to improve search, find more results, analyse document sets and data sets and how monitoring with Open Data watchlists generates leads for investigative research + + +[Open Data](#opendata) from Open Access databases like [WikiData (structured data from Wikipedia)](#wikidata) can be used to improve analysis and navigation of your private data. + +It can generate [leads for important documents where important concepts or people occur](#leads). + +Or your private data or documents can be enriched with additional data or structures from open data. + +So the integration of Open Data with Open Source research tools enables easier search, more and better search results, analytics and interactive filters (faceted search), watchlists and other useful and powerful features by a combination of textmining and data analysis methods like [entity matching and entity tagging](#named_entities), analytics or [automatic classification by machine learning](#machinelearning). + +Computing all this with open source software on your own computer or server all that is possible [without giving away sensitive informations because of privacy issues with any cloud services](#privacy). + + +## Sharing data and Open Data + + + +If there is an existing list, dictionary, vocabulary or thesaurus or if the entries are available in other structured format like an semantic web ontology yet i.e. from other tools or some [open data sources](#wikidata), you don't need to enter manually each named entity like persons, organizations, locations or important words or concepts to the [thesaurus](../thesaurus) to use them for [analytics, navigation, aggregated overview and interactive filters](../../search#faceted_search). + +You can [import existing, shared or external list of names, thesauri, dictionaries, vocabularies or ontologies](../ontologies): + +![](../../../screenshots/import_ontology.png) + + +## Tagging named entities like people or organizations + + +[![](../../../screenshots/facets.png)](../../../screenshots/faceted_search.png) +Using this list of important names or ontology the [named entities tagger](../thesaurus) can tag documents in which this names occur. + + +## Leads for research by matching watchlists + + +So you get leads for potential relevant documents where important concepts or people on such a watchlist or ontology occur, i.e. if analysing a large unknown document set or dataset or after getting new documents or news. + + +## Analytics, aggregated overviews and exploration + + +By the faceted search you get an aggregated overview for the different facets like concepts, persons, locations or organizations showing, how many documents matching this entity. + + +## Interactive filters (faceted search) + + +You can use this overviews or named entities as interactive filter to narrow down search results. +So a click to a facet (i.e. an organization) will drill down the search results to fewer documents, matching this additional facet/filter, too. + + + +## Free open data source (Linked Open Data from WikiData) + + +One of the biggest and an universal [Open Data](https://en.wikipedia.org/wiki/Open_data) source is [WikiData](https://www.wikidata.org), the structured multilingual database from Wikipedia. + +From this structured datasource you can [select and download lists of names for example of important people like politicians](wikidata) for analysis of your document sets, navigation and interactive filters, enable semantic search to find aliases or names in other languages, watchlists, data for data enrichment or data for machine learning. + +## Finds more by thesauri of synonyms and irregular verbs (Wiktionary) + + + + +Another usage of Open Data is to use a dictionary and thesaurus like the Wikipedia Wiktionary or an Libre Office or Open Office hunspell dictionary to extend search queries or indexes so you are able to find synonyms and irregular verbs, too. + + + +## Automatic classification or disambiguation (machine learning) + + + +Another use of open data from WikiData or Wikipedia is to get good training data for classification and disambiguation. + +So we get for example the possibility to guess which meaning names or words with more than one meaning (homonyms) by comparing the context with big open data like Wikipedia by machine learning algorithms for automatic classification to disambiguate the named entity. + + + +## Privacy and data protection: Investigative Research with Open Source Software + + +With our free Open Source software and research tools you can use Open Data from open data sources on the internet even for investigative research in sensitive documents or other sensitive data with enhanced privacy needs like for example needed for investigative journalism: + +Since there is no cloud but only other peoples or companies computers, we want to compute our data ourselves with Free Software. + +So after download and import of an open dataset our open source search engine computes all matching and watching for this Open Data list or ontology only on your own laptop or server. There is no upload of documents content fotr analysis nor upload of matching names to a cloud service. + + +## Big Data analysis by Open Data + + + +This is even possible for many named entities or list entries and very much data or and huge document collections. + +In some research, text mining and data analysis projects we cross referenced documents with lists and ontologies with hundreds of thousands of names like politicians, species, materials or other important concepts to look for. + +In such cases you should import the list to thesaurus editor or ontologies manager for entity tagging before indexing the documents so most entities can be extracted more performant while and before indexing instead of later searches and document updates for each entity, which will need some time in such cases. \ No newline at end of file diff --git a/docs/doc/datamanagement/opendata/wikidata/README.md b/docs/doc/datamanagement/opendata/wikidata/README.md new file mode 100644 index 0000000..e68a93e --- /dev/null +++ b/docs/doc/datamanagement/opendata/wikidata/README.md @@ -0,0 +1,187 @@ +--- +title: Import lists of names from Wikidata knowledge graph +authors: + - Markus Mandalka +--- + +# Import lists of names from Wikidata knowledge graph + + +## Import lists of names from Wikidata for analytics of your document sets, structure of navigation, interactive filters and aggregated overviews + + +[Open Data](#opendata) from Open Access databases like [WikiData](#wikidata) (structured data and universal knowledge graph from Wikipedia in open standards for linked data and semantic web) can be used to improve search, analysis, filtering and navigation of your [private documents, news and data](#privacy). + +This tutorial describes how to [import multilingual lists of names from Wikidata](#import) as universal ontology, knowledge graph or [thesaurus](../../thesaurus) to +* [see / overview which of these names occur in your document sets or search results (aggregated overview)](#aggregated_overview) +* get [interactive filters for your documents by this names or entities](#interactive_filters) like persons (for example [all politicians of your parliament](#politics)), organizations or locations +* automatically [find aliases or the same names written in other languages, too](#altlabel) +* configure [alerts, feeds or leads for new documents where important concepts or people occur](#leads) by search or filter for/of that lists/facet + + + +## Wikidata as open data database and knowledge graph for fine granular structured multilingual linked data + + +If there is an existing list, dictionary, vocabulary or thesaurus or if the entries are available in other structured format like an semantic web ontology yet from open data sources like Wikidata, you don't need to enter manually each named entity like persons, organizations, locations or important words or concepts to the [thesaurus](../../thesaurus) to use them for [analytics, navigation, aggregated overview and interactive filters](../../../search#faceted_search). + +One of the biggest and an universal [Open Data](https://en.wikipedia.org/wiki/Open_data) source is [WikiData](https://www.wikidata.org), the multilingual structured database from Wikipedia. + +From this multilingual and fine granular structured datasource you can [select and download](https://query.wikidata.org) lists of names for example of people like [politicians](#politics) for your analysis of document sets & news, interactive filters (faceted search) or alerts. + + +## Automatic tagging with named entities in list like names of people or organizations from Wikidata + + +[![](../../../../screenshots/facets.png)](../../../../screenshots/faceted_search.png) +Using this list of important names or ontology the [named entities tagger](../../thesaurus) is tagging documents in which this names occur. + + +## Leads for research by matching watchlists + + +So you get leads for potential relevant documents where important concepts or people on such a watchlist or ontology occur, i.e. if analysing a large unknown document set or dataset or after getting new documents or news. + + +## Analytics, aggregated overviews and exploration + + +By the faceted search you get an aggregated overview for the different facets like concepts, persons, locations or organizations showing, how many of the found or all documents matching this entity. + + +## Interactive filters (faceted search) + + +You can use this overviews or named entities as interactive filter to narrow down search results. +So a click to a facet (i.e. an organization) will drill down the search results to fewer documents, matching this additional facet/filter, too. + +## Multilingual labels, alternate labels and aliases for Semantic Search + + + +Since the used open standards for Semantic Web and Linked Data labels like names can be multilingual, so you will find the names in different languages. + +So for example after import of names of politicians from Wikidata the semantic search for *Angela Merkel* will find documents which contain *Angela Dorothea Kasner*, too, which is birth name of *Angela Merkel* before she married. + +Additionally documents which contain *Angela Merkelowa* or *Ангела Меркель* will be found, too, which is *Angela Merkel* written in russian language. + + +## Open Standard for linked data and interoperability + + +Since Wikidata is using open standards for Linked Data and interoperability of the Semantic Web, the structured data in XML/RDF format and linked data by RDFS and SKOS thesaurus standard is interoperable and can be used for configuration of interactive filters and analytics of your document set in Open Semantic Search out of the box. + + + +## Import list or ontology or define Wikidata query + + + +So you can [import existing, shared or external list of names, thesauri, dictionaries, vocabularies or ontologies](../../ontologies): + +![](../../../../screenshots/import_ontology.png) + +## SPARQL query and SPARQL endpoint (triplestore) + + +Instead of uploading or referencing an yet downloaded graph or list of names, you can configure a SPARQL query on a triplestore (SPARQL endpoint) in the datasources user interface for ontololgies in the tab "SPARQL": + +![](../../../../screenshots/sparql.jpeg) + +Therefore you have to use SPARQL queries with CONSTRUCT (like you can see in our [SPARQL example queries](#examples)) or DESCRIBE (warning: much more overhead if the knowledge graph has more properties and linked data than only properties and data of a thesaurus) so the SPARQL results includes the following standard properties that are used for analytics: `rdfs:label` and/or `skos:altLabel` and/or `skos:hiddenLabel` +## Plain text lists + + + +If you work only with one single language you can export the results of a SELECT query for only a single field/property in CSV format (only one field, so you get a plain text list instead of a table) and import/upload/reference this plain text list of names to the Lists and Ontologies Manager, which is much more performant for this case, because you save download bandwidth and CPU resources while import. + + +## Privacy & data protection + + +Open Semantic Search sends only the queries of the defined lists to the internet or linked data cloud and downloads the lists of names. + +Different to common cloud services for named entity recognition, all other computing is done by open source software on your own computer or server without giving away sensitive informations like document content, search queries and how often and what has been found. + +If even this list queries are sensitive information you can do downloads manually over Tor and import the data from the saved local files/graphs/lists by referencing or uploading them to the ontologies manager. + + +# Wikidata SPARQL queries examples + + + +SPARQL Endpoint: `https://query.wikidata.org/sparql` + +## Politicians + + +### Germany (german politicians) + + +#### Members of german parialment + + +##### Deutscher Bundestag (Bundestagsabgeordnete) + + + +Current and former members of German parliament (Deutscher Bundestag) (>4000 names): +```` + +PREFIX skos: +CONSTRUCT { + ?uri rdfs:label ?label ; + skos:prefLabel ?prefLabel ; + skos:altLabel ?altLabel . +} +WHERE { + ?uri wdt:P39 wd:Q1939555 . + OPTIONAL { + ?uri rdfs:label ?label . + } + OPTIONAL { + ?uri skos:prefLabel ?prefLabel . + } + OPTIONAL { + ?uri skos:altLabel ?altLabel . + } +} + +```` + +The following SPARQL alternate using DESCRIBE would work, too, but is not recommended and would cause much more overhead if the knowledge graph has more properties and linked data than only thesaurus properties and data (like it is the case with Wikidata, which is a universal knowledge graph with many different properties, not "only" a thesaurus with labels and only a few types of relations): +~~`DESCRIBE ?uri WHERE { ?uri wdt:P39 wd:Q1939555 . }`~~ +##### Landtag (Landtagsabgeordnete) + + +###### Baden Württemberg + + +Current and former members of Landtag Baden-Württemberg: + +```` + +PREFIX skos: +CONSTRUCT { + ?uri rdfs:label ?label ; + skos:prefLabel ?prefLabel ; + skos:altLabel ?altLabel . +} +WHERE { + ?uri wdt:P39 wd:Q17481175 . + OPTIONAL { + ?uri rdfs:label ?label . + } + OPTIONAL { + ?uri skos:prefLabel ?prefLabel . + } + OPTIONAL { + ?uri skos:altLabel ?altLabel . + } +} + +```` +### List of politicians of other countries or parliaments + + +To find out more about queries for politicians of your country or your countries politicians are not yet available for download, you can help to add them to Wikidata in the working group [Every Politician](https://www.wikidata.org/wiki/Wikidata:WikiProject_every_politician). \ No newline at end of file diff --git a/docs/doc/datamanagement/rss/README.md b/docs/doc/datamanagement/rss/README.md new file mode 100644 index 0000000..52a251a --- /dev/null +++ b/docs/doc/datamanagement/rss/README.md @@ -0,0 +1,58 @@ +--- +title: RSS-Feed Manager +authors: + - Markus Mandalka +--- + +# RSS-Feed Manager + + +## Managing imports of RSS newsfeeds + + + +RSS-Feed manager is a web app and user interface for managing imports of RSS-Newsfeeds. + +## Usage + + +### Login + + +Login to the admin interface. + +Choose the application "RSS-Feed manager". + +### Add new Feeds + + + +Add a RSS-Feed or more Newsfeeds. + +Set the uri of the RSS-Feed. + +The title and description is optional and only for easier managing many feeds for humans. + +### How often to import: Delta time + + +If you dont want to import a feed on every cron run, set a delta time for the feed. + +Example: A delta time of `60` minutes will import the feed (and new news) only one time per hour or set to `0` minutes to import the feed on every cron run. + + +## Installation + + +See the [admin documentation](../../../rss-feed-manager-python-django). + +## Roadmap + + +Plans for the feature ([please donate](../../../donate)): + +We want to add tagging functionality to the RSS importer, so you can add metadata or tags to all news imported with this feed, i.e. a special topic). + +At the moment you can only setup [tagging with rules](../rules) because of the datasource URL (i.e. domain of a newspaper) or topics (i.e. keywords) but not additional tags only because the source of the articles was a special RSS-Newsfeed (i.e. a feed only for one topic, we would not find out the other ways and we can not find out because of URL of the article, because the domain has more then one topic). + +Additionally want to add tagging for RSS-Feed management, so you can organize many newsfeeds in the management interface with tags. diff --git a/docs/doc/datamanagement/rules/README.md b/docs/doc/datamanagement/rules/README.md new file mode 100644 index 0000000..5d49cd8 --- /dev/null +++ b/docs/doc/datamanagement/rules/README.md @@ -0,0 +1,61 @@ +--- +title: Rules: Rule based automatic tagging and automatic classification +authors: + - Markus Mandalka +--- + +# Rules: Rule based automatic tagging and automatic classification + + +## Setting search query based rules for automatic classification + + +Since the [Thesaurus editor and named entity manager](../thesaurus) allows not only to set keywords or names to extract known named entities like locations or organisations but [flexible and powerful search operators for simple or complex queries](../../search/operators) you can use it for defining **rules** for **automatic classification** of new content or for easy and flexible definitions of news pipes or channels for example for alerts, automatically filtered newsfeeds for different channels, for further reading or automatic publishing. + + +## Classification or tagging with categories for navigation and interactive filters + + +Since this flexibility you can use the query based tagging even for better navigation and overview trough exploratory search by additional search facets or flexible rule based aggregated overviews of differenced and / or grouped aspects, known as pivot tables. + + + +![](../../../screenshots/named_entities_manager.png) + +## Tagging for alerts or newsfeeds + + +For example you can setup to tag all new articles with a keywords or search queries like `myCompanyname` or with more words like `myTown murder` or more complex queries like `myTown AND shooting AND NOT "shooting star" AND NOT "photo shooting"` with the tag `maybe urgent and/or important` and subscribe only this tag as alert or newsfeed instead managing subscriptions or alerting of many queries. + + +## Groups + + +In the admin interface you can add some or many of such rules to groups, i.e. to the group (or since groups can be part of a parent group even a taxonomy) "Violence". + +So you can manage many alerts and search queries with the admin interface and your users have only to subscribe one tag or group instead of subscribing each of the (new) queries. + +## Alerts if new or changed number too small or too big + + +Or if you indexing data sources like datasets or tables with columns with numbers you can subscribe alerts for new rows that are or get bigger or smaller than the value you set in your search query. + +## Qualifying with automatic classification + + +For example you can set rules like if source is a certain domain (with a search query like field URI like +`https://www.trusted-investigative-journalism-organisation.org/*`) then tag the article to the category "proven source". + +The other way you can classify content from advertising or boulevard media with the tag "not a reliable source" in the facet "information quality" + + +## News pipes + + + +So you can easy define newspipes: For example if there was an important alert for a special topic and a colleague who is specialist for that toppic verified that and tagged the new article with the tag "verified" mark it for a channel where more people will read it or are subscribed to or mark it for a news pipe for further verifying for other colleagues or further automatic filtering. + +## Custom facets / fields / properties + + +Rules can tag their values to the standard facet like *Tags* or *Author* or you can choose a custom facet to have a faceted search and navigation with different facets like "Locations" or "Organisations" or other custom facets. diff --git a/docs/doc/datamanagement/tagging_results_of_search_query/README.md b/docs/doc/datamanagement/tagging_results_of_search_query/README.md new file mode 100644 index 0000000..f9ba242 --- /dev/null +++ b/docs/doc/datamanagement/tagging_results_of_search_query/README.md @@ -0,0 +1,44 @@ +--- +title: Tagging by search query +authors: + - Markus Mandalka +--- + +# Tagging by search query + + +You don't have to tag each document of a search result manually i.e. by the [tagger app](../annotation) to be able to use the interactive filter (faceted search) for the tag(s). + +## How to tag all results of a search query automatically + + + +The module [Multi-Tagger or Query-Tagger app](../../../solr-search-querytagger-python-django) searches for all results of a given search query and tags all found documents or files with the given tag in the given facet (i.e. "Tags", "Organization" or "Location") + +So you can tag many documents at once with easy or with complex search queries. + +## Usage + + + +Insert a query (this can be a name or a [complex search query](../../search)). + +Select the facet to which the tag should be added. + +Optionally insert a value or tag. + +Press submit and wait for a status how many documents were tagged. + +## Use the user interface for creating search queries + + +If you don't want to type in a complex query, use the standard search user interface with its comfortable web interface for exploratory search and interactive filters (facets) and press "tag all results" there or select the view "show query" if you want to copy paste it to change or add some parts. + + +## Thesaurus for management of automatic tagging or rules based classification + + + +This tool is for quick and dirty one time tagging, i.e. to structure an small one time investigation where no new documents will be indexed and where you don't have to store or manage this query. + +If you want to store, manage and reuse such tagging queries and tag automatically and continuesly for all new data or documents matching a search query you might want to use the [thesaurus for named entities like organizations, persons, locations or concepts](../thesaurus), doing the same but automatically. \ No newline at end of file diff --git a/docs/doc/datamanagement/thesaurus/README.md b/docs/doc/datamanagement/thesaurus/README.md new file mode 100644 index 0000000..e643838 --- /dev/null +++ b/docs/doc/datamanagement/thesaurus/README.md @@ -0,0 +1,213 @@ +--- +title: Thesaurus editor for editing, structuring & linking vocabulary or dictionary of topics, concepts & names +authors: + - Markus Mandalka +--- + +# Thesaurus editor for editing, structuring & linking vocabulary or dictionary of topics, concepts & names + + +## User interface for editing, linking and managing vocabulary (words, topics, terms or concepts) and named entities (i.e. persons or organizations) of a custom thesaurus for structuring semantic search & document analysis by domain knowledge + + + +![](../../../screenshots/named_entities_manager.png) + + +Open Semantic Thesaurus Editor and Thesaurus Manager is the integrated Django (Python) based open source web app as user interfaces for editing, linking, management and structuring of a controlled vocabulary or domain knowledge. + +So you can manage important terms, words or concepts, names, topics, persons, organizations or places in a custom thesaurus for [editing names, entities or concepts](#editor), their [alternate labels like aliases (i.e. nickname), synonyms (a car is a vehicle, too)](#synonyms) or [typos and misspellings](#hiddenlabel) and its [structure or relations](#relations) like hyponyms (even if not every car is a truck, every truck is a vehicle, too). + +The structured data will be used for structuring [faceted search](../../search) and [analysis or text mining of indexed documents](../../analytics/textmining) and to be able to find more by semantic search by considering alternate spellings or synonyms: + + +## How to manage structure like names, organizations, locations, places, persons of interest or important words or concepts + + + +Therefore open the webapp clicking on "Thesaurus" in the topbar of the search interface and use its web user interface to insert or edit entities and to manage their aliases or groups. + +With the thesaurus user interfaces you can manage relevant named entities like organizations or company names, persons of interest, locations or concepts for automatic tagging (autotagging) and for automatic analysis for exploratory search: + + +## Easy adding of new entities: Just add a name, a word or a query + + + +Just add a new entity, set a name or word and save it: + +![](../../../screenshots/named_entities_manager.png) + + +Just click on the "Add new entity" button (in your entity list or in the topbar of the entities manager), set a name like a company name or a concept like an interessting or important word into the field "Name" and click the "Save" button. + +All other more complex but very powerful features like alternate labels for synonyms, hidden labels for typos or relations to other concepts are optional. + +## Structures search navigation and document analysis like overviews, interactive filters, semantic search (Faceted search by Thesaurus based Named Entity Extraction & Named Entity Linking) + + + +![](../../../screenshots/facets.png) + + +The entries of the thesaurus are used for automatic tagging for additional structure for analysis and named entity extraction or named entity linking for exploratory search or as tags for news pipes or alerts: + +Based on the thesaurus entries the named entity tagger or named entity extraction can find the name or label, alternate labels like synonyms and misspellings and add the name (prefered label) to the configured facets for aggregated overview, interactive filters and analytics. + +For example if you add the entity "Open Semantic Search" with/to the facet "Software", you will be able to use this entity or name as interactive filter and will get an aggregated overview of the count of documents matching this entity while searching for other queries. + +Additionally using the alternate labels, aliases or synonyms, the semantic search can not only find exactly the terms the user search for, but the search engine will find documents with alternate terms like synonyms, too. + + +## Alternate labels and synonyms + + +Alternate spellings, aliases or synonyms of a concept can be added to "Alternate labels". + +Different [fuzzy search methods](../../search/fuzzy) are integrated to [recommend alternate Labels](recommender). + + + +## Manage misspellings or typos and errors by automatic textrecognition (OCR) + + +Since no [automatic textrecognition (OCR)](../ocr) is perfect and there are typos in documents you didn't write yourself and can not change or since your users will write terms wrong in their queries, you can manage typos and OCR errors: + +For each concept or name you can define hidden labels or misspellings i.e. with misspelled variants of the name or concept, so the name or concept will be found, too, even if it is misspelled in the documents. + +### Recommender for misspelled names or OCR errors + + +The [thesaurus recommender can generate automatic recommendations of such hidden labels or misspelled names from variants of misspelled text](recommender) inside your documents (corpus). + + +## Broader concept + + +You can link to broader concepts up in the hierarchy or taxonomy. + +## Narrower concept + + +You can link to narrower concepts down in the hierarchy or taxonomy. + +You can use the [recommender for compounded words to automatically find some recommendations for narrower terms](recommender) you can add with one click. + +## Related terms + + +You can link to related terms which are not on higher level or lower level of the hierarchy or taxonomy. + +### Recommendation of related terms + + +Please donate for automatic recommendations of other related terms (often co-ocurences) which can be found by topic modelling (machine learning by LDA) + + +## Search query (optional) + + +Mostly you need only to set a name of a entity to tag it for exploratory search, aggregated overviews and interactive filters (faceted search) . + +If there is no (optional) search query in the tab query, this name will be used as the search query per default. + +But optional you can set a little bit different (i.e. including wildcards) or more complex queries than the name in the tab "Query". + +For example +`"shooting in my town" AND NOT "photo shooting in my town"` +## Custom tags (optional) - i.e. for alerts or newsfeeds or for classification + + +For example you can setup to tag all new articles with a keywords or search queries like `myCompanyname` or with more words like `myTown murder` or more complex queries like `myTown AND shooting AND NOT "shooting star" AND NOT "photo shooting"` with the tag *maybe urgent and or important* and subscribe this tag as alert. + + +## Groups / Lists (optional) + + + +You can add named entities to groups. + +For example if you add the entity "shooting" to the group "violence", documents with "shooting" will be tagged with "violence", too, even if not containig the word violence. + +If you search or filter with the group "violance", documents with the named entity "shooting" (which was assigned to this group/list) and all other named entities assigned to this group will be found, too. + +So you get an aggregated overview by groups/lists or you are able to filter or search not only by single entities but by whole groups/lists. + + + +## Taxonomies: Navigate and filter with groups, lists or collections and find and navigate subtopics (optional) + + +Since you can set groups to a parent group, you can build a hierarchy or taxonomy to be able to find, overview or navigate subtopics. + +For example if you search or filter for the facet violence all terms of the group like "shooting" or "murder" will be found too and you get an aggregated overview over all forms together and over the different forms. + +Or for example if you add the entity or product "Open Semantic Search" with the alias "@OpenSemSearch" to the group "Solr" which has the parent group "Search engine" which has the parent group "Open Source Software" the documents with the content "Open Semantic Search" or tweets from @OpenSemSearch will be tagged and found with "Open source" and with "search engine" and "Solr" even if not containing this words. + + + + +## Import external lists of names, thesaurus or ontologies + + +You don't need to enter each entity like persons, organizations, locations or concepts, if there is an exisiting list or if the entries are available in other structured format yet. + +You can import existing, shared or external list of names, thesauri, dictionaries, vocabularies or semantic web ontologies with the [lists and ontologies manager](../ontologies): + + +[![](../../../screenshots/import_ontology.png)](../ontologies) + + +Learn more about [how to import a lists, a dictionary, a vocabulary, a thesaurus or an ontology](../ontologies). + + +### Interoperability by open standard for a Simple Knowledge Organization System (SKOS) + + +For interoperability reasons the thesaurus can be imported from and exported to the open standard formats Resource Description Framework (RDF) and Simple Knowledge Organization System (SKOS). + + +### Integrate and import thesauri from other RDF or SKOS compatible tools or open data sources + + +Since the [ontologies manager](../../datamanagment/ontologies) for named entities extraction is able to import the open semantic web standard Resource Description Framework (RDF) and Simple Knowledge Organization System (SKOS) you can import or integrate (additional) thesauri from other thesaurus editors or thesaurus management tools by importing their thesauri. + +### Open thesauri and Open Data vocabularies + + +You don't have to create an own thesaurus for common concepts or topics. + +In many cases it is less effort to integrate or import public thesauri from the [linked open data (LOD)](../opendata) cloud. + +## Export thesaurus to RDF and SKOS + + +The thesaurus will be exportable to the open standard format Resource Description Framework (RDF) and [Simple Knowledge Organization System (SKOS)](https://www.w3.org/TR/skos-primer/), so you can use it in other software and knowledge management tools or share or publish it. + + +## Methods for managing a vocabulary for semantic search + + +* [Thesaurus](https://en.wikipedia.org/wiki/Thesaurus) for linking concepts and managing aliases and synonyms +* Simple Knowledge Organization System (SKOS): Open standard for thesauri from W3C +* Managing [Named Entities](https://en.wikipedia.org/wiki/Named_entity) like names, persons, organizations, places, terms and concepts as database or knowledge base for [Named Entity Linking](https://en.wikipedia.org/wiki/Entity_linking) +* Synonyms +* Hyponyms (narrower terms) +* [Taxonomy](https://en.wikipedia.org/wiki/Taxonomy_(general)) (defining hierarchy or tree by links to narrower or broader terms) for [taxonomy based search navigation](https://en.wikipedia.org/wiki/Taxonomy_for_search_engines) + + +## Alternate free software and open source tools for thesaurus editing + + + +Alternate Simple Knowledge Organization System (SKOS) standard compatible free software open source tools and for editing and managing thesauri: +* [Skosmos](http://skosmos.org/) (PHP & SPARQL) +* [SkosJS](https://github.com/tkurz/skosjs) (Javascript & SPARQL) +* [Unilexicon](https://unilexicon.com/) +* [Vocbench](http://vocbench.uniroma2.it/) +* [TemaTres](http://www.vocabularyserver.com) +* [OpenSKOS](http://openskos.org) +* [iQvoc](http://iqvoc.net/) (Ruby on rails) + + +[More in W3C Wiki](https://www.w3.org/2001/sw/wiki/SKOS) ... diff --git a/docs/doc/datamanagement/thesaurus/recommender/README.md b/docs/doc/datamanagement/thesaurus/recommender/README.md new file mode 100644 index 0000000..e319f5a --- /dev/null +++ b/docs/doc/datamanagement/thesaurus/recommender/README.md @@ -0,0 +1,41 @@ +--- +title: Recommender for thesaurus entries +authors: + - Markus Mandalka +--- + +# Recommender for thesaurus entries + + +## Recommender for misspelled names or OCR errors + + +Since no automatic textrecognition (OCR) is perfect and there are typos in documents you didn't write yourself and can not change or since your users will write terms wrong in their search queries, you can [manage typos and OCR failures in the thesaurus](../../thesaurus#hiddenlabel): + +For each concept or name you can define hidden labels or misspellings i.e. with misspelled variants of the name or concept, so the name or concept will be found, too, even if it is misspelled in the documents. + +The recommender can generate automatic recommendations of such [hidden labels](../../thesaurus#hiddenlabel) of misspelled names by [finding such typos by edit distance (levensthein distance) on variants of misspelled text](../../../search/fuzzy#editdistance) inside your documents (text corpus). + + +## Grammar based recommender for alternate labels + + + +Using [stemming](../../../search/fuzzy#stemming) you can analyse and add other word forms of same term despite morphology of verbs (decline) on the base of multiple stemmers. + + +## Compounded words linking by semi-automatic recommender + + + +For easy managing of compounded words, the recommender shows you automated recommendations for compounded words from your documents (corpus), so you can add and link them with only a few clicks. + +You have the choice to link them as a synonym or as a broader or narrower term. + +Compounded words are found by [wildcards](../../../search/fuzzy#wildcards). + +## Solr config + + +To be able to work with the recommender you have to switch the option "stored" to true for the fields \_text\_ and stemmed in the managed-schema config and setup all cach-all fields for all stemmers you want to use with the option stored enabled. + diff --git a/docs/doc/datavisualization/README.md b/docs/doc/datavisualization/README.md new file mode 100644 index 0000000..d135196 --- /dev/null +++ b/docs/doc/datavisualization/README.md @@ -0,0 +1,51 @@ +--- +title: Data visualization +authors: + - Markus Mandalka +--- + +# Data visualization + + +## Datavisualization of search results or analytics results + + + +Integrated visualization tools to visualize data or visualize text with charts, graphs or wordclouds: + +## Trend chart (how many documents when) + + +[Trend chart](../analyze/trend): When how many results or documents? + +![](../../screenshots/trend.png) + +## Networks, relations and connections (graph visualization) + + +The [visual graph explorer for graph visualization, discovery and exploration of connections](../analytics/graph) generates data visualizations of networks, connections and relations between named entities like persons, organizations or tags from the content of your documents. + +![](../../screenshots/visual_graph_explorer.png) + +## Word list and word cloud (words) + + +[Word list and word cloud](../analyze/words): Most used words, concept or names + + +![](../../screenshots/wordcloud.png) + +## Visualize text for text mining (content) + + +[Visualize text for text analysis, text mining, document mining and words](../analytics/textmining): What content? + + +![](../../screenshots/WordTree.jpg) + +## Open Source Datavisualization tools for quantitative data + + +Open Semantic Search focus is on information retrieval, text analysis and text mining of mostly qualitative data from text documents wherefore the data sources can be vast amounts or masses of documents and considering their size of the corpus or data volume big data, too. + +But for interactive data analytics and datavisualizations of quantitative data like numbers and diagrams you should use other open source data analytics and data visualization tools like [Apache Zeppelin](https://zeppelin.apache.org) supporting different data stores, [Kibana for Elastic Search](http://www.elastic.co/de/products/kibana) or Banana for Solr focused more on numbers and quantity than on text and quality. \ No newline at end of file diff --git a/docs/doc/desktop_search/README.md b/docs/doc/desktop_search/README.md new file mode 100644 index 0000000..3297207 --- /dev/null +++ b/docs/doc/desktop_search/README.md @@ -0,0 +1,57 @@ +--- +title: Open Semantic Desktop Search +authors: + - Markus Mandalka +--- + +# Open Semantic Desktop Search (VM) + +## Free software for your own desktop search engine for full text search, exploratory search and text analysis on Windows or Mac + +Open Semantic Desktop Search is **free open source software** for your own **desktop search engine** with integrated text analytics and research tools for **full text search, exploratory search & text mining** in large document sets, many PDF files, Word documents and many other file formats on Windows or Mac. + + +## Desktop search engine package as virtual machine for single Linux, Windows or Mac users + +The free software *Open Semantic Desktop Search* based on *Open Semantic Search* is the **all in one package for desktop users** (including Solr search server, user interfaces, open source search tools and connectors) **as virtual machine image** for [full text search, exploratory search, analytics and text mining in many documents](../search) on your own desktop computer or notebook on *Linux*, *Windows* or *iOS (Mac)*. + + +## Installation and configuration + +Like described in the [tutorial with screenshots how to install and configure the Open Semantic Desktop Search virtual machine](../admin/install/desktop_search/README.md) just import the appliance file into Virtual Box and in the settings of the virtual machine add shared folders pointing to your documents directory or directories. + + +## Starting the search engine + +* Start [*Virtual Box*](https://www.virtualbox.org) +* Start the virtual machine (VM) "*Open Semantic Desktop Search*" + + +## Search, explore and analyse + +Use [powerful research tools for full text search, exploration, discovery, analysis, text mining and document mining](../search/README.md) + +![](../../screenshots/search.png) + + +## Index documents + +Indexing documents from all configured shared folders will be started automatically after starting the Desktop Search virtual machine. + +You can index new documents which were added after the start of the virtual machine without need to restart: + +- Click or touch the menu *Activities*. + + ![](../../screenshots/vm_activities.png) + +- Click or touch the launcher "*Index all documents for search*" for recrawling all documents and subfolders in your document folder + + ![](../../screenshots/vm_index_documents.png) + + +## Launch the search user interface + +The search interface will be started automatically after new documents were added to the document processing queue. + +If you close the browser, you can open the search interface again: +Launch the search user interface by clicking the launcher "*Search for documents*" or one of the other powerful research tools. diff --git a/docs/doc/modules/README.md b/docs/doc/modules/README.md new file mode 100644 index 0000000..f9a9948 --- /dev/null +++ b/docs/doc/modules/README.md @@ -0,0 +1,528 @@ +--- +title: Search engine components and architecture +authors: + - Markus Mandalka +--- + +# Search engine components and architecture + +**Open source search engine architecture (components and modules) and processing (data integration, data analysis and data enrichment)** + +# Architecture overview + +## Overview of services and main components + +The relations in this chart show dependencies and connections between services and main components witch show different directions than the data flow (see another [flowchart of document processing and data flow](#flowchart-of-document-processing-and-data-flow)). + +```mermaid + +flowchart TB + + +subgraph CONTAINER_UI [User interface] + + direction TB + + subgraph COMPONENT_WEBSERVER [Apache webserver] + + direction TB + + + subgraph COMPONENT_DJANGO[Python Django] + + COMPONENT_APPS[Web apps] + + COMPONENT_DJANGO_DB[(Django DB)] + COMPONENT_APPS ----> COMPONENT_DJANGO_DB + end + + subgraph COMPONENT_PHP[PHP] + COMPONENT_SEARCH_UI[Solr-PHP-UI] + end + + end +end + + +subgraph CONTAINER_SOLR [Apache Solr] + direction TB + + COMPONENT_SOLR[Solr Server] + click COMPONENT_SOLR "../../solr" + COMPONENT_SOLR --> COMPONENT_SOLR_DOCUMENT_INDEX + COMPONENT_SOLR --> COMPONENT_SOLR_ENTITIES_INDEX + + COMPONENT_SOLR_DOCUMENT_INDEX[(Document index)] + COMPONENT_SOLR_ENTITIES_INDEX[(Entities index)] + +end + +subgraph CONTAINER_ETL [Open Semantic ETL] + + direction TB + + COMPONENT_OPENSEMANTICETL_FILECRAWLER[File crawler] + COMPONENT_OPENSEMANTICETL_FILECRAWLER --> COMPONENT_CELERY + + COMPONENT_OPENSEMANTICETL_WORKER[Open Semantic ETL worker] + + COMPONENT_OPENSEMANTICETL_PLUGINS[ETL plugins] + COMPONENT_OPENSEMANTICETL_WORKER --> COMPONENT_OPENSEMANTICETL_PLUGINS + + + COMPONENT_CELERY[Celery task manager] + click COMPONENT_CELERY "../admin/queue/" + + COMPONENT_OPENSEMANTICETL_WORKER --> COMPONENT_CELERY + +end + + +subgraph CONTAINER_QUEUE [RabbitMQ] + + direction TB + + COMPONENT_RABBITMQ[RabbitMQ] + click COMPONENT_RABBITMQ "../admin/queue/" + COMPONENT_RABBITMQ --> COMPONENT_RABBITMQ_DATA + + COMPONENT_RABBITMQ_DATA[(Task queue)] + click COMPONENT_RABBITMQ "../admin/queue/" + +end + + +subgraph CONTAINER_TIKA [Apache Tika] + + direction TB + + COMPONENT_TIKA_SERVER[Tika Server] + click COMPONENT_TIKA_SERVER "https://github.com/opensemanticsearch/tika-server.deb" + + COMPONENT_TIKA_SERVER --> COMPONENT_OCR_CACHE + + COMPONENT_OCR_CACHE[Tesseract OCR Cache] + COMPONENT_OCR_CACHE --> COMPONENT_OCR + COMPONENT_OCR_CACHE_DATA[(OCR cache)] + COMPONENT_OCR_CACHE ----> COMPONENT_OCR_CACHE_DATA + + COMPONENT_OCR[Tesseract] + click COMPONENT_OCR "https://github.com/opensemanticsearch/tesseract-ocr-cache" + + +end + +subgraph CONTAINER_NEO4J [Neo4j] + direction TB + + COMPONENT_NEO4J[Neo4J] + click COMPONENT_NEO4J "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/export_neo4j.py" + COMPONENT_NEO4J --> COMPONENT_NEO4J_DATA + COMPONENT_NEO4J_DATA[(Graph Database)] + +end + +subgraph CONTAINER_NER [SpaCy NLP] + + direction TB + + COMPONENT_NER[spacy-services] + + COMPONENT_NER_MODELS[(ML models)] + COMPONENT_NER --> COMPONENT_NER_MODELS + +end + + COMPONENT_EL[Open Semantic Entity Search API] + click COMPONENT_EL "https://github.com/opensemanticsearch/open-semantic-entity-search-api" + +COMPONENT_OPENSEMANTICETL_PLUGINS -->|Get tags and annotations| COMPONENT_APPS +COMPONENT_OPENSEMANTICETL_PLUGINS -->|Entity extraction by thesaurus and ontologies| COMPONENT_EL +COMPONENT_OPENSEMANTICETL_PLUGINS ---->|Metadata and text extraction| COMPONENT_TIKA_SERVER +COMPONENT_OPENSEMANTICETL_PLUGINS ---->|Named entity recognition| COMPONENT_NER +COMPONENT_OPENSEMANTICETL_PLUGINS ------>|Index data| COMPONENT_SOLR +COMPONENT_CELERY ------>|Read and write task queue| COMPONENT_RABBITMQ +COMPONENT_OPENSEMANTICETL_PLUGINS ------>|Index data| COMPONENT_NEO4J + + + +COMPONENT_EL -->|Extract entities in entities index from full text| COMPONENT_SOLR +COMPONENT_SEARCH_UI -->|Search queries| COMPONENT_SOLR +COMPONENT_APPS -->|Read search queries| COMPONENT_SOLR +COMPONENT_APPS -->|Write entities managed by thesaurus or ontologies| COMPONENT_SOLR + +``` + + + + + +## Flowchart of document processing and data flow + +```mermaid + +flowchart TD + +FILEMONITORING[Filesystem monitoring] +click FILEMONITORING "../../trigger/filemonitoring/" + +FILEMONITORING-->|Immediatelly add task if changed or new file| CELERY + +SCHEDULER[Cron scheduler] +click SCHEDULER "https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/etc/cron.d/open-semantic-search" + +SCHEDULER -->|Regularly start crawler| FILECRAWLER + +FILECRAWLER[File directory crawler] +click FILECRAWLER "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/etl_filedirectory.py" + +FILECRAWLER -->|Add task for each new or changed file in crawled directory| CELERY + +CELERY[Celery task manager] +click CELERY "../admin/queue/" + +CELERY -->|Parallel processing of files by multiple ETL workers| ETL_WORKER +CELERY --> RABBITMQ + +RABBITMQ[(RabbitMQ task queue)] +click RABBITMQ "../admin/queue/" + +RABBITMQ --> CELERY + +ETL_WORKER[Open Semantic ETL worker] +click ETL_WORKER "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/tasks.py" + +ETL_WORKER -->|Running configured plugins one by one| TIKA + +subgraph TIKA [Apache Tika for text extraction and metadata extraction] + direction LR + + TIKA_PLUGIN[ETL plugin calling Tika] + click TIKA_PLUGIN "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_extract_text_tika_server.py" + + TIKA_PLUGIN -->|Document file| TIKA_SERVER + + TIKA_SERVER[Apache Tika Server] + click TIKA_SERVER "https://github.com/opensemanticsearch/tika-server.deb" + + TIKA_SERVER -->|Image files or images in PDF|OCR + TIKA_SERVER -->|Extracted text| TIKA_PLUGIN + + OCR[Tesseract OCR] + click OCR "https://github.com/opensemanticsearch/tesseract-ocr-cache" + + OCR-->|Recognized plain text| TIKA_SERVER + +end + +TIKA -->|Extracted text and metadata| EntitySearchAPI + +subgraph EntitySearchAPI [Named Entity Extraction by lists of names, thesaurus and ontologies] + direction LR + + EL_PLUGIN[ETL plugin for entity extraction] + click EL_PLUGIN "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_entity_linking.py" + + EL_PLUGIN -->|Plain text| EL + + EL[Open Semantic Entity Search API] + click EL "https://github.com/opensemanticsearch/open-semantic-entity-search-api" + + EL -->|Extracted entities| EL_PLUGIN + + THESAURUS[(Thesaurus)] + click THESAURUS "https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/src/thesaurus/models.py" + + THESAURUS -->|SKOS| EL + + ONTOLOGIES[(Ontologies)] + click ONTOLOGIES "https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/src/ontologies/models.py" + + ONTOLOGIES -->|RDF| EL +end + +EntitySearchAPI -->|Added extracted named entities by lists of names, thesaurus and ontologies| NER + +NER[ETL plugin for spaCy Named Entity Recognition by Machine Learning] +click NER "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_ner_spacy.py" + +NER -->|Added recognized named entities| ANNOTATIONS + +subgraph ANNOTATIONS [Get tags and annotations for this documents made by humans] + direction RL + + ANNOTATIONS_DB[(DB with tags and annotations)] + click ANNOTATIONS_DB "https://github.com/opensemanticsearch/open-semantic-search-apps/blob/master/src/annotate/models.py" + + ANNOTATIONS_DB --> ANNOTATIONS_PLUGIN + + ANNOTATIONS_PLUGIN[ETL enrichment plugin getting tags and annotations] + click ANNOTATIONS_PLUGIN "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/enhance_annotations.py" +end + +ANNOTATIONS -->|Added tags and annotations| ANALYSIS_PLUGIN + +ANALYSIS_PLUGIN[ETL data analysis plugin like extraction amounts of money] +ANALYSIS_PLUGIN -->|Added extracted amounts of money| OTHER_PLUGINS + +OTHER_PLUGINS[Other configured ETL Plugins] +OTHER_PLUGINS -->|Plain text and strucured data| EXPORTER + +EXPORTER[Exporter plugins] +EXPORTER -->|Index data for full text search and faceting| SOLR +EXPORTER -->|Index data for full text search and faceting| ELASTICSEARCH +EXPORTER -->|Index linked data for graph search| NEO4J + +SOLR[(Apache Solr document index)] +click SOLR "../../solr" + +SOLR -->|Search results| UI + +UI[Web user interface for search] +UI -->|Solr search query| SOLR + +ELASTICSEARCH[(Alternate Elastic Search)] +click ELASTICSEARCH "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/export_elasticsearch.py" + +NEO4J[(Neo4J Graph Database)] +click NEO4J "https://github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/export_neo4j.py" + +``` + +# Components and Modules + +- **[User Interface](../search/README.md)**: Client and user interface + - **Search query forms**: Search query form for full text search + - **Explorer and navigator**: Search with full text search and navigate (exploratory search) the index or search results with **interactive filters (facets)** + - **Viewers**: Parts of the UI to show different views (i.e. analytics like wordlcouds or trend charts) and previews for special formats (i.e. photos, documents, email ...) + - Code: /solr-php-ui/templates/ + - **Annotators**: Web Apps for tagging documents or CMS with forms and fields to manage meta data like tags or annotations + - **Search Apps**: Applications and user interfaces for search like search with lists tool or named entities manager +- **Index and search server (Solr or Elastic Search)**: Search server managing the index (indexer) and running search queries (query handler) + - Datamodel/Schema: src/solr.deb/var/solr/data/opensemanticsearch/conf/managed-schema + - Storage: /var/solr/data + - Log: /var/solr/logs/ +- **[Open Semantic ETL](../../etl "Framework for data integration, data analysis and data enrichment")**: Framework for data integration, data analysis, data enrichment and ETL (Extract, transform, load) pipelines or chains + - **[Connectors, importers, ingestors or crawlers](../admin/connectors)**: Import data from a data source (i.e. file system, file directory, file share, website or newsfeed) + - **Parsers:** *Apache Tika* to extract text and metadata from different file formats and document formats + - **Entity extraction and entity linking**: [Open Semantic Entity Search API](https://github.com/opensemanticsearch/open-semantic-entity-search-api/blob/master/README.md) + - **[Data enrichment plugins and enhancer](../data_enrichment)**: Enhancing content with additional data like meta data (i.e. tagging or annotations) or analytics (i.e. OCR) + - **ETL Exporter** or Loader for Solr or [Elastic Search](../../etl/elasticsearch): Indexing the data to search index +- **Trigger**: Your CMS or your file system (file system monitoring) will notify the web service (API) when there is new data or when content changed, so you dont have to burn resources for recrawl often to be able to find new or changed content very soon +- **[Web services (REST-API)](../admin/rest-api)**: Available via standard network protocol HTTP and waiting until you (i.e. using the web admin interface) or another service (i.e. using the REST-API) demands actions like crawling a directory or a webpage and starting this actions +- **[Queue manager (Celery on RabbitMQ)](../admin/queue/README.md)**: Managing task queue and starting of text extraction, analysis, data enrichment and indexing jobs by the right balance of parallel workers +- **[Scheduler](../admin/config/scheduler)**: Managing starting of scheduled indexing jobs. This can be crontab for Cron starting the command line tools. + Config: /etc/cron.d/open-semantic-search + + +# Document processing, extract, transform, load (ETL) and enhancing by data enrichment and data analysis + +How (new) data is handled by this components and [ETL (extract, transform, load), document processing, data analysis and data enrichment](../../open-semantic-etl): + +* A user manually or a Cron daemon automatically from time to time starts a command +* The command line tools or the web API getting this command starts a ETL (extract, transform, load), data analysis and data enrichment chain to import, analyze and index data +* A input plugin or [connector](../admin/connectors) (i.e. the connector for the file system or the connector for a website) reads from its datasource +* The connectors, an Apache Tika parser, or a file format based data converter or extractor extracts data from the given document or file format +* The ETL framework calls all configured [enhancer plugins for data enrichment](../data_enrichment) to get additional analysis for the data or annotations to this data from a CMS. +* The output storage plugin or indexer index the text and metadata to the Solr index or to the [Elastic Search index](../../etl/elastic_search), so all other tools can search this data +* The user uses a user interface like the search user interface, the search apps or some other tools to search based on the search API of this index + + +# Services and Microservices + +Linux services: + +tika + - Text extraction and OCR + +tika-fake-ocr + - Text extraction without OCR + +solr + - Search index + +spacy-services + - spaCy NLP + +opensemanticetl + - ETL workers + +rabbitmq-server + - Task queue + +flower + - Task queue monitoring user interface + +apache2 + - Search UI + - Search apps (f.e. thesaurus app or config UI) + - Entity Search API + + +# User Interface and search applications + +## [Solr-PHP-UI](../../solr-php-ui) + +User Interface (supports responsive design for mobiles and tablets) for search, facetted search, preview, different views and visualizations. + +Based on Solr client *solr-php-client* (pure vanilla php) and standard User Interfaces (HTML5 and CSS with *Zurb Foundation*) and visualization libraries (*D3js*) so you can install and run it on standard PHP webspace without effort and without often not available special PHP-modules) + +[Learn more](../../solr-php-ui) ... + +Documentation: [Howto seach](../search/README.md) +Deployment /usr/share/solr-php-ui +Log: /var/log/apache2/ +Sourcecode: src/solr-php-ui (Github...) + + +# Index server + +## Solr search server + +Preconfigured Solr Server running as daemon (so you have only to install the package and no further configuration needed) + +[Learn more](../../solr) ... + + +# Annotation + +*Tools for editing and managing metadata like tags, notes, relations and content structure (i.e. taxonomies):* + +## Open Semantic Tagger + +[Tagger](../../tagger) is a light weight responsive web app for tagging web pages and documents. + +[Learn more](../../tagger) ... + + +# Connectors + +*Crawler, connectors, data importer and converter:* +## [Connector Files (with OCR)](../../connector/files) + + +Crawl and index directories, files and documents into Solr. Including automatic textrecognition (OCR) support for images and grafical formats included in PDF documents (i.e. scans) + +[Learn more](../../connector/files) ... + + +## [Connector RSS (RSS-Feed)](../../connector/rss) + +Indexes Webpages from a RSS-Newsfeed + +[Learn more](../../connector/rss) ... + + +## [Connector Web (HTTP)](../../connector/web) + +Crawl and index Websites into Solr index. + +[Learn more](../../connector/web) ... + + +## [Connector DB (SQL, MySQL, Postgresql)](../../connector/db) + +Index SQL databases like MySQL or PostgreSQL into Solr. + +[Learn more](../../connector/db) ... + + +## [Connector Scraper (Scraping with Scrapy)](../../connector/scraper) + +ETL and webscraping framework to crawl, extract, transform and load structured data from websites (scraping). + +[Learn more](../../connector/scraper) ... + + +# Scheduler + +If you use our connectors and want most flexibility use Cron and write a cronjob using our [command line tools](../admin/cmd) within a crontab or call our [REST-API](../admin/rest-api) within another webservice (i.e. webcron). + + +# Queue manager + +Reads and manages trigger signals for starting indexing queued files by batch mode (parallel processing but because of limited RAM resources with a maximum count of workers/processes at same time) with opensemanticsearch-etl-file. + +Filenames can be appended to the queue by the REST API, Webinterface or command line tool. + +[Learn more](../admin/queue/README.md) ... + + +# Data enrichment (Enhancer) + +Will enhance the indexed content with meta data or analytics + +[Learn more](../data_enrichment) ... + + +## [Enhancer OCR](../../enhancer/ocr) + +Automatic textrecognition (OCR) for image files and images and graphics inside PDF (i.e. scans). +[Learn more](../../solr-enhancer-ocr) ... + + +## [Enhancer RDF](../../enhancer/rdf) + +Will enhance content with metadata in Resource Description Framework (RDF) format stored on a meta data server (i.e. tags and annotations in a Semantic Mediawiki or in [Drupal CMS](../../enhancer/rdf-drupal)) + +[Learn more](../../enhancer/rdf) ... + + +## [Enhancer XMP sidecar files](../../enhancer/xmp-sidecar-files) + +Metadata like tags or descriptions for photos are often saved in XMP (Extensible Metadata Plattform) sidecar files (i.e. by *Adobe Photoshop Lightroom*. This enhancer adds the metadata of this sidecar files to the index of the original document. + +[Learn more](../../enhancer/xmp-sidecar-files) ... + + +## [Enhancer ZIP](../../enhancer/zip) + +This enhancer recognizes and unzips zip archives to index documents and files inside a zip files, too. + +[Learn more](../../enhancer/zip) ... + + +# Web Services + +## Web admin interface + +Admin interface to start actions like crawling a directory or a webpage via web interface without command line tools and starting this actions. + +[Learn more](../admin/README.md) ... + + +## [REST-API](../admin/rest-api) + +Application programming interface (API) available via generic and standard network protocol HTTP and waiting until another (web) service or software demands for an action like crawling a directory or a webpage or indexing changed data (i.e. directly started after data change by a [trigger](#trigger) of the cms) and starting this actions. + +[Learn more](../admin/rest-api) ... + + +# Trigger + +Using triggers you don't need to recrawl often to be able to find new or changed content within seconds: + +If there are hundreds of Gigabytes or some Terabytes of data and millions of files, standard recrawls can take hours in which your document can not be found and eat many resources. + +With triggers that works the other way: your CMS or file server will send a signal if there is new content or a litte part has changed and the queue manager will index only this file or page very soon. + + +## [Trigger Filemonitoring](../../trigger/filemonitoring) + +File system monitoring based on *itnotify*. + +Monitors files and file folders and index them (again), so that new or changed documents or files can be found within seconds and without recrawl often (which would burn many ressources). + +[Learn more](../../trigger/filemonitoring) ... + + +## Trigger Drupal + +After saving a page the [Drupal module](https://www.drupal.org/project/rules) notifies the search engine about changed or new content. + +[Learn more](https://www.drupal.org/project/rules) ... + + +## Generic triggers + +Like for Drupal (see before) there are generic trigger modules available for many other software projects, too. So install them and configure them to the URL of our [REST-API](../admin/rest-api) to recrawl changed data of the other software or webservices. diff --git a/docs/doc/search/README.md b/docs/doc/search/README.md new file mode 100644 index 0000000..a01f57a --- /dev/null +++ b/docs/doc/search/README.md @@ -0,0 +1,127 @@ +--- +title: How to search, explore, analyze, structure, filter and visualize large document collections or many search results +authors: + - Markus Mandalka +--- + +# How to search, explore, analyze, structure, filter and visualize large document collections or many search results + + +## Semantic search, exploratory search, interactive filters, data visualization, information retrieval, document discovery & text mining + + + +![](../../screenshots/search.png) + + +How to combine semantic search, exploratory search, interactive filters & data visualizations for searching, information retrieval, document discovery, content mining & text mining to analyze, structure, filter and visualize search results, a large document collection or data: + +## Index documents or data + + +To enable a fast search and data analysis, you have to extract and to index the data. + +If not done automatically from time to time (f.e. by a cron job), start a crawl of the directory with the command line tool or with the web user interface or if you use the desktop search version you will find the option "Index for search" in the context menu for files and directories within the file manager. + +Or copy the documents to a directory that is monitored or work in such a directory or fileshare, so new and changed files and documents will be indexed immediately and automatically. + +After the text was extracted from the different formats or recognized by OCR and the data was enriched with different analyzers or qualitative data or structure, you can search, explore and analyse the texts and structures: + +## Search operators + + +You can use [powerful search operators](operators) for your search query. + +For example you can use wildcards like *, boolean algebra like AND, OR and NOT or fuzzy search. + +## Overview and exploration with facets + + +[![](../../screenshots/facets.png)](../../screenshots/faceted_search.png) +With the **faceted search** (the right navigation sidebar for your search results), you can see an aggregated overview for the different facets like paths, concepts, persons, locations or organizations showing, how many documents matching this entity. + +## Interactive filters + + +You can use this overviews or named entities as interactive filter to narrow down search results. + +So a click to a facet (i.e. an organization) will drill down the search results to fewer documents, matching this additional facet/filter, too. + + +## Structure by named entities like organizations, concepts or tags + + +After importing or editing some [thesaurus entries or named entities like persons, locations, organizations or concepts](../datamanagement/thesaurus), you can explore your documents or search results by this named entities, which will be available as such aggregated overview and interactive filters. + + +![](../../screenshots/named_entities_manager.png) + + + +If such named entities can not be extracted automatically by structured metadata of the thesuarus, your Named Entities database or named entity recognition because not matching their queries or machine learning models for automatic extraction of persons, organizations or places, you can [tag and annotate documents](../datamanagement/annotation) manually: + + +Just click *"Tagging and annotation"* for this document in the search results to annotate this document. + + +![](../../screenshots/tagging.png) + + +Add tags (f.e. concepts, persons, organizations or locations) or write some free text into the notes field. + + +![](../../screenshots/annotation.png) + +## Table view + + + +![](../../screenshots/table.gif) + +The sortable [table view](table) shows all columns/fields of the result list, for example URL, title, author and results of configured analyzers for data enrichment (f.e. extraction of email-addresses). + +## Preview + + +The preview shows the full texts of the documents. + +Your search context like the search query or active filters are marked inside the text, so you can see fast what is interesting for you and why the document has been found to your search context. + + +## Analysis and data visualization + + + +![](../../screenshots/analyze.png) + + +The tab/button *Analyze* provides different [views and user interfaces for analysis and data visualization](../analytics) for the search results or for the whole document collection: + + +### Visualize and analyze dates with trend chars + + +[Visualize and analyze dates with trend charts](../analytics/trend): + +[![](../../screenshots/trend.png)](../analytics/trend) + +### Text mining and content analysis + + +[Visualize and analyze contents with a word cloud and a words list for text mining](../analytics/textmining): + + +[![](../../screenshots/wordcloud.png)](../analytics/words) + +### Visualize and analyze networks and connections + + +[Visualize and analyze networks, connections and relations as visual graph](../analytics/graph): + + +[![](../../screenshots/graph.png)](../analytics/graph) + +## Interoperable open standards for data import and data export + + +Since this free software is open source and uses open standards you can integrate other tools and data or you can export the enriched data and use other additional tools for example for further and advanced data analysis tools, [text analysis, text mining and document mining tools](../analytics/textmining) or data visualization tools. \ No newline at end of file diff --git a/docs/doc/search/csv/README.md b/docs/doc/search/csv/README.md new file mode 100644 index 0000000..97c2337 --- /dev/null +++ b/docs/doc/search/csv/README.md @@ -0,0 +1,64 @@ +--- +title: Managing (very big) CSV spreadsheets and tables +authors: + - Markus Mandalka +--- + +# Managing (very big) CSV spreadsheets and tables + + +## Import, browse, search and filter structured data from CSV files + + +If you want search, navigate, browse and filter a CSV spreadsheet even if it is too big for excel or Open Office Calc: + +Just copy the CSV file to a [directory with file monitoring](../../../trigger/filemonitoring) or index it the standard way by indexing a [file from your filesystem](../../../connector/files) or [URI from the web](../../../connector/web). + +So you are able to search for the content of the CSV file. + +If the CSV file is in standard format and the [CSV enhancer](../../../enhancer/csv) is set to on, you can even browse and filter rows and columns using the [table view](../table). + +But sometimes you might want to use such additional functionality even if the data is not stored in standard CSV format. + +With the webapp [CSV manager](../../../solr-search-csv-python-django) you can set additional metadata (i.e. parameters about the CSV format) with the comfortable user interface: + +* If you see, that some chars are not ok, so you have to set the charset manually from default (UTF-8) to another charset +* If the CSV dialect autodetection doesn't work for a special format, you can easily configure custom delimiter and quote chars +* If you want to map columns to existing fields or facets +* If you want to extract column titles from the csv instead of default (column 1, column 2, ...) + + +## Usage: The CSV user interface + + + +Click the button "Add new csv" in the list view. + +### Upload or reference a CSV file + + +Just upload a csv file to CSV manager or set a reference (URL) to the URI field. + + +![](../../../screenshots/csv-upload.png) + +### Set CSV format + + +If not standard CSV format, set autodetection or overwrite standard settings like delimiter or quote char with custom values: + + +![](../../../screenshots/csv-format.png) + +### Import CSV data to search engine + + +After saving your CSV settings click the button *"Import"* to import with this settings the data of the CSV file to the search engine. + +### Check imported data + + +After importing check by [table view](../table) if the structure and charset settings were right. + + +![](../../../screenshots/table.gif) diff --git a/docs/doc/search/fuzzy/README.md b/docs/doc/search/fuzzy/README.md new file mode 100644 index 0000000..64294a5 --- /dev/null +++ b/docs/doc/search/fuzzy/README.md @@ -0,0 +1,151 @@ +--- +title: Fuzzy search +authors: + - Markus Mandalka +--- + +# Fuzzy search + + +## How to find results despite incomplete or imperfect search queries, misspelled names, typos and low text quality or low OCR quality + + + +If you're sure that all search query terms are in the document(s) you search, you can search with the default operator AND. + +If you search for a exact sentence or phrase (all search terms in exact this form and order with no other words in between), you can switch to "Phrase search". + +But if you're not sure about all terms, you can use and combine different search techniques like the OR operator and scoring, wildcards, stemming, synonyms and fuzziness: + + +![](../../../screenshots/semantic.png) + +## Use OR operator and sort by scoring + + +If you use / switch to the OR operator, you will often find results without all search terms in the documents (but often relevant, since one your searched term may occur in other form). + +But even getting many irrelevant results in which only a small part or even a single word of your search query occurs, if using this search paradigma: + +The more of your search terms occur in the document, the higher is the document is scored and you will see documents with most matches on top. + +So you will often find documents even if one of your search terms is misspelled or not exact the same concept used in the document. + + +## Find alternate word forms (Stemming) + + +Considering [grammar rules to find other word forms, too (stemming)](../../admin/config/stemming), the search engine will find more. + +For example if you search for *company corruption* you will find *companies corrupted*, too. + +If you want only results matching exactly the spelling in your search query, you can disable stemming by disabling the option "Find other word forms, too". + +If you enable stemming for the whole search query, you can disable it for single words / terms by using the operator `exact:` + +But such automatic heuristics can fail, especially for example on irregular verbs, where for example another grammatical form like "went" is not only "go" with a suffix (like f.e. -ing). + +### Human curated dictionary of grammar forms and synonyms (Linked Data Knowledge Graph of Lexemes as Open Data from WikiData) + + +By considering lexemes by import of Wikidata Lexemes as Solr search engine synonyms you find documents including many such more complicated / irregular grammar forms, too. + +Hint: For manually find variants for your search, you can browse the structured data of lexemes and synonyms in the structured data base and linked open data knowledge graph [WikiData](https://www.wikidata.org) by the web user interface [Ordia](https://tools.wmflabs.org/ordia/). + +#### Import Wikidata lexemes to synonyms config + + + +The lexemes import tool can be configured by [command line parameters](../../../lexemes) and will be integrated to our web UI next. + + + +## Find unknown word parts with wildcards + + +Multiple character wildcard searches with * looks for 0 or more characters. + +So +`corrupt*` +will find corrupt, corrupt*ion*, corrupt*ed* ... but not *anti*corruption + +`*rupt` +will find corrupt or interrupt but wont find corrupt*ion* or interrupt*ion*... + +`*rupt*` +will find corrupt, corruption, anticorruption, interrupt and interruption ... + +You can also use the wildcard searches in the middle of a term: +`co*upt` +will find corupt or corrupt + + +## Find results with typos (or if not sure how to spell a name) by edit distance (Levensthein distance) + + + +Fuzziness by edit distance is useful if you search for names you don't know how to spell exactly. + +Or if you want to consider typos or misspelled names in the documents. + +Or if some documents are images or scanned documents (like PDF documents containing scanned pages only in graphical formats instead of digital text), so you maybe find more documents for your query even if the [results of automated text-recognition (OCR) are not perfect](../../admin/config/ocr), i.e. because single chars were recognized wrong. + +To do a fuzzy search use the tilde, "~", symbol at the end of a single word / term you want to search with fuzziness. + +For example to search for a term similar in spelling to "*roam*" use the fuzzy search: + +`roam~` + +This search will find terms like *foam* and *roams*. + +`similar~ words~` +would find not only *similar words* but *similer works*, too because both words are set to fuzzy search. + + +### Setting maximal edit distance (number of chars, that may differ) + + +If you use the ~ operator for fuzziness, the default maximal edit distance is two chars. This is the maximal number of chars that can be changed, added or deleted to match a term that is searched with fuzziness. + +To change the maximum number of changeable chars, set the number after the ~ operator. + +Example: +`searchterm~3` +## Proximity search to find name variants with additional name parts in between + + + +A proximity search looks for terms or name parts that are within a specific distance from one another. + +So a proximity search for +`"Barack Obama"~2` +will find name variants like *Barack Hussein Obama*, too, which would not be found by a phrase search for "Barack Obama". + +To perform a proximity search, add the tilde character ~ and a numeric value to the end of a search phrase. + +The numeric value sets how many words may maximal occur in between (the maximal distance of term movements needed to match the specified phrase). + + +## Find synonyms and hyponyms + + +If you don't switch that off for your query by disabling search for synonyms in advanced search options and you don't use the operator "exact:" for the search term, the search engine can find synonyms (f.e. if you search for car you want to find automobile, too) and hyponyms (if you search for a car, you want to find truck, too). + +You can [setup synonyms](../../admin/config/synonyms) with the [thesaurus manager](../../datamanagement/thesaurus). Just add a name or concept with the synonym as an alias or import a thesaurus or ontology with synonyms to the [ontologies manager](../../datamanagement/ontologies). + +Please donate so we can integrate (technically existing) features with open data from Wiktionary, so most synonyms and more forms of irregular verbs ("went" is not only "go" with a suffix) will be preconfigured out of the box. + + +## More like this (Term vector model) + + +Based on a relevant document find other documents with many same words ("more like this"). + +Please donate... + +## Find similarity by machine learning (Latent Dirichlet allocation (LDA), clustering, classification, co-ocurrences) + + +Find documents with related words (not only the same words in other forms or synonyms). + +Please donate... \ No newline at end of file diff --git a/docs/doc/search/fuzzy/synonames/README.md b/docs/doc/search/fuzzy/synonames/README.md new file mode 100644 index 0000000..a38e65f --- /dev/null +++ b/docs/doc/search/fuzzy/synonames/README.md @@ -0,0 +1,39 @@ +--- +title: Find documents with different first name variants (Synonames) +authors: + - Markus Mandalka +--- + +# Find documents with different first name variants (Synonames) + + +To quote an article about how [Synonames helps OCCRP investigate people across languages and alphabets](https://medium.com/occrp-unreported/an-%D0%B0%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80-by-any-other-name-819525c82d8 +) "*A single name can have many equivalents when transliterated across writing systems or represented across cultures. A Russian named Александр might open a U.K. bank account as Aleksandr, while a German Friedrich might introduce himself to Americans as “Fred”. +These variations arise naturally with cross-cultural exchange, without any malicious intent, and the human brain can usually toggle between them effortlessly. But they pose a bigger problem in data-driven research.*" + +To find documents that contain only such alternate first name variants, the full text search engine of Open Semantic Search integrates the multilingual open data knowledge of name variants from Wikidata extracted by the Open Source tool [Synonames](https://github.com/alephdata/synonames) as synonyms out of the box. + +So if you do not disable the search option "Find other word forms, too" and search for the German first name "Markus", you will find documents which contain only the English variant "Mark", too. + + +## Full names and aliases + + +Synonames only "translates" single name parts (forename) for many names for all searches. + +The advantage is, that this general forename synonyms often works for yet unknown people which are not part of your database, thesaurus or ontology, too. + +But it does not know about full name aliases, fake names, former names and pseudonyms of concrete people or their aliases. + +If you want to be able to find full name aliases with different forenames and different last names, too, you can [add aliases to your thesaurus](https://opensemanticsearch.org/doc/datamanagement/thesaurus) or [import some open data ontologies](../../../datamanagement/ontologies) like for example [lists of politicians of your parliament](https://opensemanticsearch.org/doc/datamanagement/opendata/wikidata) by the [ontologies manager](../../../datamanagement/ontologies) which suports multi word synonyms like full names or aliases, too. + +So you can find work from Kurt Tucholsky published with his alias "Peter Panter" or documents about Angela Merkel containing "only" the variant "Angela Merkelova" or her former name "Angela Kasner", too. + + +## Open Source code and Open Data + + + +The open source code to extract the open data knowledge on first name variants from Wikidata: [Source code repository of Synonymes](https://github.com/alephdata/synonames) + +Our open source integration with the Solr Synonym Graph: [Source code repository of Synonames to Solr](https://github.com/opensemanticsearch/solr-synonames) \ No newline at end of file diff --git a/docs/doc/search/graph/README.md b/docs/doc/search/graph/README.md new file mode 100644 index 0000000..b08fd32 --- /dev/null +++ b/docs/doc/search/graph/README.md @@ -0,0 +1,58 @@ +--- +title: Searching Linked Data (Open Semantic Knowledge Graph Search) +authors: + - Markus Mandalka +--- + +# Searching Linked Data (Open Semantic Knowledge Graph Search) + + +## Knowledge graph exploration and graph navigation + + +The graph/network analysis view shows you the direct and indirect relations, connections and networks between [named entities like persons, organizations or main concepts](../../datamanagement/named_entity_recognition) which occur together (co-occurrences) in your content, datasources and documents or are connected in your Linked Data Knowledge Graph. + +![](../../../screenshots/visual_graph_explorer.png) +## Graph visualization and graph analysis by full-text search + + +You can start a graph visualization from full text search (not only for entities, but for keywords in your documents, too) in the search user interface. + +Therefore click on the view "Connections (Graph)" in tab/menu analysis. + +![](../../../screenshots/graph_search.png) + + +There you can set which types (classes) of entities and connections (properties) to use for graph analysis and graph visualization and with how many of each entities to start with. + +By click on the button "Visualize graph" you open the graph explorer and can extend the graph by clicking an entity / node. + + +## Graph visualization of potential connections between entities within documents (co-occurrences of named entities like persons, organizations or concepts) + + +You can view and analyze graphs and potential connections because of occuring in same documents (co-occuring named entities like persons, organizations, products, materials or concepts) with the [visual analysis view graph](../../analytics/graph): + + +[![](../../../screenshots/document_graph.png)](../../analytics/graph) + +## Semantic Search and Text Mining on Linked Data + + +With the Resource Description Framework (RDF) plugin you can use the semantic search engine as enterprise search engine and text mining platform for full text search, thesaurus based semantic search, faceted search and text mining of strings and texts (f.e. labels or literals) in structured data like **linked data** (LD), your domain knowledge graph, enterprise knowledge graphs or linked open data (LOD) knowledge graphs: + +## Index linked data from Resource Description Framework (RDF) for full text search + + + +After [import and indexing of Resource Description Framework (RDF) graphs](../../../connector/rdf) you can analyse, search and filter the RDF data (triples) granular by entities (RDF subjects): + +## Granular filtering & analysis by seperated search result for each knowledge graph entity or subject + + +For each knowledge graph entity (RDF subject) there is an separated and granular search result with the document content type "knowledge graph" including all its properties (RDF predicates) as facets/fields/columns and all values (RDF objects) as values in such facets/fields/columns. + +## Full text search, semantic text analysis and interactive filters or faceted search on linked data knowledge graphs + + +So you can find, filter and explore your linked data knowledge graph entries by full text search, overviews and granular interactive filters (faceted search on linked data) or by more advanced [text mining and natural language processing techniques](../../analytics/textmining) for text mining on linked data knowledge graphs. diff --git a/docs/doc/search/list/README.md b/docs/doc/search/list/README.md new file mode 100644 index 0000000..ec6d474 --- /dev/null +++ b/docs/doc/search/list/README.md @@ -0,0 +1,61 @@ +--- +title: Fuzzy search by lists of names +authors: + - Markus Mandalka +--- + +# Fuzzy search by lists of names + + +If you have not only some search queries but a whole list (i.e. a list of company names, products or organizations) and you want to search for every entry of this list, if there are results in your data, you can [import this list of names, dictionary or thesaurus with the ontologies manager and get an overview in how many documents the entries occur](../../datamanagement/ontologies). + +Such an aggregated overview of named entities like names, organizations, persons, location or main concepts is very usefull since it is available automatically for all documents and all searches. + +But this works only if the names in the list are written exact the same like the names in the documents. + +If you want to do a [fuzzy search](../fuzzy) with a list to find the names even if not written correctly or not complete, you can use the fuzzy listsearch feature: + +## Web interface (App) for fuzzy list search + + + +Navigate to listsearch (menu point in your top bar, if your administrator allowed and [configured](../../../search-list) that). + +Just paste a list with one entry per line to the "Query list" textarea and start the search by pressing the "Search" button. + +This list can be (parts of) the content of a text file with one name per line or a single column (with many rows) copied and pasted from a spreadsheet. + + +![Search with a list](../../../screenshots/search-list.png) + +## Fuzzy search + + +Searching with fuzzy search will take more time, but will find similar results, too - which often are exactly what you search for but it can not be found by exact matching i.e. because of typos or if a part of a company name like the suffix Ltd. is missing in some documents but is part of your search query. Or you want to find documents even if some chars were recognized wrong while automatic textrecognition (OCR) of scans). + +So there will be a result list for each type of the enabled searches and fuzzy search methods. + +Each additional search type or fuzzy search method query will exclude all results from (better matching but not finding all) enabled search types before, so you dont have to check the same results multiple times trying to find the additional found results by this additional fuzzy search method. + +## Search results + + +Such a result list contains entries, that have been found in your indexed documents or data including the name of the entry, the count of results with a link to this results: + + +![Results of list search](../../../screenshots/search-list-results.png) + +### Sorting by score + + +The result lists contain a column with the maximum score of the documents that matched that entry showing how near the best matching document is to your list entry or query. + +Since the score column is sortable, you can check the most promising matches (most parts of the list entry found) until the results are too far away from your query (i.e. too few words of the query found) and do the same for the results of each different fuzzy search method. + +So you can even use very very fuzzy search methods like "match if some similar words"-search using the search operator OR and fuzzy search, where often the most scored documents are what you search and you would not find them by the other methods (i.e. if a part of a company name like the suffix Ltd. is missing in some documents but is part of your search query) but most parts of the very big result list is very far away from the query and was found only because containing (a) very often used word(s) which are part of the query. + + +## Filter query + + +If you want to search for the entries of the list in a search context like special paths, URIs or only in documents containing some other words or matching a more or less complex search query, you can define additional search terms or filters in the field "filter query". diff --git a/docs/doc/search/operators/README.md b/docs/doc/search/operators/README.md new file mode 100644 index 0000000..934b7d9 --- /dev/null +++ b/docs/doc/search/operators/README.md @@ -0,0 +1,147 @@ +--- +title: Search operators and wildcards +authors: + - Markus Mandalka +--- + +# Search operators and wildcards + + +*You can use and combine different search operators and wildcards in your search queries*: + +# Wildcard searches + + +To perform a single character wildcard search use the "?" symbol. + +To perform a multiple character wildcard search use the "*" symbol. + +## Unknown or all parts with * + + +Multiple character wildcard searches with * looks for zero, one or more characters. + +So +`corrupt*` +will find corrupt, corrupt*ion*, corrupt*ed* ... but not *anticorruption* +`*rupt` +will find corrupt or interrupt but wont find corrupt*ion* or interrupt*ion*... + +`*rupt*` +will find corrupt, corruption, anticorruption, interrupt and interruption ... + +You can also use the wildcard searches in the middle of a term: +`co*upt` +will find corupt or corrupt + +## Single character wildcard + + +The single character wildcard search looks for terms that match that with the single character replaced. + +For example, to search for "text" or "test" you can use the search: +`te?t` +# Boolean operators + + +Boolean operators allow terms to be combined through logic operators. Lucene supports AND, "+", OR, NOT and "-" as Boolean operators(Note: Boolean operators must be ALL CAPS). + +## AND + + +`search engine` +will find all documents which contains the word *engine* AND the word *search* +`search AND engine` +would return the same results + +## OR + + +`search OR research` +will find all documents which contains the word *search* or the word *research* +## Exclusion with - or NOT + + +The "-" or prohibit operator excludes documents that contain the term after the "-" symbol: + +`search -engine` +or +`search NOT engine` +or +`search AND NOT engine` + +will find all documents which contain the word search and do not contain the word engine + +# Phrase searches + + +## Phrase search with double quotes + + + +A Phrase is a group of words surrounded by double quotes such as +`"search engine"` +which will find exactly this phrase and will not find *i search an engine* +# Fuzzy searches + + +## Find results with typos or names not exactly pronounced by edit distance (Levensthein distance) + + + +Fuzziness by edit distance is useful if you search for names you don't know how to spell exactly or if you want to consider typos in the documents or if some documents are images or scanned documents (like PDF documents containing scanned pages only in graphical formats instead of digital text), so you maybe find more documents for your query even if the results of automated text-recognition (OCR) are not perfect). + +To do a fuzzy search use the tilde, "~", symbol at the end of a single word / term you want to search with fuzziness. + +For example to search for a term similar in spelling to "*roam*" use the fuzzy search: + +`roam~` + +This search will find terms like *foam* and *roams*. + +`similar~ words~` +would find not only *similar words* but *similer works*, too because both words are set to fuzzy search. + +### Setting maximal edit distance (number of chars, that may differ) + + +If you use the ~ operator for fuzziness, the default maximal edit distance is two chars. This is the maximal number of chars that can be changed, added or deleted to match a term that is searched with fuzziness. + +To change the maximum number of changeable chars, set the number after the ~ operator. + +Example: +`searchterm~3` +# Grammar (Stemming) + + +Considering [grammar rules to find other word forms, too (stemming)](../../admin/config/stemming), the search engine will find more. + +For example if you search for *company corruption* you will find *companies corrupted*, too. + +If you want only results matching exactly the spelling in your search query, you can disable stemming by disabling the option "Find other word forms, too". + +If you disable stemming for the whole search query, you can enable it for single terms by using the operator `stemmed:` + +If you enable stemming for the whole search query, you can disable stemming for single terms by using the operator `exact:` +# Grouping + + +## Combine criterias with OR, AND and parentheses + + + +You can use parentheses to group clauses to form sub queries: + +`(search OR research) AND (engine OR software)` +will find: +* documents containing the words *search* and *engine* +* documents containing the words *search* and *software* +* documents containing the words *research* and *engine* +* documents containing the words *research* and *software* +* documents containing the words *search* and *research* and *software* and *engine* + + + +But it wont find a document containing the words *search* and *research* without at least one of the words *engine* or *software*. + +Only one of the two last words would be enough, because connected with OR, but one of them is absolutelly neccecary because this criteria combination (connected by parantheses) is connected with AND diff --git a/docs/doc/search/table/README.md b/docs/doc/search/table/README.md new file mode 100644 index 0000000..c5e713f --- /dev/null +++ b/docs/doc/search/table/README.md @@ -0,0 +1,18 @@ +--- +title: Table view +authors: + - Markus Mandalka +--- + +# Table view + + +Search for a query. + +Click on the button "Table" to switch from standard list view to the structured table view. + +![](../../../screenshots/table.gif) + +Press a column header to sort the table view with this column ascending. + +Press the same column header a second time to sort with this column descending. diff --git a/docs/doc/tutorial/README.md b/docs/doc/tutorial/README.md new file mode 100644 index 0000000..1beb8f4 --- /dev/null +++ b/docs/doc/tutorial/README.md @@ -0,0 +1,39 @@ +--- +title: Getting started +authors: + - Markus Mandalka +--- + +# Getting started + + +# Set up a search engine server in a few steps + + +## Open Semantic Desktop Search + + + +If you are an user and want only search for yourself, you maybe want to use the [Open Semantic Desktop Search virtual maschine](../desktop_search) or the [encrypted Live-System InvestigateIX](http://www.mandalka.name/investigateix/), which is easier to install for single end users. + + + +## Open Semantic Search Server + + + +The [Open Semantic Search Server installation tutorial shows how to setup a search engine as a public website or on an intranet server](../admin/install/search_server) for admins running a Debian GNU/Linux or Ubuntu Linux (web)server or within an existing virtual maschine. + + +# Search, explore, analyze and filter + + +Enter a [search query](../search/operators) and enjoy the interactive [userinterface for navigation, faceted search, exploratory search, interactive filters, analytics and visualizations](../search). + + +[![](../../screenshots/search.png)](../search) + +# Config + + +You will find [flexible config options in the config files](../admin/config) in `/etc/opensemanticsearch/`. \ No newline at end of file diff --git a/docs/download/README.md b/docs/download/README.md new file mode 100644 index 0000000..34aeeea --- /dev/null +++ b/docs/download/README.md @@ -0,0 +1,47 @@ +--- +title: Download Open Semantic Search +authors: + - Markus Mandalka +--- + +# Download + +*Get the virtual machine, bundle or components and modules you want to use as open source software for free and please make a [donation for further development](../donate):* + +# Open Semantic Search for single desktop computer or notebook users + +*All in one bundles for easy installation* + +## Open Semantic Desktop Search + +[***Open Semantic Desktop Search***](../doc/desktop_search) is the **all in one package for desktop users** provided as a **virtual machine image** configured for search on your own **desktop computer or laptop** running on **Linux, Windows or iOS for Mac**. + +Virtual machine disk image (Virtual Box): + +### Multilingual + +VM with English keyboard settings (configurable), the OCR dictionaries / languages and some text analytics components are preset to English, but configurable multilingual. + +[open-semantic-desktop-search\_22.02.27.ova](https://nx318.your-storageshare.de/s/KHF87piM8xdgKZw/download) (4 GB) + +### German (Deutsch) + +VM with German keyboard settings (configurable), the OCR dictionaries / languages and some text analytics components are preset to German, but configurable multilingual. + +Coming soon. + +# Open Semantic Search Server for admins, research teams and organizations + +*All in one packages for easy installation of a search server (clients only need a standard browser)* + +## Open Semantic Search Server (Package) + +[***Open Semantic Search Server***](../doc/admin/install/search_server) is the **all in one package** (including Solr server, user interfaces, tools and connectors) for easy full installation on a **Debian or Ubuntu based Linux server** or within an existing Debian or Ubuntu based Linux virtual machine (VM). + +This bundle includes most modules and connectors / further packages. Just [install with one command](../doc/admin/install/search_server), index something and search. + +Debian Bullseye 11 and Ubuntu Focal 20.04 LTS: [open-semantic-search\_22.02.27.deb](https://opensemanticsearch.org/download/open-semantic-search_22.02.27.deb) (~300 MB) + +## Docker images + +Coming soon. diff --git a/docs/enhancer/csv/README.md b/docs/enhancer/csv/README.md new file mode 100644 index 0000000..a705ae1 --- /dev/null +++ b/docs/enhancer/csv/README.md @@ -0,0 +1,16 @@ +--- +title: CSV Spreadsheets +authors: + - Markus Mandalka +--- + +# CSV Spreadsheets + + +Enhanced by this module you can not only find content of the CSV file but use or filter the structure of a CSV spreadsheet or table while searching. + +So a CSV (comma seperated values) spreadsheet or table can not only be found as a single file where one word of the search query is in a row and another word of the search query in another row so that the whole file would be found even if the data of both rows is not connected, but you can search for queries that should be found in rows instead of the full CSV table. + +Additionally you can browse trough the rows and filter columns with the comfortable [table view](../../doc/search/table). + +This module supports a good working auto-detection of the encoding or charset of the CSV file and a less good working auto-detection of the CSV dialect. \ No newline at end of file diff --git a/docs/enhancer/geonames/README.md b/docs/enhancer/geonames/README.md new file mode 100644 index 0000000..346cee5 --- /dev/null +++ b/docs/enhancer/geonames/README.md @@ -0,0 +1,57 @@ +--- +title: Extract locations from GeoNames database +authors: + - Markus Mandalka +--- + +# Extract locations from GeoNames database + + +This enhancer plugin extracts locations in [GeoNames](http://www.geonames.org) databases from documents, making this locations available to exploratory search, aggregated overviews and einteractive filters. + +## Data protection and privacy: No cloud or external webservice used + + +This plugin won't call an external webservice, so wether the analyzed texts nor the extracted locations will be sent to cloud or external web services. + + +## Installation and config + + +### Install GeoNames plugin + + +Download and install the package **opensemanticsearch-enhancer-geonames** +### Download GeoNames database parts + + +Download the interesting data (f.e. all names of cities with more than 1000 people or the data of your country) from [Geonames data dumps](http://download.geonames.org/export/dump/). + +Extract the ZIP archive(s) to the directory `/etc/opensemanticsearch/geonames/` +### Config plugin + + +Config the databases you want to use for the whole system in `/etc/opensemanticsearch/etl` or for a special connector (i.e. in `/etc/opensemanticsearch/connector-files`): + +`config['geonames'] = [ + '/etc/opensemanticsearch/geonames/cities1000.txt' +]` + +You can configure more than one geonames database (which will need more ressources and cause more fase positives, because more Locations have the same name like an common word in your language): + +`config['geonames'] = [ + '/etc/opensemanticsearch/geonames/DE.txt', + '/etc/opensemanticsearch/geonames/AT.txt', + '/etc/opensemanticsearch/geonames/CH.txt' +]` +### Enable plugin + + +Enable the enhancer plugin in the same connector config: +`config['plugins'].append('enhance_geonames')` +## Hint: Check for as few locations as possible + + +Since there are many places in the world that have the same name like popular words of your language, you should check only for the interesting geoname data or parts of it. + +For example often its enough to check only the most important town names of your country and adding smaller local places for you very interesting custom locations to the named entities manager. Or you create custom GeoNames data files by filtering very granular of geonames database parts, i.e. for all locations within a radius to your main location. diff --git a/docs/enhancer/named_entities_manager/README.md b/docs/enhancer/named_entities_manager/README.md new file mode 100644 index 0000000..233e909 --- /dev/null +++ b/docs/enhancer/named_entities_manager/README.md @@ -0,0 +1,35 @@ +--- +title: Data enrichment module for Named Entity Extraction of managed Named Entities +authors: + - Markus Mandalka +--- + +# Data enrichment module for Named Entity Extraction of managed Named Entities + + +Named Entities Manager is an user interface (webapp) for management of named entities like persons of interest, organizations, locations or concepts. + +So a data enrichment module for rule based or text pattern based Entity Extraction or list or ontology based Named Entity Extraction or a integrated framework for Named Entity Recognition (NER) can recognize them and tag them for exploratory search like aggregated overviews and interactive filters. + + +## Usage + + + +See the [user documentation](../../doc/datamanagement/named_entities) +## Installation + + +* download the module *opensemanticsearch-ner-python-django* +* Copy the directory *entities* from the zip file into your Django apps directory +* Enable the new app: + +Add "*entities*" to your INSTALLED\_APPS setting like this: + + +`INSTALLED_APPS = ( + ... + 'entities', + )`* Include the entities URLconf in your project urls.py like this: +`url(r'^entities/', include('entities.urls', namespace="entities")),` +* Call `http://localhost/search-apps/entities/apply` after each data import or after editing your entities or by Cron from time to time until this module will be better integrated into the connectors by - instead of search for each query after indexing - compare the data with all queries before indexing, since such queries can not be only static strings (which are extracted on indexing time automatically without searching for them) but can be complex queires with wildcards and boolean operators, too. diff --git a/docs/enhancer/named_entitiy_recognition/stanford_named_entity_recognizer/README.md b/docs/enhancer/named_entitiy_recognition/stanford_named_entity_recognizer/README.md new file mode 100644 index 0000000..10d47ee --- /dev/null +++ b/docs/enhancer/named_entitiy_recognition/stanford_named_entity_recognizer/README.md @@ -0,0 +1,52 @@ +--- +title: Named Entity Recognition by Stanford Named Entity Recognizer (NER) +authors: + - Markus Mandalka +--- + +# Named Entity Recognition by Stanford Named Entity Recognizer (NER) + + +## Automatic Named Entity Recognition by machine learning (ML) for automatic classification and annotation of text parts + + +[Extracted named entities like Persons, Organizations or Locations (Named entity extraction) are used for structured navigation, aggregated overviews and interactive filters (faceted search)](../../../doc/datamanagement/named_entity_recognition). + +Additionally to known [named entities in a thesaurus](../../../doc/datamanagement/thesaurus) or [imported ontologies](../../../doc/datamanagement/ontologies) this data analysis plugin integrates [Named Entity Recognition (NER)](../../../doc/admin/config/named_entity_recognition) by [Stanford Named Entity Recognizer (Stanford NER)](http://nlp.stanford.edu/software/CRF-NER.shtml). + +## Named Entity Extraction of yet unknown entities or names + + +So by integration of machine learning for analysing the structure of the text and classifying parts/words of the sentences to categories like person, location or organization, many yet unknown named entities can be extracted, which aren't configured or listed yet in the thesaurus Named entities Manager or a list or ontology. + +Therefore it uses models trained with existing annotations of a large text corpus, so after that they can predict / guess if a part of a sentence is a name of a person, a name of an organization, a verb or a place. + +## Configuration of the Stanford NER plugin + + +To enable the automatic named entity recognition with Stanford Named Entitiy Recognizer (NER), enable this plugin to your document processing chain in your ETL config `/etc/opensemanticsearch/etl` or a connector config: +`config['plugins'].append('enhance_ner_stanford')` +### Config language (machine learning model) + + +You can config alternate classifiers, i.e. for a machine learning model for another language than english or for your own domain knowledge model by the config option `config['stanford_ner_classifier']` or dependent on autodetected document language in the config option `config['stanford_ner_classifiers']` in the same config file, where you find additional information on this options. + +## How to improve performance + + +Named Entity Extraction of [named entities managed by the Named Entities Manager](../../../doc/datamanagement/named_entities) or lists of names works very fast for (not complex queries) like static names or strings. So if you know many names yet, you should setup them by the Lists and Ontologies Manager, since that works more precise and so you get faster and more complete results for known names. + +In comparison to the integration of lists of entitiy names while indexing process the machine learning plugin for Stanford NER works very slow. Not only because Named Entities Recognition of unknown entities by machine learning needs much more CPU power and RAM than [Entity Linking of known entities](../../../doc/datamanagement/named_entities) by Solr standard text analysis methods using limited well known names/words instead of much more complex probability and cluster based classification models. + +The architecture of calling Stanford Named Entitiy Recognizer (NER) from the used Python library Natural Language Toolkit (NLTK) is not optimized for speed if you want to analyse many texts, since it loads the JAR and the whole classification model for each text analysis,. + +For more performance for faster analysis of many documents you should setup an Stanford Stanford Named Entitiy Recognizer server instead of using this default NER plugin using NLTK which uses the Stanford Named Entitiy Recognizer command line tool. So the analysis of each document would take a few seconds less time (the time the Java based command line tool need to load and to load and initialize the machine learning model). + +Or wait, until the existing Stanford NER integration with Apache Tika will be default feature working out of the box, since our Apache Tika is running as server that has to load only once. + +## Dependencies and used libraries + + +* [Stanford Named Entity Recognizer (NER)](http://nlp.stanford.edu/software/CRF-NER.shtml) +* [Stanford Tagger Module](http://www.nltk.org/api/nltk.tag.html#module-nltk.tag.stanford) from the Python natural language processing library [Natural Language Toolkit (NLTK)](http://www.nltk.org) +Debian package: [python-nltk](https://packages.debian.org/stable/python-nltk) diff --git a/docs/enhancer/ocr/README.md b/docs/enhancer/ocr/README.md new file mode 100644 index 0000000..60f004e --- /dev/null +++ b/docs/enhancer/ocr/README.md @@ -0,0 +1,58 @@ +--- +title: Automatic text recogniton in images by optical character recognition (OCR) +authors: + - Markus Mandalka +--- + +# Automatic text recogniton in images by optical character recognition (OCR) + + +## Optical character recognition (OCR) for automatic text recognition of text in image files or embedded images like scanned documents within a PDF document + + + +Text stored in image formats like JPG, PNG, TIFF or GIF (i.e. scans, photos or screenshots) can not be found by standard fulltext search. So this enhancer enriches meta data of images like filename, format and size with results from automatic text recognition (OCR). + +Since many information is not searchable by fulltext search because its in graphical formats embedded in PDF documents or Powerpoint presentations (i.e. screenshots instead of text format), the enhancer extracts images from PDF files for automatic textrecognition (OCR), too. + +## Enable OCR + + + +Some OCR tasks are off by default, because it slows down indexing. It uses many processor resources and will need many seconds for each graphic file. + +If you want to enable OCR for images: + +Since meanwhile Apache Tika will OCR most images for you by default, if Teseract is installed, you don't have to activate the disabled plugin for OCR of images. + +## Enable OCR for embedded images or scans inside PDF documents + + + +But if you enabled OCR by installing Tesseract, you should enable OCR for images inside PDF files, too, since many PDF files are scans and do contain much text data only as graphics. + +Therefore enable the plugin `enhance_pdf_ocr`. + +## OCR language + + +Setting OCR language to an other language than english: +1. Install the Tesseract language package (for german: *tesseract-ocr-deu*). See the list of available languages for [Debian](https://packages.debian.org/search?keywords=tesseract-ocr) or [Ubuntu](http://packages.ubuntu.com/search?keywords=tesseract-ocr). +2. set option *ocr\_language* to the language of your documents. Default is *eng* for english (in tesseract its *eng*, not *en*!). For german set *deu* (in tesseract its not *de*!): + +`# language for automatic text recognition +#config['ocr_lang'] = "eng" +config['ocr_lang']="deu"` + + +## Deskewing low quality scans before OCR + + +To enable an additional deskewing of low quality scans with [Scantailor](http://scantailor.org) before OCR for getting better results in some cases: + +Install Scantailor: +`apt-get install scantailor` + +Enable additional optimization with Scantailor before OCR by enable the plugin `enhance_ocr_descew` in your connector or ETL config. + +Hint for user of older Debian versions: If this package doesn't exist in the Debian version you use, you can get a package in the Debian backports repository. diff --git a/docs/enhancer/rdf-drupal/README.md b/docs/enhancer/rdf-drupal/README.md new file mode 100644 index 0000000..9f0df19 --- /dev/null +++ b/docs/enhancer/rdf-drupal/README.md @@ -0,0 +1,52 @@ +--- +title: Enhancer RDF Drupal +authors: + - Markus Mandalka +--- + +# Enhancer RDF Drupal + + +## Metadata management like tagging or annotation with Drupal + + +This module integrates the powerful and generic **[Drupal CMS](http://www.drupal.org)** for **metadata management** like **tagging** or **annotation**. + +Drupal provides flexible **custom data structures** and easy to use **user interfaces to configure** them. + +So you can use powerful Drupal features like **[custom fields](https://www.drupal.org/documentation/modules/field-ui)**, flexible data structures like **[taxonomies](https://www.drupal.org/getting-started/6/admin/content/taxonomy)** for tags or flexible **user management**, i.e. for tagging, verification, (re)viewing, classifying or (re)ranking large document sets. + +Since you can use the flexible user management tools of Drupal, you can use this module for **crowdsourcing** on the net (i.e. for datajournalism) using only the data of the users you trust or which was moderated or verified. + +## Installation and configuration + + +* Download and extract the module zip file +* Import our content type *meta* +* Import the view *edit.view* into your drupal views +* Import the view *rdf.view* into drupal views +* Config *metadataserver* in */etc/solr/solr-enhancer-rdf* to the url of your drupal installation + + +## Usage + + + +Example for a direct link for editing metadata for opensemanticsearch.org: +http://localhost/drupal/edit?uri=http://www.opensemanticsearch.org + +There are two ways you dont need to type in such URLs manually: + +Configure your Drupal link `http://localhost/drupal/edit?uri=[URI]` for tagging and annotation in the search user interface config. + +Or use a bookmarklet integrated in your Web browser, so you can add or annotate a new URI with one click. + +## Custom metadata content type and custom form + + +You can add own custom fields to our metadata content type *meta* to customize it. + +Or you use your own custom metadata content types and custom forms: + +Just add a field named "uri" (internal saved as field\_uri in drupal) to the (new) content type you want to use for metadata of this URL and change the contenttype from *meta* to your own in the views *edit* and *rdf*. + diff --git a/docs/enhancer/rdf/README.md b/docs/enhancer/rdf/README.md new file mode 100644 index 0000000..3aee598 --- /dev/null +++ b/docs/enhancer/rdf/README.md @@ -0,0 +1,66 @@ +--- +title: Meta data enrichment or annotator from Resource Description Framework (RDF) to Solr or Elasticsearch +authors: + - Markus Mandalka +--- + +# Meta data enrichment or annotator from Resource Description Framework (RDF) to Solr or Elasticsearch + + +## Annotator for labels from ontologies or RDF datasets to Solr or Elastic Search documents + + +This enhancer will **enrich** existing files, content or URIs with **additional metadata** in **Resource Description Framework (RDF)** standard format stored on the semantic web or intranet i.e. on a **meta data server, annotation server or CMS** (i.e. tags and annotations in a Semantic Mediawiki or in [Drupal CMS](../rdf-drupal)) and annotates the index of Elastic Search or Solr with the labels of the RDF annotations. + +Therefore it calls the meta data server with the URI as parameter or query. + +If you want to [import whole RDF graphs from RDF files or (parts) from a triplestore as content or **data source** for search and text mining, use the RDF connector](../../connector/rdf) instead. + + +## Configuration + + + +Config file: `*/etc/opensemanticsearch/enhancer/rdf*` +### Servers + + +Set the url of your meta data server or a list of meta data servers delivering RDF meta data for other URLs. + +As parameter you can use *[uri]* as template for the URL or *[uri\_md5]* for the MD5 Checksum of the URL, so the CMS is able to search for the meta data of the URL of the original content you want to enrich while indexing. + +`config['metaserver'] = { + 'http://localhost/drupal/rdf?uri=[uri]', + 'http://localhost/mediawiki/index.php/Special:ExportRDF?page=[uri_md5]', +}` +### Mappings RDF properties to Solr fields or facets + + +So you can map RDF properties to Solr fields / facets / interactive filters: + +`config['property2facet'] = { + 'http://purl.org/dc/terms/Tags': 'tag_ss', + 'http://purl.org/dc/terms/location': 'location_ss' +}` + +You can use standard fields like title, author or content or tags (Solr field name: tag\_ss). + +### Custom fields / facets + + + +If there are no convenient fields / facets yet, you can map the RDF properties to additional custom fields/facets: + +If you dont want to use standard fields like title, author and content you dont have to change the config file `managed-schema` (which defines the fields of the Solr index). + +#### Dynamic fields + + +Our Solr server is preconfigurated with [dynamic fields](https://cwiki.apache.org/confluence/display/solr/Dynamic+Fields) so that you can fill standard fields like title or content or additional dynamic fields like *yourfield\_b* for one boolean, *yourfield\_bs* for booleans, *yourfield\_s* for a string and *yourfield\_ss* for some strings to be filled with data. + +#### Enable new fields or facets in the user interface + + +If you did not use preconfigurated fields like tags (fieldname is *tag\_ss*) and want to use them not only to find data but as interactive filters (facets) for the navigation: + +To enable your own additional fields as facets (interactive filters) in the user interface just [map the technical solr fieldnames to user friendly labels in the config of the user interface with the option *$cfg[facet]*](../../doc/admin/config). diff --git a/docs/enhancer/regex/README.md b/docs/enhancer/regex/README.md new file mode 100644 index 0000000..0d3e34d --- /dev/null +++ b/docs/enhancer/regex/README.md @@ -0,0 +1,76 @@ +--- +title: Extract structured data from text by text patterns (Regular Expressions) +authors: + - Markus Mandalka +--- + +# Extract structured data from text by text patterns (Regular Expressions) + + +You can extract some structured data for aggregated overviews, interactive navigation and interactive filters (faceted search), data analysis and data visualization from unstructured text with regular expressions (RegEx). + +You can extract some structured data i.e. for aggregated overviews, interactive navigation and interactive filters (faceted search), data analysis and data visualization from unstructured text by extraction of the interesting text parts to structured fields, properties or facets by defining text patterns with regular expressions (RegEx). + +## Named entities like persons, organizations, locations or concepts + + +Regular expressions doesn't mean Named Entities with names that are strings that do not change. +If you want to [identify named entities like known persons, organizations, location or concepts, you should use the Named Entities Manager](../../doc/datamanagement/named_entities) with a comfortable user interface and which needs less resources. + +## Regular expressions for defining text patterns + + +Usage of the regular expression plugin is for text patterns with dynamic parts or variables. + +## Preconfigured regular expressions + + +There are some preconfigurated config files in `/etc/opensemanticsearch/regex` like *regex-email.tsv* extracting email-addresses or *regex-money.tsv* for extraction of amounts of money. + +## Custom regular expressions + + +If you want to add custom regular expressions, you should use the custom regex config file +`/etc/opensemanticsearch/regex/regex-custom.tsv` +so you can updates the preconfigurated lists automatically without overwriting your own config. + +## Custom regular expressions lists + + +Sometimes you might want not only to add some custom regular expressions, but a whole list or more than one. + +For example if you want to exchange such configs or lists with partners, so you should seperate such configs for special topics from your custom regular expressions. + +To add another regex list just add to the config in */etc/opensemanticsearch/etl* +`config['regex_lists'].append('/etc/opensemanticsearch/regex/regex-anOwnList.tsv')` +## Config format for extraction of text patterns + + + +The text patterns are configured in a textfile config in TSV format (tab seperated values). + +For a new pattern just add a new line to the config. + +Begin with the text patterns you search for as a [regular expression](https://docs.python.org/3.5/library/re.html). + +Optionally you can add a tab and the name of a facet/field where to write the matches. If no facet / field added, the default facet/field "Tags" will be used. + +Lines with # as first char of the line are ignored. + +Example: +`# Write text like *1000.00 $* or *100$* to the facet *dollar\_ss* +[0-9]+[\.\,]?[0-9]*[:blank:]*\$ dollar_ss` +## Extract only parts of a pattern (RegEx groups) + + + +Sometimes you don't want to extract the whole matching pattern like `size of 1000 m`, but only a part of it like only the number. + +Regular expressions can group part of the pattern with `()` + +If your pattern defines RegEx groups you can configure with an additional tab and a following number which groups result will be used. + +If you set the group to 0, the whole matching pattern will be extracted, if you set the group to `1` the (first) group of the regular expression will be extracted to the configured facet/field. If you set `2` the second group (if more than one group defined) or the regular expression will be extracted and so on... + +Example: +`Size of ([0-9]+)[:blank:]?m size_ss 1` diff --git a/docs/enhancer/speech/README.md b/docs/enhancer/speech/README.md new file mode 100644 index 0000000..6501d68 --- /dev/null +++ b/docs/enhancer/speech/README.md @@ -0,0 +1,14 @@ +--- +title: Speech recognition for audio files +authors: + - Markus Mandalka +--- + +# Speech recognition for audio files + + +This data enrichment plugin extracts text from speech in audio or sound files like WAV or MP3 so it there are findable by content automatically even if not tagged. + +For privacy issues it does not upload your file to cloud services. So you can use this plugin even offline without any internet connection. + +Todo: This plugin works at the moment only for short audio files. For very long audios please wait, until the plugin will integrate a tool, which cuts too long audios into parts (which should be between words in a certain time, not exactly after a certain time). \ No newline at end of file diff --git a/docs/enhancer/xmp-sidecar-files/README.md b/docs/enhancer/xmp-sidecar-files/README.md new file mode 100644 index 0000000..d0181e9 --- /dev/null +++ b/docs/enhancer/xmp-sidecar-files/README.md @@ -0,0 +1,23 @@ +--- +title: XMP sidecar files +authors: + - Markus Mandalka +--- + +# XMP sidecar files + + +This enhancer module reads additionally image metadata like title, tags or descriptions from XMP (Extensible Metadata Plattform) sidecar files i.e. from the photo database *Adobe Photoshop Lightroom* or *JPhototagger*. + +## Installation + + + +Just download and install the module. + +## Configuration + + + +Just setup in the config file */etc/opensemanticsearch/connector-files* the following option: +`config['xmp'] = True` \ No newline at end of file diff --git a/docs/enhancer/zip/README.md b/docs/enhancer/zip/README.md new file mode 100644 index 0000000..33949dc --- /dev/null +++ b/docs/enhancer/zip/README.md @@ -0,0 +1,14 @@ +--- +title: Enhancer ZIP +authors: + - Markus Mandalka +--- + +# Enhancer ZIP + + +This enhancer recognizes ZIP archives to unzip its content and index each file inside the zip file, too. + +So it extends the possibility to search for the ZIP file itself and its metadata like the contained filenames to be able to find the full contents of zipped documents, presentations and all other files within the archive file, too. + +Additionally all files inside the ZIP-archive will be enhanced by all other configured enhancers, too. I.e. with the OCR enhancer for automatic text recognition for images even inside the ZIP files. \ No newline at end of file diff --git a/docs/etl/README.md b/docs/etl/README.md new file mode 100644 index 0000000..00f9a9d --- /dev/null +++ b/docs/etl/README.md @@ -0,0 +1,213 @@ +--- +title: Open Semantic ETL toolkit for data integration, data analysis, document analysis, information extraction & data enrichment +authors: + - Markus Mandalka +--- + +# Open Semantic ETL toolkit for data integration, data analysis, document analysis, information extraction & data enrichment + +## Open source frameworks for data integration, document processing, information extraction, data analysis, merging & combining data, content enrichment and data enrichment pipelines + +Since most data is available in open standards or extractable by open source software libraries and free software, you can use different open source toolkits or frameworks to extract, transform and load (ETL) data into the search index. + +The preconfigured *Open Semantic ETL* is a Python based lightweight, flexible, extendable, modular and interoperable free software and **open source ETL (extract, transform, load), content enrichment and data enrichment framework, toolkit or data enrichment management system** for: +- document processing +- automated content analysis and media analysis +- information extraction +- merge and data enrichment pipelines + +It manages multiple, different and modular **import, extraction, content analysis, data combining or data enrichment plugins**. + +Since the architecture of the search engine is modular, using open standards for Linked Data and Semantic Web like RDF or SKOS and the basis Elastic Search or Solr providing common standard APIs, you can use or integrate many other alternate Open Source ETL and data analysis tools instead of or in addition to. + +## Extract structured data from unstructured documents (information extraction), merge and enrich data with multiple other data sources and data analysis tools + +Modular data enrichment plugins (enhancer) extract structured data from even unstructured documents or plain text and enhance or enrich the content with additional meta data or analytics. + +## Document processing, document analysis, data integration, content analysis and data enrichment pipeline (Enhancement chain) + +The document processing pipeline or chain is a list of data enrichment plugins (enhancer), which will be run for each document to enrich, analyse or link them with additional data or analysis. + +A part of the default [document processing pipeline configuration](#config) is for example: +* Crawl a directory and its files and subdirectories +* Filter blacklists (`filter_blacklist`) +* Filter if the file is indexed yet and not modified since last indexing (`filter_file_not_modified`) +* Extract text (`enhance_text`) +* OCR images (`enhance_ocr`) +* Adding annotations and tags (`enhance_rdf`) +* Exporting or indexing to **SQL or NoSQL database** and/or **search index** (f.e. [*Apache Solr*](http://lucene.apache.org/solr) or *[Elastic Search](elasticsearch)* or a *[Linked Data **triplestore** like Apache Jena Fuseki](export/rdf)*) + +## Semantic data enrichment plugins + +Such modular data enrichment plugins (enhancer) will extract structured data from unstrucutred documents, enhance or enrich the content with additional meta data or analytics. + +For example the [named entities extractor](../doc/datamanagement/named_entities) or [OCR for image files](../enhance/ocr). + +## Configuration of a custom document processing, content analysis and data enrichment pipeline + +If you use only Open Semantic ETL you can use `/etc/etl/config` to setup your data analysis and data enrichment chain and to set a db/exporter/writer to store or index the results (for example *Solr*, *Elastic Search*, a triplestore or a database). + +If you use the preconfigured full search engine (Open Semantic Search) the pipeline or the enabled plugins are configured for all data sources in `/etc/opensemanticsearch/etl` or can be overwritten or extended for each data source or connector in their specialized configs like `connector-files`. + +The analysis chain runs in order, since some plugins depend on data analysis of other plugins. + +You can add additional or new data enrichment plugins to `config['plugins']`. + +Or you can overwrite this config option to define a custom data enrichment pipeline with only a few needed plugins. + +You can overwrite the config by parameters of the command line tools, for example to use a custom config file or to set the plugin for your data analysis and data enrichment chain. + +So you can set a custom config file on the command line with the parameter `--config`, for example: +`etl-file --config */etc/etl/MyCustomConfig* *filename*` + +## Usage: Extract, analyze and enrich + +Extract, analyze and enrich and export data from files or webpages: + +`etl-file *filename*` +to import/extract/analyze/enrich a file + +or + +`etl-file *directory*` +to import/extract/analyze/enrich all files of a directory and its sub directories + +or + +`etl-file-monitoring *directory or file*` +for monitoring a directory and import/extract/analyze/enrich new or changed files + +or + +`etl-web *uri*` +to download a file or webpage from the web and extract, analyze and enrich it + +## Enrich parts, enrich later, add additional enrichments, update data enrichments or distributed data enrichment + +The tool `etl-enrich` can run data enrichment parts or plugins which are not enabled in your default document processing pipeline later or from time to time. + +For example sometimes its better to index all documents without OCR quickly and after that to do the OCR of the documents with images which will take a long time. So the users are able to search in most documents and text, not having to wait until only a few parts and only for a few documents like some text in images are recognized in a long time process first before other documents after them were indexed, which takes only very short time, because there are no images. + +Or you can do expensive data enrichment like OCR at night or on a low server load or distribute this work on different processors (parallel processing) or servers (cluster) or web services (cloud). + +Another possibility is to enrich with tools or webservices that improved or updated their results because of better analytics quality or more available data from time to time to integrate newer data or analytcs results. + +Or to enrich later with an additional webservice, without having to run the full document processing chain again. + +Or if a webservice was not available while indexing to enrich data with its analytics later. + +### Run additional data analysis or data enrichment plugins + +You can run the tool from REST-API or on the command line: +`etl-enrich --plugins *pluginname*` + +Optionally you can add a search or filter query, so only the interesting or important data or document(s) will get enriched: +`etl-enrich --plugins *pluginname* --query *query*` + +## Enrichment with results of webservices and APIs + +You can analyze your data with internal webservices (or if you don't need privacy with external webservices or "the cloud") and read the results with the standard RDF enhancer plugin. + +If the webservice results are not in standard Semantic Web formats, but only an API, you can call the API and read the results in your favorite programming language in a custom data enrichment plugin: + +## Development of custom data enrichment plugins + +You can develop custom data enrichment plugins with a few lines of code using the data enrichment interfaces for Python, Javascript or Java Plugins. + +Or you can develop or use a webservice in your favorite programming language and read its results with the standard RDF enhancer plugin. + +[Learn more about development of data enrichment plugins](../dev/enhancer) ... + +## Scale for big data analysis + +If there is big data and you have to index faster, you can [scale by parallel processing, search clusters and optimizing RAM settings](../doc/admin/scale). + +## Other frameworks for data integration for data warehouse or for extraction, transformation and load (ETL) or data enrichment + +There are powerful open source ETL frameworks (extraction, transformation and load) for data integration, mapping, filtering and transformation for data warehousing with powerful features and graphical user interfaces (GUI). + +![](../screenshots/spoon_job.png) +![](../screenshots/spoon_transformation.png) + +If there is an output plugin for Solr or if the tools can export data in a format which can be imported by one of our [connectors (crawler, extraction or input plugin)](../doc/admin/connectors), you can use these open source frameworks like [Kettle](http://community.pentaho.com/projects/data-integration/) or [Talend Open Studio](https://www.talend.com/resource/etl-tool.html) to integrate, extract, transform, enrich and load (index) data to the search engine. + +## Other data enrichment frameworks based on Semantic Web standards + +You can use the [Apache Stanbol](http://stanbol.apache.org/docs/trunk/components/enhancer/) data enrichment framework and one or more of its many [enhancer engines](http://stanbol.apache.org/docs/trunk/components/enhancer/engines/list). + +## Transform unstructured documents to semantic linked data + +There are not only output/storage/index writer/exporter plugins for search engines like Solr or Elastic Search, but for triplestores, too: + +So with its [triplestore storage or output plugins for RDF export](export/solr2rdf) it can integrate unstructured data like document files and document analysis like OCR to [structured Linked Data like RDF graphs and with Semantic Web Tools like a triplestore](#semanticweb) and many other tools working with [open standards for the Semantic Web](#semanticweb). + +So it can not only be used for data analysis, data enrichment and merging but as a converter from more or less unstructured document files to linked data like PDF to RDF, Word to RDF, DOC to RDF, OCR to RDF, JPG to RDF, PNG to RDF or as a flexible importer for Semantic Web infrastructure like triplestores. + +Or it can be seen as an Semantic Web-API for legacy files, documents or command line data analysis tools serving their data or analysis results to Semantic Web infrastructure. + +Another Framework for getting Semantic Web or Linked Data graphs with structured data from unstructured or legacy files are: +* [Linked Pipes ETL](http://etl.linkedpipes.com/): RDF based open source framework for extract transform load (Java) +* [LDIF](http://ldif.wbsg.de/): linked data integration framework +* [Karma](http://usc-isi-i2.github.io/karma/): Data integration tool +* [Silk](http://silkframework.org/): open source framework for integrating heterogeneous data sources +* [Apache Stanbol](http://stanbol.apache.org/docs/trunk/components/enhancer/): Data enrichment framework reads text and serves a RDF graph + +## Linked Data and the Semantic Web + +Linked Data (LD) or the Semantic Web (Web 3.0) and [Linked Open Data (LOD)](../doc/datamanagement/opendata) based on standard formats like RDF, JSON-LD or Turtle makes data integration, data enrichment and merging data sources easier. Parts of such databases or graphs can be queried and filtered via the query language SPARQL. + +The data is available in open standard linked data formats and can be imported to your favorite formats and accessible with your favorite tools, software or library. + +## Merging multiple data sources to one graph database + +To merge data from different semantic web sources, just load their graphs (database with linked data) into the triplestore (database server) and match or map the properties (in traditional databases this would be columns or data fields). + +Your triple store or frameworks, for example OpenRDF, bring some tools to load linked data in RDF or Turtle format into the triplestore. + +To download and import external graph databases or external linked data, you can use the Semantic Web ETL frameworks: +* [Unified Views](https://github.com/UnifiedViews): ETL tool for RDF data + +## Merging data fields of different data sources and IDs (Entity Mapping) + +If the different data sources don't use a common standard for data fields or IDs like Dublin Core or [Wikidata](../doc/datamanagement/opendata): + +To merge, connect and map the data fields of different data sources, you can add another graph: an ontology for mapping/connecting different property names or IDs. With the property "Same as" you can map or merge different data sources to one graph. + +### Tools and Methods + +* Semantic Web: Entity Mapping with properties like *Same As* or [linking different relations of concepts with Simple Knowledge Organisation System (*SKOS*)](../doc/datamanagement/thesaurus) +* [Record linkage](https://en.wikipedia.org/wiki/Record_linkage) (for example with Joins: [Solr Join](https://wiki.apache.org/solr/Join) or [SQL Join](https://en.wikipedia.org/wiki/Join_%28SQL%29) (if same keys or ids in both datasets)) and/or Levensthein distance for similarity +* Open Refine reconcile API + +## Open Data sources: Data enrichment with Linked Open Data + +Since there are many open data in this open standard formats for linked data, you can enrich your data with many [free knowledge bases like WikiData or DBPedia (the structured database of Wikipedia)](../doc/datamanagement/opendata), which is available via a SPARQL Endpoint. + +## Other open source projects + +* [Tika](http://tika.apache.org/): Content Analysis Toolkit: extracts content and meta data like author from different document and file formats +* [Apache ManifoldCF](http://manifoldcf.apache.org/): Data integration framework reads different datasources and exports to index +* [Apache UIMA](http://uima.apache.org/) - Pipelines to get structured information out of unstructured documents or data +* [DKPro Core](https://github.com/dkpro/dkpro-core): Provides UIMA components wrapping natural language processing (NLP) tools so they can be used interchangeably in UIMA processing pipelines +* [Kite morphlines](http://kitesdk.org/docs/current/morphlines/): ETL framework to import data to Solr or Hadoop +* [Apache Flume](https://flume.apache.org/): Framework for data pipes +* [Kettle](http://community.pentaho.com/projects/data-integration/): ETL framework with GUI +* [Talend Open Studio](https://www.talend.com/resource/etl-tool.html): ETL framework with GUI +* [Apache NiFi](https://nifi.apache.org/): Automated and managed flow and transformation of information between systems +* [DSWARM](http://www.dswarm.org): Data management platform for enrichment, normalization and linkage of knowledge data structures +* [Europeana Code repository](https://github.com/europeana): ETL tools for Europeana library +* [Scrapy](http://www.scrapy.org): Crawler and data extractor for extracting structured data from websites not providing an API for getting JSON or linked data like RDF but for example HTML without semantic annotations like RDFa +* MapReduceIndexerTool: Indexing many files to Solr faster using a Hadoop cluster (MapReduce is used for parallel processing on a cluster) +* [Freme Project](http://www.freme-project.eu/): Open framework for multilingual and semantic enrichment of digital content + +## Methods + +* [Data integration](https://en.wikipedia.org/wiki/Data_integration) +* [Extract, transform, load (ETL)](https://en.wikipedia.org/wiki/Extract,_transform,_load) +* [Optical character recognition (OCR)](https://en.wikipedia.org/wiki/Optical_character_recognition) +* [Information extraction](https://en.wikipedia.org/wiki/Information_extraction) +* [Entity Linking](https://en.wikipedia.org/wiki/Entity_linking) +* [Crawling](https://en.wikipedia.org/wiki/Web_crawler) +* [Document processing](https://en.wikipedia.org/wiki/Document_processing) +* [Document automation](https://en.wikipedia.org/wiki/Document_automation) +* [Document modelling](https://en.wikipedia.org/wiki/Document_modelling) \ No newline at end of file diff --git a/docs/etl/elasticsearch/README.md b/docs/etl/elasticsearch/README.md new file mode 100644 index 0000000..9a6f3e3 --- /dev/null +++ b/docs/etl/elasticsearch/README.md @@ -0,0 +1,71 @@ +--- +title: Index legacy documents, files and directories & file shares to Elastic Search +authors: + - Markus Mandalka +--- + +# Index legacy documents, files and directories & file shares to Elastic Search + +## How to index document files like Word documents or PDF files, file directories and file shares to Elastic Search with open source tools? + +You can import files, documents, directories and file shares to Elastic Search index with the Open Semantic ETL framework and its files connector (all components are free software & open source): + + +## Example + +1. Download and install Open Semantic ETL Elastic Search edition package +2. Index a directory with document files: +`opensemanticsearch-index-file */home/user/Documents*` +3. Search the content of the files with Elastic Search or Kibana. + +## Installation + +Install a preconfigured Open Semantic ETL package (Please donate: or Open Semantic Desktop Search and Open Semantic Search appliance) with the flavour "elastic search"-edition. + +or + +install Open Semantic ETL and [set in the config file /etc/etl/config the option "export" to "elasticsearch"](../export/elasticsearch). + +## Data enrichment and data analysis + +Documents are analyzed and enriched by enhancer plugins. + +For example image files or images inside PDF documents are enriched by automatic textrecognition (OCR), so it is possible to find text even in graphic format based PDFs like scans or photographed documents. + +## Config language for OCR + +For better OCR results you can configure another language (default language: english). + +## Alternate methods to start indexing files + +To import / index directories, documents and files you can use one of our standard tools and system integrations: +* Just [add to shared folder to the Open Semantic Search Virtual Machine](../../doc/admin/install/desktop_search) like Open Semantic Desktop Search or Open Semantic Search Appliance +* [Command line tools](../../connector/files) (so you can integrate with own scripts or standard Linux tools like Cron) +* Plugins for file managers like Nautilus or the Windows Filemanager +* Firefox Plugins +* Web API (REST API) +* [File monitoring tools](../../trigger/filemonitoring) + +## Search user interface + +After document processing and indexing you can use the Open Source user interface [Kibana](https://www.elastic.co/products/kibana) for full text search in your files and documents. + +## Performance + +We've got a first donation to improve performance, so only few donations are neccessary so one of the next versions will be able to index more documents in less time. More about how to increase performance soon. + +## Import CSV files + +Standard CSV tables are indexed automatically, soon. + +Please donate so we can release the CSV Manager UI for Elastic Search sooner, so you can import very big CSV files in a more structured form and import non-standard CSV files easier. + +## Elastic Search based Desktop Search + +A very easy to install and fully preconfigured [Open Semantic Desktop Search](../../doc/admin/install/desktop_search) Elastic Search and Kibana flavoured Virtual Machine is planned. + +Please donate to realize this earlier. + +## Named entities extraction + +Please donate so we can release the Thesaurus for Named Entity Extraction for Elastic Search sooner. diff --git a/docs/etl/export/README.md b/docs/etl/export/README.md new file mode 100644 index 0000000..92560e0 --- /dev/null +++ b/docs/etl/export/README.md @@ -0,0 +1,11 @@ +--- +title: Open Semantic ETL: Data Export +authors: + - Markus Mandalka +--- + +# Open Semantic ETL: Data Export + +Output plugins store or export results of the data extraction and data analysis chain to different formats or databases. + +For example to a search index like [Solr](solr) or [Elastic Search](elastic_search) or to a [triple store](rdf), a database or a file. diff --git a/docs/etl/export/csv/README.md b/docs/etl/export/csv/README.md new file mode 100644 index 0000000..4d459da --- /dev/null +++ b/docs/etl/export/csv/README.md @@ -0,0 +1,14 @@ +--- +title: CSV Export +authors: + - Markus Mandalka +--- + +# CSV Export + +Write data to a CSV spreadsheet, so you can import the data with other software or with Open Office Calc, Libreoffice Calc or Excel. + +If you use output plugins to index your data to a search index like [Solr](../../../open-semantic-etl/export/solr) or [Elastic Search](../../../open-semantic-etl/export/elastic_search), you can read and filter the data with their powerful search APIs. + +Just set the Solr result writer to CSV format by using the `wt` paramater: +`localhost:8983/solr/core1/select?q=*:*&wt=csv` \ No newline at end of file diff --git a/docs/etl/export/elasticsearch/README.md b/docs/etl/export/elasticsearch/README.md new file mode 100644 index 0000000..bdd3c3f --- /dev/null +++ b/docs/etl/export/elasticsearch/README.md @@ -0,0 +1,17 @@ +--- +title: ETL to Elastic Search index +authors: + - Markus Mandalka +--- + +# ETL to Elastic Search index + +This plugin indexes extracted and enriched data to [Elastic Search](../../elasticsearch). + +To configure Open Semantic ETL or a Open Semantic Search connector config to index to Elastic Search, overwrite the output plugin settings in `/etc/opensemanticsearch/etl`: + +`config['export'] = 'elasticsearch'` + +Optionally you can set another Elastic Search indexname (default: `opensemanticsearch`). + +`config['index'] = 'anotherIndex'` diff --git a/docs/etl/export/json/README.md b/docs/etl/export/json/README.md new file mode 100644 index 0000000..b9ed803 --- /dev/null +++ b/docs/etl/export/json/README.md @@ -0,0 +1,25 @@ +--- +title: Open Semantic ETL: Export results to JSON +authors: + - Markus Mandalka +--- + +# Open Semantic ETL: Export results to JSON + +This is one of the output plugins for standalone installations of Open Semantic ETL without a full search engine, for example for some data analysis, enrichment or jobs saved to an output file or to another (maybe light-weight) database. + +If you set `config['export'] = 'export_json'`, the output of `etl-file *filename*` or `etl-web *url*` will be exported as JSON. + +To write the JSON output to a file, set the argument `--outputfile`, for example + +`etl-file --outputfile *outputfilename* *inputfilename*` + +or + +`etl-web --outputfile *outputfilename* *uri*` + +## API with JSON results + +If you use output plugins to write your data to a search index like [Solr](../../../open-semantic-etl/export/solr) or [Elastic Search](../../../open-semantic-etl/export/elastic_search), you can read and filter it with their more powerful search APIs. + +For example [REST-API of Solr](http://lucene.apache.org/solr/quickstart.html#searching) for searching or / and getting data in XML or [JSON](https://cwiki.apache.org/confluence/display/solr/Using+JavaScript) format or use [Solr Client APIs](https://cwiki.apache.org/confluence/display/solr/Client+APIs) to get data with your favorite programming language. diff --git a/docs/etl/export/rdf/README.md b/docs/etl/export/rdf/README.md new file mode 100644 index 0000000..3c1d126 --- /dev/null +++ b/docs/etl/export/rdf/README.md @@ -0,0 +1,21 @@ +--- +title: Export extracted and enriched data to a graph or triplestore (RDF) +authors: + - Markus Mandalka +--- + +# Export extracted and enriched data to a graph or triplestore (RDF) + +## Export data, data enrichments and analysis results to a graph or triplestore + +Exports data, data enrichments or data analysis results as linked data in **Resource Description Format (RDF or Turtle/NT)** or to a **triplestore (graph database)** like *Apache Jena Fuseki*, *Sesame, RDF4J or OpenRDF*. + +So you can use many other tools or share the data using **open standards** for **Linked Data and the Semantic Web**. + +### Mapping RDF properties to fields or facets + +If you use connector and data enrichment plugins that don't work with semantic web formats, you can map legacy fields or facets to RDF properties. + +The mapping is configured in a graph, for example RDF or a turtle (NT) file. + +More soon ... diff --git a/docs/etl/export/solr/README.md b/docs/etl/export/solr/README.md new file mode 100644 index 0000000..b710b49 --- /dev/null +++ b/docs/etl/export/solr/README.md @@ -0,0 +1,23 @@ +--- +title: ETL to Solr search index +authors: + - Markus Mandalka +--- + +# ETL to Solr search index + +## ETL exporter configuration + +To export the results of [document extraction, data analyis and data enrichment](../..) to a [Solr](http://lucene.apache.org/solr) search server (preconfigured default, if you use the Open Semantic Search packages), set the output Plugin to `export_solr`: + +`config['export'] = 'export_solr'` + +## Solr server configuration + +If not default *http://localhost:8983/solr/* configure `config['solr']` to your Solr server, for example: + +`config['solr'] = 'http://localhost:8983/solr/'` + +## Solr core configuration + +`config['index'] = 'core1'` diff --git a/docs/etl/export/solr2rdf/README.md b/docs/etl/export/solr2rdf/README.md new file mode 100644 index 0000000..e3c82d3 --- /dev/null +++ b/docs/etl/export/solr2rdf/README.md @@ -0,0 +1,12 @@ +--- +title: Solr2RDF +authors: + - Markus Mandalka +--- + +# Solr2RDF + + +## Export Solr fields to RDF graph (Linked Data and Semantic Web) + +This Solr2RDF plugin reads data from Solr fields/facets and converts them to a RDF graph so you can import the data to a standard triplestore for Linked Data and the Semantic Web. \ No newline at end of file diff --git a/docs/graph-explorer/README.md b/docs/graph-explorer/README.md new file mode 100644 index 0000000..0a710b5 --- /dev/null +++ b/docs/graph-explorer/README.md @@ -0,0 +1,51 @@ +--- +title: Open Semantic Visual Graph Explorer for Discovery and Visualization of Linked Data +authors: + - Markus Mandalka +--- + +# Open Semantic Visual Graph Explorer for Discovery and Visualization of Linked Data + +## Open Source tool and user interface (UI) for discovery, exploration and visualization of a graph + +The open source tool Open Semantic Visual Linked Data Knowledge Graph Explorer is a web app providing user interfaces (UI) to discover, explore and visualize linked data in a graph for visualization and exploration of direct and indirect connections between entities like people, organizations and locations in your Linked Data Knowledge Graph (for example extracted from your documents by Open Semantic Search or Open Semantic ETL using Named Entity Extraction and Named Entity Recognition). + +[![](../screenshots/visual_graph_explorer.png)](../doc/analytics/graph) +## Visualize relations of entities like persons or organizations within and across documents (co-occurrences of named entities) + +The [network analysis / graph visualization shows you the relations, connections and networks between named entities like persons, organizations or main concepts which occur together (co-occurrences)](../doc/analytics/graph) in your content, datasources and documents. + +[![](../screenshots/document_graph.png)](../doc/analytics/graph) + +## Usage of the Graph User Interface + +Read more about the features, [graph user interfaces and how to use them in the documentation](../doc/analytics/graph). + +## Free software (Open Source) + +The source code of the free software is available in the Git repository [open-semantic-visual-graph-explorer](https://github.com/opensemanticsearch/open-semantic-visual-graph-explorer). + +## Integrates Python Django, Apache Solr and Cytoscape.js + +The Django web app for discovery, exploration and visualization of a graph integrates a Neo4j graph database (planed) with documents in a Apache Solr search index with the Cytoscape.js graph visualization framework. + +## Dependencies + +If you do not want to use the preconfigured Debian or Ubuntu packages, you have to setup the following dependencies: + +- Python 3 (https://www.python.org/) +- Django (https://www.djangoproject.com/) +- cytoscape.js (Git: https://github.com/cytoscape/cytoscape.js) +- cytoscape.js-panzoom (Git: https://github.com/cytoscape/cytoscape.js-panzoom) +- Foundation (https://foundation.zurb.com/) + + +### Optional dependencies / integration + + + +Optional dependencies (at least one of them needed) for integrated graph database(s) or faceted search index where your knowledge graph, entities, connections and/or documents are stored: + +- Apache Solr (https://lucene.apache.org/solr/) +- Planned: Neo4j (https://neo4j.com) +- Planned: SPARQL triplestore like Apache Jena (https://jena.apache.org/) \ No newline at end of file diff --git a/docs/investigative_journalism/howto-analyze-leaks/README.md b/docs/investigative_journalism/howto-analyze-leaks/README.md new file mode 100644 index 0000000..84af098 --- /dev/null +++ b/docs/investigative_journalism/howto-analyze-leaks/README.md @@ -0,0 +1,156 @@ +--- +title: How investigative journalists can start to investigate, analyze and explore massive leaks of large document collections with many files much faster +authors: + - Markus Mandalka +--- + +# How investigative journalists can start to investigate, analyze and explore massive leaks of large document collections with many files much faster + +A (quick and very dirty and work in progress for coming workshop) tutorial on new UIs (more easier to use UIs planned, so it will be extended and imports of entities will get easier next weeks and months) for faster picking of low hanging fruits in big data leak analysis with limited computing resources: + +After an overview of useful and powerful data and text analysis methods (which need [long document processing time on initial import, if very large amount of files](#big-data-leaks-with-large-amounts-of-files-and-text-often-need-long-processing-time)) it describes some [methods, config options and new user interfaces for investigative journalists which empower investigative journalism to pick low hanging fruits of huge leaks faster and start to investigate and analyze a big leak much earlier](#get-low-hanging-fruits-very-fast). + +## Free Open Source search tools for leak analysis, exploration and discovery for investigative reporting + +There are many powerful and useful research features by free software for information retrieval and integrated open source tools for data analysis to explore and analyze the contents of leaks and document collections by faceted search and overviews, thesaurus, ontologies, lists of named entities (batch search) for automatic entity extraction of known entities and other domain knowledge like important concepts, by machine learning (ML) tools ("artificial intelligence" AI) for natural language processing (NLP) like automatic named entity recognition (NER) of yet unknown entities, [fuzzy search](#fuzzy_search) and other powerful Text mining features which are useful in investigative journalism: + +![](../../screenshots/search.png) + +## Full text search + +The full text search user interface allows you to search the index with [powerful search operators](../../doc/search/operators) i.e. for `germany OR german* OR deu OR Berlin OR deutsch* OR "Steffan Mappus"` or some other names. + +## Privacy and data protection + +Analysis, indexing and search runs on your own computer without using cloud services, so what you search for will not be seen, stored and spied by default like on external cloud services. + +## Manage named entities like companies or politicians + +You can add names (for example companies or politicians) to the [Thesaurus](http://www.opensemanticsearch.org/doc/datamanagement/thesaurus). + +![](../../screenshots/named_entities_manager.png) + +## Faceted search (Overview and interactive filters of entities) + +This names and concepts in thesaurus, ontologies or lists of names (which investigators with domain knowledge know best and which are often very relevant but an automatic named entity recognition by machine learning fails to recognize them) and/or Named entity recognition by machine learning enables an aggregated overview for this Named Entities like people, organizations or places: + +![](../../screenshots/knowledge_graph-entities.png) + +### Extracted people and organizations + +![](../../screenshots/sentences-list.png) + +### Extracted email addresses, email domains + +![](../../screenshots/email-domains.png) + +### Extracted locations and phone numbers + +![](../../screenshots/phone.png) + +### Extracted legal codes and law clauses + +![](../../screenshots/law-code.png) + +The screenshot shows you how you can use this overviews or how to use named entities as interactive filter to narrow down search results. +So a click to a facet (i.e. an organization) will drill down the search results to fewer documents, matching this additional facet/filter, too. + +## How to get this structured facets / overviews and leads by using watchlists and Open Data + +But you dont have to add each potential name yourself to add some structure or watchlists like for example names of important people or politicians. +Import [Open Data](../../doc/datamanagement/opendata) to the [Lists and Ontologies Manager](../../doc/datamanagement/ontologies) + +### List of names of people of interest like politicians + +Get a [list of names of politians from your country for example from Wikipedias structured database Wikidata.](../../doc/datamanagement/opendata/wikidata) +So you get another search facet and overview about this potentialy relevant Names occuring in the documents. + +### Open Data list of location names + +Another option is to filter by town names of your country: +Get a list of town names of your country, for example from [GeoNames](http://www.geonames.org/), from Openstreetmap or from Wikidata. + +So you get another search facet and overview about "Locations" occurring in the documents, which are in your country. + +So you can filter for towns in your country and see which people occurre within the documents which maybe are yet unknown and not in your lists of persons but very interesting for the searched context (i.e. your country). + +## Fuzzy search + +No human writer, no OCR software and no machine learning model is perfect. There are typos in documents, wrong recognized chars by OCR and occurring but not recognized names by Named Entity Recognition by machine learning (its biased statistics not artificial intelligence magic). + +So consider to fuzzy search for similar name variants: + +As intelligent human considering more cases and conplexity of languages than a dumb computer trying natural language processing by [powerful fuzzy search operators](../../doc/search/fuzzy) or by following UI maybe finding some (but often not as many as a creative human knowing limitations of automatic fuzzy search) useful variants easier: + +![](../../screenshots/search-name-variants.png) +![](../../screenshots/recommender_results.png) + +## Big Data Leaks with large amounts of files and text often need long processing time + +Huge leaks can be large document sets with thousands, hundred thousands or millions of document files. + +Today it is mostly no problem to search in even such large amounts of documents with modern Open Source research tools even on older hardware like used by many journalists, if the documents are indexed in a open source search engine. Adding and indexing new documents over time is no problem, too, since only new and changed documents will be indexed on a recrawl of your file directories. + +But the initial text extraction, OCR and indexing such large document collections with large amounts of files to a search engine can take days or weeks (a former project to index a large document collection for collaborative investigative research took even weeks on modern hardware). + +But you don't have to wait such a long time until you can start with investigations in such big leaks: + +## Lack of IT admins? More user interfaces (UI) for investigative journalists + +Most of the below described features and methods to pick low-hanging fruits very fast had been develped years ago by a powerful modular, flexible and extendable Python based plugin architecture, but they needed Linux admin knowledge on Unix command line tools, Extract Transform Load (ETL) pipelines and related command line tools, most investigative journalists do not have. + +Like the last releases, the coming Open Source release in March (testing and improving stuff which yet in public Git repository) will provide additional web user interfaces and new default settings, so some features can be easier used even by freelance journalists or members of a team, if a specialized datajournalist or admin is busy or temporary not available: + +### Get low-hanging fruits very fast + +Many relevant information can be low-hanging fruits from a computing power perspective. + +So Open Semantic Search can run the extraction and analysis of documents in multiple stages: + +### Very fast indexing of filenames first + +Before the plain text will be extracted from documents, the path names and file names of all documents will be indexed first. + +So you can search very early all the path names and filenames while standard text extraction from your documents is yet running. + +So you have a faceted search / interactive filters for file paths and file extensions like .pdf for PDF documents or XLS for Excel sheets. + +If you on this base find interesting paths or documents, you can [prioritize files](#prioritize-text-extraction-and-ocr-tasks) for running text extraction to enable full text search of the content. + +And even in this early stage you may have faceted search for some of the keywords or names from your domain knowledge in thesaurus or lists of names if they occur in this filenames (dependent on file naming). + +### Named Entity Recognition (NER) by machine learning (ML) later + +Useful Named Entity Recognition of entities (works often even if not yet in your lists of names) by machine learning later needs up to ten times longer than entity extraction by your thesaurus or ontologies. + +So this step can be done later after text extraction, too while you are able to fulltext search all your documents earlier and maybe yet work with faster extracted entities from your domain knowledge by thesaurus or ontology based entity extraction. + +So set the ML NER plugin to be processed later (next release will have an UI config option "Do NER by ML later" in Config / Named Entity Recognition) + +### Slow OCR latest + +For most document sets OCR as the slowest task takes most time for mostly only few additional infos. + +So the very slow OCR tasks will run after all plain text was extracted from all documents and so you can find most texts (which are stored in text formats in the document files) by full text search much earlier. + +This is the new default setting in Config / OCR: + +![](../../screenshots/ocr-priority.png) + +### Prioritize text extraction and OCR tasks + +With this first analysis results or even only the path names and filenames you can often early identify potentially interesting files or directories for which you want to prioritize extraction and analysis. + +![](../../screenshots/prioritize-import.png) + +There you can click on "Prioritize" to open an UI where you can set the priority of certain files: + +![](../../screenshots/prioritize-import-ui.png) + +### Share load on multiple computers: Additional parallel ETL workers + +Maybe your team have an admin and more computers and servers? + +If one computer is slow, for more performance on the initial data import and analysis you can scale by adding additional computers or servers running a Open Semantic ETL Docker container which runs additional parallel workers to share the heavy analysis load between multiple computers. +![](../../screenshots/flower-monitor.png) +![](../../screenshots/flower.png)] diff --git a/docs/lexemes/README.md b/docs/lexemes/README.md new file mode 100644 index 0000000..8dd1429 --- /dev/null +++ b/docs/lexemes/README.md @@ -0,0 +1,53 @@ +--- +title: Import Wikidata dictionary (lexemes) to Solr synonyms config +authors: + - Markus Mandalka +--- + +# Import Wikidata dictionary (lexemes) to Solr synonyms config + +## Open Source tool to import Wikidata lexemes to Solr synonyms config + +The free Open Source tool wikidata-lexemes-to-solr-synonyms imports lexemes (dictionary including different grammar forms/lexical forms for each lexical entry) from Wikidata to Apache Solr search engine synonyms config. + +## Grammar rules for search and information retrieval + +Natural language processing of unstructured text is complicated, since the same words/meanings can occur in different grammar forms. + +### Stemming + +To find other grammar forms of words, the search engine uses [stemming](../doc/admin/config/stemming) heuristics, which for example cuts suffixes like -ing to find other grammar forms of the same words. + +But such automatic heuristics can fail, especially for example on irregular verbs, where for example another grammatical form like "went" is not only "go" with a suffix (like f.e. -ing). + +### Human curated dictionary (Linked Data Knowledge Graph of Lexemes as Open Data from WikiData) + +By considering lexemes by import of Wikidata Lexemes as Solr search engine synonyms you find documents including many such more complicated / irregular grammar forms, too. + +Hint: You can have a look and browse the structured data of lexemes in the structured data base and linked open data knowledge graph [WikiData](https://www.wikidata.org) by the web user interface [Ordia](https://tools.wmflabs.org/ordia/). + +## Import Wikidata lexemes to Solr synonyms config + +The lexemes import tool can be configured by following command line parameters and will be integrated to our web UI next. + +### Command line options + +``` +Usage: wikidata-lexemes-to-solr-synonyms [options] + +Options: + -h, --help show this help message and exit + -s SOLR, --solr=SOLR Solr URI like http://localhost:8983/solr/ + -c CORE, --core=CORE Solr core/index name + -r RESOURCE, --resource=RESOURCE + Solr managed synonyms resource where to store the + results + -l LANGUAGE, --language=LANGUAGE + Language (Wikidata entity) +``` + +## Free Open Source Software (FOSS) + +The Python & SPARQL based import tool is Free Software under the GPL license. + +The Open Source code is available in the [Github repository opensemanticsearch/lexemes](https://github.com/opensemanticsearch/lexemes). diff --git a/docs/rdf2ocr/README.md b/docs/rdf2ocr/README.md new file mode 100644 index 0000000..aa71757 --- /dev/null +++ b/docs/rdf2ocr/README.md @@ -0,0 +1,33 @@ +--- +title: Improve OCR by SKOS thesaurus or RDF ontology +authors: + - Markus Mandalka +--- + +# Improve OCR by SKOS thesaurus or RDF ontology + +The free **Open Source tool** [Solr Ontology Tagger](../solr-ontology-tagger) extracts words of a **Resource Description Format (RDF) ontology** and **Simple Knowledge Organization System (SKOS) thesaurus** to [**improve automatic text recognition by OCR**](../doc/datamanagement/ocr) by adding the words to a **custom dictionary (the "user words" list)** for the **open source** optical character recognition tool [**Tesseract OCR**](https://github.com/tesseract-ocr). + +## How to improve OCR of concepts or names in thesaurus or ontology + +By the out of the box [integration with the Tesseract OCR user word list or custom dictionary](../doc/admin/config/ocr), your concepts, words and names of named entities like organizations, places, locations or persons that are important for you so you added them to your [thesaurus](../doc/datamanagement/thesaurus) or which are included in [lists of names or ontologies](../doc/datamanagement/ontologies) (for example lists of names of relevant persons from internal databases or metadata sources or from open data sources like [Wikidata](../doc/datamanagement/opendata#wikidata)) you defined for faceted search/interactive filters and/or analytics/aggregated overviews are [recognized better by OCR of scanned documents](../doc/datamanagement/ocr), too. + +## Integrate SKOS Thesaurus or RDF ontology with Tesseract OCR dictionary + +Therefore your additional domain knowledge / vocabulary from thesaurus, lists and ontologies is used additional to the default OCR dictionaries by the Tesseract option `--user-words /etc/opensemanticsearch/ocr/dictionary.txt`. + +## In documents on paper names often in uppercase + +Since in many scanned legacy files on paper names are fully written in uppercase and for dumb computers and so OCR an "A" is another char than an "a", this autogenerated custom OCR dictionary / OCR wordlist includes the complete uppercase variant of each name or word, too. + +## Open Standards for Thesauruses and Ontologies (RDF & SKOS) + +Since using open standards **Resource Description Framework (RDF) for ontologies** and **Simple Knowledge Organization System (SKOS)** for [thesauri, knowledge bases, lists of entities, ontologies or taxonomies](../doc/datamanagement/thesaurus) you do not have to add or manage all important names yourself: + +## Open Data vocabularies like Wikidata + +So you can use [linked open data sources and databases](../doc/datamanagement/opendata) like [Wikidata](../doc/datamanagement/opendata#wikidata), the vocabularies of the European Union or the Unesco Thesaurus. + +## Free Open Source Software (FOSS) + +Since the tool and used libraries are free Open Source Software based on Python & rdflib, the full source code is included inside the downloadable packages and hosted on [Github](https://github.com/opensemanticsearch/solr-ontology-tagger). diff --git a/docs/rss-feed-manager-python-django/README.md b/docs/rss-feed-manager-python-django/README.md new file mode 100644 index 0000000..aee77e7 --- /dev/null +++ b/docs/rss-feed-manager-python-django/README.md @@ -0,0 +1,43 @@ +--- +title: RSS-Feed Manager +authors: + - Markus Mandalka +--- + +# RSS-Feed Manager + +## Managing newsfeeds and imports + +RSS-Feed manager is a web app and user interface for managing imports of RSS-Newsfeeds. + +## Usage + +Read the [user documentation](../doc/datamanagement/rss). + +## Installation + +* download the module `solr-search-rss-feed-manager-python-django` +* Copy the directory `rss_manager` from the zip file into your Django apps directory +* Enable the new app: + +Add "`rss_manager`" to your `INSTALLED_APPS` setting like this: + + +```python +INSTALLED_APPS = ( + # ... + 'rss_manager', + ) +``` + +* Include the querytagger URLconf in your project urls.py like this: +`url(r'^rss_manager/', include('rss_manager.urls')),` +* Setup a cron getting `http://localhost:8000/rss_manager/import` periodically (i.e. every 5 minutes). + +## Roadmap + +Plans for the feature ([please donate](../donate)): + +We want to add tagging functionality to the RSS importer, so you can add metadata or tags to all news imported with this feed, i.e. a special topic). + +We want to add tagging for RSS-Feed management, so you can organize many newsfeeds in the management interface with tags. diff --git a/docs/screenshots/WordTree.jpg b/docs/screenshots/WordTree.jpg new file mode 100644 index 0000000..619bd4c Binary files /dev/null and b/docs/screenshots/WordTree.jpg differ diff --git a/docs/screenshots/analyze.png b/docs/screenshots/analyze.png new file mode 100644 index 0000000..c6d6ca3 Binary files /dev/null and b/docs/screenshots/analyze.png differ diff --git a/docs/screenshots/annotation.png b/docs/screenshots/annotation.png new file mode 100644 index 0000000..c7c6032 Binary files /dev/null and b/docs/screenshots/annotation.png differ diff --git a/docs/screenshots/config.png b/docs/screenshots/config.png new file mode 100644 index 0000000..c387ceb Binary files /dev/null and b/docs/screenshots/config.png differ diff --git a/docs/screenshots/csv-format.png b/docs/screenshots/csv-format.png new file mode 100644 index 0000000..8772ec5 Binary files /dev/null and b/docs/screenshots/csv-format.png differ diff --git a/docs/screenshots/csv-upload.png b/docs/screenshots/csv-upload.png new file mode 100644 index 0000000..f3b9cd2 Binary files /dev/null and b/docs/screenshots/csv-upload.png differ diff --git a/docs/screenshots/document_graph.png b/docs/screenshots/document_graph.png new file mode 100644 index 0000000..c1c0813 Binary files /dev/null and b/docs/screenshots/document_graph.png differ diff --git a/docs/screenshots/email-domains.png b/docs/screenshots/email-domains.png new file mode 100644 index 0000000..7694180 Binary files /dev/null and b/docs/screenshots/email-domains.png differ diff --git a/docs/screenshots/faceted_search.png b/docs/screenshots/faceted_search.png new file mode 100644 index 0000000..2569ad5 Binary files /dev/null and b/docs/screenshots/faceted_search.png differ diff --git a/docs/screenshots/facets.png b/docs/screenshots/facets.png new file mode 100644 index 0000000..3f915a0 Binary files /dev/null and b/docs/screenshots/facets.png differ diff --git a/docs/screenshots/filters.png b/docs/screenshots/filters.png new file mode 100644 index 0000000..6f71d89 Binary files /dev/null and b/docs/screenshots/filters.png differ diff --git a/docs/screenshots/flower-monitor.png b/docs/screenshots/flower-monitor.png new file mode 100644 index 0000000..fe37382 Binary files /dev/null and b/docs/screenshots/flower-monitor.png differ diff --git a/docs/screenshots/flower.png b/docs/screenshots/flower.png new file mode 100644 index 0000000..f23c118 Binary files /dev/null and b/docs/screenshots/flower.png differ diff --git a/docs/screenshots/graph.png b/docs/screenshots/graph.png new file mode 100644 index 0000000..e59912a Binary files /dev/null and b/docs/screenshots/graph.png differ diff --git a/docs/screenshots/graph_circle.png b/docs/screenshots/graph_circle.png new file mode 100644 index 0000000..6473735 Binary files /dev/null and b/docs/screenshots/graph_circle.png differ diff --git a/docs/screenshots/graph_email.png b/docs/screenshots/graph_email.png new file mode 100644 index 0000000..b07d10f Binary files /dev/null and b/docs/screenshots/graph_email.png differ diff --git a/docs/screenshots/graph_search.png b/docs/screenshots/graph_search.png new file mode 100644 index 0000000..e251132 Binary files /dev/null and b/docs/screenshots/graph_search.png differ diff --git a/docs/screenshots/hypothesis.png b/docs/screenshots/hypothesis.png new file mode 100644 index 0000000..d691996 Binary files /dev/null and b/docs/screenshots/hypothesis.png differ diff --git a/docs/screenshots/hypothesis_config.png b/docs/screenshots/hypothesis_config.png new file mode 100644 index 0000000..823837d Binary files /dev/null and b/docs/screenshots/hypothesis_config.png differ diff --git a/docs/screenshots/hypothesis_import.png b/docs/screenshots/hypothesis_import.png new file mode 100644 index 0000000..4816e01 Binary files /dev/null and b/docs/screenshots/hypothesis_import.png differ diff --git a/docs/screenshots/import_ontology.png b/docs/screenshots/import_ontology.png new file mode 100644 index 0000000..69ab328 Binary files /dev/null and b/docs/screenshots/import_ontology.png differ diff --git a/docs/screenshots/knowledge_graph-entities.png b/docs/screenshots/knowledge_graph-entities.png new file mode 100644 index 0000000..5637663 Binary files /dev/null and b/docs/screenshots/knowledge_graph-entities.png differ diff --git a/docs/screenshots/law-code.png b/docs/screenshots/law-code.png new file mode 100644 index 0000000..ca8214b Binary files /dev/null and b/docs/screenshots/law-code.png differ diff --git a/docs/screenshots/law-codes-sparql.png b/docs/screenshots/law-codes-sparql.png new file mode 100644 index 0000000..f6b5217 Binary files /dev/null and b/docs/screenshots/law-codes-sparql.png differ diff --git a/docs/screenshots/map.png b/docs/screenshots/map.png new file mode 100644 index 0000000..c3f124c Binary files /dev/null and b/docs/screenshots/map.png differ diff --git a/docs/screenshots/named_entities_manager.png b/docs/screenshots/named_entities_manager.png new file mode 100644 index 0000000..49ea961 Binary files /dev/null and b/docs/screenshots/named_entities_manager.png differ diff --git a/docs/screenshots/ocr-priority.png b/docs/screenshots/ocr-priority.png new file mode 100644 index 0000000..b2bce7d Binary files /dev/null and b/docs/screenshots/ocr-priority.png differ diff --git a/docs/screenshots/phone.png b/docs/screenshots/phone.png new file mode 100644 index 0000000..9302aaf Binary files /dev/null and b/docs/screenshots/phone.png differ diff --git a/docs/screenshots/prioritize-import-ui.png b/docs/screenshots/prioritize-import-ui.png new file mode 100644 index 0000000..78c733e Binary files /dev/null and b/docs/screenshots/prioritize-import-ui.png differ diff --git a/docs/screenshots/prioritize-import.png b/docs/screenshots/prioritize-import.png new file mode 100644 index 0000000..9989cd7 Binary files /dev/null and b/docs/screenshots/prioritize-import.png differ diff --git a/docs/screenshots/recommender_results.png b/docs/screenshots/recommender_results.png new file mode 100644 index 0000000..3622c21 Binary files /dev/null and b/docs/screenshots/recommender_results.png differ diff --git a/docs/screenshots/rss_manager.png b/docs/screenshots/rss_manager.png new file mode 100644 index 0000000..ffa9798 Binary files /dev/null and b/docs/screenshots/rss_manager.png differ diff --git a/docs/screenshots/search-list-results.png b/docs/screenshots/search-list-results.png new file mode 100644 index 0000000..7d4a5d5 Binary files /dev/null and b/docs/screenshots/search-list-results.png differ diff --git a/docs/screenshots/search-list.png b/docs/screenshots/search-list.png new file mode 100644 index 0000000..8ca8a4d Binary files /dev/null and b/docs/screenshots/search-list.png differ diff --git a/docs/screenshots/search-name-variants.png b/docs/screenshots/search-name-variants.png new file mode 100644 index 0000000..360e58c Binary files /dev/null and b/docs/screenshots/search-name-variants.png differ diff --git a/docs/screenshots/search.png b/docs/screenshots/search.png new file mode 100644 index 0000000..e91e7d0 Binary files /dev/null and b/docs/screenshots/search.png differ diff --git a/docs/screenshots/search_email.png b/docs/screenshots/search_email.png new file mode 100644 index 0000000..46f6461 Binary files /dev/null and b/docs/screenshots/search_email.png differ diff --git a/docs/screenshots/semantic.png b/docs/screenshots/semantic.png new file mode 100644 index 0000000..e0ff180 Binary files /dev/null and b/docs/screenshots/semantic.png differ diff --git a/docs/screenshots/sentences-list.png b/docs/screenshots/sentences-list.png new file mode 100644 index 0000000..0a7e91d Binary files /dev/null and b/docs/screenshots/sentences-list.png differ diff --git a/docs/screenshots/shared_folders.png b/docs/screenshots/shared_folders.png new file mode 100644 index 0000000..9f6f945 Binary files /dev/null and b/docs/screenshots/shared_folders.png differ diff --git a/docs/screenshots/solr-relevance-ranking-analysis-details.png b/docs/screenshots/solr-relevance-ranking-analysis-details.png new file mode 100644 index 0000000..297365a Binary files /dev/null and b/docs/screenshots/solr-relevance-ranking-analysis-details.png differ diff --git a/docs/screenshots/solr-relevance-ranking-analysis-visualization.png b/docs/screenshots/solr-relevance-ranking-analysis-visualization.png new file mode 100644 index 0000000..bee7d53 Binary files /dev/null and b/docs/screenshots/solr-relevance-ranking-analysis-visualization.png differ diff --git a/docs/screenshots/solr-relevance-ranking-analysis.png b/docs/screenshots/solr-relevance-ranking-analysis.png new file mode 100644 index 0000000..9388e2a Binary files /dev/null and b/docs/screenshots/solr-relevance-ranking-analysis.png differ diff --git a/docs/screenshots/sparql.jpeg b/docs/screenshots/sparql.jpeg new file mode 100644 index 0000000..f2c9eaa Binary files /dev/null and b/docs/screenshots/sparql.jpeg differ diff --git a/docs/screenshots/table.gif b/docs/screenshots/table.gif new file mode 100644 index 0000000..c722116 Binary files /dev/null and b/docs/screenshots/table.gif differ diff --git a/docs/screenshots/tagging.png b/docs/screenshots/tagging.png new file mode 100644 index 0000000..20563cf Binary files /dev/null and b/docs/screenshots/tagging.png differ diff --git a/docs/screenshots/trend.png b/docs/screenshots/trend.png new file mode 100644 index 0000000..80519df Binary files /dev/null and b/docs/screenshots/trend.png differ diff --git a/docs/screenshots/visual_annotation.png b/docs/screenshots/visual_annotation.png new file mode 100644 index 0000000..8d17c05 Binary files /dev/null and b/docs/screenshots/visual_annotation.png differ diff --git a/docs/screenshots/visual_graph_explorer.png b/docs/screenshots/visual_graph_explorer.png new file mode 100644 index 0000000..42a24f5 Binary files /dev/null and b/docs/screenshots/visual_graph_explorer.png differ diff --git a/docs/screenshots/vm_activities.png b/docs/screenshots/vm_activities.png new file mode 100644 index 0000000..c29ee6d Binary files /dev/null and b/docs/screenshots/vm_activities.png differ diff --git a/docs/screenshots/vm_hd.png b/docs/screenshots/vm_hd.png new file mode 100644 index 0000000..e2fc432 Binary files /dev/null and b/docs/screenshots/vm_hd.png differ diff --git a/docs/screenshots/vm_index_documents.png b/docs/screenshots/vm_index_documents.png new file mode 100644 index 0000000..1713fd1 Binary files /dev/null and b/docs/screenshots/vm_index_documents.png differ diff --git a/docs/screenshots/vm_ram.png b/docs/screenshots/vm_ram.png new file mode 100644 index 0000000..add32f0 Binary files /dev/null and b/docs/screenshots/vm_ram.png differ diff --git a/docs/screenshots/vm_search.png b/docs/screenshots/vm_search.png new file mode 100644 index 0000000..2b324b8 Binary files /dev/null and b/docs/screenshots/vm_search.png differ diff --git a/docs/screenshots/vm_system.png b/docs/screenshots/vm_system.png new file mode 100644 index 0000000..0f298ce Binary files /dev/null and b/docs/screenshots/vm_system.png differ diff --git a/docs/screenshots/wordcloud.png b/docs/screenshots/wordcloud.png new file mode 100644 index 0000000..353a1af Binary files /dev/null and b/docs/screenshots/wordcloud.png differ diff --git a/docs/search-list/README.md b/docs/search-list/README.md new file mode 100644 index 0000000..35ef4a1 --- /dev/null +++ b/docs/search-list/README.md @@ -0,0 +1,36 @@ +--- +title: Search Solr with lists +authors: + - Markus Mandalka +--- + +# Search Solr with lists + +Searching a list of queries and show for each entry if there are results. + +## Usage + +Read the [user documentation](../doc/search/list). + +## Installation + +Download and install the module *solr-search-list*. + +### Setup the Django Webapp + +If you want to use the web user interface (webapp): +* download the module `opensemanticsearch-search-list-python-django` +* Copy the directory `search_list` from the zip file into your Django apps directory +* Enable the new app: + +Add "`search_list`" to your `INSTALLED_APPS` setting like this: + +```python +INSTALLED_APPS = ( + ... + 'search_list', + ) + ``` + + * Include the `search_list` URLconf in your project `urls.py` like this: +`url(r'^search-list/', include('search_list.urls')),` diff --git a/docs/skos2solr/README.md b/docs/skos2solr/README.md new file mode 100644 index 0000000..db4126a --- /dev/null +++ b/docs/skos2solr/README.md @@ -0,0 +1,29 @@ +--- +title: SKOS thesaurus to Solr synonyms (SKOS to Solr) +authors: + - Markus Mandalka +--- + +# SKOS thesaurus to Solr synonyms (SKOS to Solr) + +To be able to find words, concepts and names and URIs by synonyms, aliases or (alternate) labels, too, the [thesaurus manager](../doc/datamanagement/thesaurus) and [ontologies manager](../doc/datamanagement/ontologies) apps are integrated with the [Solr search server](../solr). + +## Converts Simple Knowledge Organization System (SKOS) thesaurus to Apache Solr synonyms config file + +This Python component converts or exports the thesauri from the open standard **[Simple Knowledge Organization System (SKOS)](http://www.w3.org/TR/skos-primer/)** to an **Solr synonyms** configuration file for for a [Solr synonym filter](https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-SynonymFilter). + +## Find words by alternate labels, synonyms, RDFS labels and URIs + +Therefore it adds to the Solr synonym config file all alternate SKOS labels or aliases from thesaurus entries as synonym for their prefered labels. + +So you will find documents containing only alternate labels, too. + +It supports synonyms like SKOS:altLabel or SKOS:hiddenlabel adding them as synonyms for SKOS:prefLabel and RDFS:label. + +Additionally it adds the labels of an URI of an entity as synonym for this URI, so you can find and filter documents containing only the URIs by the URIs labels, too. + +## Alternate Solr plugin + +An alternate for expansion of terms by SKOS vocabularies is to use the Solr plugin [Lucene SKOS](https://github.com/behas/lucene-skos). + +The disadvantage of this alternate is, that the plugin version has to be compatible with your Solr version and its more complex plugin interface, which could change more often than the simple Solr synonym config format. diff --git a/docs/solr-ontology-tagger/README.md b/docs/solr-ontology-tagger/README.md new file mode 100644 index 0000000..7e57b4a --- /dev/null +++ b/docs/solr-ontology-tagger/README.md @@ -0,0 +1,46 @@ +--- +title: Ontology tagger for Solr (Automatic tagging by RDF ontologies & SKOS thesaurus) +authors: + - Markus Mandalka +--- + +# Ontology tagger for Solr (Automatic tagging by RDF ontologies & SKOS thesaurus) + +## Annotator for Apache Solr by Resource Description Framework (RDF) ontology & Simple Knowledge Organization System (SKOS) thesaurus + +The auto-tagger **Ontology Tagger** for **Apache Solr** is the preconfigured search engine component for **automatic tagging** or auto-classification of **documents** in an Apache Solr index for faceted search by labels in data structures like **ontologies** in the open standard **RDF** & **thesauruses** in the open standard **SKOS** or [linked open data sources and databases](../doc/datamanagement/opendata) like [Wikidata](../doc/datamanagement/opendata#wikidata). + +## Automatic tagger for faceted search with Solr + +You can [structure, filter and navigate your indexed documents or datasets by faceted search](../doc/search#faceted_search) based on structures like [thesauri, knowledge bases, lists of entities, ontologies or taxonomies](../doc/datamanagement/thesaurus) available in open standards for the semantic web or linked data formats like Resource Description Format (RDF) or [Simple knowledge organization system (SKOS)](../doc/datamanagement/thesaurus#skos). + +## Free Open Source Software (FOSS) + +Since the Ontology based auto-tagging tool and library is free Open Source Software based on Python & rdflib, the full source code is included inside the downloadable packages and hosted on [Github](https://github.com/opensemanticsearch/solr-ontology-tagger). + +## User interface (UI) for managing ontologies and thesauri for automatic tagging + +A simple web app based user interface (UI) for easily configuring Solr with ontologies or thesauri for faceted search is provided by the [Python Django App Ontologies Manager](../doc/datamanagement/ontologies), and it's code is available inside our distribution packages and on [Github](https://github.com/opensemanticsearch/open-semantic-search-apps) too. + +## Poor mans entity linking without disambiguation + +Since for most use cases not so important if you work mainly with your own datasets and domain specific knowledge instead of universal databases with many ambigous concepts or names, at the moment there is no disambiguation integrated for automatic tagging or poor mans entity linking. *Please donate so we can integrate methods and UIs to disambiguate homonyms and different entities with same names or same labels.* + +## Automatic ontology tagger and annotator for Elastic search + +Our search engine distribution is based on Apache Solr. *Please donate with the subject "Elasticsearch ontology tagger" if you want to use these integrated tools for Elasticsearch*, since a generalization of this relatively small part of the search engine specific code would cost only few hours of effort or configure an alternate Ontology Annotator with an [Elastic search plugin](https://github.com/flaxsearch/BioSolr/tree/master/ontology/ontology-annotator/elasticsearch-ontology-annotator). + +## Open Source tools for entity linking, dictionary based entity extraction or dictionary based annotation + +Other methods, open source frameworks and free tools for automatic tagging, entity linking, entity extraction or disambiguation by machine learning: + +* [Apache Stanbol Entity Linking Engine](https://stanbol.apache.org/docs/trunk/components/enhancer/engines/entitylinking) +* [BioSolr ontology annotator](https://github.com/flaxsearch/BioSolr/tree/master/ontology/ontology-annotator) - Ontology tagger for Solr or Elastic Search +* [Fast entity linker](https://github.com/yahoo/FEL) - Entity linking with disambiguation by machine learning +* [Dexter](http://dexter.isti.cnr.it/) +* [NEL](https://github.com/wikilinks/nel) +* [SolrTextTagger](https://github.com/OpenSextant/SolrTextTagger) +* [Solr Dictionary Annotator](https://github.com/elsevierlabs-os/soda) - Microservice for Spark +* [Datafari OntologyUpdateProcessor](https://datafari.atlassian.net/wiki/display/DATAFARI/Link+an+ontology) - Solr update processor plugin +* [Apache UIMA dictionary annotator](https://uima.apache.org/d/uima-addons-current/DictionaryAnnotator/DictionaryAnnotatorUserGuide.html) +* [Apache UIMA concept mapper](https://uima.apache.org/d/uima-addons-current/ConceptMapper/ConceptMapperAnnotatorUserGuide.html#dict) diff --git a/docs/solr-php-ui/README.md b/docs/solr-php-ui/README.md new file mode 100644 index 0000000..8eba233 --- /dev/null +++ b/docs/solr-php-ui/README.md @@ -0,0 +1,63 @@ +--- +title: Solr-PHP-UI: Solr client and user interface for search (UI) +authors: + - Markus Mandalka +--- + +# Solr-PHP-UI: Solr client and user interface for search (UI) + +![](../screenshots/search.png) + +This search user interface component of the open source search engine Open Semantic Search is a PHP based lightweight search client with complete and responsive user interface for searching with Apache Lucene / Solr (open source enterprise search server). + +So you can install / run an search engine on standard LAMP or standard PHP webspace without effort (based on vanilla PHP and Solr-PHP-Client). It doesn't need a database but only connection to or an installation of a standard Solr server/service (ready packages available). + +Just install the Debian GNU/Linux or Ubuntu Linux package or copy the source to PHP webspace and search with a flexible responsive UI: + +## Features + +* [Fulltext search](../doc/search) +* Facetted search (interactive filters) +* Viewer for preview +* Analyze text +* Sorting +* Different views + +### Views + +* Result list (with snippets and highlighted search terms) +* Preview +* Images* Table (sortable and filterable) +* Analyze search results or all documents with data visualizations: + + Wordcloud + + Trend chart + + Networks, connections and relations (graph) + +## Configuration + +Edit `/etc/solr-php-ui/config.php` (if installed from a package) or `config/config.php` (if installed from source) for setting another language or for adding custom facets (additional fields and interactive filters). + +## Used libraries + +*Used libraries and frameworks (all included in the package)* +* solr-php-client (Solr client library for PHP) +* jquery (javascript library for easier accessing the dom model) +* Zurb Foundation (CSS and UI lib for responsive web design) +* d3js (javascript library for visualizations) +* nvd3 (d3js based javascript library for charts) +* Cytoscape.js (graph) + +## Dashboards + +Solr-PHP-UI is a lightweight solution which doesn't need a database or special libraries. So the configuration options for the users are limited. + +If you want to configure dashboards, add some calls of a view into iframes, show some Solr-PHP-UI RSS feeds (i.e. show results of some configured search feeds in Drupal views) or you have to setup a user interface with a database like Hue (Django/Python) or Sarnia (Drupal/PHP): + +## Alternates + +Alternate components (Open Source user interfaces for Solr): +* [Velocity](https://cwiki.apache.org/confluence/display/solr/Velocity+Search+UI) (Java) +* [Solarium](http://www.solarium-project.org/) (PHP) +* [Drupal Solr](https://drupal.org/project/apachesolr) and [Sarnia](https://drupal.org/project/sarnia) (PHP and Drupal) +* [Hue Hadoop User Interface](http://www.gethue.com/) (Python and Django) +* [Blacklight](http://projectblacklight.org/) (Ruby on rails) diff --git a/docs/solr-ranking-analysis/README.md b/docs/solr-ranking-analysis/README.md new file mode 100644 index 0000000..9f99694 --- /dev/null +++ b/docs/solr-ranking-analysis/README.md @@ -0,0 +1,49 @@ +--- +title: Solr Relevance Ranking Analysis and Visualization Tool +authors: + - Markus Mandalka +--- + +# Solr Relevance Ranking Analysis and Visualization Tool + +## Relevance Ranking Analysis and Visualization for easier Solr relevancy tuning + +This Python Django based Open Source tool and web user interface (UI) for easier [Solr Relevancy](https://wiki.apache.org/solr/SolrRelevancyFAQ) analysis helps while one is performing search relevance tuning and relevancy ranking debugging. + +Therefore the tool summarize and visualizes the relevance ranking and scoring by [field boosts](https://lucene.apache.org/solr/guide/7_6/the-dismax-query-parser.html#qf-query-fields-parameter) (qf), term weights (TF/IDF) and [boost function](https://lucene.apache.org/solr/guide/7_6/the-dismax-query-parser.html#bf-boost-functions-parameter) (bf) score of documents found by an Apache Solr search query. + +## Usage + +Open the web user interface (UI) on the server/port/path you run this Django web app (see section "Installation"). + +Copy the full Solr query (URL) to the field "Query" of the form in the web user interface (UI) + +Click the button "Analyze relevance ranking" + +## Visual summary + +So you get an visual summary of the relevance ranking of the found documents: + +![](../screenshots/solr-relevance-ranking-analysis.png) + +## Ranking details + +By clicking the button "Show details" you get the full details of the scoring calculation for each document: + +![](../screenshots/solr-relevance-ranking-analysis-details.png) + +## Visualization + +The button "Chart" in the top bar shows a more compact visualization: + +![](../screenshots/solr-relevance-ranking-analysis-visualization.png) + +## Installation and configuration + +The tool can be used with other [Apache Solr](http://lucene.apache.org/solr/) environments than Open Semantic Search. + +You find the documentation of the installation and configuration in the [README.md](https://github.com/opensemanticsearch/solr-relevance-ranking-analysis). + +## Free Open Source Software + +The tool is Free Software. You find the full [Source Code on GitHub](https://github.com/opensemanticsearch/solr-relevance-ranking-analysis) diff --git a/docs/solr-relevance-ranking-analysis/README.md b/docs/solr-relevance-ranking-analysis/README.md new file mode 100644 index 0000000..d08f047 --- /dev/null +++ b/docs/solr-relevance-ranking-analysis/README.md @@ -0,0 +1,50 @@ +--- +title: Solr Relevance Ranking Analysis and Visualization Tool +authors: + - Markus Mandalka +--- + +# Solr Relevance Ranking Analysis and Visualization Tool + +## Relevance Ranking Analysis and Visualization for easier Solr relevancy tuning + +This Python Django based Open Source tool and web user interface (UI) allows for easier [Solr Relevancy](https://wiki.apache.org/solr/SolrRelevancyFAQ) analysis and is helpful while one is performing search relevance tuning and relevancy ranking debugging. + +The tool summarizes and visualizes the relevance ranking and scoring by [field boosts](https://lucene.apache.org/solr/guide/7_6/the-dismax-query-parser.html#qf-query-fields-parameter) (qf), term weights (TF/IDF) and the [boost function](https://lucene.apache.org/solr/guide/7_6/the-dismax-query-parser.html#bf-boost-functions-parameter) (bf) score of documents found by an Apache Solr search query. + +## Usage + +Open the web user interface (UI) on the server/port/path you run this Django web app (see section "Installation"). + +Copy the full Solr query (URL) to the field "Query" of the form in the web user interface (UI) + +Click the button "Analyze relevance ranking" + +## Visual summary + +So you get a visual summary of the relevance ranking of the found documents: + + +![](../screenshots/solr-relevance-ranking-analysis.png) + +## Ranking details + +By clicking the button "Show details" you get the full details of the scoring calculation for each document: + +![](../screenshots/solr-relevance-ranking-analysis-details.png) + +## Visualization + +The button "Chart" in the top bar shows a more compact visualization: + +![](../screenshots/solr-relevance-ranking-analysis-visualization.png) + +## Installation and configuration + +The tool can be used with other [Apache Solr](http://lucene.apache.org/solr/) environments than Open Semantic Search. + +You can find the documentation on installation and configuration in the [README.md](https://github.com/opensemanticsearch/solr-relevance-ranking-analysis). + +## Free Open Source Software + +The tool is Free Software. You can find the full [Source Code on GitHub](https://github.com/opensemanticsearch/solr-relevance-ranking-analysis) diff --git a/docs/solr-search-csv-python-django/README.md b/docs/solr-search-csv-python-django/README.md new file mode 100644 index 0000000..7ff4730 --- /dev/null +++ b/docs/solr-search-csv-python-django/README.md @@ -0,0 +1,31 @@ +--- +title: CSV Manager +authors: + - Markus Mandalka +--- + +# CSV Manager + +User interface (webapp) for structured import of CSV spreadsheets. + +## Usage + +See the [user documentation](../doc/search/csv) + +## Installation + +* Download the module `opensemanticsearch-search-csv-python-django` +* Copy the directory `csvmanager` from the zip file into your Django apps directory +* Enable the new app: + +Add "`csvmanager`" to your `INSTALLED_APPS` setting like this: + + +```python +INSTALLED_APPS = ( + ... + 'csvmanager', + ) +``` +* Include the `search_list` URLconf in your project `urls.py` like this: +`url(r'^csvmanager/', include('csvmanager.urls')),` diff --git a/docs/solr-search-querytagger-python-django/README.md b/docs/solr-search-querytagger-python-django/README.md new file mode 100644 index 0000000..7dc34e8 --- /dev/null +++ b/docs/solr-search-querytagger-python-django/README.md @@ -0,0 +1,31 @@ +--- +title: Web interface for tagging all results of a Solr search query +authors: + - Markus Mandalka +--- + +# Web interface for tagging all results of a Solr search query + +Tags all results of a search query. + +## Usage + +See the [user documentation](../doc/search/tagging_results_of_search_query) + +## Installation + +* download the module `solr-search-querytagger-python-django` +* Copy the directory `querytagger` from the zip file into your Django apps directory +* Enable the new app: + +Add "`querytagger`" to your `INSTALLED\APPS` setting like this: + +```python +INSTALLED_APPS = ( + ... + 'querytagger', +) +``` + +Include the querytagger URLconf in your project `urls.py` like this: +`url(r'^querytagger/', include('querytagger.urls')),` \ No newline at end of file diff --git a/docs/solr/README.md b/docs/solr/README.md new file mode 100644 index 0000000..b36677b --- /dev/null +++ b/docs/solr/README.md @@ -0,0 +1,48 @@ +--- +title: Solr Server (Daemon) +authors: + - Markus Mandalka +--- + +# Solr Server (Daemon) + +## Solr package for Debian and Ubuntu + +This Debian package and Ubuntu package is a preconfigurated [Apache Solr](http://lucene.apache.org/solr) server running as a daemon providing important settings like the integration of the [thesaurus editor](../doc/datamanagement/thesaurus) and ontologies manager, settings for better performance, disabled logging and security settings and a more current Solr version than the [packages of the Debian](https://packages.debian.org/search?suite=stable§ion=all&arch=any&searchon=sourcenames&keywords=lucene-solr) or Ubuntu standard repositories. + +# Settings of preconfigured Solr package + +## Disabled Logfiles + +**Disabled logfiles**: we don't want to write each search query to Solr logs. If you want to switch on logging for debugging purposes, switch on `file` and `console` in the config file `/var/solr/log4j.properties` + +## Autocommits + +**Automatic commits** to the index after 15 seconds after adding or update of documents (autocommit=15000) + +## Running as daemon + +**Automatic start on booting** running as a daemon in Debian GNU/Linux or Ubuntu Linux. + +## Increase maximum RAM settings of the Java Virtual Machine (JVM) + +**Automatic memory settings**: In most cases no manual setting of Java virtual machine options is needed anymore. Allows the Java VM to use as much RAM as possible on this server, so you won't have problems because of default Java Virtual Machine (JVM) maximal RAM settings (option *-Xmx*) if indexing large amounts of data or large documents. + +## Swappiness + +**Disabled swappiness**, so the system will only swap if necessary. So it doesn't do so to optimize RAM for running software swapping the Solr index and search caches automatically after some time because they are not used for some time. Why? Even if some parts of the Solr index and caches in RAM are not used for a long time (i.e. if search isn't used for the night or some days) and that RAM could be used by other software meanwhile to read hundrets of MB or some GB from Swap on slower harddisks to RAM again because of using again while the first search after long time would lead to timeouts and errors on maybe important searches, which then could take tens of seconds longer. + +## Access only from localhost + +For security reasons access to the Solr search server is only possible from the same computer. +So **[access is only possible from localhost](#localhost)**, so that if you set a password to the User Interfaces module *solr-php-ui* and the search apps nobody without an account on your computer or an account for a service on your computer can read all the data from Solr. + +To enable Solr remote admin access from other computers than localhost you have to edit `jetty-http.xml` and delete the `default="127.0.0.1"` from the config option `"host"`. Then restart Solr by `service solr restart`. + +Warning: You don't want to enable access to an unprotected Solr server with the possibility to read, add, change or delete all indexed data for everybody on the intranet or internet! So if the computers are part of a network you can not fully trust, you have to protect the IP of the Solr server or the Solr port for example by a firewall. + +## Solr schema + +There are additional fields and stemming configured in the Solr schema. You can read the XML schema config in `/var/solr/data/core1/conf/managed-schema` which is based on the Solr example config set `/opt/solr/server/solr/configsets`, so you can use a diff tool to compare and see the config additions. + +Additionally the ETL and search tool adds & uses some additional fields which are created automatically using the Solr dynamic fields feature configured for the schema because of type endings like \_b \_s or \_tt. You can see such additional fields using the table view. diff --git a/docs/tagger/README.md b/docs/tagger/README.md new file mode 100644 index 0000000..13441b2 --- /dev/null +++ b/docs/tagger/README.md @@ -0,0 +1,11 @@ +--- +title: Open Semantic Tagger +authors: + - Markus Mandalka +--- + +# Open Semantic Tagger + +Tagger is a light weight responsive web app for tagging web pages and documents. + +It stores the tags for the documents, files or web pages in the Django database and makes them available in RDF. \ No newline at end of file diff --git a/docs/trigger/filemonitoring/README.md b/docs/trigger/filemonitoring/README.md new file mode 100644 index 0000000..3310e31 --- /dev/null +++ b/docs/trigger/filemonitoring/README.md @@ -0,0 +1,112 @@ +--- +title: Filesystem monitoring +authors: + - Markus Mandalka +--- + +# Filesystem monitoring + + +## (Re)index new or changed files within seconds and find new or changed content in document files much earlier + + + +Despite some [limitations](#limitations) and after a first [initialization time of the file monitoring tools on start](#limitations), monitoring files and directories is a fast and efficient method to hold up to date the search index for your files or fileshare: + +Instead of (re)crawling all directories and checking each file if new or changed, the operating system notifies the filemonitoring service when a file was changed or added. + +So changed documents or new files can be indexed and found within seconds and without recrawl often, since frequent recrawls would burn many resources and can take a while, if there are tens of thousands of files, hundreds of thousands of files or even more. + + +## Commandline tool (CLI) + + +(Package: *opensemanticsearch-trigger-filemonitoring*) + +Monitor path(s) given as command line parameter: +`opensemanticsearch-filemonitoring *pathname*` + +Monitor all files and directories listed in *configfilename*: +`opensemanticsearch-filemonitoring --fromfile *configfilename*` +containing one directory or file per line. + + +## Automatically starting system service (Daemon) + + +(Package: *opensemanticsearch-trigger-filemonitoring-daemon*) + +The daemon runs in the background as a system service and will start automatically while booting. + +### Directories and files to monitor + + +It monitors the paths and files listed in the config file (one directory or file per line) +*`/etc/opensemanticsearch/filemonitoring/files`* +### Restart daemon after config changes + + +After config changes (i.e. adding new paths or filenames which are not subpaths of yet monitored paths) restart it with: +`systemctl restart opensemanticetl-filemonitoring` +## File monitoring on remote fileserver + + +(Package: *opensemanticsearch-trigger-filemonitoring-daemon-remote*) + +The file monitoring daemon is available as a lightweight remote package for remote fileservers, which only calls the search API of the remote search server. + +### Directories and files to monitor + + +List the directories or files you want to monitor into the config file +`/etc/opensemanticsearch/filemonitoring/files` +containing one directory or file per line. + +### Config remote API address + + +Change the IP address of your search servers and the URL of its API in the config file `/etc/opensemanticsearch/filemonitoring/config`: + +`config['api'] = "http://192.168.1.1/search-apps/api"` +### Blacklisting + + +Like on the search server (later in the indexing process), the remote filemonitoring daemon supports [blacklisting](../../doc/admin/config/blacklist) too, so there is no network load to API because of changed files in blacklisted directories, blacklisted filename patterns or blacklisted file endings. + +## Limitations + + +Even if filesystem monitoring needs much fewer resources than frequent recrawls, you should be aware of some limitations: + +### Inotify config + + +You have to increase the kernel parameter +`fs.inotify.max_user_watches` +to a size fitting your count of monitored directories and files. + +Well prepare an easy to change conig file for that in the next version. + +### Initialization time + + +On start the filemonitor has to walk recursivly trough all monitored directories and subdirectories to set up an inotify monitoring for this directories. + +This can take a while: The initialization time can need some minutes to even some dozens of minutes, if the fileserver has hundred thousands of directories. + +There will be some CPU load and high IO load on the harddrives while initialization. But after this initial directories scan and monitoring setup, it needs much fewer resources than recrawls. + +While this initialization time not all directories are scanned and so not initialized for monitoring yet, so the file monitoring can not trigger (re)indexing of new or changed files. + +### Passed filesystem changes + + +So while initialization time after boot or restart of the filemonitoring service and because sometimes the system can by so busy, that the file monitoring can pass some notify events for file changes, you should do from time to time an classic recrawl. This can run at night or on weekend and be started automatically by the Cron service. + + +## Used methods and libraries + + +Technically the Linux kernels *inode notify* subsystem [inotify](https://en.wikipedia.org/wiki/Inotify) notifies when the filesystem writes a file in a monitored directory, so we can react relatively fast when there is new or changed file. + +So the command line tool or the daemon *OpenSemanticSearch-Trigger-Filemonitoring* based on the Python library [PyInotify](https://packages.debian.org/stable/python-pyinotify) will notice that and will start the crawler (communicating over [REST-API](../../doc/admin/rest-api)) to *[(re)index the file](../../connector/files) that is new or was changed*. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..c68bd85 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,49 @@ +site_name: Open Semantic Search +site_url: https://opensemanticsearch.org +repo_url: https://github.com/opensemanticsearch/open-semantic-search/ + +nav: + - 'About': 'README.md' + - 'Usage': + - 'Search': 'doc/search/README.md' + - 'Search operators': 'doc/search/operators/README.md' + - 'Interactive filters (Faceted search)': 'doc/search/#overview-and-exploration-with-facets' + - 'Fuzzy search': 'doc/search/fuzzy/README.md' + - 'Tagging and annotation': 'doc/datamanagement/annotation/README.md' + - 'Structuring data and documents (Metadata management)': + - 'Vocabulary and thesaurus (dictionary of names or concepts)': 'doc/datamanagement/thesaurus/README.md' + - 'Lists, Dictionaries, Vocabularies and Thesauri (Ontologies)': 'doc/datamanagement/ontologies/README.md' + - 'Analyze and explore (Analytics)': + - 'Investigate massive leaks for investigative reporting': 'investigative_journalism/howto-analyze-leaks/README.md' + - 'Legal codes and law clauses': 'doc/analytics/law/README.md' + - 'Search by list of names (batch searches)': 'doc/search/list/README.md' + - 'Administration': + - 'Getting started': 'doc/tutorial/README.md' + - 'Installation': 'doc/admin/install/README.md' + - 'Configuration': 'doc/admin/config/README.md' + - 'Task queue': 'doc/admin/queue/README.md' + - 'Logs': 'doc/admin/config/log/README.md' + - 'Additional Applications': + - 'CSV Manager': '/solr-search-csv-python-django/README.md' + - 'Graph Explorer': '/graph-explorer/README.md' + - 'Lexememes': '/lexememes/README.md' + - 'Ontology Tagger': '/solr-ontology-tagger/README.md' + - 'Relevance Ranking Analysis': '/solr-relevance-ranking-analysis/README.md' + - 'RDF or SKOS to OCR': '/rdf2ocr/README.md' + - 'RSS-Feed Manager': '/rss-feed-manager-python-django/README.md' + - 'Search Lists': '/search-list/README.md' + - 'SKOS to Solr': '/skos2solr/README.md' + - 'Solr Server': '/solr/README.md' + - 'Tagger': '/tagger/README.md' + - 'QueryTagger': '/solr-search-querytagger-python-django/README.md' + - 'Download': 'download/README.md' + - 'Development': 'https://github.com/opensemanticsearch/open-semantic-search/' + - 'Donate': 'donate/README.md' + +theme: + name: readthedocs + +plugins: + - search + - mermaid2: + version: 8.14.0 \ No newline at end of file diff --git a/neo4j.env b/neo4j.env new file mode 100644 index 0000000..649e20a --- /dev/null +++ b/neo4j.env @@ -0,0 +1 @@ +NEO4J_AUTH=neo4j/your_password diff --git a/src/flower/DEBIAN/control b/src/flower/DEBIAN/control new file mode 100644 index 0000000..5dbbac7 --- /dev/null +++ b/src/flower/DEBIAN/control @@ -0,0 +1,11 @@ +Package: flower +Version: 22.02.18 +Section: misc +Priority: optional +Architecture: all +Depends: python3-pip(>=0) +Installed-Size: 100 +Maintainer: Markus Mandalka +Homepage: https://opensemanticsearch.org/ +Description: Flower + Task queue manager for Celery tasks diff --git a/src/flower/DEBIAN/postinst b/src/flower/DEBIAN/postinst new file mode 100644 index 0000000..11c5496 --- /dev/null +++ b/src/flower/DEBIAN/postinst @@ -0,0 +1,21 @@ +#!/bin/sh + +adduser --system --disabled-password flower + +# install dependencies +pip3 install flower + +# load our additional systemd service config +systemctl daemon-reload + +# start while booting +systemctl enable flower + +# (re)start after installation (or upgrade) +systemctl restart flower + +# Enable apache2 reverse proxy modules +a2enmod proxy +a2enmod proxy_http + +systemctl restart apache2 diff --git a/src/flower/DEBIAN/prerm b/src/flower/DEBIAN/prerm new file mode 100644 index 0000000..c30c65d --- /dev/null +++ b/src/flower/DEBIAN/prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +systemctl disable flower + +systemctl stop flower + +exit 0 diff --git a/src/flower/etc/apache2/conf-available/flower.conf b/src/flower/etc/apache2/conf-available/flower.conf new file mode 100644 index 0000000..6f4c09f --- /dev/null +++ b/src/flower/etc/apache2/conf-available/flower.conf @@ -0,0 +1,33 @@ + + Define FLOWER_URL http://localhost:5555/flower + + +ProxyRequests off +ProxyPass /flower ${FLOWER_URL} + + + + + + AuthType Basic + AuthUserFile /etc/opensemanticsearch-django-webapps/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + + AuthType Basic + AuthUserFile /etc/solr-php-ui/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + diff --git a/src/flower/etc/apache2/conf-enabled/flower.conf b/src/flower/etc/apache2/conf-enabled/flower.conf new file mode 100644 index 0000000..6f4c09f --- /dev/null +++ b/src/flower/etc/apache2/conf-enabled/flower.conf @@ -0,0 +1,33 @@ + + Define FLOWER_URL http://localhost:5555/flower + + +ProxyRequests off +ProxyPass /flower ${FLOWER_URL} + + + + + + AuthType Basic + AuthUserFile /etc/opensemanticsearch-django-webapps/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + + AuthType Basic + AuthUserFile /etc/solr-php-ui/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + diff --git a/src/flower/etc/flower/apache.conf b/src/flower/etc/flower/apache.conf new file mode 100644 index 0000000..6f4c09f --- /dev/null +++ b/src/flower/etc/flower/apache.conf @@ -0,0 +1,33 @@ + + Define FLOWER_URL http://localhost:5555/flower + + +ProxyRequests off +ProxyPass /flower ${FLOWER_URL} + + + + + + AuthType Basic + AuthUserFile /etc/opensemanticsearch-django-webapps/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + + AuthType Basic + AuthUserFile /etc/solr-php-ui/.htpasswd + AuthName "Open Semantic Search" + + + Require valid-user + + + + + diff --git a/src/flower/etc/systemd/system/flower.service b/src/flower/etc/systemd/system/flower.service new file mode 100644 index 0000000..2d0b4e0 --- /dev/null +++ b/src/flower/etc/systemd/system/flower.service @@ -0,0 +1,12 @@ +[Unit] +Description=Flower +After=network.target rabbitmq-server.service + +[Service] +Type=simple +User=flower +ExecStart=/usr/local/bin/celery flower --address=127.0.0.1 --url_prefix=flower +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/src/open-semantic-desktop-search/README.md b/src/open-semantic-desktop-search/README.md new file mode 100644 index 0000000..1a6d6ed --- /dev/null +++ b/src/open-semantic-desktop-search/README.md @@ -0,0 +1,87 @@ +--- +title: How to build the Open Semantic Desktop Search VM +authors: + - Markus Mandalka +--- + +# Open Semantic Desktop Search VM + +## Documentation + +This `README.md` is documentation for developers who want to build an Open Semantic Desktop Search VM. + +The admin and usage documentation of *Open Semantic Desktop Search* VM is located in [`docs/doc/desktop_search`](../../docs/doc/desktop_search/README.md). + + +## VM provisioning by Ansible + +The *Open Semantic Desktop Search* VM is provisioned by the automation tool [*Ansible*](https://docs.ansible.com/ansible/latest/index.html). + +The installation and configuration of *Open Semantic Search* and the *Gnome* desktop environment is defined in the Ansible playbook [`playbook.yml`](playbook.yml). + + +## Prerequisites + +Dependencies for the VM build process: + +- *Virtual Box* + +- *Vagrant* + +- *Vagrant* plugin *vagrant-reload* (Command: `vagrant plugin install vagrant-reload`) + + +## Build + +To build the Open Semantic Desktop Search VM call the bash script [`build.sh`](build.sh): + +``` +./build.sh +``` + +It will create and start a *Debian GNU/Linux* based Virtual Machine (VM) by *Vagrant* using the config file [`Vagrantfile`](Vagrantfile). + +The running VM is provisioned by the *Ansible* playbook [`playbook.yml`](playbook.yml). + +After that it stops and exports the VM as a *Virtual Box* Appliance to the file `open-semantic-desktop-search.ova`. + + +## Debugging + +### Start the build VM + +To start the build VM without using the full build script `build.sh` use the command + +``` +vagrant up +``` + + +### Replay playbook + +After fixing bugs in the playbook you can replay the playbook by + +``` +vagrant provision +``` + + +### Shell + +You can get a shell running inside the VM by the command + +``` +vagrant ssh +``` + +Within the opened shell you can get root by + +``` +sudo su +``` + + +### Virtual Box GUI + +To start the VM in the Virtual Box GUI, where you have access to Gnome Desktop UI too, +you can set/uncomment the option `vb.gui = true` in the config file [`Vagrantfile`](Vagrantfile). \ No newline at end of file diff --git a/src/open-semantic-desktop-search/Vagrantfile b/src/open-semantic-desktop-search/Vagrantfile new file mode 100644 index 0000000..bed7ed7 --- /dev/null +++ b/src/open-semantic-desktop-search/Vagrantfile @@ -0,0 +1,110 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://vagrantcloud.com/search. + config.vm.box = "debian/bullseye64" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # NOTE: This will enable public access to the opened port + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine and only allow access + # via 127.0.0.1 to disable public access + # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "1024" + # end + # + # View the documentation for the provider you are using for more + # information on available options. + + config.vm.provider "virtualbox" do |vb| + + # Display the VirtualBox GUI when booting the machine + #vb.gui = true + + # Set CPUs + vb.cpus = 2 + + # Customize the amount of memory on the VM: + vb.memory = "5000" + + # Set name so we can access the VM in build.sh by name + vb.name = "Open_Semantic_Desktop_Search" + end + + # Resize disk + config.vm.disk :disk, size: "60GB", primary: true + + # Disable default Vagrant share + config.vm.synced_folder ".", "/vagrant", disabled: true + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # apt-get update + # apt-get install -y apache2 + # SHELL + + # Install Virtualbox guest additions + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.playbook = "playbook-virtualbox-guest-additions.yml" + end + + # Reboot VM to enable Virtual Box Additions with new kernel + # since if not, it seems on the very first start of exported VM + # shared folders are mounted with rights root:root (not group vboxsf) + # and indexing will fail due missing rights of user and etl + config.vm.provision :reload + + # Install Open Semantic Search and Gnome desktop environment + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.playbook = "playbook.yml" + end + +end diff --git a/src/open-semantic-desktop-search/build.sh b/src/open-semantic-desktop-search/build.sh new file mode 100644 index 0000000..3e800b1 --- /dev/null +++ b/src/open-semantic-desktop-search/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# must be same like in Vagrantfile in setting vb.name +VMNAME=Open_Semantic_Desktop_Search + +# Change work dir to src dir (for the case this build script is started from other dir) +cd "$(dirname "$0")" + +# get Open Semantic Search deb package from its build dir +if [ -f "../../open-semantic-search.deb" ]; then + # copy deb package to this destination + cp ../../open-semantic-search.deb ./ +else + echo "Please first build open-semantic-search.deb as root by ../../build-deb" + exit 1 +fi + +# enable disk resize feature used by Vagrantfile +export VAGRANT_EXPERIMENTAL="disks" + +# create build VM, start it and provision by Ansible playbook +vagrant up + +# stop build VM +vagrant halt + +# Remove Vagrants autoconfigured port forwarding to ssh +VBoxManage modifyvm Open_Semantic_Desktop_Search --natpf1 delete ssh + +# export appliance +VBoxManage export ${VMNAME} --output open-semantic-desktop-search.ova --options manifest,nomacs --vsys 0 --vmname "Open Semantic Desktop Search" --product "Open Semantic Desktop Search" --producturl https://opensemanticsearch.org + +# remove build VM +vagrant destroy + +# remove deb package temporary copied to this workdir for Vagrant provisioning by Ansible +rm open-semantic-search.deb diff --git a/src/open-semantic-desktop-search/etc/firefox/policies/policies.json b/src/open-semantic-desktop-search/etc/firefox/policies/policies.json new file mode 100644 index 0000000..84ea50d --- /dev/null +++ b/src/open-semantic-desktop-search/etc/firefox/policies/policies.json @@ -0,0 +1,6 @@ +{ + "policies": { + "LocalFileLinks": ["http://localhost/"] + } +} + diff --git a/src/open-semantic-desktop-search/etc/opensemanticsearch/connector-files-custom b/src/open-semantic-desktop-search/etc/opensemanticsearch/connector-files-custom new file mode 100644 index 0000000..d65b407 --- /dev/null +++ b/src/open-semantic-desktop-search/etc/opensemanticsearch/connector-files-custom @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +# +# Additional custom config options for opensemanticsearch-index-file +# (Overwriting or extending options in /etc/opensemanticsearch/connector-files) +# + +# UI path navigator: Strip parts of path facet +config['facet_path_strip_prefix'] = [ "file:///home/user/Documents/sf_", "file:///home/user/Documents/", "file://" ] diff --git a/src/open-semantic-desktop-search/home/user/.config/autostart/open-semantic-desktop-search.desktop b/src/open-semantic-desktop-search/home/user/.config/autostart/open-semantic-desktop-search.desktop new file mode 100644 index 0000000..fe19f4f --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.config/autostart/open-semantic-desktop-search.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment= +Terminal=false +Name=Open Semantic Desktop Search +Exec=/usr/bin/open-semantic-desktop-search +Type=Application +Icon=document-open-symbolic diff --git a/src/open-semantic-desktop-search/home/user/.local/share/applications/extract-entities.desktop b/src/open-semantic-desktop-search/home/user/.local/share/applications/extract-entities.desktop new file mode 100644 index 0000000..e80b7e5 --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.local/share/applications/extract-entities.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment= +Terminal=false +Name=Extract named entities from thesaurus in new documents +Exec=firefox http://localhost/search-apps/thesaurus/apply +Type=Application +Icon=mark-location-symbolic diff --git a/src/open-semantic-desktop-search/home/user/.local/share/applications/index-documents.desktop b/src/open-semantic-desktop-search/home/user/.local/share/applications/index-documents.desktop new file mode 100644 index 0000000..3a10e6c --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.local/share/applications/index-documents.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment= +Terminal=false +Name=Index new documents +Exec=/usr/bin/opensemanticsearch_index_dir_zenity /home/user/Documents +Type=Application +Icon=document-open-symbolic diff --git a/src/open-semantic-desktop-search/home/user/.local/share/applications/search-list.desktop b/src/open-semantic-desktop-search/home/user/.local/share/applications/search-list.desktop new file mode 100644 index 0000000..f2fd791 --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.local/share/applications/search-list.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment=Fuzzy search for each list entry +Terminal=false +Name=Search with list +Exec=firefox http://localhost/search-apps/search-list +Type=Application +Icon=view-list-symbolic diff --git a/src/open-semantic-desktop-search/home/user/.local/share/applications/search.desktop b/src/open-semantic-desktop-search/home/user/.local/share/applications/search.desktop new file mode 100644 index 0000000..513a8d3 --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.local/share/applications/search.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment=Search +Terminal=false +Name=Search +Exec=firefox http://localhost/search +Type=Application +Icon=preferences-system-search-symbolic diff --git a/src/open-semantic-desktop-search/home/user/.local/share/applications/thesaurus.desktop b/src/open-semantic-desktop-search/home/user/.local/share/applications/thesaurus.desktop new file mode 100644 index 0000000..eab2f8c --- /dev/null +++ b/src/open-semantic-desktop-search/home/user/.local/share/applications/thesaurus.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Comment=Thesaurus and Named Entities Manager to structure exploratory search and interactive filters +Terminal=false +Name=Thesaurus for management of Named Entities (i.e. organizations, persons, locations or concepts) +Exec=firefox http://localhost/search-apps/thesaurus/ +Type=Application +Icon=accessories-dictionary-symbolic diff --git a/src/open-semantic-desktop-search/playbook-virtualbox-guest-additions.yml b/src/open-semantic-desktop-search/playbook-virtualbox-guest-additions.yml new file mode 100644 index 0000000..fcbdcfc --- /dev/null +++ b/src/open-semantic-desktop-search/playbook-virtualbox-guest-additions.yml @@ -0,0 +1,51 @@ +--- + +- name: Installation of Virtual Box guest additions + hosts: all + tasks: + + - name: Add Debian Repos contrib and non-free + ansible.builtin.apt_repository: + repo: deb http://deb.debian.org/debian bullseye main contrib non-free + state: present + become: yes + + - name: Upgrade the OS (apt-get dist-upgrade) + apt: + upgrade: dist + update_cache: yes + become: yes + + - name: Install packages for virtual box guest additions + apt: + pkg: + - virtualbox-guest-additions-iso + - linux-image-amd64 + - linux-headers-amd64 + - build-essential + - module-assistant + become: yes + + - name: Mount virtual box guest additions iso image + ansible.posix.mount: + src: /usr/share/virtualbox/VBoxGuestAdditions.iso + path: /mnt/cdrom + state: mounted + fstype: auto + opts: exec + become: yes + + - name: Install virtual box guest additions + command: /mnt/cdrom/VBoxLinuxAdditions.run + # Virtual Box guest additions installer returns the return code 2 + # but seems to work, so quick and dirty handle return code 2 not as fail + # Feel free to debug and add a pull request with full solution + register: ret + failed_when: ret.rc == 1 or ret.rc > 2 + become: yes + + - name: Unmount virtual box guest additions iso image + ansible.posix.mount: + path: /mnt/cdrom + state: absent + become: yes diff --git a/src/open-semantic-desktop-search/playbook.yml b/src/open-semantic-desktop-search/playbook.yml new file mode 100644 index 0000000..dc2c866 --- /dev/null +++ b/src/open-semantic-desktop-search/playbook.yml @@ -0,0 +1,288 @@ +--- + +- name: Installation and configuration of/in Open Semantic Desktop Search VM + hosts: all + tasks: + + - name: Add Debian Repos contrib and non-free + ansible.builtin.apt_repository: + repo: deb http://deb.debian.org/debian bullseye main contrib non-free + state: present + become: yes + + - name: Upgrade the OS (apt-get dist-upgrade) + apt: + upgrade: dist + update_cache: yes + become: yes + + - name: Install Desktop environment + apt: + name: task-desktop + become: yes + + - name: Stop Gnome Display Manager + ansible.builtin.service: + name: gdm + state: stopped + become: yes + + - name: Install zenity + apt: + name: zenity + become: yes + + - name: Copy Open Semantic Search deb package to VM + ansible.builtin.copy: + src: open-semantic-search.deb + dest: /open-semantic-search.deb + become: yes + + - name: Install Open Semantic Search deb package + apt: + deb: /open-semantic-search.deb + become: yes + + - name: Stop cron + ansible.builtin.service: + name: cron + state: stopped + become: yes + + - name: Stop Flower + ansible.builtin.service: + name: flower + state: stopped + become: yes + + - name: Stop Apache + ansible.builtin.service: + name: apache2 + state: stopped + become: yes + + - name: Stop spaCy + ansible.builtin.service: + name: spacy + state: stopped + become: yes + + - name: Stop Filemonitoring + ansible.builtin.service: + name: opensemanticetl-filemonitoring + state: stopped + become: yes + + - name: Stop ETL workers + ansible.builtin.service: + name: opensemanticetl + state: stopped + become: yes + + - name: Stop RabbitMQ + ansible.builtin.service: + name: rabbitmq-server + state: stopped + become: yes + + - name: Stop Solr + ansible.builtin.service: + name: solr + state: stopped + become: yes + + - name: Stop Tika + ansible.builtin.service: + name: tika + state: stopped + become: yes + + - name: Stop Tika Fake OCR service + ansible.builtin.service: + name: tika-fake-ocr + state: stopped + become: yes + + - name: Remove deb package + file: + state: absent + path: /open-semantic-search.deb + become: yes + + - name: Remove packages that are no longer required + apt: + autoremove: yes + become: yes + + - name: Apt - Removes all packages from the package cache + command: apt-get clean + become: yes + + - name: Delete cache of Python package manager pip + file: + state: absent + path: /root/.cache/pip + become: yes + + - name: Add group vboxsf to user opensemanticetl for access to document index in shared folder + ansible.builtin.user: + name: opensemanticetl + groups: vboxsf + append: yes + become: yes + + - name: Add group vboxsf to user solr for access to document index in shared folder + ansible.builtin.user: + name: solr + groups: vboxsf + append: yes + become: yes + + - name: Copy custom ETL config files + ansible.builtin.copy: + src: etc/opensemanticsearch + dest: /etc/ + owner: root + group: root + become: yes + + # Todo: Idempotency + - name: Create Django superuser admin with password live + command: | + python3 /var/lib/opensemanticsearch/manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'user@localhost', 'live')" + become: yes + + - name: Create group user + ansible.builtin.group: + name: user + become: yes + + - name: Add user + ansible.builtin.user: + name: user + comment: User + group: user + shell: /bin/bash + # Add to group sudo for root access + # Add to group vboxsf for access to shared folders of the VM + groups: sudo, vboxsf + append: yes + become: yes + + - name: Empty password for user + command: passwd -d user + become: yes + + - name: Empty password for root + command: passwd -d root + become: yes + + - name: Link Documents folder to shared folders mount path + file: + src: "/media" + dest: "/home/user/Documents" + state: link + become: yes + + - name: Status shared folder for document index + stat: path=/media/sf_index + register: data_solr + become: yes + + - name: Move document index to shared folder + command: mv /var/solr/data/opensemanticsearch/data /media/sf_index + when: not data_solr.stat.exists + become: yes + + - name: Link old pathname of document index to this shared folder + file: + src: "/media/sf_index" + dest: "/var/solr/data/opensemanticsearch/data" + state: link + become: yes + + - name: Allow Firefox to open local file links linked by localhost + ansible.builtin.copy: + src: etc/firefox + dest: /etc/ + owner: root + group: root + become: yes + + - name: Copy GUI scripts to usr/bin + ansible.builtin.copy: + src: usr/bin + dest: /usr/ + owner: root + group: root + mode: 0755 + become: yes + + - name: Copy home with Gnome app configs of the GUI scripts + ansible.builtin.copy: + src: home/user + dest: /home/ + owner: user + group: user + become: yes + + - name: Add this Gnome apps to favorites / application sidebar + community.general.dconf: + key: "/org/gnome/shell/favorite-apps" + value: "['search.desktop', 'thesaurus.desktop', 'extract-entities.desktop', 'search-list.desktop', 'index-documents.desktop', 'firefox-esr.desktop', 'org.gnome.Nautilus.desktop', 'yelp.desktop']" + state: present + become: yes + become_user: user + + - name: Disable automatic screen lock + community.general.dconf: + key: "/org/gnome/desktop/screensaver/lock-enabled" + value: "false" + state: present + become: yes + become_user: user + + - name: Set User for AutomaticLogin + lineinfile: + path: /etc/gdm3/daemon.conf + regexp: '^AutomaticLogin =' + insertafter: '^# Enabling automatic login' + line: 'AutomaticLogin = user' + become: yes + + - name: Enable AutomaticLogin + lineinfile: + path: /etc/gdm3/daemon.conf + regexp: '^AutomaticLoginEnable =' + insertafter: '^# Enabling automatic login' + line: 'AutomaticLoginEnable = true' + become: yes + + - name: Overwrite deleted files with zeros for better compression of disk image export + shell: dd if=/dev/zero of=/ZEROS bs=1M; sync; rm -f /ZEROS + become: yes + + - name: Create swap file + command: fallocate -l 4G /swapfile + become: yes + + - name: change swap file permissions + file: + path: /swapfile + owner: root + group: root + mode: 0600 + become: yes + + - name: Format swap file + command: mkswap /swapfile + become: yes + + - name: Mount entry for swap file + mount: + src: /swapfile + path: none + fstype: swap + opts: sw + state: present + become: yes diff --git a/src/open-semantic-desktop-search/usr/bin/open-semantic-desktop-search b/src/open-semantic-desktop-search/usr/bin/open-semantic-desktop-search new file mode 100644 index 0000000..7fda2df --- /dev/null +++ b/src/open-semantic-desktop-search/usr/bin/open-semantic-desktop-search @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/wait_until_solr_is_up_zenity ; nice -n 19 /usr/bin/opensemanticsearch_index_dir_zenity /home/user/Documents ; firefox http://localhost/search diff --git a/src/open-semantic-desktop-search/usr/bin/opensemanticsearch_index_dir_zenity b/src/open-semantic-desktop-search/usr/bin/opensemanticsearch_index_dir_zenity new file mode 100644 index 0000000..291b62f --- /dev/null +++ b/src/open-semantic-desktop-search/usr/bin/opensemanticsearch_index_dir_zenity @@ -0,0 +1,6 @@ +#!/bin/sh + +DIR=$1 + +# start opensemanticsearch-index-dir in documents folder with progressbar by Zenity GUI +opensemanticsearch-index-dir "$DIR" | zenity --progress --pulsate --auto-close --no-cancel --title="Adding new documents to processing queue" --text="Adding new documents in directory $DIR to processing queue ..." diff --git a/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up b/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up new file mode 100644 index 0000000..c6e0c27 --- /dev/null +++ b/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up @@ -0,0 +1,10 @@ +#!/bin/sh + +printf 'Waiting until Solr search server is up' + +until $(curl --output /dev/null --silent --head --fail http://localhost:8983/solr/opensemanticsearch/select); do + printf '.' + sleep 1 +done + +echo "\nSolr is up and the core is loaded" diff --git a/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up_zenity b/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up_zenity new file mode 100644 index 0000000..635f39c --- /dev/null +++ b/src/open-semantic-desktop-search/usr/bin/wait_until_solr_is_up_zenity @@ -0,0 +1,4 @@ +#!/bin/sh + +# start waiting for Solr with progressbar by Zenity GUI +wait_until_solr_is_up | zenity --progress --pulsate --auto-close --no-cancel --title="Waiting for Solr search server" --text="Waiting until Solr search server is up and loaded the core ..." diff --git a/test/jest.config.json b/test/jest.config.json new file mode 100644 index 0000000..009a363 --- /dev/null +++ b/test/jest.config.json @@ -0,0 +1,4 @@ +{ + "bail": 1, + "verbose": true +} diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..9c15606 --- /dev/null +++ b/test/test.js @@ -0,0 +1,25 @@ +const { chromium } = require('playwright'); +let browser; +let page; +beforeAll(async () => { + browser = await chromium.launch(); +}); +afterAll(async () => { + await browser.close(); +}); +beforeEach(async () => { + page = await browser.newPage(); +}); +afterEach(async () => { + await page.close(); +}); + +it('Solr-PHP-UI available via Apache, since Title is search', async () => { + await page.goto('http://apps/search'); + expect(await page.title()).toBe('Search'); +}); + +it('Open Semantic Search APPS available via Apache', async () => { + await page.goto('http://apps/search-apps/datasources/'); + expect(await page.content()).toMatch('

Queue

'); +});