mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 01:01:03 +02:00
Fix isinstance test on null values
This commit is contained in:
parent
5770af51ef
commit
896ce9720d
1 changed files with 13 additions and 9 deletions
|
|
@ -205,16 +205,20 @@ class Api:
|
||||||
"limit": limit
|
"limit": limit
|
||||||
}
|
}
|
||||||
|
|
||||||
if not isinstance(s, Uri):
|
if s:
|
||||||
raise RuntimeError("s must be Uri")
|
if not isinstance(s, Uri):
|
||||||
if not isinstance(p, Uri):
|
raise RuntimeError("s must be Uri")
|
||||||
raise RuntimeError("p must be Uri")
|
input["s"] = { "v": str(s), "e": isinstance(s, Uri), }
|
||||||
if not isinstance(o, Uri) and not isinstance(o, Literal):
|
|
||||||
raise RuntimeError("o must be Uri or Literal")
|
if p:
|
||||||
|
if not isinstance(p, Uri):
|
||||||
|
raise RuntimeError("p must be Uri")
|
||||||
|
input["p"] = { "v": str(p), "e": isinstance(p, Uri), }
|
||||||
|
|
||||||
if s: input["s"] = { "v": str(s), "e": isinstance(s, Uri), }
|
if o:
|
||||||
if p: input["p"] = { "v": str(p), "e": isinstance(p, Uri), }
|
if not isinstance(o, Uri) and not isinstance(o, Literal):
|
||||||
if o: input["o"] = { "v": str(o), "e": isinstance(o, Uri), }
|
raise RuntimeError("o must be Uri or Literal")
|
||||||
|
input["o"] = { "v": str(o), "e": isinstance(o, Uri), }
|
||||||
|
|
||||||
url = f"{self.url}triples-query"
|
url = f"{self.url}triples-query"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue