E-model database (First version, kept for records)

The E-model database or called EFIM is a prototype of E-model theory developed purely based on SQL implementing hybrid graph data model and adding supports to existing relational database systems.

Download

Visit http://www.elifelog.org/book/source-code-distribution and select EFIM git to check out the SQL codes. EFIM is purely written in SQL completely database server side script. 

API Documentation

This is a working draft -- June 26th, 2011.

 

The EFIM API is the set of SQL source codes that constitute the EFIM back-end database on top of the relational database.

The whole EFIM API codes are written in SQL following the SQL-99 standard. The current implementation is tested on the MySQL database version 5.1.23-rc-community version. We expect to get user's contribution on the problems for any other relational database products.

This document will explain extensive procedures and functions. As of August 2008, the EFIM API has 110 stored procedures and 95 functions. It supports 8 views that describe the content of data stored in the EFIM database. After installation, the EFIM will use 15 tables for operation.

Let us start by the list of stored procedures and functions.

== Naming convention ==
Stored procedures in the EFIM has a special naming convention. They are numbered by its associated role:
* 100: C-data
* 200: e-node
* 300: Tag
* 400: Category and path search
* 410: Import relational tables
* 411: Export relational tables
* 420: Import XML
* 421: Export XML
* 500: Debug view
* 600: Application extension
* 700: Search related e-nodes
* 900: System status
* 990: Utility procedures
* No number: WordNet interface

Regarding functions, since they can be called in any routines, no special naming convention is applied. However, one such rule is that their name start with ''EFIM_(Get/Put/Is/Query/Util/Translate)'' depending on their role.

