forked from cariaso/Semantic-MediaWiki-Bot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
97 lines (64 loc) · 2.69 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
MediaWiki::Bot::Plugin::Semantic
==========================
This is Semantic, a Mediawiki::Bot plugin designed to for data retrieval from Semantic Mediawiki ( http://semantic-mediawiki.org/ ).
SYNOPSIS
my $bot = MediaWiki::Bot->new();
$bot->set_wiki({
protocol => 'http',
host => 'bots.snpedia.com',
path => '/',
});
my $results1 = $bot->ask({
query=>"[[Category:Is a genotype]] [[On chromosome::1]]
|?Allele1
|?Allele2
|limit=500",
});
my $results2 = $bot->askargs({
conditions=>"[[Category:Is a genotype]] [[On chromosome::1]]",
outs=>['Allele1','Allele2'],
});
# Output format still reflects the raw JSON response, and is likely to change in the future.
use Data::Dumper;
print Dumper $results1;
print Dumper $results2;
# Requests are still made as uncacheable POSTs instead of cacheable GETs
# See https://rt.cpan.org/Public/Bug/Display.html?id=75296 for current status
METHODS
ask
askargs
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
Some of the test scripts included with this distribution of Semantic
require a working Internet connection. If the test phase will not
complete because you do not have access to bots.snpedia.com, you can
(probably) safely install the module anyway.
MINIMAL INSTALL
CPAN can often a trigger a huge dependency cascade. While trying to
build a bug report for someone else I found this to be a minimal
path to testing from a fresh amazon cloud image
sudo yum -y install make cpan perl-JSON git
git clone git://github.com/cariaso/Semantic-MediaWiki-Bot.git
git clone git://github.com/MediaWiki-Bot/MediaWiki-Bot.git
wget http://cpansearch.perl.org/src/EXOBUZZ/MediaWiki-API-0.37/lib/MediaWiki/API.pm -O MediaWiki-Bot/lib/MediaWiki/API.pm
export PERL5LIB=MediaWiki-Bot/lib/:Semantic-MediaWiki-Bot/lib/
perl Semantic-MediaWiki-Bot/t/02-jdd-test.pl
DEPENDENCIES
This module requires these other modules and libraries:
MediaWiki::API
In addition, you must have MediaWiki::Bot version 1.5.2 or greater for plugin support.
COPYRIGHT AND LICENCE
Copyright (C) 2012 Michael Cariaso
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.