public JSONPropertyNaming(PrefixMapping given) { this.pm = PrefixMapping.Factory.create() .setNsPrefixes( given ) // .withDefaultMappings( Prefixes.various ) ; }
/** 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) ; } }
/** * Register a set of prefix to namespace mappings with the parser */ public void registerPrefixMap(Map<String, String> map) { prefixMapping.setNsPrefixes(map); }
/** @see com.hp.hpl.jena.shared.PrefixMapping#getNsPrefixURI(java.lang.String) */ @Override public String getNsPrefixURI(String prefix) { String s = pmapLocal.getNsPrefixURI(prefix) ; if ( s != null ) return s ; if ( pmapGlobal != null ) return pmapGlobal.getNsPrefixURI(prefix) ; return null ; }
/** * Register a new prefix/namespace mapping which will be used to shorten * the print strings for resources in known namespaces. */ public static void registerPrefix(String prefix, String namespace) { prefixMapping.setNsPrefix( prefix, namespace ); }
/** Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples. */ @Override public void performAdd( Triple t ) { throw new AddDeniedException( "GraphBase::performAdd" ); }
protected StatementBase( ModelCom model ) { if (model == null) throw new JenaException( "Statement models must no be null" ); this.model = model; }
public boolean samePrefixMappingAs(PrefixMapping other) { if ( other == null ) return false ; if ( ! ( other instanceof PrefixMapping2 ) ) return false ; PrefixMapping2 other2 = (PrefixMapping2)other ; return this.pmapGlobal.samePrefixMappingAs(other2.pmapGlobal) && this.pmapLocal.samePrefixMappingAs(other2.pmapLocal) ; } }
/** Remove a triple from the triple store. The default implementation throws a DeleteDeniedException; subclasses must override if they want to be able to remove triples. */ public void performDelete( Triple t ) { throw new DeleteDeniedException( "GraphBase::delete" ); }
/** @see com.hp.hpl.jena.shared.PrefixMapping#lock() */ public PrefixMapping lock() { pmapLocal.lock() ; return this; }
/** Utility method: throw a ClosedException if this graph has been closed. */ protected void checkOpen() { if (closed) throw new ClosedException( "already closed", this ); }
/** @see com.hp.hpl.jena.shared.PrefixMapping#setNsPrefixes(com.hp.hpl.jena.shared.PrefixMapping) */ @Override public PrefixMapping setNsPrefixes(PrefixMapping other) { pmapLocal.setNsPrefixes(other) ; return this ; }
/** @see com.hp.hpl.jena.shared.PrefixMapping#getNsPrefixURI(java.lang.String) */ public String getNsPrefixURI(String prefix) { String s = pmapLocal.getNsPrefixURI(prefix) ; if ( s != null ) return s ; if ( pmapGlobal != null ) return pmapGlobal.getNsPrefixURI(prefix) ; return null ; }
/** @see com.hp.hpl.jena.shared.PrefixMapping#setNsPrefix(java.lang.String, java.lang.String) */ public PrefixMapping setNsPrefix(String prefix, String uri) { pmapLocal.setNsPrefix(prefix, uri) ; return this ; }
/** 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) ; }
/** Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples. */ public void performAdd( Triple t ) { throw new AddDeniedException( "GraphBase::performAdd" ); }
/** @see com.hp.hpl.jena.shared.PrefixMapping#setNsPrefixes(java.util.Map) */ public PrefixMapping setNsPrefixes(Map<String, String> map) { pmapLocal.setNsPrefixes(map) ; return this; }
/** Lookup a prefix for this query, including the default prefixes */ public String getPrefix(String prefix) { return prefixMap.getNsPrefixURI(prefix) ; }
/** @see com.hp.hpl.jena.shared.PrefixMapping#setNsPrefixes(com.hp.hpl.jena.shared.PrefixMapping) */ public PrefixMapping setNsPrefixes(PrefixMapping other) { pmapLocal.setNsPrefixes(other) ; return this ; }