Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

DBmeta is a way to change all behavior here by database and/or tablewise. This page contains necessary information about how DBmetas are defined.

DBmetas are jsettings files under “Settings\Reader\DBMeta”

Columns filters

Limit indexing by table or columnGEODI, by default, indexes all or selected tables in a database with some default behavior. DBMetas are the optional definitions to change this behavior.

To index embedded or linked files, to index SQL, to change to indexed rows will be viewed, you need to define a DBmeta.

DBmeta files are *.jsettings and should be in “Settings\Reader\DBMeta"

Limiting the Settings Scope

You may limit the settings by the following criteria. This way, you may have multiple meta-definitions that each is effective for a limited scope.

Key

Description

WorkspaceName

WorkSpace(s) to which the settings will apply.

TableFilter

Tables to which the settings will apply.

ColumnFilter

Tables that contain the given columns (if - is given, tables that do not contain the relevant columns are considered). If more than one is given, the relationship is AND.

Columns

Columns to be Indexed or Excluded

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBView, Geodi.Database",
         "WorkspaceName":"0000-Promotional and Educational Videos",
         "TableFilter":"*",
         "ColumnFilter":"*",         
         "Columns":"-FILEPATH,-ID,DATE,GEODIFILELINK"
      },
   ]
}

How rows appear in GEODI

...

Determining Row names

Each row is a document/content. GEODI behaves rows just like other documents. By default first text column is the name. The name is the content used by doc:(…) query.

You can change row names for each table using DisplayNameMacro. You can also use other columns in the title macro. Macro rules are given at the end of the page.

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowDisplayName, Geodi.Database",
         "DisplayNameMacro":"[TEXT4]/[TEXT2]-[TEXT3]"
      }
   ]
}

Indexing files embedded in tables

 Geodi can scan files with file paths in the database or are embedded as blobs. This document explains how to make the necessary settings. 

  • File1 column shows file names File2 column shows blob files. In the created database, the BLOB file column is selected as "bytea" data type.

  • You can use it in Access,Postgres,Mssql,Oracle,Sqlıte,MySql databases.

  • (warning) FileMemoColumn in VT must have a file extension in the given column.

    • If there is no extension in the column value and all files are of the same type, an extension can be added to the macro value.

...

BLOB/MEMO field containing the file content. GEODI will automatically determine the file content

Key

Description

FileMemoColumn

IDColumnMacro

Macro for the unique number of the file. The rules for macros are at the end of the document.

FileNameColumnMacro

Macro for the name of the file to appear in searches and viewers. Rules for macros are at the end of the document.

...

FileMemoColumn

BLOB/MEMO field containing the file content. GEODI will automatically determine the file content

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "TableFilter":"TEST",
         "IDColumnMacro":"[OBJECTID]",
         "FileNameColumnMacro":"[FILE1]",
         "FileMemoColumn":"file2"
      }
   ]
}

Indexing Multiple Embedded Files in a Table

  • You can use the following meta to index files embedded in multiple columns in the same table.

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "TableFilter":"TQA",
         "IDColumnMacro":"[OBJECTID]_1",
         "FileNameColumnMacro":"[file1]",
         "FileMemoColumn":"file2"
      },
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "TableFilter":"TQA",
         "IDColumnMacro":"[OBJECTID]_2",
         "FileNameColumnMacro":"[dosya1file1]",
         "FileMemoColumn":"dosya2file2"
      }
   ]
}

Indexing an Embedded File Without a Filename in a Table

  • When there is no file name in the table in the database, you can build one using the FileNameColumnMacro value. There are two examples below. The first example is a simple one. the second one assumes that some rows do not have an extension value. FileMemoColumn is the file stream.

    • Code Block
      languagejson
      {
         "Defines":[
            {
               "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
               "TableFilter":"CMS.FileContentCore",
               "IDColumnMacro":"[FieldId][VersionNumber][MinorVersionNumber]",
               "FileNameColumnMacro":"[Internalid][Extension]",
               "FileMemoColumn":"FileContent"
            }
         ]
      }

    • In the following example, the Extension column is assumed to have the file extension. Some rows may have empty values. We assumed that the file is PDF if no extension. The macro might have returned an empty string to skip the files.

      Code Block
      languagejson
      {
         "Defines":[
             {
               "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
               "TableFilter":"Documents",
               "IDColumnMacro":"[DocumentsID]",
               "FileNameColumnMacro":'=string.Concat(d["Internalid"],"-",d["CreateDate"],string.IsNullOrEmpty(d["Extension"])?".pdf":d["Extension"])',
               "FileMemoColumn":"File"
            }
      
         ]
      }

