Custom SQL Queries within Logos

Tom Garcia
Tom Garcia Member Posts: 13
edited November 2024 in English Forum

Is there a way to perform custom SQL queries within Logos to pull data in a custom layout?  I've heard that there are certain search strings that are native to logos, but haven't been able to find what they are.  The basic keyword search is not always the best option as it takes too long or returns to many results.

For example, in a normal database,  if I wanted to see how often a name or word is used in a text, I can do something like this:

<span class="kwd">SELECT<span class="pln">
    SUB_COUNT<span class="pun">(<span class="str">&#39;my word&#39;<span class="pun">,<span class="pln"> <span class="pun">`<span class="pln">my_column<span class="pun">`)<span class="pln"> <span class="kwd">AS<span class="pln"> <span class="pun">`<span class="pln">match_count<span class="pun">`<span class="pln">
<span class="kwd">FROM<span class="pln"> <span class="pun">`<span class="kwd">table<span class="pun">`

Comments

  • David Ames
    David Ames Member Posts: 2,977 ✭✭✭

    first question: Are the files stored in plan text or are they encrypted?

  • NB.Mick
    NB.Mick MVP Posts: 16,055

    Is there a way to perform custom SQL queries within Logos to pull data in a custom layout? 

    No. Logos gives a very sophisticated search engine with capabilities far beyond simple SQL queries, specifically geared towards the bible text (and its dataset annotations) that most often is queried - allowing for original language morphology, syntax searches etc. 

    Searching for text will be performed on a proprietary index rather than on raw data, but will allow for matching grammatical word forms and even a "fuzzy search". 

    Have joy in the Lord! Smile

  • NB.Mick
    NB.Mick MVP Posts: 16,055

    first question: Are the files stored in plan text or are they encrypted?

    While the files are stored in SQLite databases (thus on the metadata level there is a possibility for using SQL, such as for querying the library - this is not recommended and in nearly all use cases not needed at all), the book content is encrypted and thus can't be queried by SQL statements

    Have joy in the Lord! Smile

  • The basic keyword search is not always the best option as it takes too long or returns to many results.

    Please provide an example or two to allow other users an opportunity to replicate. Also helpful would be an idea about what trying to find. Logos and Verbum have a number of search options.

    Logos Logos Bible Software Wiki includes: Search HELP LT Search + VT Search with ways to refine search.

    Keep Smiling [:)]

  • Tom Garcia
    Tom Garcia Member Posts: 13

    Thanks for the info.  So more specifically, I attached an example of what I see when I search  for Biblical People in the passage guide. It gives the first three examples which appear to be the top hits, but I don't think this is the case.  The huge list below the graphics sometimes has more occurences of the person than the top results. 

    For example, I want to see the the number of occurences of "people" in a particular book with the number of times they are referenced.  In Exodus, I'd like to see how many times Moses is mentioned or if i don't know who the top characters are in a book, then I'd like to list out all of the people and see who they are.

    image

  • Mark Barnes
    Mark Barnes Member Posts: 15,432 ✭✭✭

    For example, I want to see the the number of occurences of "people" in a particular book with the number of times they are referenced.

    You should use the Concordance tool for this. I'm not able to post more detailed instructions now, but ask if it's not clear. See this post: https://community.logos.com/forums/p/79673/1063893.aspx#1063893 

    This is my personal Faithlife account. On 1 March 2022, I started working for Faithlife, and have a new 'official' user account. Posts on this account shouldn't be taken as official Faithlife views!

  • Tom Garcia
    Tom Garcia Member Posts: 13

    Thanks Mark. Good Ol' Logos/Faithlife wants me to upgrade to get that tool.

  • Mark Barnes
    Mark Barnes Member Posts: 15,432 ✭✭✭

    Thanks Mark. Good Ol' Logos/Faithlife wants me to upgrade to get that tool.

    It's a useful tool. Here's a screenshot for Exodus for you:

    It counts explicit naming ("Moses said") and implicit naming ("he said").

    The order is not identical to the Biblical People section (which has: Israelites, Moses, Pharaoh, Aaron, God, Egyptians, etc.). I'm not able to explain why.

    This is my personal Faithlife account. On 1 March 2022, I started working for Faithlife, and have a new 'official' user account. Posts on this account shouldn't be taken as official Faithlife views!

  • For example, I want to see the the number of occurences of "people" in a particular book with the number of times they are referenced. 

    Appears Passage Guide for Biblical People in Luke (Jesus, Disciples, A Man) has different order of Top Three when compared to Concordance Count (Jesus, A Man, Disciples):

    Keep Smiling [:)]

  • Tom Garcia
    Tom Garcia Member Posts: 13

    Thanks, again Mark. I think I'm going to ask one of the pastors if they have the concordance tool on their account. It does look really helpful for the particular research I'm looking to do.

  • Tom Garcia
    Tom Garcia Member Posts: 13

    Yeah, the i was noticing some inconsistnencies with the biblical people search which lead me down this path.  thanks for the help.