We study the complexity of answer counting for ontology-mediated queries and for querying under constraints, considering conjunctive queries and unions thereof (UCQs) as the query language and guarded TGDs as the ontology and constraint language, respectively. Our main result is a classification according to whether answer counting is fixed-parameter tractable (FPT), W[1]-equivalent, #W[1]-equivalent, #W[2]-hard, or #A[2]-equivalent, lifting a recent classification for UCQs without ontologies and constraints due to Dell et al. The classification pertains to various structural measures, namely treewidth, contract treewidth, starsize, and linked matching number. Our results rest on the assumption that the arity of relation symbols is bounded by a constant and, in the case of ontology-mediated querying, that all symbols from the ontology and query can occur in the data (so-called full data schema). We also study the meta-problems for the mentioned structural measures, that is, to decide whether a given ontology-mediated query or constraint-query specification is equivalent to one for which the structural measure is bounded.
翻译:我们研究答案的复杂程度,以计算本体介质的查询和在限制下查询,将合并查询及其结合(UCQs)视为查询语言,将保守的TGD视为本体和约束语言。我们的主要结果是根据答案计数是否固定参数可移动(FPT)、W[1]-等效、#W[1]-等值、#W[2]-硬等值、#A[2]-等同、#A[2]-等同、取消最近对CEQ的分类,而没有因Dell 等人等而引起的原因和限制。分类涉及各种结构措施,即树线、合同树枝、恒星化和链接的对应数字。我们的结果依据的假设是,关系符号的对等性取决于一个常数,而就本体介质和查询的所有符号都可以在数据中出现(所谓的完整数据计划)。我们还研究上述结构措施的元问题,即决定一个结构定型的规格是否与一个结构定型的定型的矩。