<commit_before>/* <module> logicmoo_plarkc - special module hooks into the logicmoo engine allow
%   clif syntax to be recocogized via our CycL/KIF handlers 
% 
% Logicmoo Project: A LarKC Server written in Prolog
% Maintainer: <NAME>
% Dec 13, 2035
%
*/

:- module(logicmoo_snark,[]).

:- system:use_module(library(logicmoo_util_common)).

:- dynamic   user:file_search_path/2.
:- multifile user:file_search_path/2.
:- prolog_load_context(directory,Dir),
   DirFor = library,
   during_boot((( \+ user:file_search_path(DirFor,Dir)) ->asserta(user:file_search_path(DirFor,Dir));true)),!.

:- '$set_source_module'(baseKB).

:- system:reexport(library(logicmoo_engine)).
:- asserta_new(user:file_search_path(logicmoo,library)).

:- add_library_search_path('./logicmoo/common_logic/',[ 'common_*.pl']).
/*
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_snark.pl')). 
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_boxlog.pl')).
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_skolem.pl')).
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_compiler.pl')). 
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_kb_hooks.pl')).
*/
:- ensure_loaded(baseKB:library('logicmoo/common_logic/common_logic_clif.pfc')).
% :- ensure_loaded(baseKB:library('logicmoo/common_logic/common_logic_sumo.pfc')).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SETUP SUMO KB EXTENSIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

:- system:ensure_loaded(library(logicmoo_snark)).

:- set_prolog_flag(do_renames,term_expansion).

:- during_boot(set_prolog_flag(do_renames,restore)).

sumo_ain(I,O):-sexpr_sterm_to_pterm(I,M),sumo_ain1(M,O).
sumo_ain1('$COMMENT'(A),'$COMMENT'(A)):- !.
sumo_ain1(D,CycLOut):- must(kif_assertion_recipe(D,CycLOut)).    

sumo_ain2(documentation(_, xtChineseLanguage,_)).
sumo_ain2(CycLOut):-
    delay_rule_eval(CycLOut,sumo_rule,NewAsserts),
    dmsg(NewAsserts),
    ain(NewAsserts).

loadSumo(File):- \+ exists_file(File),!,wdmsg(no_such_file(File)),!.
loadSumo(File):- with_lisp_translation_cached(File,sumo_ain,nop).


skip_sumo:- app_argv(List), member('--nosumo',List),!.

clone_ontologyportal_sumo:- skip_sumo,!.
clone_ontologyportal_sumo:- exists_directory('./ontologyportal_sumo'),!.
clone_ontologyportal_sumo:- shell('git clone https://github.com/ontologyportal/sumo.git ./ontologyportal_sumo'),shell('touch *.tmp'),('touch _*').

:- during_boot(clone_ontologyportal_sumo).

loadSumo1:- skip_sumo,!.
loadSumo1:- 
   loadSumo('./ontologyportal_sumo/Merge.kif'),
   loadSumo('./ontologyportal_sumo/Mid-level-ontology.kif'),
   !.

loadSumo2:- skip_sumo,!.
loadSumo2:- 
   loadSumo('./ontologyportal_sumo/Translations/relations-en.txt'),
   loadSumo('./ontologyportal_sumo/english_format.kif'),
   loadSumo('./ontologyportal_sumo/domainEnglishFormat.kif'),<commit_msg>--skip-sumo 2017-03-31-19:26:17<commit_after>/* <module> logicmoo_plarkc - special module hooks into the logicmoo engine allow
%   clif syntax to be recocogized via our CycL/KIF handlers 
% 
% Logicmoo Project: A LarKC Server written in Prolog
% Maintainer: <NAME>
% Dec 13, 2035
%
*/

:- module(logicmoo_snark,[]).

:- system:use_module(library(logicmoo_util_common)).

:- dynamic   user:file_search_path/2.
:- multifile user:file_search_path/2.
:- prolog_load_context(directory,Dir),
   DirFor = library,
   during_boot((( \+ user:file_search_path(DirFor,Dir)) ->asserta(user:file_search_path(DirFor,Dir));true)),!.

:- '$set_source_module'(baseKB).

:- system:reexport(library(logicmoo_engine)).
:- asserta_new(user:file_search_path(logicmoo,library)).

:- add_library_search_path('./logicmoo/common_logic/',[ 'common_*.pl']).
/*
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_snark.pl')). 
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_boxlog.pl')).
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_skolem.pl')).
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_compiler.pl')). 
:- reexport(baseKB:library('logicmoo/common_logic/common_logic_kb_hooks.pl')).
*/
:- ensure_loaded(baseKB:library('logicmoo/common_logic/common_logic_clif.pfc')).
% :- ensure_loaded(baseKB:library('logicmoo/common_logic/common_logic_sumo.pfc')).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SETUP SUMO KB EXTENSIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

:- system:ensure_loaded(library(logicmoo_snark)).

:- set_prolog_flag(do_renames,term_expansion).

:- during_boot(set_prolog_flag(do_renames,restore)).

sumo_ain(I,O):-sexpr_sterm_to_pterm(I,M),sumo_ain1(M,O).
sumo_ain1('$COMMENT'(A),'$COMMENT'(A)):- !.
sumo_ain1(D,CycLOut):- must(kif_assertion_recipe(D,CycLOut)).    

sumo_ain2(documentation(_, xtChineseLanguage,_)).
sumo_ain2(CycLOut):-
    delay_rule_eval(CycLOut,sumo_rule,NewAsserts),
    dmsg(NewAsserts),
    ain(NewAsserts).

loadSumo(File):- \+ exists_file(File),!,wdmsg(no_such_file(File)),!.
loadSumo(File):- with_lisp_translation_cached(File,sumo_ain,nop).

skip_sumo:- app_argv(List), member('--nosumo',List),!.
skip_sumo:- app_argv(List), member('--skip-sumo',List),!.
skip_sumo:- app_argv(List), \+ member('--sumo',List), \+ member('--snark',List), \+ member('--all',List),!.

clone_ontologyportal_sumo:- skip_sumo,!.
clone_ontologyportal_sumo:- exists_directory('./ontologyportal_sumo'),!.
clone_ontologyportal_sumo:- shell('git clone https://github.com/ontologyportal/sumo.git ./ontologyportal_sumo'),shell('touch *.tmp'),('touch _*').

:- during_boot(clone_ontologyportal_sumo).

loadSumo1:- skip_sumo,!.
loadSumo1:- 
   loadSumo('./ontologyportal_sumo/Merge.kif'),
   loadSumo('./ontologyportal_sumo/Mid-level-ontology.kif'),
   !.

loadSumo2:- skip_sumo,!.
loadSumo2:- 
   loadSumo('./ontologyportal_sumo/Translations/relations-en.txt'),
   loadSumo('./ontologyportal_sumo/english_format.kif'),
   loadSumo('./ontologyportal_sumo/domainEnglishFormat.kif'),
{'fraction_non_alphanumeric': 0.20723739319819065, 'fraction_numerical': 0.008041547997989612, 'mean_word_length': 7.0675675675675675, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6310634', 'n_tokens_mistral': 2377, 'n_tokens_neox': 2249, 'n_words': 214}