Dontopedia

expand_query

From Dontopedia, the open, paraconsistent wiki. (Last updated 2026-06-10.)

expand_query has 103 facts recorded in Dontopedia across 10 references, with 19 live disagreements.

103 facts·54 predicates·10 sources·19 in dispute

Mostly:rdf:type(9), returns(6), combines(4)

Maturity scale raw canonical shape-checked rule-derived certified

Inbound mentions (27)

Other subjects in dontopedia point AT this entity as a value. These are inverse relationships — e.g. "X motherOf this subject" — and answer questions the forward facts can't. Grouped by predicate.

hasMethodHas Method(6)

usedInUsed in(6)

invokedByInvoked by(3)

containsFunctionContains Function(2)

addressesAddresses(1)

appliesToApplies to(1)

callsCalls(1)

callsMethodCalls Method(1)

definesDefines(1)

definesFunctionDefines Function(1)

describesDescribes(1)

isAlsoKnownAsIs Also Known As(1)

isDistinctFromIs Distinct From(1)

mayBeSynonymousWithMay Be Synonymous With(1)

Other facts (99)

The long tail: predicates that appear too rarely to warrant their own section. Filter or scroll to find a specific one. Each row links to its source.

99 facts
PredicateValueRef
Rdf:typeFunction[1]
Rdf:typeFunction[2]
Rdf:typeFunction[3]
Rdf:typeMethod[5]
Rdf:typeMethod[6]
Rdf:typeMethod[7]
Rdf:typeMethod[8]
Rdf:typePython Method[9]
Rdf:typeMethod[10]
Returnsexpanded-query[3]
ReturnsExpanded Query[4]
ReturnsQuery[5]
ReturnsString[8]
ReturnsQuery[10]
ReturnsTransformed Query[10]
Combinestokens[3]
Combinesentities[3]
Combinesfiltered-synonyms[3]
Combinesmwe-matches[3]
Has ParameterQuery[5]
Has ParameterQuery Param[8]
Has ParameterSelf[10]
Has ParameterQuery[10]
Execution Order1[7]
Execution Order2[7]
Execution Order3[7]
Execution Ordersanitize → keyword_substitution → pattern_matching → contextual_expansion[10]
Calls MethodSanitize Query[10]
Calls MethodApply Keyword Substitution[10]
Calls MethodApply Pattern Matching[10]
Calls MethodApply Contextual Expansion[10]
Calls in OrderSanitize Query[10]
Calls in OrderApply Keyword Substitution[10]
Calls in OrderApply Pattern Matching[10]
Calls in OrderApply Contextual Expansion[10]
Purposequery-expansion[3]
PurposeChain Techniques[6]
PurposeApplies Techniques Sequentially[7]
Executes in Orderfilter-synonyms-step[3]
Executes in Ordermatch-mwe-step[3]
Executes in Ordercombine-step[3]
Chains TechniqueApply Keyword Substitution[7]
Chains TechniqueApply Pattern Matching[7]
Chains TechniqueApply Contextual Expansion[7]
InvokesApply Keyword Substitution[7]
InvokesApply Pattern Matching[7]
InvokesApply Contextual Expansion[7]
Invocation Sequence1[7]
Invocation Sequence2[7]
Invocation Sequence3[7]
ParameterQuery[1]
Parameterquery[3]
PerformsTokenization[1]
PerformsEntity Recognition[1]
CallsNltk Tokenize[1]
CallsSpacy Nlp[1]
Uses Data Structureset[3]
Uses Data Structurelist[3]
Applied tonatural-language-processing[3]
Applied tomachine-learning[3]
Converts toset-data-structure[3]
Converts tolist-data-structure[3]
Has BodyIncomplete[8]
Has BodyEmpty Body[8]
Inverse ofQuery Parameter[1]
InputQuery String[2]
OutputSynonyms List[2]
Filters Synonyms byword-count[3]
Processesdocument[3]
Extractsmulti-word-expressions[3]
Has Return Valueexpanded-query[3]
Takes ArgumentQuery[4]
ImprovesSearch Relevance[4]
UsesRe Sub[5]
Iterates OverRules[5]
AssignsPattern[5]
Is Also Known AsRewrite Query[5]
Uses ModuleRe Module[5]
Uses Regular Expressionstrue[5]
Applies Rules Sequentiallytrue[5]
Applies Techniques Sequentiallytrue[6]
AppliesTechniques[6]
Uses Execution OrderSequential Application[6]
EnablesQuery Transformation[6]
CoordinatesAll Techniques[6]
EnforcesSequential Order[6]
Implemented inQuery Rewriter[7]
Is Method ofQuery Rewriter[7]
Data FlowSequential Technique Application[7]
Composition PatternComposite Method[7]
Is Implemented inQuery Rewriter[8]
Is Called byRewrite Query[8]
Is Incompletetrue[8]
Is Publictrue[8]
Parameter Count2[8]
Is Method Body Emptytrue[8]
Is Method Incompletetrue[8]
Has Ellipsis Bodytrue[8]
Called byRewrite Query[9]