Indexing

...

with File

...

Paths

...

You can also index files specified by file links in a record. (CSV files are not supported).

Key

Description

FileFullPathColumnMacro

A macro that calculates the directories where files are located. This macro can be the value directly in a field (e.g. PATH), or it can be a path calculated in combination with other fields of the record.( Example: column name PATH on VT)

FileFullPathColumnSplitter

If there is more than one file in the file path, you can give the bracket character this way.

...

languagejson

...

full paths for the files. This files becomes child of of the rows.

FileFullPathColumnSplitter

If there is more than one file in the file path, this is the splitter character.

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "FileFullPathColumnMacro":"[PATH]",
         "FileFullPathColumnSplitter":"|"
      },
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "FileFullPathColumnMacro":"//server/files/[PATH][FILE].[EXTENTION]",
         "FileFullPathColumnSplitter":","
      },
      {
         "__type":"Geodi.Database.Meta.DBSubContent, Geodi.Database",
         "FileFullPathColumnMacro":"[PATH]//server/files/[ID].tif",
         "FileFullPathColumnSplitter":"|,"
      }
   ]
}

Specifying a Primary Key Column

A Each table requires a primary column is required for each table for scanning and versioning changes. GEODI sets the ObjectID value by default. You can specify a different column with the definition described here.

...

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBPKey, Geodi.Database",
         "WorkspaceName":"BLOBDataset Deneme",
         "KeyColumns":"BelgeBelgeIDDocDocID"
      }
   ]
}
Code Block
languagejson
      {
         "__type":"Geodi.Database.Meta.DBPKey, Geodi.Database",
         "TableFilter":"tablo1table1",
         "KeyColumns":"id"
      },

Indexing the result of

...

an SQL statement

You create a new table named NewName with the SQL key. The SQL statement must be compatible with the relevant DBMS.

  • Alternatively, you can specify the value of KeyColums in SQL by writing "as P_KEY" or "as OBJECTID" in the column.

  • This feature is valid for file-based ones such as *.xDeceConnection and MDB.

  • Standard SQL must be used.

  • It should be ensured that there is no more than one repeating column with the same name in the result of the SQL statement.

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBSQL, Geodi.Database",
         "TableFilter":"ADABLOCK,IRTIFAKEASEMENT_HAKKIRIGHT",
         "ColumnFilter":"ADABLOCK.ADABLOCK_NO,ADABLOCK.OBJECTID,IRTIFAKEASEMENT_HAKKIRIGHT.OBJECTID,IRTIFAKEASEMENT_HAKKIRIGHT.TABAKALAYER",
         "NewName":"ADALAR2BLOCKS2",
         "SQL":"SELECT * FROM ADABLOCK,IRTIFAKEASEMENT_HAKKIRIGHT WHERE IRTIFAKEASEMENT_HAKKIRIGHT.OBJECTID=ADABLOCK.OBJECTID",
         "KeyColumns":"ADABLOCK.OBJECTID"
      }
   ]
}
Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBSQL, Geodi.Database",
         "TableFilter":"TEST,TEST1",
         "ColumnFilter":"TEST.TARIHDATE,TEST.OBJECTID,TEST1.OBJECTID,TEST.TAMS1INT1",
         "NewName":"DENEME12TEST12",
         "SQL":"SELECT TEST.* FROM TEST,TEST1 WHERE TEST.OBJECTID=TEST1.TAMS2INT2",
         "KeyColumns":"OBJECTID"
      }
   ]
}

