Methods for query answering over incomplete knowledge graphs retrieve entities that are likely to be answers, which is particularly useful when such answers cannot be reached by direct graph traversal due to missing edges. However, existing approaches have focused on queries formalized using first-order-logic. In practice, many real-world queries involve constraints that are inherently vague or context-dependent, such as preferences for attributes or related categories. Addressing this gap, we introduce the problem of query answering with soft constraints. We formalize the problem and introduce two efficient methods designed to adjust query answer scores by incorporating soft constraints without disrupting the original answers to a query. These methods are lightweight, requiring tuning only two parameters or a small neural network trained to capture soft constraints while maintaining the original ranking structure. To evaluate the task, we extend existing QA benchmarks by generating datasets with soft constraints. Our experiments demonstrate that our methods can capture soft constraints while maintaining robust query answering performance and adding very little overhead. With our work, we explore a new and flexible way to interact with graph databases that allows users to specify their preferences by providing examples interactively.
翻译:针对不完整知识图谱的查询问答方法能够检索出可能成为答案的实体,这在因缺失边而无法通过直接图遍历获得答案时尤为实用。然而现有方法主要聚焦于基于一阶逻辑形式化的查询。实践中,许多真实查询涉及本质模糊或依赖上下文的约束,例如对属性或相关类别的偏好。为解决这一差距,我们提出带软约束的查询问答问题。我们对问题进行形式化,并引入两种高效方法,通过融入软约束调整查询答案分数而不干扰原始查询结果。这些方法轻量级,仅需调整两个参数或训练一个捕捉软约束的小型神经网络,同时保持原始排序结构。为评估该任务,我们通过生成带软约束的数据集扩展了现有问答基准。实验表明,我们的方法能在保持稳健查询问答性能且几乎无额外开销的同时捕捉软约束。通过这项工作,我们探索了一种与图数据库交互的新灵活方式,允许用户通过交互式示例指定偏好。