/// <summary> /// Sets the Group Context for the Binder /// </summary> /// <param name="accessContents">Whether you want to access the Group Contents or the Groups themselves</param> public override void SetGroupContext(bool accessContents) { if (accessContents) { if (this._context.InputMultiset is GroupMultiset) { this._groupSet = (GroupMultiset)this._context.InputMultiset; this._context.InputMultiset = this._groupSet.Contents; } else { throw new RdfQueryException("Cannot set Group Context to access Contents data when the Input is not a Group Multiset"); } } else { if (this._groupSet != null) { this._context.InputMultiset = this._groupSet; this._groupSet = null; } else { throw new RdfQueryException("Cannot set Group Context to acess Group data when there is no Group data available"); } } }
/// <summary> /// Sets the Group Context for the Binder /// </summary> /// <param name="accessContents">Whether you want to access the Group Contents or the Groups themselves</param> public override void SetGroupContext(bool accessContents) { if (accessContents) { if (this._context.InputMultiset is GroupMultiset) { this._groupSet = (GroupMultiset)this._context.InputMultiset; this._context.InputMultiset = this._groupSet.Contents; } else { throw new RdfQueryException("Cannot set Group Context to access Contents data when the Input is not a Group Multiset, you may be trying to use a nested aggregate which is illegal"); } } else { if (this._groupSet != null) { this._context.InputMultiset = this._groupSet; this._groupSet = null; } else { throw new RdfQueryException("Cannot set Group Context to acess Group data when there is no Group data available"); } } }
/// <summary> /// Returns the Group with the given ID /// </summary> /// <param name="groupID">Group ID</param> /// <returns></returns> public override BindingGroup Group(int groupID) { if (this._context.InputMultiset is GroupMultiset) { GroupMultiset groupSet = (GroupMultiset)this._context.InputMultiset; return(groupSet.Group(groupID)); } else { throw new RdfQueryException("Cannot retrieve a Group when the Input Multiset is not a Group Multiset"); } }