Tabnine Logo
PrefixMapping.shortForm
Code IndexAdd Tabnine to your IDE (free)

How to use
shortForm
method
in
com.hp.hpl.jena.shared.PrefixMapping

Best Java code snippets using com.hp.hpl.jena.shared.PrefixMapping.shortForm (Showing top 18 results out of 315)

origin: com.hp.hpl.jena/arq

  /** Use the prefix map to turn a URI into a qname, or return the original URI */
  
  public String shortForm(String uri)
  {
    return prefixMap.shortForm(uri) ;
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  Answer a String representing the node, taking into account the PrefixMapping.
  The horrible test against null is a stopgap to avoid a circularity issue.
  TODO fix the circularity issue
*/
@Override
public String toString( PrefixMapping pm, boolean quoting )
  { return pm == null ? (String) label : pm.shortForm( (String) label ); }
  
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

/** Use the prefix map to turn a URI into a qname, or return the original URI */

public String shortForm(String uri)
{
  return prefixMap.shortForm(uri) ;
}

origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public String shortForm(String uri) {
  return this.prefixes.shortForm(uri);
}
origin: epimorphics/elda

protected String rangeType( PrefixMapping pm, String uri ) {
  if (uri == null) return "unspecified";
  return pm.shortForm( uri );    	
}
origin: epimorphics/elda

private String linkFor(PrefixMapping pm, String uri) {
  return "<a href='" + uri + "'>" + pm.shortForm( uri ) + "</a>";
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

/** @see com.hp.hpl.jena.shared.PrefixMapping#shortForm(java.lang.String) */
@Override
public String shortForm(String uri)
{
  String s = pmapLocal.shortForm(uri) ;
  if ( pmapGlobal == null )
    return s ;
  
  if ( s == null || s.equals(uri) )
    s = pmapGlobal.shortForm(uri) ;
  return s ;
}
origin: com.hp.hpl.jena/arq

/** @see com.hp.hpl.jena.shared.PrefixMapping#shortForm(java.lang.String) */
public String shortForm(String uri)
{
  String s = pmapLocal.shortForm(uri) ;
  if ( pmapGlobal == null )
    return s ;
  
  if ( s == null || s.equals(uri) )
    s = pmapGlobal.shortForm(uri) ;
  return s ;
}
origin: epimorphics/elda

public String forceShorten( String uri ) {
  String shorter = allPrefixes.shortForm( uri );
  return shorter.equals( uri ) ? null : shorter.replace( ':', '_' );
}
 
origin: epimorphics/elda

protected static String shortForm( PrefixMapping pm, Resource r ) {
  return pm.shortForm( r.getURI() );
}

origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override
public String shortForm( String uri )
{ return getPrefixMapping().shortForm( uri ); }
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  Compress the URI using the prefix mapping. This version of the code looks
  through all the maplets and checks each candidate prefix URI for being a
  leading substring of the argument URI. There's probably a much more
  efficient algorithm available, preprocessing the prefix strings into some
  kind of search table, but for the moment we don't need it.
*/
@Override public String shortForm( String uri )
  {
  String s = getBaseMapping().shortForm( uri );
  if (s.equals( uri ))
    {
    List<Graph> graphs = poly.getSubGraphs();
    for (int i = 0; i < graphs.size(); i += 1)
      {
      String ss = graphs.get(i).getPrefixMapping().shortForm( uri );
      if (!ss.equals( uri )) return ss;
      }
    }
  return s;
  }

origin: com.hp.hpl.jena/arq

  private void node(Node n)
  {
    if ( ! n.isURI() ) return ;
    String uri = n.getURI() ;
    
    if ( usedPMap.shortForm(uri) != uri )
      return ;
    
    for ( Iterator<Map.Entry<String, String>> iter = pmap.entrySet().iterator() ; iter.hasNext() ; )
    {
      Map.Entry<String, String> e = iter.next();
      String k = e.getKey() ;
      String v = e.getValue() ;
      
      if ( uri.startsWith(v) )
      {
        usedPMap.setNsPrefix(k, v) ;
        return ;
      }
    }
  }
}
origin: epimorphics/elda

protected void recordAltName(String uri, PrefixMapping pm) {
  // Note local name
  recordAltName( getLocalName(uri), uri );
  // Note prefixed name
  String sf = pm.shortForm(uri);
  if (!sf.equals( uri )) recordAltName( sf.replace(':', '_'), uri );
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

  private void node(Node n)
  {
    if ( ! n.isURI() ) return ;
    String uri = n.getURI() ;
    
    if ( usedPMap.shortForm(uri) != uri )
      return ;
    
    for ( Iterator<Map.Entry<String, String>> iter = pmap.entrySet().iterator() ; iter.hasNext() ; )
    {
      Map.Entry<String, String> e = iter.next();
      String k = e.getKey() ;
      String v = e.getValue() ;
      
      if ( uri.startsWith(v) )
      {
        usedPMap.setNsPrefix(k, v) ;
        return ;
      }
    }
  }
}
origin: epimorphics/elda

String lf = v.spelling() == null ? "<i>none</i>" : v.spelling();
String type =
  v.type().length() > 0 ? pm.shortForm( v.type() )
  : v.lang().length() > 0 ? v.lang()
  : ""
origin: com.hp.hpl.jena/arq

private static String prefixFor(String uri, PrefixMapping mapping)
{
  if ( mapping == null ) return null ;
  
  String pname = mapping.shortForm(uri) ;
  if ( pname != uri && checkValidPrefixName(pname) )
    return pname ;
  pname = mapping.qnameFor(uri) ;
  if ( pname != null && checkValidPrefixName(pname) )
    return pname ;
  return null ;
}
 
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

private static String prefixFor(String uri, PrefixMapping mapping)
{
  if ( mapping == null ) return null ;
  
  String pname = mapping.shortForm(uri) ;
  if ( pname != uri && checkValidPrefixName(pname) )
    return pname ;
  pname = mapping.qnameFor(uri) ;
  if ( pname != null && checkValidPrefixName(pname) )
    return pname ;
  return null ;
}

com.hp.hpl.jena.sharedPrefixMappingshortForm

Javadoc

Compress the URI using the prefix mappings if possible. If there is a prefix mapping Name -> URIStart, and uri is URIStart+Tail, return Name:Tail; otherwise return uri unchanged. If there are multiple applicable mappings available, the "most recent" is chosen if that is possible, otherwise one is picked "at random".

The result is primarily intended for human convenience: it is not necessarily a legal QName, as Tail need not be a legal NCName; and there's no way to tell a shortened name from a URI with an unusual scheme.

Popular methods of PrefixMapping

  • getNsPrefixMap
    Return a copy of the internal mapping from names to URI strings. Updating this copy will have no eff
  • setNsPrefix
    Specify the prefix name for a URI prefix string. Any existing use of that prefix name is overwritten
  • getNsPrefixURI
    Get the URI bound to a specific prefix, null if there isn't one.
  • setNsPrefixes
    Copies the prefix mapping from other into this. Illegal prefix mappings are detected. Existing binds
  • getNsURIPrefix
    Answer the prefix for the given URI, or null if there isn't one. If there is more than one, one of t
  • qnameFor
    Answer a qname with the expansion of the given uri, or null if no such qname can be constructed usin
  • expandPrefix
    Expand the uri using the prefix mappings if possible. If prefixed has the form Foo:Bar, and Foo is a
  • samePrefixMappingAs
    Answer true iff this prefix-mappings are equal, that is, map the same prefixes to the same URIs; sam
  • lock
    Lock the PrefixMapping so that changes can no longer be made to it. Primarily intended to lock Stand
  • removeNsPrefix
    Remove any existing maplet with the given prefix name and answer this mapping. If the prefix is the
  • withDefaultMappings
    Update this PrefixMapping with the bindings in map, only adding those (p, u) pairs for which neither
  • withDefaultMappings

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now