Row Based Authorization

  • You can authorize based on Table, SQL or View row.

  • You can use user and/or GEODI groups in "PermitMacro" & "DenyMacro" for authorization.

    • You can also use [geodi:username] for the users you create.

    • (warning) If you want to write more than one user, group, you should start with = and use advanced macro. Simple macro definition can only be used to define a single group/user.

  • Usernames or groups must be generated from a column in a table (or SQL, or View).

  • Rows will be authorized in the table, and these authorizations will be used in files (child content).

(warning) The generated group name is case -separatedsensitive.

Example 1 : SQL Query Result Authorization

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowDisplayName, Geodi.Database",
         "TableFilter":"",
         "DisplayNameMacro":"[TEXT4]/[TEXT2]-[TAMS1]"
      },
      {
         "__type":"Geodi.Database.Meta.DBSQL, Geodi.Database",
         "TableFilter":"TEST,TEST2",
         "ColumnFilter":"TEST.TARIHDATE,TEST.OBJECTID,TEST2.OBJECTID,TEST.TAMS1INT1",
         "NewName":"DENEME12TEST12",
         "SQL":"SELECT TEST.* FROM TEST,TEST2 WHERE TEST.OBJECTID=TEST2.TAMS2INT2",
         "KeyColumns":"OBJECTID"
      },
      {
         "__type":"Geodi.Database.Meta.DBRowPermission, Geodi.Database",
         "TableFilter":"DENEME12TEST12",
         "PermitMacro":"DECE\\kullanıcıadıusername",
         "DenyMacro":"[geodi:kullanıcıadıusername]"
      }
   ]
}

Example 2 : Created Group Based Authorization

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"birimlerunits",
         "PermitMacro":"[birimlerunits]",
         "DenyMacro":""
      }
   ]
}

Example 3 : Advanced Macro Examples

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"birimlerunits",
         "PermitMacro":'=d.Get<string>("birimler").Split(\',\')',
         "DenyMacro":""
      }
   ]
}

...

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"birimlerunits",
         "PermitMacro":'=new string[] {d.Get<string>("YETKILI_GRUPAUTHORIZED GROUP"),"S-1-5-21-128668610-1027347169-903626496-1222","geodi:guest"}',
         "DenyMacro":""
      }
   ]
}

...

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"birimlerunits",
	 "PermitMacro":'=new string[] {string.Concat("GrubumMyGroup_",d["KOLON1COLUMN1"]),string.Concat("GrubumMyGroup_",d["KOLON2COLUMN2"])}'
         "DenyMacro":""
      }
   ]
}

...

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"BIRIMLERUNITS,BIRIMLERUNITS_TEST",
         "PermitMacro":'=new string[] {d.Get("BIRIMLERUNITS"),d.Get("BIRIMLERUNITS_TEST")}',
         "DenyMacro":""
      },
   ]
}
________________________________________________________________________________________
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBRowPermission,Geodi.Database",
         "TableFilter":"test",
         "ColumnFilter":"BIRIMLERUNITS,BIRIMLERUNITS_TEST",
         "PermitMacro":'=new string[] {d["BIRIMLERUNITS"],d["BIRIMLERUNITS_TEST"]}',
         "DenyMacro":""
      }
   ]
}

Specifying the Text/Text Result of a Record

This feature is used to change the GEODI search index. When the nomenclature given in the context is searched through GEODI, it finds all the contents in the table. With Content, we can select the search word of the column of a record, we can turn words without a column name into a search word with this feature. You can write and name more than one [Column Name] in Content. It allows to turn off and on the setting made in the Ignore state in DBmeta.

...

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DBContent, Geodi.Database",
         "WorkspaceName":"otf_meta_testV1",
         "TableFilter":"TEST",
         "ColumnFilter":"TARIHDATE",
         "Ignore":"False",
         "Content":"[TAMS2INT2] ZAMANTIME [TEXT3]"
      }
   ]
}

...

Adjusting the Way Records Look

The html HTML template you provide with the "TemplateName" key will determine the appearance of the records that meet the criteria. This template with the ".html" extension should be under the Templates folder under the "DBMeta" file, and the generated meta should be saved under the "DBMeta" folder.

(warning) Using TemplateName gives you visual flexibility , but can be a performance penalty.

