NAME
RDF::AllegroGraph::Session4 - AllegroGraph session handle for AGv4
INTERFACE
Methods (additional to RDF::AllegroGraph::Repository4)
- ping
-
$pong = $session->ping
This method will keep the "connection" with the HTTP server alive (it probably resets the timeout). In the regular case it should return
pong
, in the error case it will time out. - rules
-
$session->rules (" .... prolog rules encoded in LISP, brr ...")
This method parks additional ontological knowledge as rules onto the server. If they can be parsed correctly, they will be used with the onboard PROLOG reasoner. See the Franz Prolog tutorial (./doc/prolog-tutorial.html) for details.
- generator
-
This method creates one generator, in the AGv4 sense. As parameter you have to pass in
- the name of the generator:
-
A symbol, just a simple string, probably better without any fancy characters.
- how to reach other nodes in the RDF model:
-
Here you name various predicates (full URIs, no namespaces seem to work) and also whether these edges should be followed
Example:
$session->generator ('associates', { '<http://www.franz.com/lesmis#knows_well>' => 'bidirectional', '<http://www.franz.com/lesmis#knows>' => 'bidirectional' } );
SNA Convenience Methods
While all of the following can be (and actually are) emulated via generator
and prolog
invocations, you might find the following handy:
- SNA_members
-
@members = $session->SNA_members ($start_node, { generator specification })
This method returns the member nodes which can be reached when starting at a particular node and when particular edges are followed. That edge specification is the same as for the method
generator
.NOTE: Internally an SNA generator is created and - using this method - it will be always overwritten. So, if you need to query this heavily, it is better to fall back to the low-level generator method and use that instead of a full specification:
$session->generator ('intimates', { '<http://www.franz.com/lesmis#knows_well>' => 'bidirectional' }); @ms = $session->SNA_members ('<where-to-start>', 'intimates');
- SNA_cliques
-
@cliques = $session->SNA_cliques ($node, $generator)
This method returns a list of list references to the cliques the node is part of. The generator can again be one predefined (see
generator
), or an adhoc one (seeSNA_members
).
AUTHOR
Robert Barta, <rho at devc.at>
COPYRIGHT & LICENSE
Copyright 2011 Robert Barta, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.