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

RDF::Endpoint - A SPARQL Protocol Endpoint implementation

Author

        Gregory Todd Williams <gwilliams@cpan.org>

Description

       This modules implements the SPARQL Protocol for RDF using the PSGI interface provided by Plack. It may be
       run with any Plack handler.  See Plack::Handler for more details.

       When this module is used to create a SPARQL endpoint, configuration variables are loaded using
       Config::ZOMG. An example configuration file rdf_endpoint.json is included with this package. Valid top-
       level configuration keys include:

       store
           This is used to define the underlying RDF::Trine::Store for the endpoint.  It can be a hashref of the
           type that can be passed to RDF::Trine::Store->new_with_config, but a simple string can also be used.

       endpoint
           A hash of endpoint-specific configuration variables. Valid keys for this hash include:

           update  A  boolean value indicating whether Update operations should be allowed to be executed by the
                   endpoint.

           load_data
                   A boolean value indicating whether the endpoint should use URLs that appear in FROM and  FROM
                   NAMED  clauses  to  construct  a  SPARQL  dataset  by  dereferencing the URLs and loading the
                   retrieved RDF content.

           service_description
                   An associative array (hash) containing details on which and how much information  to  include
                   in  the  service  description provided by the endpoint if no query is included for execution.
                   The boolean values 'default' and 'named_graphs' indicate that the respective  SPARQL  dataset
                   graphs should be described by the service description.

           html    An  associative  array (hash) containing details on how results should be serialized when the
                   output media type is HTML. The boolean value 'resource_links' specifies  whether  URI  values
                   should  be  serialized  as  HTML anchors (links).  The boolean value 'embed_images' specifies
                   whether URI values that are typed as foaf:Image should  be  serialized  as  HTML  images.  If
                   'embed_images'  is true, the integer value 'image_width' specifies the image width to be used
                   in the HTML markup (letting the image height scale appropriately).

Example Configurations

UsingPlack::Handler::Apache2
       Using Plack::Handler::Apache2, mod_perl2 can be configured to serve  and  endpoint  using  the  following
       configuration:

         <Location /sparql>
           SetHandler perl-script
           PerlResponseHandler Plack::Handler::Apache2
           PerlSetVar psgi_app /path/to/endpoint.psgi
           PerlSetEnv RDF_ENDPOINT_CONFIG /path/to/rdf_endpoint.json
         </Location>

       To  get  syntax  highlighting  and  other pretty features, in the VirtualHost section of your server, add
       three aliases:

         Alias /js/ /path/to/share/www/js/
         Alias /favicon.ico /path/to/share/www/favicon.ico
         Alias /css/ /path/to/share/www/css/

       The exact location can be determined by finding where the file "sparql_form.js".

Methods

       "new ( \%conf )"
       "new ( $model, \%conf )"
           Returns a new Endpoint object. "\%conf" should be a HASH reference with configuration settings.

       "run ( $req )"
           Handles the request specified  by  the  supplied  Plack::Request  object,  returning  an  appropriate
           Plack::Response object.

       "run_tag"
           Returns a unique key for each instantiation of this service.

       "service_description ( $request, $model )"
           Returns  a new RDF::Trine::Model object containing a service description of this endpoint, generating
           dataset statistics from $model.

Name

       RDF::Endpoint - A SPARQL Protocol Endpoint implementation

See Also

       •   <http://www.w3.org/TR/sparql11-protocol/>

       •   <http://www.perlrdf.org/>

       •   <irc://irc.perl.org/#perlrdf>

       •   <http://codemirror.net/>

Synopsis

        plackup /usr/local/bin/endpoint.psgi

Version

       This document describes RDF::Endpoint version 0.11.

See Also