1 6 7 package com.hp.hpl.jena.shared; 8 9 import java.util.*; 10 import com.hp.hpl.jena.shared.impl.*; 11 import com.hp.hpl.jena.vocabulary.*; 12 13 23 24 public interface PrefixMapping 25 { 26 44 PrefixMapping setNsPrefix( String prefix, String uri ); 45 46 59 60 PrefixMapping removeNsPrefix( String prefix ); 61 62 69 PrefixMapping setNsPrefixes( PrefixMapping other ); 70 71 79 PrefixMapping setNsPrefixes( Map map ); 80 81 86 PrefixMapping withDefaultMappings( PrefixMapping map ); 87 88 94 String getNsPrefixURI( String prefix ); 95 96 105 String getNsURIPrefix( String uri ); 106 107 113 Map getNsPrefixMap(); 114 115 123 String expandPrefix( String prefixed ); 124 125 139 String shortForm( String uri ); 140 141 145 String usePrefix( String uri ); 146 147 151 String qnameFor( String uri ); 152 153 159 PrefixMapping lock(); 160 161 165 public static class IllegalPrefixException extends JenaException 166 { 167 public IllegalPrefixException( String prefixName ) { super( prefixName ); } 168 } 169 170 173 public static class JenaLockedException extends JenaException 174 { 175 public JenaLockedException( PrefixMapping pm ) { super( pm.toString() ); } 176 } 177 178 181 public static class Factory 182 { public static PrefixMapping create() { return new PrefixMappingImpl(); } } 183 184 188 public static final PrefixMapping Standard = PrefixMapping.Factory.create() 189 .setNsPrefix( "rdfs", RDFS.getURI() ) 190 .setNsPrefix( "rdf", RDF.getURI() ) 191 .setNsPrefix( "dc", DC.getURI() ) 192 .setNsPrefix( "daml", DAMLVocabulary.NAMESPACE_DAML_2001_03_URI ) 193 .setNsPrefix( "owl", OWL.getURI() ) 194 .setNsPrefix( "xsd", "http://www.w3.org/2001/XMLSchema#" ) 195 .lock() 196 ; 197 198 201 public static final PrefixMapping Extended = PrefixMapping.Factory.create() 202 .setNsPrefixes( Standard ) 203 .setNsPrefix( "rss", RSS.getURI() ) 204 .setNsPrefix( "vcard", VCARD.getURI() ) 205 .setNsPrefix( "jms", JenaModelSpec.getURI() ) 206 .setNsPrefix( "eg", "http://www.example.org/" ) 207 .lock() 208 ; 209 } 210 211 | Popular Tags |