Sorry for the confusion - I meant to say "I was unable to open the RDF/XML
file with any text editor to see the prefixes."
Loading the Jena model was successful.
Here is my code:
model = TDBFactory.createDataset(my_tdb_directory).getDefaultModel();
Map<String, String> nsMap = model.getNsPrefixMap();
for (Map.Entry<String, String> entry : nsMap.entrySet()) {
log("PREFIX " + entry.getKey() + ": " + entry.getValue());
}
The problem is nsMap is empty with size=0.
Thanks!
On Wed, Jul 31, 2013 at 10:37 PM, Joshua TAYLOR <[email protected]>wrote:
> On Wed, Jul 31, 2013 at 9:47 PM, Charles Li <[email protected]>
> wrote:
> > I am trying to retrieve the prefix mappings from inside a huge RDF/XML
> (4+
> > GB), which I cannot even open.
> >
> > Using model.listNameSpaces(), I was able to list all actually, long "<
> > http://blah.blah#>" format of namespaces, but I was unable to see what
> > short namespace aliases are assigned to these actual namespaces.
> >
> > As recommended by the Jena JavaDoc on "Model", I tried to use
> > getNsPrefixMap(), but got an empty Map.
> >
> > My Jena version is 2.10.1.
>
> At first you said that you couldn't load the RDF/XML, but then you
> mentioned using model.listNameSpaces(). Where did the model come
> from? Can you should an example of the code that isn't working?
>
> --
> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
>