| 1 |
NAME |
| 2 |
RDF::Generator::Void - Generate VoID descriptions based on data in an RDF |
| 3 |
model |
| 4 |
|
| 5 |
VERSION |
| 6 |
Version 0.16 |
| 7 |
|
| 8 |
SYNOPSIS |
| 9 |
use RDF::Generator::Void; |
| 10 |
use RDF::Trine::Model; |
| 11 |
my $mymodel = RDF::Trine::Model->temporary_model; |
| 12 |
[add some data to $mymodel here] |
| 13 |
my $generator = RDF::Generator::Void->new(inmodel => $mymodel); |
| 14 |
$generator->urispace('http://example.org'); |
| 15 |
$generator->add_endpoints('http://example.org/sparql'); |
| 16 |
my $voidmodel = $generator->generate; |
| 17 |
|
| 18 |
DESCRIPTION |
| 19 |
This module takes a RDF::Trine::Model object as input to the constructor, |
| 20 |
and based on the data in that model as well as data supplied by the user, |
| 21 |
it creates a new model with a VoID description of the data in the model. |
| 22 |
|
| 23 |
For a description of VoID, see <http://www.w3.org/TR/void/>. |
| 24 |
|
| 25 |
METHODS |
| 26 |
new(inmodel => $mymodel, dataset_uri => URI->new($dataset_uri), level => 1); |
| 27 |
The constructor. It can be called with two parameters, namely, `inmodel` |
| 28 |
which is a model we want to describe and `dataset_uri`, which is the URI |
| 29 |
we want to use for the description. Users should make sure it is possible |
| 30 |
to get this with HTTP. If this is not possible, you may leave this field |
| 31 |
empty so that a simple URN can be created for you as a default. |
| 32 |
|
| 33 |
`inmodel` |
| 34 |
Read-only accessor for the model used in description creation. |
| 35 |
|
| 36 |
`dataset_uri` |
| 37 |
Read-only accessor for the URI to the dataset. |
| 38 |
|
| 39 |
Property Attributes |
| 40 |
The below attributes concern some essential properties in the VoID |
| 41 |
vocabulary. They are mostly arrays, and can be manipulated using array |
| 42 |
methods. Methods starting with `all_` will return an array of unique |
| 43 |
values. Methods starting with `add_` takes a list of values to add, and |
| 44 |
those starting with `has_no_` return a boolean value, false if the array |
| 45 |
is empty. |
| 46 |
|
| 47 |
`all_vocabularies`, `add_vocabularies`, `has_no_vocabularies` |
| 48 |
Methods to manipulate a list of vocabularies used in the dataset. The |
| 49 |
values should be a string that represents the URI of a vocabulary. |
| 50 |
|
| 51 |
`all_endpoints`, `add_endpoints`, `has_no_endpoints` |
| 52 |
Methods to manipulate a list of SPARQL endpoints that can be used to query |
| 53 |
the dataset. The values should be a string that represents the URI of a |
| 54 |
SPARQL endpoint. |
| 55 |
|
| 56 |
`all_titles`, `add_titles`, `has_no_titles` |
| 57 |
Methods to manipulate the titles of the datasets. The values should be |
| 58 |
RDF::Trine::Node::Literal objects, and should be set with language. |
| 59 |
Typically, you would have a value per language. |
| 60 |
|
| 61 |
`all_licenses`, `add_licenses`, `has_no_licenses` |
| 62 |
Methods to manipulate a list of licenses that regulates the use of the |
| 63 |
dataset. The values should be a string that represents the URI of a |
| 64 |
license. |
| 65 |
|
| 66 |
`urispace`, `has_urispace` |
| 67 |
This method is used to set the URI prefix string that will match the |
| 68 |
entities in your dataset. The computation of the number of entities |
| 69 |
depends on this being set. `has_urispace` can be used to check if it is |
| 70 |
set. |
| 71 |
|
| 72 |
Running this stuff |
| 73 |
`level`, `has_level` |
| 74 |
Set the level of detail. 0 doesn't do any statistics or heuristics, 1 has |
| 75 |
some statistics for the dataset as a whole, 2 will give some partition |
| 76 |
statistics and 3 will give subject and object counts for property |
| 77 |
partitions. Setting no level will give everything. |
| 78 |
|
| 79 |
`stats`, `clear_stats`, `has_stats` |
| 80 |
Method to compute a statistical summary for the data in the dataset, such |
| 81 |
as the number of entities, predicates, etc. `clear_stats` will clear the |
| 82 |
statistics and `has_stats` will return true if exists. |
| 83 |
|
| 84 |
generate( [ $model ] ) |
| 85 |
Returns the VoID as an RDF::Trine::Model. You may pass a model with |
| 86 |
statements as argument to this method. This model may then contain |
| 87 |
arbitrary RDF that will be added to the RDF model. If you do not send a |
| 88 |
model, one will be created for you. |
| 89 |
|
| 90 |
AUTHORS |
| 91 |
Kjetil Kjernsmo `<[email protected]>` Toby Inkster `<[email protected]>` |
| 92 |
|
| 93 |
TODO |
| 94 |
* URI regexps support. |
| 95 |
|
| 96 |
* Technical features (esp. serializations). |
| 97 |
|
| 98 |
* Example resources and root resources. |
| 99 |
|
| 100 |
* Data dumps. |
| 101 |
|
| 102 |
* Subject classification. |
| 103 |
|
| 104 |
* Method to disable heuristics. |
| 105 |
|
| 106 |
* More heuristics. |
| 107 |
|
| 108 |
* Linkset descriptions. |
| 109 |
|
| 110 |
* Set URI space on partitions. |
| 111 |
|
| 112 |
* Use CHI to cache? |
| 113 |
|
| 114 |
* Use schema introspection to generate property attributes with |
| 115 |
MooseX::Semantic. |
| 116 |
|
| 117 |
BUGS |
| 118 |
Please report any bugs you find to |
| 119 |
<https://github.com/kjetilk/RDF-Generator-Void/issues> |
| 120 |
|
| 121 |
Note that any claim that this module will generate a void in spacetime, a |
| 122 |
wormhole, black hole, or funny philosophy is totally bogus and without any |
| 123 |
scientific merit whatsoever. The lead author has made elaborate |
| 124 |
precautions to avoid any such issues, and expects everyone to take his |
| 125 |
word for it. Oh, BTW, should it just happen anyway, it won't hurt much |
| 126 |
<http://news.sciencemag.org/sciencenow/2012/03/scienceshot-one-black-hole- |
| 127 |
wont-.html>. |
| 128 |
|
| 129 |
SUPPORT |
| 130 |
You can find documentation for this module with the perldoc command. |
| 131 |
|
| 132 |
perldoc RDF::Generator::Void |
| 133 |
|
| 134 |
The Perl and RDF community website is at <http://www.perlrdf.org/> where |
| 135 |
you can also find a mailing list to direct questions to. |
| 136 |
|
| 137 |
You can also look for information at: |
| 138 |
|
| 139 |
* AnnoCPAN: Annotated CPAN documentation |
| 140 |
|
| 141 |
<http://annocpan.org/dist/RDF-Generator-Void> |
| 142 |
|
| 143 |
* CPAN Ratings |
| 144 |
|
| 145 |
<http://cpanratings.perl.org/d/RDF-Generator-Void> |
| 146 |
|
| 147 |
* MetaCPAN |
| 148 |
|
| 149 |
<https://metacpan.org/module/RDF::Generator::Void> |
| 150 |
|
| 151 |
ACKNOWLEDGEMENTS |
| 152 |
Many thanks to Konstantin Baierer for help with |
| 153 |
RDF::Generator::Void::Meta::Attribute::ObjectList. |
| 154 |
|
| 155 |
LICENSE AND COPYRIGHT |
| 156 |
Copyright 2012 Toby Inkster. Copyright 2012,2013,2016 Kjetil Kjernsmo. |
| 157 |
|
| 158 |
This program is free software; you can redistribute it and/or modify it |
| 159 |
under the terms of either: the GNU General Public License as published by |
| 160 |
the Free Software Foundation; or the Artistic License. |
| 161 |
|
| 162 |
See http://dev.perl.org/licenses/ for more information. |
| 163 |
|