File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# ---- Logging -----
33# -------------------------------------
44logging :
5- handlers :
6- file :
7- filename : " logs/my_saezapp_logger.log"
5+ handlers :
6+ file :
7+ filename : logs/my_saezapp_logger.log
8+
9+ loggers :
10+ default :
11+ level : DEBUG
12+ pkg_infra :
13+ level : INFO
14+ handlers : [file, console]
15+ propagate : false
16+ download_manager :
17+ level : INFO
18+ handlers : [file, console]
19+ propagate : false
20+ ontograph :
21+ level : INFO
22+ handlers : [file, console]
23+ propagate : false
24+
25+ root :
26+ level : WARNING
27+ handlers : [file, console]
828
929# -------------------------------------
1030# ---- Integrations -----
1131# -------------------------------------
1232integrations : # New question: store the big yaml?
1333 # OntoGraph
14- ontograph :
15- settings :
16- - enabled : true # This will be switch <--- what should be the default value?
17- - cache_path : " ontograph_config.yaml"
18- - source_ontology : " chebi"
19- - backend : " graphblas"
34+ ontograph :
35+ settings :
36+ - enabled : true # This will be switch <--- what should be the default value?
37+ - cache_path : ontograph_config.yaml
38+ - source_ontology : chebi
39+ - backend : graphblas
2040
2141 # Download manager
22- download_manager :
23- settings :
24- enabled : true # This will be switch <--- what should be the default value?
25- path : " /tmp"
26- backend : " requests"
27-
28- url : " https://getsamplefiles.com/download/txt/sample-1.txt"
29- dest : false
30- newer_than : null
31- older_than : null
42+ download_manager :
43+ settings :
44+ enabled : true # This will be switch <--- what should be the default value?
45+ path : /tmp
46+ backend : requests
47+ url : https://getsamplefiles.com/download/txt/sample-1.txt
48+ dest : false
49+ newer_than :
50+ older_than :
Original file line number Diff line number Diff line change @@ -152,6 +152,9 @@ report_level = "INFO"
152152
153153# ---- Ruff: a fast Python linter and formatter.
154154[tool .ruff ]
155+ exclude = [
156+ " sandbox/"
157+ ]
155158extend-include = [" *.ipynb" ]
156159line-length = 80
157160target-version = " py312"
Original file line number Diff line number Diff line change 1+ import pkg_infra
2+
3+ from ontograph .client import ClientCatalog , ClientOntology
4+ from ontograph .downloader import PoochDownloaderAdapter
5+ from ontograph .config .settings import DEFAULT_CACHE_DIR
6+
7+ def main ():
8+ workspace = './'
9+
10+ # Create a session for the app
11+ session = pkg_infra .get_session (workspace = workspace , include_location = True )
12+
13+ # Get logger from the session
14+ logger = session .get_logger ()
15+
16+ # Add simple messages to the current logger
17+ logger .info ('This is an INFO message' )
18+ logger .debug ('This is a DEBUG message' )
19+ logger .warning ('This is a WARNING message' )
20+ logger .error ('This is an ERROR message' )
21+ logger .critical ('This is a CRITICAL message' )
22+
23+ # Call a given downloader from OntoGraph
24+ downloader = PoochDownloaderAdapter (cache_dir = DEFAULT_CACHE_DIR )
25+
26+ # Download a catalog
27+ catalog = ClientCatalog (cache_dir = './data/out' , downloader = downloader )
28+ catalog .load_catalog ()
29+
30+ # print the schema tree
31+ #catalog.print_catalog_schema_tree()
32+
33+ # Download a given ontology
34+ client = ClientOntology (cache_dir = './data/out' , downloader = downloader )
35+ client .load (source = 'go' ) # catalog download
36+
37+ if __name__ == '__main__' :
38+
39+ main ()
You can’t perform that action at this time.
0 commit comments