Functions:
-
try_expand_curie
–Execute rdflib
expand_curie
with 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
) –NamespaceManager
maps 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
quiet
and URI cannot be expanded using the givenns_manager
Source code in src/rdf_utils/uri.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
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
) –NamespaceManager
maps prefixes to namespaces. -
quiet
(bool
, default:False
) –If False will raise ValueError, else return None.
Raises:
-
ValueError
–When not
quiet
andtry_parse_n3_string
throws an exception
Source code in src/rdf_utils/uri.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
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
) –NamespaceManager
maps prefixes to namespaces. -
quiet
(bool
, default:False
) –If False will raise ValueError, else return None.
Raises:
-
ValueError
–When not
quiet
andfrom_n3
throws an exception
Source code in src/rdf_utils/uri.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|