logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

OpenGuides::RDF - An OpenGuides plugin to output RDF/XML.

Author

       The OpenGuides Project (openguides-dev@lists.openguides.org)

Credits

       Code  in  this  module  written  by  Kake  Pugh  and  Earle Martin. Dan Brickley, Matt Biddulph and other
       inhabitants of #swig on irc.freenode.net gave useful feedback and advice.

perl v5.40.0                                       2025-01-02                               OpenGuides::RDF(3pm)

Description

       Does all the RDF stuff for OpenGuides.  Distributed and installed as part of the OpenGuides project, not
       intended for independent installation.  This documentation is probably only useful to OpenGuides
       developers.

Methods

new
               my $rdf_writer = OpenGuides::RDF->new( wiki   => $wiki,
                                                      config => $config );

           "wiki"  must  be  a  Wiki::Toolkit  object  and  "config" must be an OpenGuides::Config object.  Both
           arguments mandatory.

       emit_rdfxml
               $wiki->write_node( "Masala Zone, N1 0NU",
                                "Quick and tasty Indian food",
                                $checksum,
                                { comment  => "New page",
                                  username => "Kake",
                                  locale   => "Islington" }
               );

               print "Content-Type: application/rdf+xml\n\n";
               print $rdf_writer->emit_rdfxml( node => "Masala Zone, N1 0NU" );

           Note: Some of the fields emitted by the RDF/XML generator are taken from the node metadata. The  form
           of  this  metadata  is not mandated by Wiki::Toolkit. Your wiki application should make sure to store
           some or all of the following metadata when calling "write_node":

           postcode - The postcode or zip code of the place discussed by the node.  Defaults to the empty
           string.
           city - The name of the city that the node is in.  If not supplied, then the value of "default_city"
           in the config object supplied to "new", if available, otherwise the empty string.
           country - The name of the country that the node is in.  If not supplied, then the value of
           "default_country" in the config object supplied to "new" will be used, if available, otherwise the
           empty string.
           username - An identifier for the person who made the latest edit to the node.  This person will be
           listed as a contributor (Dublin Core).  Defaults to empty string.
           locale - The value of this can be a scalar or an arrayref, since some places have a plausible claim
           to being in more than one locale.  Each of these is put in as a "Neighbourhood" attribute.
           phone - Only one number supported at the moment.  No validation.
           website - No validation.
           opening_hours_text - A freeform text field.

Name

       OpenGuides::RDF - An OpenGuides plugin to output RDF/XML.

See Also

       •   Wiki::Toolkit

       •   <http://openguides.org/>

       •   <http://chefmoz.org/>

Synopsis

           use Wiki::Toolkit;
           use OpenGuides::Config;
           use OpenGuides::RDF;

           my $wiki = Wiki::Toolkit->new( ... );
           my $config = OpenGuides::Config->new( file => "wiki.conf" );
           my $rdf_writer = OpenGuides::RDF->new( wiki   => $wiki,
                                                config => $config );

           # RDF version of a node.
           print "Content-Type: application/rdf+xml\n\n";
           print $rdf_writer->emit_rdfxml( node => "Masala Zone, N1 0NU" );

See Also