Why do transitive functions include start node in output?

12 views
Skip to first unread message

Pi Robot

unread,
Jun 6, 2015, 9:39:54 AM6/6/15
to rdfli...@googlegroups.com
Hello,

I've just started learning about RDFlib and I was looking at the transitive.py example that uses the "parent" relation to generate either ancestors or descendants of a person node using the transitive_subjects and transitive_objects functions. If you run the example, the person is listed as his/her own descendant or ancestor which doesn't seem meaningful. Shouldn't these two functions omit the start node from their output?

Thanks!
patrick

mr.niels.c...@gmail.com

unread,
Jun 8, 2015, 4:15:05 PM6/8/15
to rdfli...@googlegroups.com
Hi Patrick,

I didn't write any of rdflib's code, but I suppose the idea is to follow the definition of the transitive closure of a relation in mathematics. I can see how excluding the start node might be useful too, though, but I think you will have to filter it out with an "if" to get that behaviour.

Best regards,
Niels

PS: I'm not the
Reply all
Reply to author
Forward
0 new messages