org.apache.any23.rdf
Class Prefixes

java.lang.Object
  extended by org.apache.any23.rdf.Prefixes

public class Prefixes
extends Object

A mapping from prefixes to namespace URIs. Supports "volatile mappings", which will be overwritten without notice when mappings are merged, while for normal mappings this causes an exception. This allows combining "hard" mappings (which must be retained or something breaks) and "soft" mappings (which might be read from input RDF files and should be retained only if they are not in conflict with the hard ones).

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
static Prefixes EMPTY
           
 
Constructor Summary
Prefixes()
           
Prefixes(Prefixes initial)
           
 
Method Summary
 String abbreviate(String uri)
           
 void add(Prefixes other)
           
 void add(String prefix, String namespaceURI)
           
 void addVolatile(Prefixes other)
           
 void addVolatile(String prefix, String namespaceURI)
           
 Set<String> allPrefixes()
           
 Map<String,String> asMap()
           
 boolean canAbbreviate(String uri)
           
 boolean canExpand(String curie)
           
static Prefixes create1(String prefix, String namespaceURI)
           
static Prefixes createFromMap(Map<String,String> prefixesToNamespaceURIs, boolean areVolatile)
           
 Prefixes createSubset(String... prefixes)
           
 org.openrdf.model.URI expand(String curie)
           
 String getNamespaceURIFor(String prefix)
           
 boolean hasNamespaceURI(String uri)
           
 boolean hasPrefix(String prefix)
           
 boolean isEmpty()
           
 boolean isVolatile(String prefix)
           
 void removePrefix(String prefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static Prefixes EMPTY
Constructor Detail

Prefixes

public Prefixes()

Prefixes

public Prefixes(Prefixes initial)
Method Detail

create1

public static Prefixes create1(String prefix,
                               String namespaceURI)

createFromMap

public static Prefixes createFromMap(Map<String,String> prefixesToNamespaceURIs,
                                     boolean areVolatile)

expand

public org.openrdf.model.URI expand(String curie)

abbreviate

public String abbreviate(String uri)

canExpand

public boolean canExpand(String curie)

canAbbreviate

public boolean canAbbreviate(String uri)

getNamespaceURIFor

public String getNamespaceURIFor(String prefix)

hasNamespaceURI

public boolean hasNamespaceURI(String uri)

hasPrefix

public boolean hasPrefix(String prefix)

allPrefixes

public Set<String> allPrefixes()

isEmpty

public boolean isEmpty()

add

public void add(String prefix,
                String namespaceURI)

add

public void add(Prefixes other)

removePrefix

public void removePrefix(String prefix)

createSubset

public Prefixes createSubset(String... prefixes)

addVolatile

public void addVolatile(String prefix,
                        String namespaceURI)

addVolatile

public void addVolatile(Prefixes other)

isVolatile

public boolean isVolatile(String prefix)

asMap

public Map<String,String> asMap()


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.