Created
July 4, 2009 23:02
-
-
Save dajobe/140762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def namespaces_seen(self): | |
"""Get a dictionary of prefix/URI pairs for namespaces seen during parsing. | |
""" | |
count = Redland.librdf_parser_get_namespaces_seen_count(self._parser) | |
nspaces={} | |
for index in range(0, count-1): | |
prefix=Redland.librdf_parser_get_namespaces_seen_prefix(self._parser, index) | |
uri_obj=Redland.librdf_parser_get_namespaces_seen_uri(self._parser, index) | |
if uri_obj is None: | |
uri=None | |
else: | |
uri=Uri(from_object=uri_obj) | |
nspaces[prefix]=uri | |
return nspaces | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment