From d9667456eacd4986e163ca876c478442e80d56c9 Mon Sep 17 00:00:00 2001 From: BarCo Date: Wed, 23 Jul 2025 11:15:17 +0300 Subject: [PATCH 1/2] Update readme sample --- README.md | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c406ad6..db0092e 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,16 @@ This project is a pure python connector to timbr (no dependencies required). enable_IPv6 = , ) - # url - Required - String - The IP / Hostname of the Timbr platform. - # ontology - Required - String - The ontology / knowledge graph to connect to. - # token - Required - String - Timbr token value. - # query - Required - String - The query that you want to execute. - # datasource - Optional - String - Add the specific datasource name that you want to query from, the default value is the current active datasource of your ontology. - # nested - Optional - String - Change to 'true' if nested flag needs to be enabled. make sure this flag contains string value not bool value. - # verify_ssl - Optional - Boolean - Verifying the target server's SSL Certificate, use False to disable this process. - # enable_IPv6 - Optional - Boolean - Change to 'true' if you are using IPv6 connection. + # url - Required - String - The IP / Hostname of the Timbr platform. + # ontology - Required - String - The ontology / knowledge graph to connect to. + # token - Required - String - Timbr token value or JWT token value. Note: If you are using JWT token, you need to set the is_jwt parameter to True. + # query - Required - String - The query that you want to execute. + # datasource - Optional - String - Add the specific datasource name that you want to query from, the default value is the current active datasource of your ontology. + # nested - Optional - String - Change to 'true' if nested flag needs to be enabled. make sure this flag contains string value not bool value. + # verify_ssl - Optional - Boolean - Verifying the target server's SSL Certificate, use False to disable this process. + # enable_IPv6 - Optional - Boolean - Change to 'true' if you are using IPv6 connection. + # is_jwt - Optional - Boolean - Set to True if you are using JWT token, otherwise set to False. + # jwt_tenant_id - Optional - String - The tenant ID for JWT authentication ``` ### HTTP example @@ -69,6 +71,22 @@ This project is a pure python connector to timbr (no dependencies required). ) ``` +### HTTP example - Using JWT token +```python + response = timbr.run_query( + url = "http://mytimbrenv.com:11000", + ontology = "my_ontology", + token = "tk_mytimbrtoken", + query = "SELECT * FROM timbr.sys_concepts", + datasource = "my_datasource", + nested = "false", + verify_ssl = False, + enable_IPv6 = False, + is_jwt = True, + jwt_tenant_id = "my_tenant_id", + ) +``` + ### HTTPS example ```python pytimbr_api.run_query( From 85babda4264355dc41774ae181b7967c0cedd1cd Mon Sep 17 00:00:00 2001 From: Dor Eliyahu <80757492+DorEliyahu176@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:26:27 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index db0092e..fc38472 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This project is a pure python connector to timbr (no dependencies required). ## Installation - Install as clone repository: - - Install Python: https://www.python.org/downloads/release/python-3713/ + - Install Python: https://www.python.org/downloads/release/python-3913/ - Install using pip and git: - `pip install git+https://github.com/WPSemantix/timbr_python_http` @@ -57,7 +57,9 @@ This project is a pure python connector to timbr (no dependencies required). # jwt_tenant_id - Optional - String - The tenant ID for JWT authentication ``` -### HTTP example +### Using Timbr token + +#### HTTP example ```python pytimbr_api.run_query( url = "http://mytimbrenv.com:11000", @@ -71,9 +73,25 @@ This project is a pure python connector to timbr (no dependencies required). ) ``` -### HTTP example - Using JWT token +#### HTTPS example ```python - response = timbr.run_query( + pytimbr_api.run_query( + url = "https://mytimbrenv.com:443", + ontology = "my_ontology", + token = "tk_mytimbrtoken", + query = "SELECT * FROM timbr.sys_concepts", + datasource = "my_datasource", + nested = "false", + verify_ssl = True, + enable_IPv6 = False, + ) +``` + +### Using JWT token + +#### HTTP example +```python + pytimbr_api.run_query( url = "http://mytimbrenv.com:11000", ontology = "my_ontology", token = "tk_mytimbrtoken", @@ -87,10 +105,10 @@ This project is a pure python connector to timbr (no dependencies required). ) ``` -### HTTPS example +#### HTTPS example ```python pytimbr_api.run_query( - url = "https://mytimbrenv.com:443", + url = "https://mytimbrenv.com:11000", ontology = "my_ontology", token = "tk_mytimbrtoken", query = "SELECT * FROM timbr.sys_concepts", @@ -98,11 +116,16 @@ This project is a pure python connector to timbr (no dependencies required). nested = "false", verify_ssl = True, enable_IPv6 = False, + is_jwt = True, + jwt_tenant_id = "my_tenant_id", ) ``` ## Execute query examples -### HTTP connection + +### Using Timbr token + +#### HTTP connection ```python response = pytimbr_api.run_query( url = "http://mytimbrenv.com:11000", @@ -117,7 +140,7 @@ This project is a pure python connector to timbr (no dependencies required). print(response) ``` -### HTTPS connection +#### HTTPS connection ```python response = pytimbr_api.run_query( url = "https://mytimbrenv.com:443", @@ -131,3 +154,39 @@ This project is a pure python connector to timbr (no dependencies required). ) print(response) ``` + +### Using JWT token + +#### HTTP example +```python + response = pytimbr_api.run_query( + url = "http://mytimbrenv.com:11000", + ontology = "my_ontology", + token = "tk_mytimbrtoken", + query = "SELECT * FROM timbr.sys_concepts", + datasource = "my_datasource", + nested = "false", + verify_ssl = False, + enable_IPv6 = False, + is_jwt = True, + jwt_tenant_id = "my_tenant_id", + ) + print(response) +``` + +#### HTTPS example +```python + response = pytimbr_api.run_query( + url = "https://mytimbrenv.com:11000", + ontology = "my_ontology", + token = "tk_mytimbrtoken", + query = "SELECT * FROM timbr.sys_concepts", + datasource = "my_datasource", + nested = "false", + verify_ssl = True, + enable_IPv6 = False, + is_jwt = True, + jwt_tenant_id = "my_tenant_id", + ) + print(response) +```