Timeline

Timeline axis is valid_time — when each source says the fact was true in the world, not when Dontopedia learned about it. Retracted rows are kept for provenance; coloured stripes indicate the context kind.

typebeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:Function
labelbeam/b438bfff-866b-4889-95b0-033946ccfb13
expand_query
parameterbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:query
performsbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:tokenization
performsbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:entity-recognition
inverseOfbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:query-parameter
callsbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:nltk-tokenize
callsbeam/b438bfff-866b-4889-95b0-033946ccfb13
ex:spacy-nlp
typebeam/6f825f15-5c97-4244-84f2-e40ee078d6ae
ex:Function
inputbeam/6f825f15-5c97-4244-84f2-e40ee078d6ae
ex:query-string
outputbeam/6f825f15-5c97-4244-84f2-e40ee078d6ae
ex:synonyms-list
typebeam/1a51d867-7928-4726-90bc-381cb7667092
ex:Function
parameterbeam/1a51d867-7928-4726-90bc-381cb7667092
query
returnsbeam/1a51d867-7928-4726-90bc-381cb7667092
expanded-query
filtersSynonymsBybeam/1a51d867-7928-4726-90bc-381cb7667092
word-count
usesDataStructurebeam/1a51d867-7928-4726-90bc-381cb7667092
set
usesDataStructurebeam/1a51d867-7928-4726-90bc-381cb7667092
list
processesbeam/1a51d867-7928-4726-90bc-381cb7667092
document
extractsbeam/1a51d867-7928-4726-90bc-381cb7667092
multi-word-expressions
combinesbeam/1a51d867-7928-4726-90bc-381cb7667092
tokens
combinesbeam/1a51d867-7928-4726-90bc-381cb7667092
entities
combinesbeam/1a51d867-7928-4726-90bc-381cb7667092
filtered-synonyms
combinesbeam/1a51d867-7928-4726-90bc-381cb7667092
mwe-matches
purposebeam/1a51d867-7928-4726-90bc-381cb7667092
query-expansion
appliedTobeam/1a51d867-7928-4726-90bc-381cb7667092
natural-language-processing
appliedTobeam/1a51d867-7928-4726-90bc-381cb7667092
machine-learning
executesInOrderbeam/1a51d867-7928-4726-90bc-381cb7667092
filter-synonyms-step
executesInOrderbeam/1a51d867-7928-4726-90bc-381cb7667092
match-mwe-step
executesInOrderbeam/1a51d867-7928-4726-90bc-381cb7667092
combine-step
hasReturnValuebeam/1a51d867-7928-4726-90bc-381cb7667092
expanded-query
convertsTobeam/1a51d867-7928-4726-90bc-381cb7667092
set-data-structure
convertsTobeam/1a51d867-7928-4726-90bc-381cb7667092
list-data-structure
takes-argumentbeam/41f0e371-afe4-455b-9a40-2242af7222b0
ex:query
returnsbeam/41f0e371-afe4-455b-9a40-2242af7222b0
ex:expanded-query
improvesbeam/41f0e371-afe4-455b-9a40-2242af7222b0
ex:search-relevance
typebeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:Method
hasParameterbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:query
returnsbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:query
usesbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:re-sub
iteratesOverbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:rules
assignsbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:pattern
isAlsoKnownAsbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:rewrite-query
usesModulebeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
ex:re-module
usesRegularExpressionsbeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
true
appliesRulesSequentiallybeam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
true
typebeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:Method
labelbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
expand_query
purposebeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:chain-techniques
appliesTechniquesSequentiallybeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
true
appliesbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:techniques
usesExecutionOrderbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:sequential-application
enablesbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:query-transformation
coordinatesbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:all-techniques
enforcesbeam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
ex:sequential-order
typebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:Method
labelbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
expand_query
implementedInbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:query-rewriter
chainsTechniquebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-keyword-substitution
chainsTechniquebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-pattern-matching
chainsTechniquebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-contextual-expansion
purposebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:applies-techniques-sequentially
executionOrderbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
1
executionOrderbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
2
executionOrderbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
3
isMethodOfbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:query-rewriter
invokesbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-keyword-substitution
invokesbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-pattern-matching
invokesbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:apply-contextual-expansion
dataFlowbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:sequential-technique-application
invocationSequencebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
1
invocationSequencebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
2
invocationSequencebeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
3
compositionPatternbeam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
ex:composite-method
typebeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:Method
hasParameterbeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:query-param
returnsbeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:string
isImplementedInbeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:query-rewriter
isCalledBybeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:rewrite-query
isIncompletebeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
true
hasBodybeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:incomplete
isPublicbeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
true
hasBodybeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
ex:empty-body
parameterCountbeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
2
isMethodBodyEmptybeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
true
isMethodIncompletebeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
true
hasEllipsisBodybeam/b75dfd8f-8843-48b6-a51b-7bca94983b62
true
typebeam/ac826f8e-c61d-42f2-a68f-f348f50ad7c5
ex:PythonMethod
calledBybeam/ac826f8e-c61d-42f2-a68f-f348f50ad7c5
ex:rewrite-query
typebeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:Method
labelbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
expand_query
hasParameterbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:self
hasParameterbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:query
callsMethodbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:sanitize-query
callsMethodbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-keyword-substitution
callsMethodbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-pattern-matching
callsMethodbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-contextual-expansion
returnsbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:query
executionOrderbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
sanitize → keyword_substitution → pattern_matching → contextual_expansion
callsInOrderbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:sanitize-query
callsInOrderbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-keyword-substitution
callsInOrderbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-pattern-matching
callsInOrderbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:apply-contextual-expansion
returnsbeam/7b4bf2e3-60c1-4558-933c-d63455859bde
ex:transformed-query

