You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone and thanks for the great library. I was trying to use rdflib of Python in PyCall.jl. I'm using macos, Julia 1.9.1 and using ENV["Python"]="" with Conda.jl. With this code,
using PyCall
# Create an empty graph
graph =pyimport("rdflib").Graph()
# Define the namespace
ex ="http://example.org/"# Define the triples
subject =pyimport("rdflib").URIRef(ex *"subject")
predicate =pyimport("rdflib").URIRef(ex *"predicate")
object =pyimport("rdflib").Literal("object")
# Add the triples to the graph
graph.add((subject, predicate, object))
I got the following output
ERROR: PyError ($(Expr(:escape, :(ccall(#= /Users/hiiroo/.julia/packages/PyCall/ilqDX/src/pyfncall.jl:43 =#@pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'AssertionError'>AssertionError('Subject http://example.org/subject must be an rdflib term')
File "/Users/hiiroo/.julia/conda/3/lib/python3.7/site-packages/rdflib/graph.py", line 532, in add
assert isinstance(s, Node), "Subject %s must be an rdflib term"% (s,)
The text was updated successfully, but these errors were encountered:
which tells it to return a raw PyObject rather than trying to convert to a native Julia object (which I guess happens here because rdflib.term.URIRef is a subtype of string).
Hello everyone and thanks for the great library. I was trying to use rdflib of Python in PyCall.jl. I'm using macos, Julia 1.9.1 and using
ENV["Python"]=""
with Conda.jl. With this code,I got the following output
The text was updated successfully, but these errors were encountered: