Java tutorial
//package com.java2s; public class Main { /** * This method will extract a type from an URI. * * This is a helper like extractFragment (see python sources) that * works just a little different but should suit our needs. * * @param typeUri The URI containing the type (or the type itself) * @return A type (extracted from the URI or left unchanged) */ public static String extractTypeFromURI(String typeUri) { String[] f = typeUri.split("#"); if (f == null || f.length < 2) return typeUri; else return f[1]; } }