Zum Inhalt

textsearch

dsstools.textsearch

This module allows for text search in graph nodes.

TextSearch

Bases: WDCGeneric

Class allowing to search for keywords in the WDC API.

token property writable

Get the password token.

__init__(identifier=None, *, token=None, api='https://dss-wdc.wiso.uni-hamburg.de/api', insecure=False, timeout=60, params=None)

Base class for interacting with the WDC API.

Parameters:

Name Type Description Default
identifier Optional[str]

Identifier of the network data.

None
token Optional[str]

Token for authorization.

None
api str

API address to send request to. Leave this as is.

'https://dss-wdc.wiso.uni-hamburg.de/api'
insecure bool

Hide warning regarding missing https.

False
timeout int

Set the timeout to the server. Increase this if you request large networks.

60
params Optional[dict]

These are additional keyword arguments passed onto the API endpoint. See https://dss-wdc.wiso.uni-hamburg.de/#_complex_datatypes_for_the_api_requests for further assistance.

None

search(domains, terms, exact=True)

Searches the given keywords across a Graph or iterator.

Parameters:

Name Type Description Default
domains Graph | list

Set of identifiers to search in.

required
terms list[str]

Terms to search for.

required

Returns:

Type Description

Updated graph or dict containing the responses, Set of all failed

responses