public function &getNonDimensionalRoleRefs( $filter = array(), $sort = true )
	{
		// Make sure the filter is initialized and contains lowercase values
		if ( ! is_array( $filter ) ) $filter = array();
		$filter = array_flip( array_map( 'strtolower', $filter ) );

		$refs = $this->context->nonDimensionalRoleRefs;

		/**
		 * @var array $result
		 */
		$result = array();

		foreach ( $refs as $refKey => $ref )
		{
			// Apply the filter if one is provided
			if ( count( $filter ) && ! isset( $filter[ strtolower( $refKey ) ] ) ) continue;

			$result[ $refKey ] = $this->context->nonDimensionalRoleRefs[ $refKey ];
			foreach ( $result[ $refKey ] as $arcroleKey => $arcrole )
			{
				// If the acrole type is defined, get the cycles allowed otherwise set it to be 'none'
				$arcRoleTaxonomy = $this->getTaxonomyForXSD( $arcrole['href'] );
				$arcRoleRefs = $arcRoleTaxonomy ? $arcRoleTaxonomy->getArcroleTypes() : false;
				if ( $arcRoleRefs && isset( $arcRoleRefs['link:definitionArc'][ $arcroleKey ] ) )
				{
					$arcRoleRef = $arcRoleRefs['link:definitionArc'][ $arcroleKey ];
					$result[ $refKey ][ $arcroleKey ]['text'] = isset( $arcRoleRef['description'] ) ? $arcRoleRef['description'] : "";
					$result[ $refKey ][ $arcroleKey ]['cyclesAllowed'] = isset( $arcRoleRef['cyclesAllowed'] ) ? $arcRoleRef['cyclesAllowed'] : "none";
				}
				else
				{
					$result[ $refKey ][ $arcroleKey ]['text'] = "";
					$result[ $refKey ][ $arcroleKey ]['cyclesAllowed'] = "none";
				}

				// Add the description
				$description = $arcRoleTaxonomy->getNonDimensionalArcRoleDescription( $arcroleKey );
				$result[ $refKey ][ $arcroleKey ]['text'] = $description ? $description : "";

				// Remove any prohibited arcs
				if ( isset( $result[ $refKey ][ $arcroleKey ]['arcs'] ) && count( $result[ $refKey ][ $arcroleKey ]['arcs'] ) )
				{
					$arcs =& $result[ $refKey ][ $arcroleKey ]['arcs'];
					foreach ( $arcs as $from => $targets )
					{
						foreach ( $targets as $to => $node )
						{
							if ( $node['use'] == XBRL_Constants::$xlinkUseOptional ) continue;
							unset( $arcs[ $from ][ $to ] );
						}

						if ( count( $arcs[ $from ] ) ) continue;
						unset( $arcs[ $from ] );
					}
				}
			}

			if ( $sort )
			{
				$this->sortRoleRefs( $result[ $refKey ] );
			}

		}

		return $result;
	}