static String getPrefix(final String uri) {
        final String tmp = uri.substring(0, uri.indexOf("#"));
        return tmp.substring(tmp.lastIndexOf("/") + 1);
    }
Helper methods for working with prefix lines in SPARQL queries.
sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java