public function extractPrefixesFromQuery($query)
    {
        preg_match_all('/PREFIX\s+([a-z0-9]+)\:\s*\<([a-z0-9\:\/\.\#\-]+)\>/', $query, $matches);

        $prefixes = [];

        foreach ($matches[1] as $index => $key) {
            $prefixes[$key] = $matches[2][$index];
        }

        return $prefixes;
    }