Code Block
languagejson
{
   "Defines":[
      {
         "__type":"Geodi.Database.Meta.DB_DLV_View, Geodi.Database",
         "TemplateName":"PortalAnkaraGeziveMesirePortalLondonTourandPicnic.html"
      }
   ]
}

FieldIndex Settings (Limiting Searches by Column Name)

The default search covers all tables and all columns. To limit the search result based on columns, you should set FieldIndex. After setting "columnname:<your search phrase>", the criteria will be limited to the related column.

  • You should set ContentReaderEnumerators → Your Database → EnableAutoFieldIndex to true in the project detail settings and rescan your project.  Rescanning can take time with big data, so it is better to plan planning it from the beginning is better.  

    If we are scanning the database connection to GEODI on a file basis, we cannot use this setting.

(warning) When this feature is active Words that are recognized in the database and fall in the KLV will be written next to the column in which they are found, each discovery for a DB will have the column name with it.

...

...

Sampled Data Discovery in Databases

By default, GEODI discovers all database contents. You can optionally sample and explore your database contents, so you can save on scanning time and storage space.

Project detail settings ContentReaderEnumerators → Veritabanınız → GenericSettings to add "DB.SamplingMode":100 Tables/Selected Table/SQL query 100 records are randomly process.

...

GEODI samples random N records per table.

The sampling settings will be effective for File-based databases if this setting is used in folder sources. such as *.xlsx, *.mdb, *.accdb

...

.

...

Make column names multilingual and define aliases

If you want, you should make the following definitions.

  1. "fields" must be included in resx file names. These files must be located in the globalization directory.

  2. The name value used must be att{fieldname} and must match the one in the table. You must use the same key in different languages.

  3. The value value contains alternative column names (aliasaliases). You can separate multiple alternatives with "|".

  4. If any of the alias aliases you use is the same as match another column name, it they will be ignored.

  5. In multilingual representations, the first alias is taken into account.

...

Code Block
  <data name="att_{fieldname}" xml:space="preserve">
    <value>{alias1}|{alias2}|{alias3}</value>
  </data>
  
  <data name="att_EnvanterNoInventoryNo" xml:space="preserve">
    <value>Envanter<value>Inventory Numarası|EnvanterInventory N.|EnvanterInventory Sırası<Order</value>
  </data>
  <data name="att_ADINAME" xml:space="preserve">
    <value>Ad<value>Name|AdıName SoyadıSurname|AdSoyad<NameSurname</value>
  </data>

myfields.en-us.resx

Code Block
  <data name="att_{fieldname}" xml:space="preserve">
    <value>{alias1}|{alias2}|{alias3}</value>
  </data>
  
  
  <data name="att_EnvanterNoInventoryNo" xml:space="preserve">
    <value>Inventory Number|Inventory N|Inventory Position</value>
  </data> 
  <data name="att_PersonName" xml:space="preserve">
    <value>Name|Pname|Person Name</value>
  </data> 

...


Macros

You can write macros for values such as Document ID, File path. Macros allow you to solve situations where column values are directly insufficient. For which values macros can be used is specified in the related sections.

...

"FileFullPathColumnMacro":"C:\TEST\KUR-1166 VT\files\[FILE1]"

"DisplayNameMacro":“[ADANOBLOCKNO] Ada [PARSELNOPLOTNO] Parsel”Plot”

"DisplayNameMacro":“[TITLE]-[POSITION]”

...

"DisplayNameMacro":'=string.Concat(d["ADANOBLOCKNO"]," Ada Block ",d["PARSELNOPLOTNO"]," ParselPlot")'

"DisplayNameMacro":'=string.Concat(d["TITLE"],"-",d["POSITION"])'

"DisplayNameMacro":'=d.Get<int>("DEGER")>-1?"Pozitif":"Negatif"'

Detail Information

Expand
titleWhat to check in case DBMeta does not work:
  • Jsettings files should be syntax validated, you can use https://jsonformatter.curiousconcept.com/ site for this validation.

  • We should check the correctness of the column, table and GEODI project name and their names on the Table/Column/Project database.

  • Scan error logs should be examined and analyzed. You can examine the errors received in the scan with the developer report via GEODI.

...