search_query.wos.linter
Web-of-Science query linter.
Classes
|
|
|
Linter for WOS Query Strings |
- class search_query.wos.linter.WOSQueryListLinter(parser: search_query.wos.parser.WOSListParser, string_parser_class: Type[search_query.wos.parser.WOSParser])
Bases:
QueryListLinter
- validate_list_tokens() None
Lint the list parser.
- class search_query.wos.linter.WOSQueryStringLinter(query_str: str = '')
Bases:
QueryStringLinter
Linter for WOS Query Strings
- DOI_VALUE_REGEX = re.compile('^10\\.\\d{4,9}/[-._;()/:A-Z0-9]+$', re.IGNORECASE)
- ISBN_VALUE_REGEX = re.compile('^(?:\\d{1,5}-\\d{1,7}-\\d{1,7}-[\\dX]|\\d{3}-\\d{1,5}-\\d{1,7}-\\d{1,7}-\\d{1})$', re.IGNORECASE)
- ISSN_VALUE_REGEX = re.compile('^\\d{4}-\\d{3}[\\dX]$', re.IGNORECASE)
- PLATFORM: <PLATFORM.WOS: 'wos'> = 'wos'
- VALID_FIELDS_REGEX: re.Pattern = re.compile('ab=|abstract=|la=|language=|ad=|address=|all=|all fields=|ai=|author identifiers=|ak=|author keywords=|au=|author=|cf=|conference=|ci=|city=|cu=|country/region=|do=|doi=|ed=|editor=|fg=|grant number=, re.IGNORECASE)
- VALID_TOKEN_SEQUENCES = {TokenTypes.FIELD: [TokenTypes.SEARCH_TERM, TokenTypes.PARENTHESIS_OPEN], TokenTypes.LOGIC_OPERATOR: [TokenTypes.SEARCH_TERM, TokenTypes.FIELD, TokenTypes.PARENTHESIS_OPEN], TokenTypes.PARENTHESIS_CLOSED: [TokenTypes.PARENTHESIS_CLOSED, TokenTypes.LOGIC_OPERATOR, TokenTypes.PROXIMITY_OPERATOR], TokenTypes.PARENTHESIS_OPEN: [TokenTypes.FIELD, TokenTypes.SEARCH_TERM, TokenTypes.PARENTHESIS_OPEN], TokenTypes.PROXIMITY_OPERATOR: [TokenTypes.SEARCH_TERM, TokenTypes.PARENTHESIS_OPEN, TokenTypes.FIELD], TokenTypes.SEARCH_TERM: [TokenTypes.SEARCH_TERM, TokenTypes.LOGIC_OPERATOR, TokenTypes.PROXIMITY_OPERATOR, TokenTypes.PARENTHESIS_CLOSED]}
- WILDCARD_CHARS = ['?', '$', '*']
- YEAR_VALUE_REGEX = re.compile('^\\d{4}(-\\d{4})?$')
- check_format_left_hand_wildcards(query: Query) None
Check for wrong usage among left-hand wildcards in the search string.
- check_implicit_near() None
Check for implicit NEAR operator.
- check_invalid_syntax() None
Check for invalid syntax in the query string.
- check_invalid_token_sequences() None
Check for the correct order of tokens in the query.
- check_search_fields_general() None
Check the general search field (from JSON).
- check_unsupported_right_hand_wildcards(query: Query, index: int) None
Check for unsupported right-hand wildcards in the search string.
- check_unsupported_wildcards(query: Query) None
Check for unsupported characters in the search string.
- check_year_without_search_terms(query: Query) None
Check if the year is used without a search terms.
- syntax_str_to_generic_search_field_set(field_value: str) set
Translate a search field