Paste number 8476: | pyrple.Graph.infer example (for chimezie) |
Pasted by: | sbp |
When: | 19 years, 9 months ago |
Share: | Tweet this! | http://paste.lisp.org/+6JG |
Channel: | #swhack |
Paste contents: |
>>> import pyrple >>> G = pyrple.Graph(ntriples='<#Jessica> <#likes> <#Chris> .') >>> P = pyrple.Graph(ntriples='?p ?q ?r .') >>> Q = pyrple.Graph(ntriples='?r ?q ?p .') >>> print G.infer(P, Q, mode='filter') [(<#Chris>, <#likes>, <#Jessica>)] >>> G.infer(P, Q, mode='apply') >>> print G [(<#Jessica>, <#likes>, <#Chris>), (<#Chris>, <#likes>, <#Jessica>)] >>>
This paste has no annotations.