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

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

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

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

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

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

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

@Override
public String qnameFor( String uri )
{ return getPrefixMapping().qnameFor( uri ); }
origin: epimorphics/elda

/**
  <p>Present a URI as a SPARQL term, either <>-quoted, or
  as a qname if there's a suitable prefix mapping for it.
  </p>
  
  <p>SPARQL qname local names can't end with ".", so we
  protect against generating illegal SPARQL by an ad-hoc
  check against the URL ending with dot. May need to
  consider other characters too, and may want to push
  this protection into Jena. 
  </p>
*/
public String present( String unsafeURI ) {
  String qName = pm.qnameFor( unsafeURI );
  if (qName == null) {
    return "<" + URIUtils.escapeAsURI(unsafeURI) + ">";
  } else {
    seen.add( qName.substring( 0, qName.indexOf( ':' ) ) );
    return qName;
  }
  
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override public String qnameFor( String uri )
  {
  String result = getBaseMapping().qnameFor( uri );
  if (result == null)
    {
    List<Graph> graphs = poly.getSubGraphs();
    for (int i = 0; i < graphs.size(); i += 1)
      {
      String ss = graphs.get(i).getPrefixMapping().qnameFor( uri );
      if (ss != null) return ss;
      }
    }
  return result;
  }
}
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 ;
}

origin: com.hp.hpl.jena/sdb

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

  @Test public void prefix7()
  {
    String uri1 = "http://example/" ;
    String uri2 = "http://example/ns#" ;
    
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb) ;
    pmap.setNsPrefix("ex1", uri1) ;
    pmap.setNsPrefix("ex2", uri2) ;
    assertEquals("ex2:foo", pmap.qnameFor("http://example/ns#foo")) ;
  }        
}
com.hp.hpl.jena.sharedPrefixMappingqnameFor

Javadoc

Answer a qname with the expansion of the given uri, or null if no such qname can be constructed using the mapping's prefixes.

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
  • 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

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JCheckBox (javax.swing)
  • From CI to AI: The AI layer in your organization
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