References (10)

10 references
  1. ctx:claims/beam/b438bfff-866b-4889-95b0-033946ccfb13
    • full textbeam-chunk
      text/plain1 KBdoc:beam/b438bfff-866b-4889-95b0-033946ccfb13
      Show excerpt
      ``` ### Summary By refactoring the code to use a set for lookups and building a new string from a list of tokens, you can significantly improve performance. Additionally, consider batch processing and parallel processing techniques for la
  2. ctx:claims/beam/6f825f15-5c97-4244-84f2-e40ee078d6ae
    • full textbeam-chunk
      text/plain1 KBdoc:beam/6f825f15-5c97-4244-84f2-e40ee078d6ae
      Show excerpt
      - **Contextual Relevance**: Consider using a context-aware approach to filter synonyms based on the context of the query. - **Dependency Parsing**: Use dependency parsing to better understand the relationships between words in the query. #
  3. ctx:claims/beam/1a51d867-7928-4726-90bc-381cb7667092
    • full textbeam-chunk
      text/plain1016 Bdoc:beam/1a51d867-7928-4726-90bc-381cb7667092
      Show excerpt
      # Filter out irrelevant synonyms filtered_synonyms = set(synonyms) for synonym in synonyms: if len(synonym.split()) > 1: filtered_synonyms.remove(synonym) # Match multi-word expressions matc
  4. ctx:claims/beam/41f0e371-afe4-455b-9a40-2242af7222b0
  5. ctx:claims/beam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
    • full textbeam-chunk
      text/plain1 KBdoc:beam/2446c55d-3e7d-4dce-b1a2-10ccc35b4cca
      Show excerpt
      def expand_query(self, query): for pattern, replacement in self.rules: query = re.sub(pattern, replacement, query) return query # Example usage: rewriter = QueryRewriter() query = "SELECT * FROM table WHERE
  6. ctx:claims/beam/fe1ff925-6e8a-431d-aa01-2d4b499ae7e2
  7. ctx:claims/beam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
    • full textbeam-chunk
      text/plain1 KBdoc:beam/ea0e817a-1408-493e-bbcf-6f0c90a888ee
      Show excerpt
      # Example usage: rewriter = QueryRewriter() query = "SELECT * FROM table WHERE condition AND column = value" rewritten_query = rewriter.rewrite_query(query) print(f"Rewritten Query: {rewritten_query}") ``` ### Explanation 1. **Keyword Sub
  8. ctx:claims/beam/b75dfd8f-8843-48b6-a51b-7bca94983b62
  9. ctx:claims/beam/ac826f8e-c61d-42f2-a68f-f348f50ad7c5
    • full textbeam-chunk
      text/plain1 KBdoc:beam/ac826f8e-c61d-42f2-a68f-f348f50ad7c5
      Show excerpt
      def apply_contextual_expansion(self, query): for context, expansion in self.contextual_expansions.items(): query = re.sub(r'\b' + re.escape(context) + r'\b', expansion, query) return query def process_qu
  10. ctx:claims/beam/7b4bf2e3-60c1-4558-933c-d63455859bde
    • full textbeam-chunk
      text/plain1 KBdoc:beam/7b4bf2e3-60c1-4558-933c-d63455859bde
      Show excerpt
      raise QueryParseError(f"Error rewriting query: {query} - {e}") def expand_query(self, query): query = self.sanitize_query(query) query = self.apply_keyword_substitution(query) query = self.apply_patt

See also

Keep researching

Missing something or suspicious of what's here? Kick off a research session — a Claude agent will investigate, cite its sources, and file new facts into a dedicated context you can review before accepting into the shared view.