Functions:
-
try_expand_curie–Execute rdflib
expand_curiewith exception handling. -
try_parse_n3_iterable–Parse an iterable of N3 strings using rdflib.util.from_n3 with exception handling.
-
try_parse_n3_string–Parse N3 string using rdflib.util.from_n3 with exception handling.
try_expand_curie
try_expand_curie(ns_manager, curie_str, quiet=False)
Execute rdflib expand_curie with exception handling.
Parameters:
-
ns_manager(NamespaceManager) –NamespaceManagermaps prefixes to namespaces, usually can use the one in the Graph object. -
curie_str(str) –The short URI string to be expanded
-
quiet(bool, default:False) –If False will raise ValueError, else return None
Returns:
Raises:
-
ValueError–When not
quietand URI cannot be expanded using the givenns_manager
Source code in src/rdf_utils/uri.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
try_parse_n3_iterable
try_parse_n3_iterable(n3_str_iterable, ns_manager, quiet=False)
Parse an iterable of N3 strings using rdflib.util.from_n3 with exception handling.
Parameters:
-
n3_str_iterable(Iterable[str]) –Iterable of N3 strings to be parsed.
-
ns_manager(NamespaceManager) –NamespaceManagermaps prefixes to namespaces. -
quiet(bool, default:False) –If False will raise ValueError, else return None.
Raises:
-
ValueError–When not
quietandtry_parse_n3_stringthrows an exception
Source code in src/rdf_utils/uri.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
try_parse_n3_string
try_parse_n3_string(n3_str, ns_manager, quiet=False)
Parse N3 string using rdflib.util.from_n3 with exception handling.
Parameters:
-
n3_str(str) –N3 string to be parsed.
-
ns_manager(NamespaceManager) –NamespaceManagermaps prefixes to namespaces. -
quiet(bool, default:False) –If False will raise ValueError, else return None.
Raises:
-
ValueError–When not
quietandfrom_n3throws an exception
Source code in src/rdf_utils/uri.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |