RDF::G...::Void(3pm)
π RDF::Generator::Void π
ok bestie, so this is the RDF::Generator::Void page from the User Contributed Perl Documentation, and we're gonna get you comfy with it. It's a Perl module that builds VoID descriptions from the data sitting in an RDF model. Yes it's giving metadata-girlie. Yes you're gonna slay.
β¨ VERSION β¨
Version 0.16 β she's on 0.16 and she's thriving π
π SYNOPSIS π
here's the vibe, copy-paste-able and everything:
use RDF::Generator::Void;
use RDF::Trine::Model;
my $mymodel = RDF::Trine::Model->temporary_model;
[add some data to $mymodel here]
my $generator = RDF::Generator::Void->new(inmodel => $mymodel);
$generator->urispace('http://example.org');
$generator->add_endpoints('http://example.org/sparql');
my $voidmodel = $generator->generate;
(that [add some data to $mymodel here] line? that's literally in the docs, it's your homework, go do it πΈ)
π¦ DESCRIPTION π¦
So the way this works: you hand the constructor an RDF::Trine::Model object, and then based on the data chillin' in that model plus whatever extra data you feed it, it makes you a brand new model containing a VoID description of the data in your model. It's giving glow-up for your metadata β¨
Want the actual description of what VoID is? It lives at <http://www.w3.org/TR/void/>. Go read it, bestie, it's important.
π METHODS π
π new(inmodel => $mymodel, dataset_uri => URI->new($dataset_uri), level => 1);
This is the constructor, the main character. You can call it with two parameters:
inmodelβ the model we wanna describedataset_uriβ the URI we wanna use for the description
β οΈ important, bestie: you should make sure it's actually possible to get that URI with HTTP. If that's not possible for you, you can just leave the field empty and a simple URN will get created for you as a default. no stress π
π₯ inmodel
Read-only accessor for the model used in description creation. That's it, that's the girl.
π₯ dataset_uri
Read-only accessor for the URI to the dataset.
π Property Attributes π
ok so the attributes down here are about some essential properties in the VoID vocabulary. They're mostly arrays, and you can mess with them using array methods. Here's the pattern:
- Methods starting with
all_return an array of unique values. - Methods starting with
add_take a list of values to add. - Methods starting with
has_no_return a boolean value βfalseif the array is empty.
π all_vocabularies, add_vocabularies, has_no_vocabularies
Methods to manipulate a list of vocabularies used in the dataset. The values should be a string that represents the URI of a vocabulary.
π all_endpoints, add_endpoints, has_no_endpoints
Methods to manipulate a list of SPARQL endpoints that can be used to query the dataset. The values should be a string that represents the URI of a SPARQL endpoint.
π all_titles, add_titles, has_no_titles
Methods to manipulate the titles of the datasets. The values should be RDF::Trine::Node::Literal objects, and should be set with language. Typically, you would have a value per language. multilingual queen π
π all_licenses, add_licenses, has_no_licenses
Methods to manipulate a list of licenses that regulates the use of the dataset. The values should be a string that represents the URI of a license.
π urispace, has_urispace
This method sets the URI prefix string that will match the entities in your dataset. Heads up though β the computation of the number of entities depends on this being set. So set it. has_urispace is there to check if it's set. no cap π«Ά
π§ Running this stuff π§
β level, has_level
Set the level of detail, bestie. Here's the scale:
0β doesn't do any statistics or heuristics1β has some statistics for the dataset as a whole2β will give some partition statistics3β will give subject and object counts for property partitions
And if you set no level at all? You get everything. maximalist energy, we love to see it π
β stats, clear_stats, has_stats
Method to compute a statistical summary for the data in the dataset β stuff like the number of entities, predicates, etc. clear_stats will clear the statistics, and has_stats will return true if it exists.
β generate( [ $model ] )
Returns the VoID as an RDF::Trine::Model. You may pass a model with statements as an argument to this method β and that model may then contain arbitrary RDF that will be added to the RDF model. If you don't send a model, one will be created for you. it's giving self-care, she'll make her own π
πΈ AUTHORS πΈ
- Kjetil Kjernsmo
<kjetilk@cpan.org> - Toby Inkster
<tobyink@cpan.org>
π TODO π
the to-do list, aka the "manifesting" list:
- URI regexps support.
- Technical features (esp. serializations).
- Example resources and root resources.
- Data dumps.
- Subject classification.
- Method to disable heuristics.
- More heuristics.
- Linkset descriptions.
- Set URI space on partitions.
- Use CHI to cache?
- Use schema introspection to generate property attributes with MooseX::Semantic.
π BUGS π
Please report any bugs you find to <https://github.com/kjetilk/RDF-Generator-Void/issues>
π ok and this next part is REAL, bestie, it's literally in the manual: Note that any claim that this module will generate a void in spacetime, a wormhole, black hole, or funny philosophy is totally bogus and without any scientific merit whatsoever. The lead author has made elaborate precautions to avoid any such issues, and expects everyone to take his word for it. Oh, BTW, should it just happen anyway, it won't hurt much <http://news.sciencemag.org/sciencenow/2012/03/scienceshot-one-black-hole-wont-.html>.
so if you were worried about accidentally making a black hole with your metadata... allegedly you're fine β¨
π«Ά SUPPORT π«Ά
You can find documentation for this module with the perldoc command:
perldoc RDF::Generator::Void
The Perl and RDF community website is at <http://www.perlrdf.org/> where you can also find a mailing list to direct questions to. group chat but for RDF, iconic.
You can also look for information at:
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/RDF-Generator-Void>
- CPAN Ratings
<http://cpanratings.perl.org/d/RDF-Generator-Void>
- MetaCPAN
<https://metacpan.org/module/RDF::Generator::Void>
π ACKNOWLEDGEMENTS π
Many thanks to Konstantin Baierer for help with RDF::Generator::Void::Meta::Attribute::ObjectList. we stan a helpful collaborator π₯Ή
π LICENSE AND COPYRIGHT π
Copyright 2012 Toby Inkster. Copyright 2012,2013,2016 Kjetil Kjernsmo.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
ok that's the whole page, bestie, every last flag and footnote π
this was perl v5.34.0 flavor, dated 2022-06-17, from the User Contributed Perl Documentation β and you read the whole thing, which is main character behavior. go forth and generate some VoID, ily π¦β¨π
π¦ where this page comes from
- debian bookworm: librdf-generator-void-perl 0.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-generator-void-perl 0.16-4 Β· 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