== EFIM stored prcedures ==
* [[EFIM:Procedure:100_sp_find_data|100_sp_find_data]]
** IN iRawDataType INTEGER(11)
** IN sValue VARCHAR(255)
** IN iOption INTEGER(11)
** IN iLimit BIGINT
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:100_sp_get_data|100_sp_get_data]]
** IN sData BLOB
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:100_sp_get_data_untagged|100_sp_get_data_untagged]]
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:100_sp_get_data_with_data_id|100_sp_get_data_with_data_id]]
** IN iDataID BIGINT(20) UNSIGNED
** OUT iResult BIGINT(20) UNSIGNED
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:100_sp_show_data_all_type_limit|100_sp_show_data_all_type_limit]]
** IN iLimit BIGINT(20) UNSIGNED
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:121_sp_get_rawdata_type|121_sp_get_rawdata_type]]
* [[EFIM:Procedure:200_import_event_relationship_table|200_import_event_relationship_table]]
** IN sTable TEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_delete_event|200_sp_delete_event]]
** IN iParentEvent BIGINT(20) UNSIGNED
* [[EFIM:Procedure:200_sp_get_event|200_sp_get_event]]
** IN iSymbol BIGINT(20) UNSIGNED
** IN iData BIGINT(20) UNSIGNED
** IN iLimit BIGINT(20) UNSIGNED
** OUT iResult BIGINT(20) UNSIGNED
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:200_sp_get_event_with_event_id|200_sp_get_event_with_event_id]]
** IN iEventID BIGINT(20) UNSIGNED
** OUT iResult BIGINT(20) UNSIGNED
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:200_sp_get_generic_subtree|200_sp_get_generic_subtree]]
** IN iParentEvent INTEGER(11) UNSIGNED
* [[EFIM:Procedure:200_sp_get_list_adjacency_paths|200_sp_get_list_adjacency_paths]]
** IN direction char(5)
* [[EFIM:Procedure:200_sp_get_list_descendants|200_sp_get_list_descendants]]
** IN iParentEvent INTEGER(11)
* [[EFIM:Procedure:200_sp_get_list_descendants_in_table|200_sp_get_list_descendants_in_table]]
** IN iParentEvent INTEGER(11)
** IN sEFIMPathTable VARCHAR(255)
* [[EFIM:Procedure:200_sp_get_list_descendants_in_xml|200_sp_get_list_descendants_in_xml]]
** IN iParentEvent BIGINT(20) unsigned
** OUT sXML LONGTEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_get_list_descendants_in_xml_no_group_node|200_sp_get_list_descendants_in_xml_no_group_node]]
** IN iParentEvent BIGINT(20) unsigned
** OUT sXML LONGTEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_get_list_descendants_in_xml_with_relationships|200_sp_get_list_descendants_in_xml_with_relationships]]
** IN iParentEvent BIGINT(20) UNSIGNED
** IN iType ENUM('all','category','group')
** OUT sXML LONGTEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_get_list_descendants_option_in_table|200_sp_get_list_descendants_option_in_table]]
** IN iParentEvent BIGINT(20) UNSIGNED
** IN iRelationship BIGINT(20) UNSIGNED
** IN iDepthLimit BIGINT(20) UNSIGNED
** IN sEFIMPathTable VARCHAR(255)
* [[EFIM:Procedure:200_sp_get_list_descendants_option_in_xml|200_sp_get_list_descendants_option_in_xml]]
** IN iParentEvent BIGINT(20) UNSIGNED
** IN iRelationship BIGINT(20) UNSIGNED
** IN iDepthLimit BIGINT(20) UNSIGNED
** OUT sXML LONGTEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_get_xml_from_efim_nextparents|200_sp_get_xml_from_efim_nextparents]]
** INOUT sXML LONGTEXT
** IN iType ENUM('all', 'category', 'group')
** OUT iRows BIGINT(20) UNSIGNED
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:200_sp_query_getresultbytemptable|200_sp_query_getresultbytemptable]]
** IN sTempTable varchar(255)
** IN sSelectQuery TEXT
* [[EFIM:Procedure:200_sp_query_get_related_events|200_sp_query_get_related_events]]
** IN iSourceEvent INTEGER(11)
** IN iRecursive INTEGER(11)
* [[EFIM:Procedure:200_sp_search_event_relationship|200_sp_search_event_relationship]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN iTargetEvent BIGINT(20) UNSIGNED
** IN iRelationship BIGINT(20) UNSIGNED
** IN iSearchOption BIGINT(20) UNSIGNED
** OUT iResult BIGINT(20) UNSIGNED
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:210_sp_get_event_relationship|210_sp_get_event_relationship]]
** OUT iResult BIGINT(20) UNSIGNED
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:300_sp_create_tag_international_view|300_sp_create_tag_international_view]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:300_sp_create_tag_view|300_sp_create_tag_view]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:300_sp_get_one_level_path_with_options|300_sp_get_one_level_path_with_options]]
** IN sDirection CHAR(5)
** IN sEFIMPathTable VARCHAR(255)
** IN iInputType ENUM('event','symbol','data')
** IN iInput BIGINT(20) UNSIGNED
* [[EFIM:Procedure:300_sp_get_tag|300_sp_get_tag]]
** IN iSynsetID VARCHAR(255)
** IN iWordID INTEGER(11)
** IN iLexID INTEGER(11)
** IN iDataID BIGINT(20) UNSIGNED
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:300_sp_get_tag_text|300_sp_get_tag_text]]
** sText VARCHAR(255)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:300_sp_get_tag_with_tag_id|300_sp_get_tag_with_tag_id]]
** IN iTagID BIGINT(20) UNSIGNED
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:300_sp_tag_115_data_text|300_sp_tag_115_data_text]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:300_sp_tag_116_data_varchar|300_sp_tag_116_data_varchar]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:300_sp_tag_texts|300_sp_tag_texts]]
** IN iDataID BIGINT(20) UNSIGNED
** IN sData LONGTEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:300_sp_tag_word|300_sp_tag_word]]
** IN iDataID BIGINT(20) UNSIGNED
** IN sWord VARCHAR(255)
* [[EFIM:Procedure:400_sp_create_category_sdtype_view|400_sp_create_category_sdtype_view]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:400_sp_create_category_view|400_sp_create_category_view]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:400_sp_create_event_dump_table|400_sp_create_event_dump_table]]
* [[EFIM:Procedure:400_sp_find_category_childs|400_sp_find_category_childs]]
** IN sSourceSymbol VARCHAR(255)
** IN sSourceData VARCHAR(255)
** IN sSourceDataType VARCHAR(255)
** IN sTargetSymbols TEXT
** IN sTargetKeywords TEXT
** IN sResultTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_category|400_sp_get_category]]
** IN sCategoryName VARCHAR(255)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_category_child_events|400_sp_get_category_child_events]]
** IN sParentTable VARCHAR(255)
** IN sChildTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_category_list|400_sp_get_category_list]]
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_category_model_in_xml|400_sp_get_category_model_in_xml]]
** IN iCategoryID BIGINT(20) UNSIGNED
** OUT sXML LONGTEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:400_sp_get_group_child_events|400_sp_get_group_child_events]]
** IN sParentTable VARCHAR(255)
** IN sRelationship TEXT
** IN sChildTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_group_event|400_sp_get_group_event]]
** IN sCategoryName VARCHAR(255)
** IN sGroupTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_parent_category_events|400_sp_get_parent_category_events]]
** IN sSourceSymbol VARCHAR(255)
** IN sSourceData LONGTEXT
** IN sSourceDataType VARCHAR(255)
** IN sResultTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_parent_category_events_from_input_table|400_sp_get_parent_category_events_from_input_table]]
** IN sSourceEventTable VARCHAR(255)
** IN sResultTable VARCHAR(255)
* [[EFIM:Procedure:400_sp_get_path|400_sp_get_path]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN sRelationship TEXT
** IN iTargetEvent BIGINT(20) UNSIGNED
** IN sOutputTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
** IN iMatchOption ENUM('complete','all','shortest','count')
** IN iMatchCount INTEGER(11)
** IN iSearchDirection ENUM('both','forward','backward')
* [[EFIM:Procedure:400_sp_get_path_bidrectional_table|400_sp_get_path_bidrectional_table]]
** IN sSourceTable VARCHAR(255)
** IN sRelationship TEXT
** IN sTargetTable VARCHAR(255)
** IN sOutputTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
** IN iMatchOption ENUM('complete','all','shortest', 'count')
** IN iMatchCount INTEGER(11)
* [[EFIM:Procedure:400_sp_get_path_from_source_to_target_table|400_sp_get_path_from_source_to_target_table]]
** IN sSourceTable VARCHAR(255)
** IN sRelationship TEXT
** IN sTargetTable VARCHAR(255)
** IN sOutputTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
** IN iMatchOption ENUM('complete','all','shortest', 'count')
** IN iMatchCount INTEGER(11)
* [[EFIM:Procedure:400_sp_get_path_from_table|400_sp_get_path_from_table]]
** IN sSourceTable VARCHAR(255)
** IN sRelationship TEXT
** IN sTargetTable VARCHAR(255)
** IN sOutputTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
** IN iMatchOption ENUM('complete','all','shortest','count')
** IN iMatchCount INTEGER(11)
** IN iSearchDirection ENUM('both','forward','backward')
* [[EFIM:Procedure:400_sp_get_path_from_target_to_source_table|400_sp_get_path_from_target_to_source_table]]
** IN sSourceTable VARCHAR(255)
** IN sRelationship TEXT
** IN sTargetTable VARCHAR(255)
** IN sOutputTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
** IN iMatchOption ENUM('complete','all','shortest', 'count')
** IN iMatchCount INTEGER(11)
* [[EFIM:Procedure:400_sp_get_recursive_target_events|400_sp_get_recursive_target_events]]
** IN sParentTable VARCHAR(255)
** IN sRelationship TEXT
** IN sCategories TEXT
** IN sChildTable VARCHAR(255)
** IN iDepthLimit INTEGER(11)
* [[EFIM:Procedure:400_sp_put_category_model_in_xml|400_sp_put_category_model_in_xml]]
** IN sXML LONGTEXT
** IN sRootNode VARCHAR(255)
** INOUT iCategoryID BIGINT(20) UNSIGNED
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:410_sp_dump_with_select_query|410_sp_dump_with_select_query]]
** IN sSelectQuery VARCHAR(255)
** IN bUseMemory INTEGER(11)
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:410_sp_import_rawdata_from_dump_column|410_sp_import_rawdata_from_dump_column]]
** IN sColumn VARCHAR(255)
** IN sMySQLType VARCHAR(255)
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:410_sp_import_relational_database|410_sp_import_relational_database]]
** IN sCategory VARCHAR(255)
** IN sOperationMode VARCHAR(255)
** IN sArgument TEXT
** IN sFunctionModel TEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:410_sp_import_select_query|410_sp_import_select_query]]
** IN sSelectQuery VARCHAR(255)
* [[EFIM:Procedure:410_sp_register_rdbms_events|410_sp_register_rdbms_events]]
** IN sCategoryName VARCHAR(255)
** IN bStatusReport INTEGER(11)
** OUT iCategoryID BIGINT(20) UNSIGNED
* [[EFIM:Procedure:410_sp_register_rdbms_event_relationships|410_sp_register_rdbms_event_relationships]]
** IN iCategoryID BIGINT(20) UNSIGNED
** IN sXML TEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:410_sp_register_rdbms_raw_data|410_sp_register_rdbms_raw_data]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:411_sp_export_create_export_table|411_sp_export_create_export_table]]
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:411_sp_export_data_from_path_table|411_sp_export_data_from_path_table]]
** IN iCategoryID BIGINT(20) UNSIGNED
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:411_sp_export_relational_database|411_sp_export_relational_database]]
** IN sCategory TEXT
** IN sTable VARCHAR(255)
** IN iTransactionLimit INTEGER(11)
** IN bUseMemory INTEGER(11)
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:420_sp_import_xml|420_sp_import_xml]]
** IN iCategoryID BIGINT(20) UNSIGNED
** IN iParentID BIGINT(20) UNSIGNED
** IN sInputData LONGTEXT
** INOUT sModel LONGTEXT
** IN sInputDataRootNode LONGTEXT
** IN sModelRootNode LONGTEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:420_sp_import_xml_with_xml|420_sp_import_xml_with_xml]]
** IN iCategoryID BIGINT(20) UNSIGNED
** IN iParentID BIGINT(20) UNSIGNED
** IN sInputData LONGTEXT
** INOUT sModel LONGTEXT
** IN sInputDataRootNode LONGTEXT
** IN sModelRootNode LONGTEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:500_sp_debug_event_view|500_sp_debug_event_view]]
** IN iEventID BIGINT(20) UNSIGNED
* [[EFIM:Procedure:600_sp_get_efim_player_current_scene_id|600_sp_get_efim_player_current_scene_id]]
** OUT iSceneID INTEGER(11)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_current_similar_scene|600_sp_get_efim_player_current_similar_scene]]
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_current_similar_scene_order|600_sp_get_efim_player_current_similar_scene_order]]
** IN iOrder INTEGER(11)
** OUT iChildScript TEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_current_similar_scene_script|600_sp_get_efim_player_current_similar_scene_script]]
** IN iOrder INTEGER(11)
** OUT sScript TEXT
** IN bStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_event|600_sp_get_efim_player_event]]
** IN sData TEXT
** IN iRawDataType INTEGER(11) UNSIGNED
** IN iIsSymbol INTEGER(11) UNSIGNED
** IN iIsData INTEGER(11) UNSIGNED
** IN iLimit BIGINT(20) UNSIGNED
** IN iOffset BIGINT(20) UNSIGNED
** IN iStatusReport INTEGER(11) UNSIGNED
* [[EFIM:Procedure:600_sp_get_efim_player_related_event|600_sp_get_efim_player_related_event]]
** IN iSourceEventID BIGINT(20) UNSIGNED
** IN iLimit BIGINT(20) UNSIGNED
** IN iOffset BIGINT(20) UNSIGNED
** IN iStatusReport INTEGER(11) UNSIGNED
* [[EFIM:Procedure:600_sp_get_efim_player_scene|600_sp_get_efim_player_scene]]
** IN iEpisodeID INTEGER(11)
** IN sEFIMPathTable VARCHAR(255)
** IN sPathToSave TEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_scene_id|600_sp_get_efim_player_scene_id]]
** IN iEpisodeID INTEGER(11)
** IN iMilliSecond INTEGER(11)
** OUT iSceneID INTEGER(11)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_scene_similarity|600_sp_get_efim_player_scene_similarity]]
** IN iSceneID INTEGER(11)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_get_efim_player_subtitle|600_sp_get_efim_player_subtitle]]
** IN iEpisodeID INTEGER(11)
** IN sEFIMPathTable VARCHAR(255)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:600_sp_put_efim_player_status_message|600_sp_put_efim_player_status_message]]
** IN sEFIMPlayerEpisodeID VARCHAR(255)
** IN sEFIMPlayerStatusClass VARCHAR(255)
** IN sEFIMPlayerStatusType VARCHAR(255)
** IN sEFIMPlayerStatusValue VARCHAR(255)
* [[EFIM:Procedure:700_sp_get_one_related_event_data|700_sp_get_one_related_event_data]]
** IN sSourceSymbol VARCHAR(255)
** IN iSourceDataType INTEGER(11)
** IN sSourceData LONGBLOB
** IN sTargetSymbol VARCHAR(255)
** IN iTargetDataType INTEGER(11)
** OUT sTargetData LONGBLOB
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:700_sp_get_related_event_by_group_in_table|700_sp_get_related_event_by_group_in_table]]
** IN sSourceSymbol VARCHAR(255)
** IN sTargetSymbol VARCHAR(255)
** IN sEFIMPathTable VARCHAR(255)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:700_sp_get_related_event_by_group_in_xml|700_sp_get_related_event_by_group_in_xml]]
** IN sSourceSymbol VARCHAR(255)
** IN sTargetSymbol VARCHAR(255)
** IN sRootNodeName VARCHAR(255)
** OUT sXML LONGTEXT
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:700_sp_get_related_event_by_value_in_table|700_sp_get_related_event_by_value_in_table]]
** IN sSourceTable VARCHAR(255)
** IN sSourceSymbol VARCHAR(255)
** IN iSourceDataType INTEGER(11)
** IN sTargetSymbol VARCHAR(255)
** IN sEFIMPathTable VARCHAR(255)
** IN iStatusReport INTEGER(11)
* [[EFIM:Procedure:900_get_efim_system_log|900_get_efim_system_log]]
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:990_sp_create_efim_tables|990_sp_create_efim_tables]]
* [[EFIM:Procedure:990_sp_create_efim_views|990_sp_create_efim_views]]
* [[EFIM:Procedure:990_sp_initialize|990_sp_initialize]]
** IN iOption ENUM('all', 'event')
* [[EFIM:Procedure:990_sp_initialize_event_parts|990_sp_initialize_event_parts]]
* [[EFIM:Procedure:990_sp_util_list_api|990_sp_util_list_api]]
* [[EFIM:Procedure:990_util_find_procedures|990_util_find_procedures]]
** IN sKeyword VARCHAR(255)
* [[EFIM:Procedure:990_util_find_related_word|990_util_find_related_word]]
** iSynset INTEGER(11), iWord INTEGER(11)
** INOUT sPos CHAR(1)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:990_util_find_word|990_util_find_word]]
** sWord VARCHAR(255), sPos CHAR(1), iOption INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:990_util_install_trigger|990_util_install_trigger]]
** IN sDatabase INTEGER(11)
* [[EFIM:Procedure:990_util_process_sentence_xml|990_util_process_sentence_xml]]
** IN sFile varchar(255)
* [[EFIM:Procedure:990_util_remove_all_events_with_tasks|990_util_remove_all_events_with_tasks]]
* [[EFIM:Procedure:990_util_string_split|990_util_string_split]]
** IN strResponse LONGTEXT
** IN strSplitter CHAR(1)
** IN sOutputTable VARCHAR(255)
* [[EFIM:Procedure:1000_sp_find_events|1000_sp_find_events]]
** IN sRawDataType varchar(255)
** IN sKeywords TEXT
* [[EFIM:Procedure:sp_get_linkdef|sp_get_linkdef]]
* [[EFIM:Procedure:sp_get_linkdef_count_by_lemma|sp_get_linkdef_count_by_lemma]]
** sWord VARCHAR(255)
* [[EFIM:Procedure:sp_get_linkdef_count_by_word_synset_id|sp_get_linkdef_count_by_word_synset_id]]
** iWord INTEGER(11), iSynset INTEGER(11)
* [[EFIM:Procedure:sp_get_related_lexlink_word|sp_get_related_lexlink_word]]
** iWordID INTEGER(11), iSynsetID INTEGER(11), iLinkType INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_related_semlink_word|sp_get_related_semlink_word]]
** iWordID INTEGER(11), iSynsetID INTEGER(11), iLinkType INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_related_word|sp_get_related_word]]
** iWordID INTEGER(11), iSynsetID INTEGER(11), iLinkType INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_related_word_from_lemma|sp_get_related_word_from_lemma]]
** sWord VARCHAR(255), iLinkType INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_related_word_from_lemma_linktype|sp_get_related_word_from_lemma_linktype]]
** sWord VARCHAR(255), sLinkType VARCHAR(255)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_symbol_relations|sp_get_symbol_relations]]
* [[EFIM:Procedure:sp_get_word|sp_get_word]]
** sWord VARCHAR(255), sPos CHAR(1), iOption INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_word_user_data_extension|sp_get_word_user_data_extension]]
** sWord VARCHAR(255), iOption INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:sp_get_word_user_data_extension_with_option|sp_get_word_user_data_extension_with_option]]
** IN sWord VARCHAR(255)
** IN sPos CHAR(1)
** IN iOption INTEGER(11)
** OUT iResult INTEGER(11)
** OUT sResult VARCHAR(255)
* [[EFIM:Procedure:test|test]]
** IN sKeyword TEXT
* [[EFIM:Procedure:test_search_conversation|test_search_conversation]]
** IN sSpeakerA VARCHAR(255)
** IN sSpeakerB VARCHAR(255)
** IN sKeywords VARCHAR(255)
* [[EFIM:Procedure:test_search_speaker|test_search_speaker]]
** IN sSourceSymbol varchar(255)
** IN sSourceData varchar(255)
** IN sTargetSymbols VARCHAR(255)
** IN sTargetKeywords VARCHAR(255)
* [[EFIM:Procedure:traverse_category_down|traverse_category_down]]
** IN start_with INTEGER(11) UNSIGNED

== EFIM Functions ==
* [[EFIM:Function:BASE64_DECODE|BASE64_DECODE]]
** IN input LONGBLOB
** RETURN TYPE: longblob
* [[EFIM:Function:BASE64_ENCODE|BASE64_ENCODE]]
** IN input LONGBLOB
** RETURN TYPE: longblob
* [[EFIM:Function:EFIM_GetCategoryName|EFIM_GetCategoryName]]
** IN iCategoryID BIGINT UNSIGNED
** RETURN TYPE: char(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetDataIDbyRawDataTypeID|EFIM_GetDataIDbyRawDataTypeID]]
** IN iRawDataType BIGINT(20) UNSIGNED
** IN  iRawDataID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetDataIDofEvent|EFIM_GetDataIDofEvent]]
** IN iEventID BIGINT UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetDatainBlob|EFIM_GetDatainBlob]]
** IN iDataID BIGINT UNSIGNED
** RETURN TYPE: longblob
* [[EFIM:Function:EFIM_GetDatainText|EFIM_GetDatainText]]
** IN iDataID BIGINT UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetDatainTextLimit|EFIM_GetDatainTextLimit]]
** IN iDataID BIGINT UNSIGNED
** IN  iLimit INTEGER(11)
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetDataofEventinBlob|EFIM_GetDataofEventinBlob]]
** IN iEventID BIGINT UNSIGNED
** RETURN TYPE: longblob
* [[EFIM:Function:EFIM_GetDataofEventinText|EFIM_GetDataofEventinText]]
** IN iEventID BIGINT UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetDataTypebyRawDataTypeID|EFIM_GetDataTypebyRawDataTypeID]]
** IN iRawDataTypeID INTEGER(11)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetDataTypeofEvent|EFIM_GetDataTypeofEvent]]
** IN iEventID BIGINT UNSIGNED
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetEFIMDumpFieldID|EFIM_GetEFIMDumpFieldID]]
** IN sFieldName TEXT
** RETURN TYPE: int(11)
* [[EFIM:Function:EFIM_GetEventCountbySymbol|EFIM_GetEventCountbySymbol]]
** IN sSymbol VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetEventRelationshipID|EFIM_GetEventRelationshipID]]
** IN sRelationship VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetEventTimeStamp|EFIM_GetEventTimeStamp]]
** IN iEventID BIGINT UNSIGNED
** RETURN TYPE: timestamp
* [[EFIM:Function:EFIM_GetFunctionName|EFIM_GetFunctionName]]
** IN iFunctionID BIGINT UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetMySQLTypebyRawDataTypeID|EFIM_GetMySQLTypebyRawDataTypeID]]
** IN iRawDataTypeID INTEGER(11)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetOneCategoryID|EFIM_GetOneCategoryID]]
** IN sCategory VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneChildEventwithOptions|EFIM_GetOneChildEventwithOptions]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN  iRelationshipEvent BIGINT(20) UNSIGNED
** IN  iSymbolID BIGINT(20) UNSIGNED
** IN  iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneDataID|EFIM_GetOneDataID]]
** IN iRawDataType INTEGER(11)
** IN  sData LONGTEXT
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneDataIDforAllType|EFIM_GetOneDataIDforAllType]]
** IN sData LONGBLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneEventID|EFIM_GetOneEventID]]
** IN iSymbolID BIGINT(20) UNSIGNED
** IN  iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneEventIDbySymbolNameRawDataTypeRawData|EFIM_GetOneEventIDbySymbolNameRawDataTypeRawData]]
** IN sSymbolName VARCHAR(255)
** IN  sRawDataType VARCHAR(255)
** IN  sData LONGBLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneFunctionID|EFIM_GetOneFunctionID]]
** IN sFunction VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneIntegerDataID|EFIM_GetOneIntegerDataID]]
** IN sData VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneRawDataID|EFIM_GetOneRawDataID]]
** IN iRawDataType BIGINT(20) UNSIGNED
** IN  sData LONGBLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneSDTypeID|EFIM_GetOneSDTypeID]]
** IN iSymbolID VARCHAR(255)
** IN  iRawDataTypeID VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneSDTypeIDbySymbolNameRawDataTypeName|EFIM_GetOneSDTypeIDbySymbolNameRawDataTypeName]]
** IN sSymbol VARCHAR(255)
** IN  sRawDataType VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneSourceEventID|EFIM_GetOneSourceEventID]]
** IN iRelationshipEventID BIGINT(20) UNSIGNED
** IN  iTargetEventID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneSourceEventIDbySymbolNameSourceData|EFIM_GetOneSourceEventIDbySymbolNameSourceData]]
** IN sSourceSymbol VARCHAR(255)
** IN  sSourceDataType VARCHAR(255)
** IN  sSourceData LONGTEXT
** IN  sRelationship VARCHAR(255)
** RETURN TYPE: bigint(20)
* [[EFIM:Function:EFIM_GetOneTagID|EFIM_GetOneTagID]]
** IN iSynset INTEGER(11)
** IN  iWordno INTEGER(11)
** IN  iLexno INTEGER(11)
** IN  iData BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneTagIDbyName|EFIM_GetOneTagIDbyName]]
** IN sSymbolName VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetOneTextData|EFIM_GetOneTextData]]
** IN iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetOneTextDataID|EFIM_GetOneTextDataID]]
** IN sData VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetRawDataName|EFIM_GetRawDataName]]
** IN iRawDataType BIGINT(20) UNSIGNED
** RETURN TYPE: char(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTableName|EFIM_GetRawDataTableName]]
** IN iRawDataType BIGINT(20) UNSIGNED
** RETURN TYPE: char(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTableNamebyMySQLType|EFIM_GetRawDataTableNamebyMySQLType]]
** IN sMySQLType varchar(255)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTableNamebyRawDataName|EFIM_GetRawDataTableNamebyRawDataName]]
** IN sRawDataType VARCHAR(255)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTypebyMySQLType|EFIM_GetRawDataTypebyMySQLType]]
** IN sMySQLType varchar(255)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTypeIDbyMySQLType|EFIM_GetRawDataTypeIDbyMySQLType]]
** IN sMySQLType varchar(255)
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetRawDataTypeofData|EFIM_GetRawDataTypeofData]]
** IN iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: varchar(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetSymbolIDofEvent|EFIM_GetSymbolIDofEvent]]
** IN iEventID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_GetSymbolofEventinText|EFIM_GetSymbolofEventinText]]
** IN iEventID BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_GetSynsetofTag|EFIM_GetSynsetofTag]]
** IN iTagID BIGINT(20) UNSIGNED
** RETURN TYPE: int(11)
* [[EFIM:Function:EFIM_GetTagName|EFIM_GetTagName]]
** IN iTagID BIGINT(20) UNSIGNED
** RETURN TYPE: char(255) CHARSET utf8
* [[EFIM:Function:EFIM_GetXMLSafeString|EFIM_GetXMLSafeString]]
** IN sXML LONGTEXT
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_IsBlobEvent|EFIM_IsBlobEvent]]
** IN iEventID BIGINT(20) UNSIGNED
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsDateTime|EFIM_IsDateTime]]
** IN sData BLOB
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsGeometry|EFIM_IsGeometry]]
** IN sData BLOB
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsGroupEvent|EFIM_IsGroupEvent]]
** IN iEventID BIGINT(20)
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsMultiByteChar|EFIM_IsMultiByteChar]]
** IN sText VARCHAR(255)
** RETURN TYPE: int(11)
* [[EFIM:Function:EFIM_IsNumeric|EFIM_IsNumeric]]
** IN sData BLOB
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsSymboltoTag|EFIM_IsSymboltoTag]]
** IN iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_IsUUID|EFIM_IsUUID]]
** IN sUUID VARCHAR(255)
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsValidDataID|EFIM_IsValidDataID]]
** IN iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_IsValidEventID|EFIM_IsValidEventID]]
** IN iEventID BIGINT(20) UNSIGNED
** RETURN TYPE: int(11)
* [[EFIM:Function:EFIM_PutCategory|EFIM_PutCategory]]
** IN iSymbol INTEGER(11)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutCategorybyName|EFIM_PutCategorybyName]]
** IN sCategoryName VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutCategorybySymbolName|EFIM_PutCategorybySymbolName]]
** IN sSymbol varchar(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutCategoryElement|EFIM_PutCategoryElement]]
** IN iCategoryEventID BIGINT(20) UNSIGNED
** IN  iElementEventID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutCategoryElementbyCategoryNameElementID|EFIM_PutCategoryElementbyCategoryNameElementID]]
** IN sCategory VARCHAR(255)
** IN  iElementEventID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutCategoryEvent|EFIM_PutCategoryEvent]]
** IN iCategoryEvent BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutData|EFIM_PutData]]
** IN iRawDataType BIGINT(20) UNSIGNED
** IN  sData LONGBLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutDatabyMimeIDDataSize|EFIM_PutDatabyMimeIDDataSize]]
** IN iMimeType INTEGER(11)
** IN  iDataSize INTEGER(11)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEvent|EFIM_PutEvent]]
** IN iSymbol BIGINT(20) UNSIGNED
** IN  iData BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventbySymbolIDRawDataTypeIDData|EFIM_PutEventbySymbolIDRawDataTypeIDData]]
** IN iSymbolID BIGINT(20) UNSIGNED
** IN  iRawDataTypeID BIGINT(20) UNSIGNED
** IN  sData BLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventbySymbolNameDataID|EFIM_PutEventbySymbolNameDataID]]
** IN sSymbol VARCHAR(255)
** IN  iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventbySymbolNameRawDataTypeData|EFIM_PutEventbySymbolNameRawDataTypeData]]
** IN sSymbol VARCHAR(255)
** IN  sRawDataType VARCHAR(255)
** IN  sData BLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventbySymbolNameRawDataTypeIDData|EFIM_PutEventbySymbolNameRawDataTypeIDData]]
** IN sSymbol VARCHAR(255)
** IN  iRawDataTypeID INTEGER(11) UNSIGNED
** IN  sData BLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventRelationship|EFIM_PutEventRelationship]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN  iRelationship BIGINT(20) UNSIGNED
** IN  iTargetEvent BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventRelationshipText|EFIM_PutEventRelationshipText]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN  iTargetEvent BIGINT(20) UNSIGNED
** IN  sRelaionship VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutEventRelationshipType|EFIM_PutEventRelationshipType]]
** IN sRelationship VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutFunctionbyName|EFIM_PutFunctionbyName]]
** IN sFunctionName VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutFunctionElement|EFIM_PutFunctionElement]]
** IN iFunctionEventID BIGINT(20) UNSIGNED
** IN  iIsInput BIGINT(20) UNSIGNED
** IN  iSDTypeID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutFunctionElementbyFunctionNameElementID|EFIM_PutFunctionElementbyFunctionNameElementID]]
** IN sFunction VARCHAR(255)
** IN  iIsInput INTEGER(11)
** IN  iSDTypeID BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutRawData|EFIM_PutRawData]]
** IN iRawDataType BIGINT(20) UNSIGNED
** IN  sData LONGBLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutSDType|EFIM_PutSDType]]
** IN iSymbolID BIGINT(20) UNSIGNED
** IN  iRawDataTypeID INTEGER UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutSDTypebySymbolNameRawDataType|EFIM_PutSDTypebySymbolNameRawDataType]]
** IN sSymbol VARCHAR(255)
** IN  sRawDataType VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutSingleDatabyRawDataTypeID|EFIM_PutSingleDatabyRawDataTypeID]]
** IN iRawDataTypeID BIGINT(20) UNSIGNED
** IN  sData BLOB
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutSystemLog|EFIM_PutSystemLog]]
** IN iType ENUM('normal'
** IN 'warning'
** IN 'result')
** IN  sMessage varchar(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutTag|EFIM_PutTag]]
** IN iSynset INTEGER(11)
** IN  iWordno INTEGER(11)
** IN  iLexno INTEGER(11)
** IN  iData BIGINT(20) UNSIGNED
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_PutTagbyTextData|EFIM_PutTagbyTextData]]
** IN iSynset INTEGER(11)
** IN  iWordno INTEGER(11)
** IN  iLexno INTEGER(11)
** IN  sData VARCHAR(255)
** RETURN TYPE: bigint(20) unsigned
* [[EFIM:Function:EFIM_Query_SelectEventRelationship|EFIM_Query_SelectEventRelationship]]
** IN iIsUp INTEGER
** IN  sEFIMPathTable VARCHAR(255)
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_Query_SelectRawData|EFIM_Query_SelectRawData]]
** IN iRawDataType BIGINT(20) UNSIGNED
** IN  sValue LONGBLOB
** IN  iOption BIGINT(20) UNSIGNED
** IN  iLimit BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_Query_SelectRawDatabyDataID|EFIM_Query_SelectRawDatabyDataID]]
** IN iDataID BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_Query_SelectRawDataFromAssignedDataTable|EFIM_Query_SelectRawDataFromAssignedDataTable]]
** IN sDataTableName VARCHAR(255)
** IN  iRawDataType BIGINT(20) UNSIGNED
** IN  iOption BIGINT(20) UNSIGNED
** IN  iLimit BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_Query_SelectRelatedEvents|EFIM_Query_SelectRelatedEvents]]
** IN iSourceEvent BIGINT(20) UNSIGNED
** IN  iRelationshipEvent BIGINT(20) UNSIGNED
** IN  iTargetEvent BIGINT(20) UNSIGNED
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_TranslateKoreanKeywordsToEnglish|EFIM_TranslateKoreanKeywordsToEnglish]]
** IN sKeywords TEXT
** RETURN TYPE: text CHARSET utf8
* [[EFIM:Function:EFIM_TranslateKoreanWordToEnglish|EFIM_TranslateKoreanWordToEnglish]]
** IN sKeyword TEXT
** RETURN TYPE: text CHARSET utf8
* [[EFIM:Function:EFIM_Util_GetRawCastData|EFIM_Util_GetRawCastData]]
** IN iRawDataTypeID INTEGER UNSIGNED
** IN  sColumn VARCHAR(255)
** RETURN TYPE: longtext CHARSET utf8
* [[EFIM:Function:EFIM_Util_GetRawCastValue|EFIM_Util_GetRawCastValue]]
** IN iRawDataTypeID BIGINT(20) UNSIGNED
** IN  sColumn VARCHAR(255)
** RETURN TYPE: text CHARSET utf8
* [[EFIM:Function:EFIM_Util_IsTableExist|EFIM_Util_IsTableExist]]
** IN sDatabase varchar(255)
** IN  sTable varchar(255)
** RETURN TYPE: int(11)
* [[EFIM:Function:EFIM_Util_PutEFIMReservedKeywords|EFIM_Util_PutEFIMReservedKeywords]]
** RETURN TYPE: tinyint(4)
* [[EFIM:Function:EFIM_Util_RowID|EFIM_Util_RowID]]
** RETURN TYPE: bigint(20) unsigned

== References ==
* Codes to generate the stored procedure list

BEGIN
/*
  Developed by Pilho Kim, 08/03/2008

Object: Procedure to list up all stored procedures and funcstion.

Input:
Output:
  The list of functions will be stored at the specified directory and file.
  Be aware that you have to delete the local file before running this procedure. 
  If already exists, then this procedure will fail.
  
Comment:

Revision History:
  08/03/2008 # First codes
*/

SELECT CONCAT(
		CONCAT('* [[EFIM:Procedure:', mproc.name, '|', mproc.name, ']]'),
        # IF param_list exists
        IF (LENGTH(mproc.param_list) > 1, 
        	CONCAT('\n** ', REPLACE(REPLACE(mproc.param_list, ', IN', '\n** IN'), ', OUT', '\n** OUT')),
            ''))
        AS 'EFIM API list'
        INTO OUTFILE 'c:/EFIM_Stored_procedure_list.txt' 
        LINES TERMINATED BY '\n'
FROM mysql.proc AS mproc 
WHERE db = 'efim_release' AND type = 'procedure'
ORDER BY mproc.name ASC;

SELECT CONCAT(
		CONCAT('* [[EFIM:Function:', mproc.name, '|', mproc.name, ']]'),
        # Return type
        # IF param_list exists
        IF (LENGTH(mproc.param_list) > 1, 
        	CONCAT('\n** IN ', REPLACE(mproc.param_list, ',', '\n** IN ')),
            ''),
        CONCAT('\n** RETURN TYPE: ', mproc.returns))
        AS 'EFIM API list'
        INTO OUTFILE 'c:/EFIM_Function_list.txt' 
        LINES TERMINATED BY '\n'
FROM mysql.proc AS mproc 
WHERE db = 'efim_release' AND type = 'function'
ORDER BY mproc.name ASC;

END

 

 

 

 

 

 

 

 

 

Practice in importing and exporting database tables that include "TIMESTAMP" field

To keep a long story short, I made this mistake a number of times even when handling billions of records. So here is a record for prevention :)

When exporting or importing table data that include TIMESTAMP field in there, MySQL by defaults exports the data based on UTC. It internally executes "SET time_zone='UTC'" command before exporting any data. This is a default behavior (See https://dev.mysql.com/doc/refman/5.6/en/mysqldump.html#option_mysqldump_tz-utc) and so after using mysqldump to export data, you MUST set "SET time_zone='UTC'" before importing (using LOAD DATA) the data to any database.

ex) exporting data:
mysqldump --opt -Q -h 127.0.0.1 --user=youruseid --password=yourpassword --no-create-info --where="unixtimestamp < 1373925599" --tab="/wheretosave/tmp" --fields-terminated-by="\t" --fields-optionally-enclosed-by="\"" --lines-terminated-by="\n" yourdb yourtable

Then when importing data within MySQL console:

mysql> SET time_zone="UTC";
mysql> USE yourdb;
mysql> LOAD DATA LOCAL INFILE '/wheretosave/tmp/yourtable.txt' INTO TABLE yourtable FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n';

EML (First version -- Kept for records)

EML stands for the E-model language designed for the general purpose event query. It is based on the triple-type e-node graph and its syntax will be the extension of SPARQL and SQL. EML is based on the hyper graph data structure (See the E-model database structure.) Currently it supports MySQL database and this labs defines the BNF specification of EML and its parser. 

This is a working draft -- June 26th, 2011

EML Namespaces

Name Notation Comments
All sets _* Search all objects in the E-model database
Parent object _parent, _parent[i] [i] means the ith parent object
Child object _child, _child[i] [i] means ith child object
Name _name Object name
Value _value Object value
Raw data type _type Object raw data type
Timestamp _timestamp Object transaction time
Temporal constraint WHEN Temporal search of associated time predicates
Relation _R(,,) Query object relation
Graph path (%d, _EPATH, *) _EPATH specifies edges to walk. %d denotes the dth slected field.
Populatiry _Popularity() Used to order results by popularity

Documents

EML BNF Specification

! -----------------------------------------------------------------------------------
! E-model language (EML)
!
! An E-model prototype is built on top of relational database. 
! Its full functions are implemented using hundreds of SQL procedures
! and functions. The idea is when a database system adds the E-model 
! database to existing databases, then a user can query the database 
! in the mixture of structured queries in addition to E-model queries. 
! EML implements such ideas by extending the SQL language to support 
! both structured and unstructured queries with various feature additions. 
!
! Update:
!   03/29/2009 Preliminary EML design
!   06/05/2009 Add chain expression in Id list
!
! Note: This is a preliminary version of the EML based on the SQL 89 grammar 
! at http://www.devincook.com/goldparser/grammars/index.htm.
!
! Note, 05/02/2010: Add supports to _parent, _child, _parent[%d], _child[%d] namespaces
! Note, 06/02/2010: Add supports to Id without child specification in WHEN clause
! Note, 10/16/2010: Add supports functions like second, year as the type specifier
!                   ex) WHEN ABS(t3 - t4) <= 30 SECOND;
! -----------------------------------------------------------------------------------

"Name"         = 'E-model language (EML)'
"Author"       = 'Pilho Kim'
"Version"      = '03/26/2011'
"About"        = 'EML is an extended SQL language developed on top of E-model.'

"Start Symbol" = 

! =============================================================================
! Comments
! =============================================================================

Comment Start = '/*'
Comment End   = '*/'
Comment Line  = '--'

! =============================================================================
! Terminals
! =============================================================================

{String Ch 1}      = {Printable} - ["]
{String Ch 2}      = {Printable} - ['']
{Id Ch Standard}   = {Alphanumeric} + [_] + ['*']
{Id Ch Extended}   = {Printable} - ['['] - [']']

StringLiteral   = '"'{String Ch 1}*'"' | ''{String Ch 2}*''
IntegerLiteral  = {Digit}+
RealLiteral     = {Digit}+'.'{Digit}+

! =============================================================================
! EML namespace
! =============================================================================

! Extension for EML, allow * to specify whole database
{EML Id Ch}   = {Letter} + ['_'] + ['*']

!----- Identifiers in SQL are very complex. 
! Id             = ({Letter}{Id Ch Standard}* | '['{Id Ch Extended}+']')  ('.'({Letter}{Id Ch Standard}* | '['{Id Ch Extended}+']'))?
! Support _* expression that specify the whole databases and tables
! Allow chain expression
! Id  = ({EML Id Ch}{Id Ch Standard}* | '['{Id Ch Extended}+']') ('.'({EML Id Ch}{Id Ch Standard}* | '['{Id Ch Extended}+']'))?
Id  = ({EML Id Ch}{Id Ch Standard}* | '['{Id Ch Extended}+']') ('.'({EML Id Ch}{Id Ch Standard}* | '['{Id Ch Extended}+']'))*


! =============================================================================
! Rules
! =============================================================================

! Support EndofStatement ';'
       ::=  
                |  
                |  
                |  
                |  
                | 
                  | INSERT INTO Id '('  ')' VALUES '('  ')'

    ::= UPDATE Id SET   

   ::= Id '='  ',' 
                  | Id '='  

    ::= DELETE FROM Id  

! =============================================================================
! Select Statement
! =============================================================================

! Add LIMIT
 ')'
                | '('  ')'

  ::=  ',' 
               | 

     ::=  ','  
                | 

!    ::= Id
!                | Id Id

! Support 'AS' and sub query
   ::= Id
                | Id Id
                | Id AS Id
                | '('  ')' Id
                | '('