Martin 'Kingpin' Thurn
and 1 contributors


RDF::AllegroGraph::Session4 - AllegroGraph session handle for AGv4


Methods (additional to RDF::AllegroGraph::Repository4)


$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.


$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.


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

in the forward direction, or
in the reverse direction (inverseOf in the OWL sense), or
in both directions: bidirectional


   $session->generator ('associates', 
          { '<>' => 'bidirectional',
            '<>'      => '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:


@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', 
          { '<>' => 'bidirectional' });

   @ms = $session->SNA_members ('<where-to-start>', 'intimates');

@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 (see SNA_members).


Robert Barta, <rho at>


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.