DSMS Config Schema#
The Configuration class for the DSMS Python SDK is designed to handle various settings required to connect and interact with a DSMS instance. This documentation provides a detailed overview of the configurable properties, their types, defaults, and descriptions.
This section describes the configuration properties for the DSMS Python SDK.
Configuration Fields#
Field Name |
Description |
Type |
Default |
Property Namespace |
Required/Optional |
Environment Variable |
|---|---|---|---|---|---|---|
Host URL |
URL of the DSMS instance to connect. |
|
Not Applicable |
|
Required |
|
Request timeout |
Timeout in seconds until the request to the DSMS is timed out. |
|
|
|
Optional |
|
SSL verify |
Whether the SSL of the DSMS shall be verified during connection. |
|
|
|
Optional |
|
Username |
User name for connecting to the DSMS instance |
|
|
|
Optional |
|
Password |
Password for connecting to the DSMS instance |
|
|
|
Optional |
|
Token |
JWT bearer token for connecting to the DSMS instance |
|
|
|
Optional |
|
Ping DSMS |
Check whether the host is a DSMS instance or not. |
|
|
|
Optional |
|
Auto fetch KTypes |
Whether the KTypes of the DSMS should be fetched automatically when the session is started. They will be fetched if requested and cached in memory. |
|
|
|
Optional |
|
Always refetch KTypes |
Whether the KTypes of the DSMS should be refetched every time used in the SDK. This can be helpful if the SDK is integrated in a service and the KTypes are updated. |
|
|
|
Optional |
|
Strict validation |
Whether the validation of custom properties shall be strict. Disabling this might be helpful when, for example, the schema of a KType has been changed and the custom properties are not compatible anymore and should be updated accordingly. |
|
|
|
Optional |
|
Enable auto reauth |
Whether to automatically reauthenticate with username and password when the token is expired. |
|
|
|
Optional |
|
Encoding |
General encoding to be used for reading/writing serializations. |
|
|
|
Optional |
|
Datetime format |
Datetime format used in the DSMS instance. |
|
|
|
Optional |
|
KItem repository |
Repository of the triplestore for KItems in the DSMS |
|
|
|
Optional |
|
SPARQL Object for units |
Class and Module specification in order to retrieve the units. |
|
|
|
Optional |
|
Individual Slugs |
When set to |
|
|
|
Optional |
|
Display units |
Whether the custom properties or the dataframe columns shall directly reveal their unit when printed. WARNING: This might lead to performance issues. |
|
|
|
Optional |
|
Autocomplete units |
When a unit is fetched but does not hold a symbol next to its URI, it shall be fetched from the respective ontology (which is general side effect from the |
|
|
|
Optional |
|
QUDT units |
URI of the QUDT unit ontology |
|
|
|
Optional |
|
QUDT Quantity Kinds |
URI of the QUDT quantity kind ontology |
|
|
|
Optional |
|
Hide properties |
Properties to hide while printing, e.g |
|
|
|
Optional |
|
Log level |
Logging level |
|
|
|
Optional |
|
Example Usage#
from dsms import DSMS
config = DSMS(
host_url="https://dsms.example.com",
request_timeout=30,
ssl_verify=True,
username="****",
password="****",
token=None,
ping_dsms=True,
individual_slugs=True,
encoding="utf-8",
datetime_format="%Y-%m-%dT%H:%M:%S.%f",
display_units=False,
autocomplete_units=True,
kitem_repo="knowledge-items",
qudt_units="http://qudt.org/2.1/vocab/unit",
qudt_quantity_kinds="http://qudt.org/vocab/quantitykind/",
units_sparql_object="dsms.knowledge.semantics.units.sparql:UnitSparqlQuery",
hide_properties={"external_links"},
log_level="INFO",
)
print(dsms.config)