I would like to write a python code to express a graph like this:
Jim → is eating → an apple
An apple → is in → the kitchen
in RDF format. I have tried the RDFlib in python but I am confused about how to do it. I would appreciate if anybody could help on this matter.
Edit 1 :
I have defined two URI nodes for Apple and Jim in the first sentence. So I am still confused how I connect between the two nodes with my predicate "is eating" and add them to graph g. I appreciate if anyone could instruct on this too.
from rdflib.namespace import FOAF , XSD
# create a Graph
g = Graph()
# Create an RDF URI node to use as the subject for multiple triples
apple = URIRef("http://example.org/apple")
# Add another node
jim = URIRef("http://example.org/jim")```