The only difference is that I first used the TDB loader to load the sampleRdfXML.xml into a directory, say <my_model_dir>. Then
model = TDBFactory.createDataset(my_model_dir).getDefaultModel() ; System.err.println( m.getNsPrefixMap() ); And nothing printed out. On Thu, Aug 1, 2013 at 9:56 AM, Chris Dollin <[email protected]>wrote: > On Thursday, August 01, 2013 09:23:46 AM Charles Li wrote: > > I tried again using a very small RDF/XML file (attached). This RDF/XML > file > > defined namespace alias at the very beginning. model.listNameSpaces() > gave > > me all four actual namespaces without the alias. But getNsPrefixMap() > only > > gave me an empty Map. > > Hmm, works for me. Show (minimal, complete) code; mine's below. > > > Could this be a bug in getNsPrefixMap()? > > Possible but unlikely: I would have expected it to show up much sooner > if so. > > > //////////////////////////////////////////////////////////////////////////////////// > > Code (using memory model): > > package cmd; > > import com.hp.hpl.jena.rdf.model.Model; > import com.hp.hpl.jena.util.FileManager; > > public class scog { > > public static void main( String [] args ) { > Model m = FileManager.get().loadModel( > "/home/chris/Documents/sampleRdfXML.xml" ); > System.err.println( m.getNsPrefixMap() ); > m.write( System.out, "TTL" ); > } > } > > -- > "The wizard seemed quite willing when I talked to him." /Howl's Moving > Castle/ > > Epimorphics Ltd, http://www.epimorphics.com > Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 > 6PT > Epimorphics Ltd. is a limited company registered in England (number > 7016688) > >
