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

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

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

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

/** @see com.hp.hpl.jena.shared.PrefixMapping#getNsURIPrefix(java.lang.String) */
@Override
public String getNsURIPrefix(String uri)
{
  String s = pmapLocal.getNsURIPrefix(uri) ;
  if ( s != null )
    return s ;
  if ( pmapGlobal == null )
    return null ;
  if ( pmapGlobal != null )
    return pmapGlobal.getNsURIPrefix(uri) ;
  return null ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public String getNsURIPrefix(String uri) {
  return this.prefixes.getNsURIPrefix(uri);
}
origin: com.hp.hpl.jena/arq

/** @see com.hp.hpl.jena.shared.PrefixMapping#getNsURIPrefix(java.lang.String) */
public String getNsURIPrefix(String uri)
{
  String s = pmapLocal.getNsURIPrefix(uri) ;
  if ( s != null )
    return s ;
  if ( pmapGlobal == null )
    return null ;
  if ( pmapGlobal != null )
    return pmapGlobal.getNsURIPrefix(uri) ;
  return null ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

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

@Override public String getNsURIPrefix( String uri )
  {
  String s = getBaseMapping().getNsURIPrefix( uri );
  if (s == null)
    {
    List<Graph> graphs = poly.getSubGraphs();
    for (int i = 0; i < graphs.size(); i += 1)
      {
      String ss = graphs.get(i).getPrefixMapping().getNsURIPrefix( uri );
      if (ss != null && ss.length() > 0) return ss;
      }
    }
  return s;
  }
  
origin: epimorphics/elda

/**
  Encode the URI string <code>any</code> into a "short"name.
  If any can be expressed as a legal shortname pre_local where
  pre is the prefix for any's namespace and local is the
  local name of any, return that. Otherwise, if the local
  name isn't a legal shortname but a prefix exists, return
  pre_thatPrefix_localnameEncoded. Otherwise, return
  uri_theEntireURIencoded.
*/
public static String encode( PrefixMapping pm, String any ) {
  int cut = Util.splitNamespace( any );
  String ns = any.substring( 0, cut );
  String ln = any.substring( cut );
  String prefix = pm.getNsURIPrefix( ns );
  return
    prefix == null ? "unknown_" + encodeLightly(true, any) 
    : EldaNameUtils.isLegalShortname( ln ) ? prefix + "_" + ln
    : "pre_" + prefix + "_" + encodeLightly(false, ln)
    ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

protected String substitutedAttribute( String s ) 
  {
  String substituted = Util.substituteStandardEntities( s );
  if (!showDoctypeDeclaration.booleanValue()) 
    return attributeQuoted( substituted );
  else
    {
    int split = Util.splitNamespace( substituted );
    String namespace = substituted.substring(  0, split );
    String prefix = modelPrefixMapping.getNsURIPrefix( namespace );
    return prefix == null || isPredefinedEntityName( prefix )
      ? attributeQuoted( substituted )
      : attributeQuoted( "&" + strForPrefix(prefix) + ";" + substituted.substring( split ) )
      ;
    }
  }

origin: epimorphics/elda

String ln = EldaNameUtils.localName(u);
String ns = EldaNameUtils.nameSpace(u);
String prefix = pm.getNsURIPrefix(ns);
if (prefix == null) {
  result.put( u, Transcoding.encode( pm, u ) );
origin: com.hp.hpl.jena/sdb

@Test public void prefix4()
{
  String uri = "http://example/" ;
  PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb) ;
  pmap.setNsPrefix("ex", uri) ;
  
  assertEquals("ex", pmap.getNsURIPrefix("http://example/")) ;
}
   
com.hp.hpl.jena.sharedPrefixMappinggetNsURIPrefix

Javadoc

Answer the prefix for the given URI, or null if there isn't one. If there is more than one, one of them will be picked. If possible, it will be the most recently added prefix. (The cases where it's not possible is when a binding has been removed.)

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
  • 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
  • shortForm
    Compress the URI using the prefix mappings if possible. If there is a prefix mapping Name -> URIStar
  • 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

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JTable (javax.swing)
  • JTextField (javax.swing)
  • Best IntelliJ 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