I want to pattern match triples of an existing RDF graph. The triples() function of the RDFLib module looks like it could do the job, but I cant get it to work.
Can someone provide an example?
Consider the following graph.
@prefix ex: <http://example.com/family/> .
ex:Bob a ex:Person.
ex:Bob ex:Occupation ex:Doctor.
ex:Bob ex:Country ex:USA.
ex:Bob ex:Age ex:32.
I would like to pattern match all triples with subject ex:Bob.
I have a hunch I am using the wrong function to begin with. Can someone explain? Thanks