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

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

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

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

/**
 * Return a map of all the discovered prefixes
 */
public Map<String, String> getPrefixMap() {
  return prefixMapping.getNsPrefixMap();
}

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

@Override
public Map<String, String> getNsPrefixMap() {
  return this.prefixes.getNsPrefixMap();
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public Map<String, String> getNsPrefixMap(boolean includeGlobalMap)
{
  Map<String, String> m1 = pmapLocal.getNsPrefixMap() ;
  if ( pmapGlobal == null )
    return m1 ;
  if ( includeGlobalMap )
  {
    Map<String, String> m2 = pmapGlobal.getNsPrefixMap() ;
    m1.putAll(m2) ;
  }
  return m1 ;
}
origin: com.hp.hpl.jena/arq

public Map<String, String> getNsPrefixMap(boolean includeGlobalMap)
{
  Map<String, String> m1 = pmapLocal.getNsPrefixMap() ;
  if ( pmapGlobal == null )
    return m1 ;
  if ( includeGlobalMap )
  {
    Map<String, String> m2 = pmapGlobal.getNsPrefixMap() ;
    m1.putAll(m2) ;
  }
  return m1 ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  Add the bindings of other to our own. We defer to the general case 
  because we have to ensure the URIs are checked.
  
  @param other the PrefixMapping whose bindings we are to add to this.
*/
@Override public PrefixMapping setNsPrefixes( PrefixMapping other )
  { return setNsPrefixes( other.getNsPrefixMap() ); }
  
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  Add the bindings of other to our own. We defer to the general case 
  because we have to ensure the URIs are checked.
  
  @param other the PrefixMapping whose bindings we are to add to this.
*/
@Override
public PrefixMapping setNsPrefixes( PrefixMapping other )
  { return setNsPrefixes( other.getNsPrefixMap() ); }

origin: epimorphics/elda

  private static String namespacesDocument(PrefixMapping pm) {
    StringBuilder sb = new StringBuilder();
    sb.append("<namespaces>\n");
    for (Map.Entry<String, String> e : pm.getNsPrefixMap().entrySet()) {
      sb.append("<namespace prefix='");
      sb.append(e.getKey());
      sb.append("'>");
      sb.append(e.getValue());
      sb.append("</namespace>\n");
    }
    sb.append("</namespaces>\n");
    return sb.toString();
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

  public static int hash(Prologue prologue) {
    final int prime = 31 ;
    int x = 1 ; 
    if ( prologue.seenBaseURI )
      x = prime * x + prologue.getBaseURI().hashCode() ;
    else
      x = 1237 ;
    if ( prologue.prefixMap != null )
      x = prime * x + prologue.prefixMap.getNsPrefixMap().hashCode() ;
    return x ;
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public void putAll(PrefixMapping pmap) {
  putAll(pmap.getNsPrefixMap()) ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override
public Map<String, String> getNsPrefixMap()
{ return getPrefixMapping().getNsPrefixMap(); }
origin: net.sourceforge.owlapi/pellet-jena-ignazio1977

  static public QNameProvider makeQNameProvider(PrefixMapping mapping) {
    QNameProvider qnames = new QNameProvider();

    Iterator<Map.Entry<String, String>> entries = mapping.getNsPrefixMap().entrySet().iterator();
    while( entries.hasNext() ) {
      Map.Entry<String, String> entry = entries.next();
      String prefix = entry.getKey();
      String uri = entry.getValue();

      qnames.setMapping( prefix, uri );
    }

    return qnames;
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override public Map<String, String> getNsPrefixMap()
  { 
  Map<String, String> result = CollectionFactory.createHashedMap();
  List<Graph> graphs = poly.getSubGraphs();
  for (int i = graphs.size(); i > 0;)
    result.putAll( graphs.get( --i ).getPrefixMapping().getNsPrefixMap() );
  result.remove( "" );
  result.putAll( getBaseMapping().getNsPrefixMap() );
  return result; 
  }
  
origin: com.hp.hpl.jena/arq

public PrefixMapping withDefaultMappings(PrefixMapping map)
{
  Iterator<Map.Entry<String, String>> it = map.getNsPrefixMap().entrySet().iterator();
  while (it.hasNext())
    {
    Map.Entry<String, String> e = it.next();
    String prefix = e.getKey();
    String uri = e.getValue();
    if (getNsPrefixURI( prefix ) == null && getNsURIPrefix( uri ) == null)
      setNsPrefix( prefix, uri );
    }
  return this;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public PrefixMapping withDefaultMappings(PrefixMapping map)
{
  Iterator<Map.Entry<String, String>> it = map.getNsPrefixMap().entrySet().iterator();
  while (it.hasNext())
    {
    Map.Entry<String, String> e = it.next();
    String prefix = e.getKey();
    String uri = e.getValue();
    if (getNsPrefixURI( prefix ) == null && getNsURIPrefix( uri ) == null)
      setNsPrefix( prefix, uri );
    }
  return this;
}
origin: com.hp.hpl.jena/arq

public void visitPrologue(Prologue query)
{
  if ( query.explicitlySetBaseURI() )
    x ^= query.getBaseURI().hashCode() ;
  x ^= query.getPrefixMapping().getNsPrefixMap().hashCode() ;
}
origin: org.ow2.weblab.core.helpers/rdf-helper-jena

/**
 * @param prefix
 *            A prefix to be used in RDF/XML.
 * @param uri
 *            The uri associated with this prefix.
 * @return The full map of prefixes after the addition of <code>prefix</code> and <code>uri</code>.
 */
public Map<String, String> setNSPrefix(final String prefix, final String uri) {
  if ((this.model != null) && (prefix != null) && (uri != null) && (!prefix.equals("")) && (!uri.equals(""))) {
    final Map<?, ?> map = this.model.setNsPrefix(prefix, uri).getNsPrefixMap();
    return BackEndJenaHelper.convertNSMap(map);
  }
  return this.getNSPrefixes();
}
origin: com.hp.hpl.jena/arq

public static Prologue create(String base, PrefixMapping pmapping)
{
  PrefixMap pmap = null ;
  if ( pmapping != null )
  {
    pmap = new PrefixMap() ;
    Map<String, String> x =  pmapping.getNsPrefixMap() ;
    for ( Entry<String, String> e : x.entrySet() )
      pmap.add(e.getKey(), e.getValue()) ;
  }
  IRIResolver resolver = null ;
  if ( base != null )
    resolver = IRIResolver.create(base) ;
  return new Prologue(pmap, resolver) ;
}
 
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

static public PrefixMapping used(Op op, PrefixMapping pmap)
{
  PrefixMapping pmap2 = new PrefixMappingImpl() ;
  PrefixFinder finder = new PrefixFinder(pmap2, pmap.getNsPrefixMap()) ;
  OpWalker.walk(op, finder) ;
  return pmap2 ;
}

origin: com.hp.hpl.jena/arq

static public PrefixMapping used(Op op, PrefixMapping pmap)
{
  PrefixMapping pmap2 = new PrefixMappingImpl() ;
  PrefixFinder finder = new PrefixFinder(pmap2, pmap.getNsPrefixMap()) ;
  OpWalker.walk(op, finder) ;
  return pmap2 ;
}
 
origin: epimorphics/elda

@Test public void testWithNoMappings() {
  Model m = ModelFactory.createDefaultModel();
  Resource r = ModelTestBase.resource( m, "null" );
  PrefixMapping pm = ExtractPrefixMapping.from( r );
  assertEquals( 0, pm.getNsPrefixMap().size() );
}

com.hp.hpl.jena.sharedPrefixMappinggetNsPrefixMap

Javadoc

Return a copy of the internal mapping from names to URI strings. Updating this copy will have no effect on the PrefixMap.

Popular methods of PrefixMapping

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

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top plugins for Android Studio
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