|
1 <?php namespace App\Console\Commands; |
|
2 |
|
3 use Illuminate\Console\Command; |
|
4 use Symfony\Component\Console\Input\InputOption; |
|
5 use Symfony\Component\Console\Input\InputArgument; |
|
6 |
|
7 class ImportCocoonRDF extends Command { |
|
8 |
|
9 /** |
|
10 * The console command name. |
|
11 * |
|
12 * @var string |
|
13 */ |
|
14 protected $name = 'corpus-parole:importRDF'; |
|
15 |
|
16 /** |
|
17 * The console command description. |
|
18 * |
|
19 * @var string |
|
20 */ |
|
21 protected $description = 'Command description.'; |
|
22 |
|
23 /** |
|
24 * Create a new command instance. |
|
25 * |
|
26 * @return void |
|
27 */ |
|
28 public function __construct() |
|
29 { |
|
30 parent::__construct(); |
|
31 } |
|
32 |
|
33 /** |
|
34 * Execute the console command. |
|
35 * |
|
36 * @return mixed |
|
37 */ |
|
38 public function fire() |
|
39 { |
|
40 echo("hello\n"); |
|
41 $doc = new \EasyRdf_Graph("http://cocoon.huma-num.fr/exist/crdo/rdf/crdo-ESLO1_ENTCONT_203"); |
|
42 $doc->load(); |
|
43 |
|
44 echo $doc->dump('text'); |
|
45 |
|
46 echo(join(', ', $doc->allOfType('foaf:Agent'))); |
|
47 } |
|
48 |
|
49 /** |
|
50 * Get the console command arguments. |
|
51 * |
|
52 * @return array |
|
53 */ |
|
54 protected function getArguments() |
|
55 { |
|
56 return [ |
|
57 ['example', InputArgument::REQUIRED, 'An example argument.'], |
|
58 ]; |
|
59 } |
|
60 |
|
61 /** |
|
62 * Get the console command options. |
|
63 * |
|
64 * @return array |
|
65 */ |
|
66 protected function getOptions() |
|
67 { |
|
68 return [ |
|
69 //['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null], |
|
70 ]; |
|
71 } |
|
72 |
|
73 } |