@Test public void testShorten1() { ShortnameService sns = stubShortNameService(); ShortNameRenderer snr = new ShortNameRenderer( sns, null ); assertEquals( "name_p", snr.shorten( "http: assertEquals( "_foo", snr.shorten( "http: }
public String shorten( String uri, boolean memoise ) { String shortName = lookupURI( uri ); if (shortName == null) { shortName = shortForm( uri ); if (!shortName.equals( uri ) && memoise) { addShortName( shortForm( uri ), uri ); } } return shortName; }
ShortNameRenderer { public String shorten( String uri, boolean memoise ) { String shortName = lookupURI( uri ); if (shortName == null) { shortName = shortForm( uri ); if (!shortName.equals( uri ) && memoise) { addShortName( shortForm( uri ), uri ); } } return shortName; } }
ShortNameRenderer { public String shorten( String uri, boolean memoise ) { String shortName = lookupURI( uri ); if (shortName == null) { shortName = shortForm( uri ); if (!shortName.equals( uri ) && memoise) { addShortName( shortForm( uri ), uri ); } } return shortName; } ShortNameRenderer( ShortnameService sns, Iterable<Binding<Resource>> bindings ); }
ShortNameRenderer { public String shorten( String uri, boolean memoise ) { String shortName = lookupURI( uri ); if (shortName == null) { shortName = shortForm( uri ); if (!shortName.equals( uri ) && memoise) { addShortName( shortForm( uri ), uri ); } } return shortName; } ShortNameRenderer( ShortnameService sns, Iterable<Binding<Resource>> bindings ); ShortnameService shortNameService(); ShortnameService shortNameService( boolean required ); boolean isDatatype( String type ); Resource asResource( RDFNode r ); Resource asResource( String s ); String expand( String shortName ); String shorten( String uri, boolean memoise ); String shorten( String uri ); boolean hasShortNameService(); boolean isKnownShortnamePath( String path ); }
ShortNameRenderer { public String shorten( String uri, boolean memoise ) { String shortName = lookupURI( uri ); if (shortName == null) { shortName = shortForm( uri ); if (!shortName.equals( uri ) && memoise) { addShortName( shortForm( uri ), uri ); } } return shortName; } ShortNameRenderer( ShortnameService sns, Iterable<Binding<Resource>> bindings ); ShortnameService shortNameService(); ShortnameService shortNameService( boolean required ); boolean isDatatype( String type ); Resource asResource( RDFNode r ); Resource asResource( String s ); String expand( String shortName ); String shorten( String uri, boolean memoise ); String shorten( String uri ); boolean hasShortNameService(); boolean isKnownShortnamePath( String path );  }