Skip to content
Snippets Groups Projects
Commit 49384b16 authored by alangrafu's avatar alangrafu Committed by GIT_AUTHOR_NAME
Browse files

Merge branch 'master' into development

parents be82596c 8867f057
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,8 @@ class SpecialFunction extends AbstractSpecialFunction{ ...@@ -73,7 +73,8 @@ class SpecialFunction extends AbstractSpecialFunction{
$base['this']['contentType'] = $acceptContentType; $base['this']['contentType'] = $acceptContentType;
$base['model']['directory'] = $conf['model']['directory']; $base['model']['directory'] = $conf['model']['directory'];
$base['view']['directory'] = $conf['view']['directory']; $base['view']['directory'] = $conf['view']['directory'];
$base['ns'] = $conf['ns']; $base['ns'] = $conf['ns']; $base['ns'] = $conf['ns'];
$base['sparqlendpoint'] = $conf['endpoint'];
$base['type'] = $modelFile; $base['type'] = $modelFile;
$base['header'] = $prefixHeader; $base['header'] = $prefixHeader;
$base['args'] = $args; $base['args'] = $args;
...@@ -83,7 +84,8 @@ class SpecialFunction extends AbstractSpecialFunction{ ...@@ -83,7 +84,8 @@ class SpecialFunction extends AbstractSpecialFunction{
$base['view']['directory'] = $conf['home'].$conf['view']['directory']; $base['view']['directory'] = $conf['home'].$conf['view']['directory'];
$base['model']['directory'] = $conf['home'].$conf['model']['directory']; $base['model']['directory'] = $conf['home'].$conf['model']['directory'];
chdir($conf['model']['directory']); chdir($conf['model']['directory']);
Utils::queryFile($modelFile, $endpoints['local'], $data); $first = array();
Utils::queryFile($modelFile, $endpoints['local'], $data, $first);
chdir($conf['home']); chdir($conf['home']);
$data = Utils::internalize($data); $data = Utils::internalize($data);
......
...@@ -30,13 +30,13 @@ class MetaDb{ ...@@ -30,13 +30,13 @@ class MetaDb{
global $conf; global $conf;
try{ try{
$db = new PDO('sqlite:'.$this->dbLocation); $db = new PDO('sqlite:'.$this->dbLocation);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$results = $db->exec($q);
$results = $db->exec($q);
$db = NULL; $db = NULL;
}catch(PDOException $e){ }catch(Exception $e){
print 'Exception exec: '.$e->getMessage()."\n\n"; echo "Can't write in SQLite database. Please check you have granted write permissions to <tt>meta/</tt> and <tt>meta/db.sqlite</tt>.";
exit(10); trigger_error('Exception exec: '.$e->getMessage(), E_USER_ERROR);
exit(1);
} }
return $results; return $results;
} }
......
...@@ -22,9 +22,12 @@ class Utils{ ...@@ -22,9 +22,12 @@ class Utils{
exit(0); exit(0);
} }
public static function send500($uri){ public static function send500($msg = null){
header("HTTP/1.0 500 Internal Server Error"); header("HTTP/1.0 500 Internal Server Error");
echo "An internal error ocurred. Please try later\n\n"; echo "An internal error ocurred. Please try later\n\n";
if($msg != null){
echo $msg;
}
exit(0); exit(0);
} }
......
#!/usr/bin/env bash
# Installation script for LODSPeaKr (http://lodspeakr.org)
# Author: Alvaro Graves (alvaro@graves.cl)
# Modified by: Tim Lebo (lebot@rpi.edu)
lodspeakr_repository="git://github.com/alangrafu/lodspeakr.git"
home=`basename $lodspeakr_repository | sed 's/.git//'`
source ~/.bashrc
GIT=`which git`
if [ -z "$GIT" ]; then
echo "git is required to continue installation. Please add git to your \$PATH."
exit 1
fi
if [ ! -e "$home" ]; then
$GIT clone $lodspeakr_repository
cd $home
./install.sh
else
echo "There is already an existing directory called '$home'. Installation cancelled. Remove it first and try again."
fi
#!/bin/bash
#
# Script to borrow essential bits ;rom another lodspeakr instance on local machine.
# Desired when lodspeakr essentials are maintained in a project-specfic repository.
# Contributed by Tim Lebo when trying to apply lodspeakr for DataFAQs.
#
# Usage:
# bash-3.2$ pwd
# /Applications/XAMPP/htdocs/hello/lodspeakr
#
# bash-3.2$ sudo rm -rf .htaccess settings.inc.php models views
#
# bash-3.2$ sudo /Users/lebo/projects/lodspeakr/github/lodspeakr/utils/link-components.sh /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr
# ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/settings.inc.php settings.inc.php
# ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/.htaccess .htaccess
# ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/models models
# ln -s /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr/views views
#
# bash-3.2$ sudo /Users/lebo/projects/lodspeakr/github/lodspeakr/utils/link-components.sh /Users/lebo/projects/DataFAQs/github/DataFAQs/ui/configure-epoch/lodspeakr
# WARNING: not linking settings.inc.php because it exists.
# WARNING: not linking .htaccess because it exists.
# WARNING: not linking models because it exists.
# WARNING: not linking views because it exists.
essentials='settings.inc.php .htaccess models views'
if [ $# -lt 1 ]; then
echo "usage: `basename $0` other-lodspeakr-directory"
echo " soft links the following from other-lodspeakr-director to current directory: $essentials"
exit 1
fi
otherDir="$1"
if [[ ! -d $otherDir && "$otherDir" != "/" ]]; then
echo "$otherDir does not exist."
exit 1
fi
for essential in $essentials; do
if [[ ! -e $essential && -e $otherDir/$essential ]]; then
echo ln -s $otherDir/$essential $essential
ln -s $otherDir/$essential
else
echo "WARNING: not linking $essential because it exists."
fi
done
<h4>Endpoint: {{base.sparqlendpoint.local}}</h4>
<div style='float:center'> <div style='float:center'>
<a href='{{base.home}}'>Home</a> | <a href='{{base.home}}/special/classes'>Classes</a> | <a href='{{base.home}}/special/namedGraphs'>Named Graphs</a> <a href='{{base.home}}'>Home</a> | <a href='{{base.home}}special/classes'>Classes</a> | <a href='{{base.home}}special/namedGraphs'>Named Graphs</a>
</div> </div>
...@@ -11,14 +11,8 @@ ...@@ -11,14 +11,8 @@
<h1>Classes available</h1> <h1>Classes available</h1>
{%include "header.inc"%} {%include "header.inc"%}
<ul> <ul>
{% if r.resource.value != null %}
<!-- Only one class available -->
<li><a href='{{base.baseUrl}}special/instances/{{ r.resource.curie }}'>{{r.resource.curie}}</a></li>
{% endif %}
{% for row in r %} {% for row in r %}
{% if row.resource.value %}
<li><a href='{{base.baseUrl}}special/instances/{{ row.resource.curie }}'>{{row.resource.curie}}</a></li> <li><a href='{{base.baseUrl}}special/instances/{{ row.resource.curie }}'>{{row.resource.curie}}</a></li>
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</body> </body>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<link href="{{base.baseUrl}}/lodspeakr/css/basic.css" rel="stylesheet" type="text/css" media="screen" /> <link href="{{base.baseUrl}}/lodspeakr/css/basic.css" rel="stylesheet" type="text/css" media="screen" />
</head> </head>
<body> <body>
<h1>Graphs available in the triple store</h1> <h1>Graphs available</h1>
{%include "header.inc"%} {%include "header.inc"%}
<ul> <ul>
{% for row in r %} {% for row in r %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment