RDF::Endpoint(3pm)
π RDF::Endpoint π
okay bestie, gather round, because this is the RDF::Endpoint manual page from User Contributed Perl Documentation and it's literally the blueprint for a SPARQL Protocol Endpoint and you're gonna understand every word of it, no cap π«Ά
β¨ NAME β¨
RDF::Endpoint β a whole SPARQL Protocol Endpoint implementation, as a treat π
πΈ VERSION πΈ
This doc is describing RDF::Endpoint version 0.11. periodt.
π SYNOPSIS π
the way you just... run it:
plackup /usr/local/bin/endpoint.psgi
that's it. that's the whole vibe check. go off π
π¦ DESCRIPTION π¦
so this module implements the SPARQL Protocol for RDF using the PSGI interface that Plack hands you. it can be run with any Plack handler β any of them, iconic behavior. if you wanna know more about that whole situation, go peek at Plack::Handler.
when you use this module to spin up a SPARQL endpoint, the configuration variables get loaded via Config::ZOMG. there's an example config file, rdf_endpoint.json, shipped right inside this package, so you're not out here guessing. the valid top-level configuration keys are:
storeβ defines the underlying RDF::Trine::Store for the endpoint. it can be a hashref of the kind you'd hand toRDF::Trine::Store->new_with_config, but ngl a plain simple string works too. flexible queen β¨endpointβ a hash of endpoint-specific config variables. the valid keys inside this hash are:updateβ a boolean that says whether Update operations are allowed to be executed by the endpoint. lowercase: can this endpoint be changed? π³load_dataβ a boolean that says whether the endpoint should use the URLs showing up inFROMandFROM NAMEDclauses to construct a SPARQL dataset, by dereferencing those URLs and loading up whatever RDF content comes back.service_descriptionβ an associative array (a hash) with the details on which info and how much info goes into the service description the endpoint hands out when 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. so cute, so informative π₯°htmlβ an associative array (a hash) with the details on how results should be serialized when the output media type is HTML. the boolean value'resource_links'specifies whether URI values get serialized as HTML anchors (you know, links). the boolean value'embed_images'specifies whether URI values typed as foaf:Image get serialized as HTML images. and if'embed_images'is true, the integer value'image_width'says what image width to use in the HTML markup β and it lets the image height scale appropriately, because we respect aspect ratios in this household π
π EXAMPLE CONFIGURATIONS π
π§ Using Plack::Handler::Apache2 π§
using Plack::Handler::Apache2, you can configure mod_perl2 to serve an endpoint with 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>
and if you want syntax highlighting and other pretty pretty features, drop these three aliases into the VirtualHost section of your server:
Alias /js/ /path/to/share/www/js/
Alias /favicon.ico /path/to/share/www/favicon.ico
Alias /css/ /path/to/share/www/css/
how do you find the exact location? by finding where the file "sparql_form.js" lives. that's your little treasure map πΊοΈβ¨
π METHODS π
new ( \%conf )new ( $model, \%conf )
returns a fresh new Endpoint object. \%conf should be a HASH reference full of configuration settings. two ways to call it, both slay.
run ( $req )
handles the request specified by the supplied Plack::Request object, and returns an appropriate Plack::Response object. in and out, baby π«Ά
run_tag
returns a unique key for each instantiation of this service. every instance gets its own little name tag π·οΈ
service_description ( $request, $model )
returns a brand-new RDF::Trine::Model object holding a service description of this endpoint, generating dataset statistics from $model. main character energy fr fr π
β SEE ALSO β
- <http://www.w3.org/TR/sparql11-protocol/>
- <http://www.perlrdf.org/>
- <irc://irc.perl.org/#perlrdf>
- <http://codemirror.net/>
(that IRC one is a whole hangout spot, iykyk π¬)
π AUTHOR π
Gregory Todd Williams <gwilliams@cpan.org>
π LICENSE AND COPYRIGHT π
copyright (c) 2010-2014 Gregory Todd Williams.
this software is provided 'as-is', without any express or implied warranty. in no event will the authors be held liable for any damages arising from the use of this software. (translation: it's free, be normal about it π)
permission is granted to anyone to use this software for any purpose β including commercial applications β and to alter it and redistribute it freely, subject to the following restrictions:
- the origin of this software must not be misrepresented; you must not claim that you wrote the original software. if you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. (nice but optional, bestie π)
- altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. don't be shady π«
- this notice may not be removed or altered from any source distribution.
with the exception of the CodeMirror files, the files in this package may also be redistributed and/or modified under the same terms as Perl itself.
the CodeMirror (Javascript and CSS) files contained in this package are copyright (c) 2007-2010 Marijn Haverbeke, and licensed under the terms of the same zlib license as this code.
β οΈ heads up: that last bit means CodeMirror is doing its own licensing thing, separate from the Perl-terms party the rest of the package is having. keep both notes intact!
aaaand that's the whole page, we ate and left no crumbs π
β¨ this was perl v5.36.0, dated 2022-10-14, closing out the RDF::Endpoint manual page. byeee, go build an endpoint π¦ππ
π¦ where this page comes from
- ubuntu noble: librdf-endpoint-perl 0.11-2 Β· Zlib OR Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librdf-endpoint-perl 0.11-2 Β· Zlib OR Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-endpoint-perl 0.11-2 Β· Zlib OR Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms