Skip to content

Commit

Permalink
FIX ensure to skip tricky empty federations
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesalvo committed Jun 1, 2020
1 parent 2b66b81 commit ce67521
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RDFSharp/Query/Mirella/RDFQueryEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ internal RDFSelectQueryResult EvaluateSelectQuery(RDFSelectQuery selectQuery, RD
//Step 1: Get the intermediate result tables of the pattern group
if (datasource.IsFederation())
{
//Ensure to skip tricky empty federations
if (((RDFFederation)datasource).DataSourcesCount == 0)
{
fedQueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
QueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
}

#region TrueFederations
foreach (RDFDataSource fedDataSource in (RDFFederation)datasource)
Expand Down Expand Up @@ -211,6 +217,12 @@ internal RDFDescribeQueryResult EvaluateDescribeQuery(RDFDescribeQuery describeQ
//Step 1: Get the intermediate result tables of the pattern group
if (datasource.IsFederation())
{
//Ensure to skip tricky empty federations
if (((RDFFederation)datasource).DataSourcesCount == 0)
{
fedQueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
QueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
}

#region TrueFederations
foreach (RDFDataSource fedDataSource in (RDFFederation)datasource)
Expand Down Expand Up @@ -386,6 +398,12 @@ internal RDFConstructQueryResult EvaluateConstructQuery(RDFConstructQuery constr
//Step 1: Get the intermediate result tables of the pattern group
if (datasource.IsFederation())
{
//Ensure to skip tricky empty federations
if (((RDFFederation)datasource).DataSourcesCount == 0)
{
fedQueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
QueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
}

#region TrueFederations
foreach (RDFDataSource fedDataSource in (RDFFederation)datasource)
Expand Down Expand Up @@ -508,6 +526,12 @@ internal RDFAskQueryResult EvaluateAskQuery(RDFAskQuery askQuery, RDFDataSource
//Step 1: Get the intermediate result tables of the pattern group
if (datasource.IsFederation())
{
//Ensure to skip tricky empty federations
if (((RDFFederation)datasource).DataSourcesCount == 0)
{
fedQueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
QueryMemberTemporaryResultTables.Add(evaluableQueryMember.QueryMemberID, new List<DataTable>());
}

#region TrueFederations
foreach (RDFDataSource fedDataSource in (RDFFederation)datasource)
Expand Down

0 comments on commit ce67521

Please sign in to comment.