diff --git a/app/Http/Controllers/CreatelinksController.php b/app/Http/Controllers/CreatelinksController.php index 4662473..22e4e26 100644 --- a/app/Http/Controllers/CreatelinksController.php +++ b/app/Http/Controllers/CreatelinksController.php @@ -2,15 +2,12 @@ namespace App\Http\Controllers; -use App\Models\OntologyTypeDriver; -use Illuminate\Http\Request; -use Illuminate\Http\Response; -use App\Project; -use App\File; +use DB; use Cache; use Storage; -use DB; -use App\Notification; +use App\Project; +use Illuminate\Http\Request; +use Illuminate\Http\Response; class CreatelinksController extends Controller { @@ -26,7 +23,6 @@ public function __construct() { * @return Response */ public function index(Project $project) { - session_start(); $this->cacheOntologies(); $nameSource = implode("_", ["project", $project->id, "source", $project->source->id, '']); $nameTarget = implode("_", ["project", $project->id, "target", $project->target->id, '']); @@ -68,9 +64,7 @@ public function json_serializer($file) { $jsonfile = Storage::disk('public')->get('json_serializer/' . $file); } catch (\Exception $ex){ - $newfile = explode("_", explode(".", $file)[0]); - $this->D3_convert(Project::find($newfile[1]), $newfile[2], $newfile[4]); - $jsonfile = Storage::disk('public')->get('json_serializer/' . $file); + dd($ex); } return (new Response($jsonfile, 200)) ->header('Content-Type', 'application/json'); @@ -141,114 +135,4 @@ public function getGroups() ->get(); return $select; } - - public function D3_convert(Project $project, $dump, $orderBy = null) { - $type = "SKOS"; - - $file = $project->$dump; - /* - * Read the graph - */ - $graph = $file->cacheGraph(); - /* - * Get the parent node - */ - $driver = OntologyTypeDriver::Factory($type); - $parents = $graph->allOfType($driver::root); - /* - * Iterate through all parents - */ - if($dump === "source"){ - $score = Cache::get("scores_graph_project" . $project->id); - } - else{ - $score = null; - } - foreach ($parents as $parent) { - /* - * Create Root Entry - */ - $name = $this->label($graph, $parent); - $JSON['name'] = "$name"; - $JSON['url'] = urlencode($parent); - $children = $this->find_children($graph, $driver::firstLevelPath, $parent, $orderBy, $score, $JSON, $type); - if (sizeOf($children) == 0){ - $children = $this->find_children($graph, $driver::inverseFirstLevelPath, $parent, $orderBy, $score, $JSON, $type); - } - $JSON['children'] = $orderBy === null ? $children : collect($children)->sortBy($orderBy)->values()->toArray(); - } - - /* - * create JSON file - */ - $name = implode("_", ["project", $project->id, $dump, $file->id, $orderBy]); - $filename = 'json_serializer/' . $name . ".json"; - Storage::disk('public')->put($filename, json_encode($JSON)); - return $filename; - } - - function find_children(\EasyRdf_Graph $graph, $hierarchic_link, $parent_url, $orderBy = null, $score = null, $type) { - $driver = OntologyTypeDriver::Factory($type); - $children = $graph->allResources($parent_url, $hierarchic_link); - $counter = 0; - $myJSON = []; - - foreach ($children as $child) { - $name = $this->label($graph, $child); - $myJSON[]["name"] = "$name"; - if($score !== null){ - $suggestions = count($score->resourcesMatching("http://knowledgeweb.semanticweb.org/heterogeneity/alignment#entity1", $child)); - } - else{ - $suggestions = 0; - } - - $myJSON[$counter]['suggestions'] = $suggestions; - $myJSON[$counter]['url'] = urlencode($child); - $children = $this->find_children($graph, $driver::secondLevelPath, $child, $orderBy, $score, $myJSON, $type); - if (sizeOf($children) == 0){ - $children = $this->find_children($graph, $driver::inverseSecondLevelPath, $child, $orderBy, $score, $myJSON, $type); - } - - $myJSON[$counter]['children'] = $orderBy === null ? $children : collect($children)->sortBy($orderBy)->values()->toArray(); - $counter++; - } - return $myJSON; - } - - public function parseScore(Project $project, $user_id){ - $old_score = storage_path() . "/app/projects/project" . $project->id . "/" . "score.nt"; - $score_filepath = storage_path() . "/app/projects/project" . $project->id . "/" . "score_project" . $project->id . ".nt"; - try{ - $command = 'rapper -i rdfxml -o ntriples ' . $old_score . ' > ' . $score_filepath; - $out = []; - logger($command); - exec( $command, $out); - logger(var_dump($out)); - Notification::create([ - "message" => 'Converted Score Graph...', - "user_id" => $user_id, - "project_id" => $project->id, - "status" => 2, - ]); - } - catch(\Exception $ex){ - logger($ex); - } - try{ - $scores = new \EasyRdf_Graph; - $scores->parseFile($score_filepath, "ntriples"); - - Notification::create([ - "message" => 'Parsed and Stored Graphs!!!', - "user_id" => $user_id, - "project_id" => $project->id, - "status" => 2, - ]); - } catch (\Exception $ex) { - logger($ex); - } - logger("converting files"); - Cache::forever("scores_graph_project" . $project->id, $scores); - } } \ No newline at end of file diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php index 0dc50af..739cbcd 100644 --- a/app/Http/Controllers/FileController.php +++ b/app/Http/Controllers/FileController.php @@ -5,8 +5,6 @@ use Illuminate\Http\Request; use App\File; -use App\User; -use Auth; class FileController extends Controller { @@ -21,21 +19,10 @@ public function __construct() * @return Response */ public function mygraphs() - { - $user = Auth::user(); - $files = $this->ownGraphs($user)->merge($this->publicGraphs($user)); - return view('files.index',["user"=>$user, "files"=>$files]); - } - - public function ownGraphs(User $user){ - $files = File::where("user_id", $user->id)->withCount("projects")->with("projects")->get(); - return $files; - } - - public function publicGraphs(User $user){ - $files = File::where("public", true)->where("user_id", "!=", $user->id)->withCount("projects")->with("projects")->get(); - return $files; - } + { + $user = auth()->user(); + return view('files.index',["user"=>$user, "files"=>$user->userGraphs()]); + } public function store() { @@ -44,7 +31,7 @@ public function store() 'resource' => 'file', 'resource_url' => 'url', ])->validate(); - if($input["resource_url"]){ + if($input["resource_url"] !== null){ $input["resource"] = $input["resource_url"]; } $file = File::create( $input ); @@ -72,8 +59,6 @@ public function update() $file->save(); return redirect()->route('mygraphs')->with('notification', 'File updated!!!'); - - } public function destroy(File $file) @@ -88,34 +73,8 @@ public function download(Request $request, File $file){ } public function parse(File $file) - { - /* - * Read the graph - */ - try{ - if($file->filetype != 'ntriples'){ - FileController::convert($file); - $file->cacheGraph(); - } - else{ - $file->cacheGraph(); - } - return redirect()->route('mygraphs')->with('notification', 'Graph Parsed!!!'); - - } catch (\Exception $ex) { - $file->parsed = false; - $file->save(); - error_log($ex); - return redirect()->route('mygraphs')->with('error', 'Failed to parse the graph. Please check the logs.' . $ex); - } - } - - public function convert(File $file){ - $command = 'rapper -i ' . $file->filetype . ' -o ntriples ' . $file->resource->path() . ' > ' . $file->resource->path(). '.nt'; - $out = []; - logger($command); - exec( $command, $out); - logger(var_dump($out)); - return; - } + { + dispatch(new \App\Jobs\Parse($file, auth()->user())); + return redirect()->back()->with('notification', 'Parsing Job Dispatched, check your logs.'); + } } diff --git a/app/Jobs/Convert.php b/app/Jobs/Convert.php index 5cdb6a1..3f921f2 100644 --- a/app/Jobs/Convert.php +++ b/app/Jobs/Convert.php @@ -2,15 +2,19 @@ namespace App\Jobs; - +use Cache; +use Storage; +use App\Project; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; -use App\Project; +use App\Models\OntologyTypeDriver; class Convert extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; + + use \App\RDFTrait; protected $project,$user, $dump; /** @@ -37,9 +41,8 @@ public function handle() "user_id" => $this->user, "project_id" => $this->project->id, "status" => 2, - ]); - $controller = new \App\Http\Controllers\CreatelinksController(); - $controller->D3_convert($this->project, $this->dump); + ]); + $this->D3_convert($this->project, $this->dump); if($this->dump === "target"){ \App\Notification::create([ @@ -48,12 +51,85 @@ public function handle() "project_id" => $this->project->id, "status" => 3, ]); - $this->project->processed = 1; $this->project->save(); } else{ - dispatch(new \App\Jobs\Convert($this->project, $this->user, "target")); + dispatch(new Convert($this->project, $this->user, "target")); + } + } + + public function D3_convert(Project $project, $dump, $orderBy = null) { + $type = "SKOS"; + $file = $project->$dump; + /* + * Get the parent node + */ + $driver = OntologyTypeDriver::Factory($type); + /* + * Read the graph + */ + $graph = $file->cacheGraph(); + + $parents = $graph->allOfType($driver::root); + /* + * Iterate through all parents + */ + if($dump === "source"){ + $score = Cache::get("scores_graph_project" . $project->id); + } + else{ + $score = null; + } + foreach ($parents as $parent) { + /* + * Create Root Entry + */ + $name = $this->label($graph, $parent); + $JSON['name'] = "$name"; + $JSON['url'] = urlencode($parent); + $children = $this->find_children($graph, $driver::firstLevelPath, $parent, $orderBy, $score, $JSON, $type); + if (sizeOf($children) == 0){ + $children = $this->find_children($graph, $driver::inverseFirstLevelPath, $parent, $orderBy, $score, $JSON, $type); + } + $JSON['children'] = $orderBy === null ? $children : collect($children)->sortBy($orderBy)->values()->toArray(); + } + + /* + * create JSON file + */ + $name = implode("_", ["project", $project->id, $dump, $file->id, $orderBy]); + $filename = 'json_serializer/' . $name . ".json"; + Storage::disk('public')->put($filename, json_encode($JSON)); + return $filename; + } + + function find_children(\EasyRdf_Graph $graph, $hierarchic_link, $parent_url, $orderBy = null, $score = null, $type) { + $driver = OntologyTypeDriver::Factory($type); + $children = $graph->allResources($parent_url, $hierarchic_link); + $counter = 0; + $myJSON = []; + + foreach ($children as $child) { + $name = $this->label($graph, $child); + $myJSON[]["name"] = "$name"; + if($score !== null){ + $suggestions = count($score->resourcesMatching("http://knowledgeweb.semanticweb.org/heterogeneity/alignment#entity1", $child)); + } + else{ + $suggestions = 0; + } + + $myJSON[$counter]['suggestions'] = $suggestions; + $myJSON[$counter]['url'] = urlencode($child); + $children = $this->find_children($graph, $driver::secondLevelPath, $child, $orderBy, $score, $myJSON, $type); + if (sizeOf($children) == 0){ + $children = $this->find_children($graph, $driver::inverseSecondLevelPath, $child, $orderBy, $score, $myJSON, $type); + } + + $myJSON[$counter]['children'] = $orderBy === null ? $children : collect($children)->sortBy($orderBy)->values()->toArray(); + $counter++; } + return $myJSON; } } diff --git a/app/Jobs/Parse.php b/app/Jobs/Parse.php new file mode 100644 index 0000000..6ce52b6 --- /dev/null +++ b/app/Jobs/Parse.php @@ -0,0 +1,75 @@ +file = $file; + $this->user = $user; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + $this->parse($this->file); + } + + public function parse(File $file) + { + /* + * Read the graph + */ + try{ + if($file->filetype != 'ntriples'){ + $this->reserialize($file); + } + $file->cacheGraph(); + } catch (\Exception $ex) { + $file->parsed = false; + $file->save(); + error_log($ex); + } + } + + public function reserialize(File $file){ + $command = [ + 'rapper', + '-i ', + $file->filetype, + '-o', + 'ntriples', + $file->resource->path(), + '>', + $file->resource->path(). '.nt' + ]; + + $process = new Process($command); + $process->run(); + return; + } +} diff --git a/app/Jobs/ParseScores.php b/app/Jobs/ParseScores.php index 6e67ffd..8ab9910 100644 --- a/app/Jobs/ParseScores.php +++ b/app/Jobs/ParseScores.php @@ -2,13 +2,13 @@ namespace App\Jobs; -use App\Http\Controllers\CreatelinksController; +use Cache; +use App\Project; use App\Jobs\Job; -use App\Models\SuggestionConfigurations\SilkConfiguration; +use App\Notification; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; -use App\Project; class ParseScores extends Job implements ShouldQueue { @@ -33,8 +33,43 @@ public function __construct(Project $project, $user) */ public function handle() { - $score = new CreatelinksController(); - $score->parseScore($this->project, $this->user); + $this->parseScore($this->project, $this->user); dispatch(new \App\Jobs\Convert($this->project, $this->user, "source")); } + + private function parseScore(Project $project, $user_id){ + $old_score = storage_path() . "/app/projects/project" . $project->id . "/" . "score.nt"; + $score_filepath = storage_path() . "/app/projects/project" . $project->id . "/" . "score_project" . $project->id . ".nt"; + try{ + $command = 'rapper -i rdfxml -o ntriples ' . $old_score . ' > ' . $score_filepath; + $out = []; + logger($command); + exec( $command, $out); + logger(var_dump($out)); + Notification::create([ + "message" => 'Converted Score Graph...', + "user_id" => $user_id, + "project_id" => $project->id, + "status" => 2, + ]); + } + catch(\Exception $ex){ + logger($ex); + } + try{ + $scores = new \EasyRdf_Graph; + $scores->parseFile($score_filepath, "ntriples"); + + Notification::create([ + "message" => 'Parsed and Stored Graphs!!!', + "user_id" => $user_id, + "project_id" => $project->id, + "status" => 2, + ]); + } catch (\Exception $ex) { + logger($ex); + } + logger("converting files"); + Cache::forever("scores_graph_project" . $project->id, $scores); + } } diff --git a/app/Jobs/RunSilk.php b/app/Jobs/RunSilk.php index 300609a..03640aa 100644 --- a/app/Jobs/RunSilk.php +++ b/app/Jobs/RunSilk.php @@ -2,12 +2,14 @@ namespace App\Jobs; -use App\Models\SuggestionConfigurations\SilkConfiguration; +use App\User; +use App\Project; use Illuminate\Queue\SerializesModels; +use Symfony\Component\Process\Process; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; -use App\Project; -use App\User; +use Symfony\Component\Process\Exception\ProcessFailedException; + class RunSilk extends Job implements ShouldQueue { @@ -18,12 +20,14 @@ class RunSilk extends Job implements ShouldQueue * * @return void */ - protected $project,$user; + protected $project,$user, $configFileName; public function __construct(Project $project, User $user) { $this->project = $project; $this->user = $user->id; + $this->configFileName = storage_path() . "/app/projects/project" . $project->id . "/project" . $project->id . "_config.xml"; + $this->checkExistingFile($project->id); } /** @@ -32,9 +36,44 @@ public function __construct(Project $project, User $user) * @return void */ public function handle() - { - $score = new SilkConfiguration(); - $score->runSiLK($this->project, $this->user); - + { + $this->runSiLK($this->project); + } + + private function getConfig($filename){ + $config = array_merge( + ["java"], + config("alignment.silk.config", []), + [ + '-jar', + config("alignment.silk.jar"), + '-DconfigFile=' . $filename + ]); + return $config; + } + + public function runSiLK(Project $project) { + \App\Notification::create([ + "message" => 'Started Job...', + "user_id" => $this->user, + "project_id" => $project->id, + "status" => 2, + ]); + $config = $this->getConfig($this->configFileName); + $process = new Process($config); + $process->run(); + \App\Notification::create([ + "message" => 'Finished SiLK similarities Calculations...', + "user_id" => $this->user, + "project_id" => $project->id, + "status" => 2, + ]); + dispatch(new \App\Jobs\ParseScores($project, $this->user)); + } + + private function checkExistingFile($id){ + if (\Storage::disk("projects")->exists("/project" . $id . "/score_project" . $id . ".nt")) { + \Storage::disk("projects")->delete("/project" . $id . "/score_project" . $id . ".nt"); + } } } diff --git a/app/Jobs/Skosify.php b/app/Jobs/Skosify.php new file mode 100644 index 0000000..577c76e --- /dev/null +++ b/app/Jobs/Skosify.php @@ -0,0 +1,34 @@ + "owl:Class", - "restriction" => "rdfs:subClassOf", - "firstLevelPath" => "rdfs:subClassOf" - ], - [ - "class" => "owl:ObjectProperty", - "restriction" => "rdfs:subPropertyOf", - "firstLevelPath" => "rdfs:subPropertyOf" - ] - ]; +use App\Models\OntologyTypeDriver; +class OWLDriver extends OntologyTypeDriver +{ - - protected $firstLevelPath = null; - - protected $inverseFirstLevelPath = null; - - protected $secondLevelPath = null; - - protected $inverseSecondLevelPath = null; + const id = "OWL"; + + const name = "OWL Driver"; + + const description = "" ; + + const root = "owl:Ontology"; + + const firstLevelPath = "rdfs:subClassOf"; + + const inverseFirstLevelPath = "^rdfs:subClassOf"; + + const secondLevelPath = "rdfs:subClassOf"; + + const inverseSecondLevelPath = "^rdfs:subClassOf"; + +// protected $firstLevel = [ +// [ +// "class" => "owl:Class", +// "restriction" => "rdfs:subClassOf", +// "firstLevelPath" => "rdfs:subClassOf" +// ], +// [ +// "class" => "owl:ObjectProperty", +// "restriction" => "rdfs:subPropertyOf", +// "firstLevelPath" => "rdfs:subPropertyOf" +// ] +// ]; +// +// +// +// protected $firstLevelPath = null; +// +// protected $inverseFirstLevelPath = null; +// +// protected $secondLevelPath = null; +// +// protected $inverseSecondLevelPath = null; } diff --git a/app/Models/SuggestionConfigurations/SilkConfiguration.php b/app/Models/SuggestionConfigurations/SilkConfiguration.php index cece58d..da64960 100644 --- a/app/Models/SuggestionConfigurations/SilkConfiguration.php +++ b/app/Models/SuggestionConfigurations/SilkConfiguration.php @@ -5,8 +5,6 @@ use App\Project; use App\Settings; use Storage; -use Cache; - class SilkConfiguration { @@ -203,29 +201,5 @@ public function validateSchema($file) { "errors" => $errors ]; return collect($bag); - } - - public function runSiLK(Project $project, $user_id) { - $id = $project->id; - $filename = storage_path() . "/app/projects/project" . $id . "/project" . $id . "_config.xml"; - \App\Notification::create([ - "message" => 'Started Job...', - "user_id" => $user_id, - "project_id" => $project->id, - "status" => 2, - ]); - exec('java -d64 -Xms2048M -Xmx4096M -DconfigFile=' . $filename . ' -Dreload=true -Dthreads=4 -jar ' . app_path() . '/functions/silk/silk.jar'); - - if (Storage::disk("projects")->exists("/project" . $project->id . "/score_project" . $project->id . ".nt")) { - Storage::disk("projects")->delete("/project" . $project->id . "/score_project" . $project->id . ".nt"); - } - - \App\Notification::create([ - "message" => 'Finished SiLK similarities Calculations...', - "user_id" => $user_id, - "project_id" => $project->id, - "status" => 2, - ]); - dispatch(new \App\Jobs\ParseScores($project, $user_id)); - } + } } diff --git a/app/User.php b/app/User.php index 20f09a9..b53c157 100644 --- a/app/User.php +++ b/app/User.php @@ -22,9 +22,7 @@ class User extends Authenticatable */ protected $hidden = [ 'password', 'remember_token', - ]; - - + ]; public function links(){ return $this->hasMany("App\Link"); @@ -50,4 +48,16 @@ public function social(){ return $this->hasMany("App\SocialAccount"); } + public function userGraphs(){ + return $this->ownGraphs()->merge($this->publicGraphs()); + } + + public function ownGraphs(){ + return File::where("user_id", $this->id)->withCount("projects")->with("projects")->get(); + } + + public function publicGraphs(){ + return File::where("public", true)->where("user_id", "!=", $this->id)->withCount("projects")->with("projects")->get(); + } + } diff --git a/composer.json b/composer.json index abb2808..d53bac6 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,9 @@ "vluzrmos/language-detector": "^1.0", "rairlie/laravel-locking-session": "^1.0", "yajra/laravel-datatables-oracle": "^8.0", - "sabre/xml": "^2.0" + "sabre/xml": "^2.0", + "laravel/tinker": "^1.0", + "symfony/process": "^4.0" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index be334b3..21e1430 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9bb6a4dbe69d3b11ad9ec769fa802efc", - "content-hash": "caf32c7822534b973292e2c80282593e", + "hash": "7b87e6cbb1f13309753fd0338f885c12", + "content-hash": "c9899c3826ee8be90a069b69c26aa482", "packages": [ { "name": "acacha/admin-lte-template-laravel", @@ -582,6 +582,39 @@ ], "time": "2018-03-29 22:10:58" }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", + "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "@stable" + }, + "type": "project", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "time": "2014-10-24 07:27:01" + }, { "name": "doctrine/annotations", "version": "v1.6.0", @@ -1513,6 +1546,93 @@ ], "time": "2015-09-19 16:54:05" }, + { + "name": "jakub-onderka/php-console-color", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "0.*", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "3.7.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleColor": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com", + "homepage": "http://www.acci.cz" + } + ], + "time": "2014-04-08 15:00:19" + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.3.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "shasum": "" + }, + "require": { + "jakub-onderka/php-console-color": "~0.1", + "php": ">=5.3.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~0.5", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleHighlighter": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ], + "time": "2015-04-20 18:58:01" + }, { "name": "laravel/framework", "version": "v5.6.15", @@ -1713,6 +1833,69 @@ ], "time": "2017-11-06 16:02:48" }, + { + "name": "laravel/tinker", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "94f6daf2131508cebd11cd6f8632ba586d7ecc41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/94f6daf2131508cebd11cd6f8632ba586d7ecc41", + "reference": "94f6daf2131508cebd11cd6f8632ba586d7ecc41", + "shasum": "" + }, + "require": { + "illuminate/console": "~5.1", + "illuminate/contracts": "~5.1", + "illuminate/support": "~5.1", + "php": ">=5.5.9", + "psy/psysh": "0.7.*|0.8.*", + "symfony/var-dumper": "~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (~5.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "time": "2018-03-06 17:34:36" + }, { "name": "laravelcollective/html", "version": "v5.6.5", @@ -2254,6 +2437,57 @@ ], "time": "2018-03-19 15:50:49" }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28 20:30:58" + }, { "name": "paragonie/random_compat", "version": "v2.0.11", @@ -2496,6 +2730,78 @@ ], "time": "2017-10-23 01:57:42" }, + { + "name": "psy/psysh", + "version": "v0.8.18", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5357b1cffc8fb375d6a9e3c86d5c82dd38a40834", + "reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834", + "shasum": "" + }, + "require": { + "dnoegel/php-xdg-base-dir": "0.1", + "jakub-onderka/php-console-highlighter": "0.3.*", + "nikic/php-parser": "~1.3|~2.0|~3.0", + "php": ">=5.3.9", + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "hoa/console": "~3.16|~1.14", + "phpunit/phpunit": "^4.8.35|^5.4.3", + "symfony/finder": "~2.1|~3.0|~4.0" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.8.x-dev" + } + }, + "autoload": { + "files": [ + "src/Psy/functions.php" + ], + "psr-4": { + "Psy\\": "src/Psy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "time": "2018-04-02 05:41:44" + }, { "name": "rairlie/laravel-locking-session", "version": "v1.1.0", @@ -3386,16 +3692,16 @@ }, { "name": "symfony/process", - "version": "v4.0.6", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e" + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6ed08502a7c9559da8e60ea343bdbd19c3350b3e", - "reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e", + "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", "shasum": "" }, "require": { @@ -3431,7 +3737,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-02-19 12:18:43" + "time": "2018-04-03 05:24:00" }, { "name": "symfony/routing", diff --git a/config/alignment/silk.php b/config/alignment/silk.php index 8c4301e..f7b6b42 100644 --- a/config/alignment/silk.php +++ b/config/alignment/silk.php @@ -7,6 +7,14 @@ */ return [ - "jar"=>"" + "jar"=> app_path() . '/functions/silk/silk.jar', + + "config" => [ + '-d64', + '-Xms2G', + '-Xmx4G', + '-Dreload=true', + '-Dthreads=4' + ] ]; diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 0000000..739c0b6 --- /dev/null +++ b/config/logging.php @@ -0,0 +1,68 @@ + env('LOG_CHANNEL', 'stack'), + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + ], + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, + ], + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => 'critical', + ], + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'with' => [ + 'stream' => 'php://stderr', + ], + ], + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + ], +]; \ No newline at end of file diff --git a/database/migrations/2016_04_11_162009_create_failed_jobs_table.php b/database/migrations/2018_04_04_090710_create_failed_jobs_table.php similarity index 74% rename from database/migrations/2016_04_11_162009_create_failed_jobs_table.php rename to database/migrations/2018_04_04_090710_create_failed_jobs_table.php index 3d733b6..df9f443 100644 --- a/database/migrations/2016_04_11_162009_create_failed_jobs_table.php +++ b/database/migrations/2018_04_04_090710_create_failed_jobs_table.php @@ -1,5 +1,6 @@ increments('id'); + $table->bigIncrements('id'); $table->text('connection'); $table->text('queue'); $table->longText('payload'); + $table->longText('exception'); $table->timestamp('failed_at')->useCurrent(); }); } @@ -28,6 +31,6 @@ public function up() */ public function down() { - Schema::drop('failed_jobs'); + Schema::dropIfExists('failed_jobs'); } } diff --git a/storage/app/projects/.gitignore b/storage/app/projects/.gitignore index 93c00b7..67bd945 100644 --- a/storage/app/projects/.gitignore +++ b/storage/app/projects/.gitignore @@ -1,4 +1,5 @@ * +!owl2skos.cfg !default_config.xml !LinkSpecificationLanguage.xsd !.gitignore diff --git a/storage/app/projects/owl2skos.cfg b/storage/app/projects/owl2skos.cfg new file mode 100644 index 0000000..1c726fb --- /dev/null +++ b/storage/app/projects/owl2skos.cfg @@ -0,0 +1,49 @@ +# Skosify configuration file for transforming simple OWL or RDFS ontologies into SKOS +# +# Can be used e.g. with the DCMI Type vocabulary: +# wget http://dublincore.org/2010/10/11/dctype.rdf -q -O - | ./skosify.py -c owl2skos.cfg -o dctype-skos.ttl + +# runtime options which correspond to command line parameters +[options] +narrower=True +transitive=False +aggregates=False +debug=False + +# define custom RDF namespaces that can then be used in the mappings below (and will also be used in the output file) +# Note that common namespaces are already defined: rdf, rdfs, owl, skos, dc, dct +[namespaces] +dcmitype=http://purl.org/dc/dcmitype/ + +# define what to do with types in the source vocabulary, i.e. how these map to SKOS constructs +# key: CURIE or localname (string) +# value: CURIE or empty (to delete the instances) +# the instances will be replaced with instances. +# key may start with * which matches any localname prefix +# Note: use period '.' instead of colon ':' as separator in key CURIEs +[types] +owl.Class=skos:Concept +owl.ObjectProperty=skos:Concept +owl.DatatypeProperty=skos:Concept +rdfs.Class=skos:Concept + +# define what to do with literal properties on Concepts +# key: CURIE or localname (string) +# value: CURIE or empty (to delete the property) +# the properties will be replaced with properties +# key may start with * which matches any prefix +# Note: use period '.' instead of colon ':' as separator in key CURIEs +[literals] +rdfs.label=skos:prefLabel +rdfs.comment=skos:definition + +# define what to do with relation properties on Concepts +# key: CURIE or localname (string) +# value: CURIE or empty (to delete the property) +# the properties will be replaced with properties +# key may start with * which matches any prefix +# Note: use period '.' instead of colon ':' as separator in key CURIEs +[relations] +rdfs.subClassOf=skos:broader +rdfs.subPropertyOf=skos:broader +owl.equivalentClass=skos:exactMatch