Skip to content

Instantly share code, notes, and snippets.

View cmarat's full-sized avatar

Marat Charlaganov cmarat

View GitHub Profile
@cmarat
cmarat / azure-ubuntu-virtuoso7-shell-history.sh
Last active January 12, 2017 16:20
Virtuoso 7 Installation Notes
sudo apt-get update
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make OpenSSL libssl-dev
sudo apt-get install git wget curl libreadline-dev
git clone https://github.com/openlink/virtuoso-opensource.git
cd virtuoso-opensource
./autogen.sh
./configure --enable-silent-rules --enable-fct-vad --enable-rdb2rdf-vad --with-pthreads --with-readline
make -j3
sudo make install
@cmarat
cmarat / virtuoso-sparql-autologin
Last active December 21, 2015 03:19
Authenticate Virtuoso SPARQL endpoint users using the SQL user name given in the endpoint Realm.
create procedure
DB.DBA.HP_AUTH_SQL_USER_AUTO (in realm varchar)
{
declare _user varchar;
_user := realm;
connection_set ('SPARQLUserId', _user);
return 1;
}
;
TMPDIR=`mktemp -d`
cd $TMPDIR
wget https://github.com/ers-devs/sugar-mail/archive/master.zip
unzip master.zip
cd sugar-mail-master/src/
python setup.py dist_xo
sugar-install-bundle dist/Messages-1.xo
rm -r $TMPDIR
C:\elaticsearch\service\ElasticSearch.exe //IS//ElasticSearch –DisplayName="ElasticSearch" –Description="Distributed RESTful Full-Text Search Engine based on Lucene (http://www.elasticsearch.org/)" –Install=C:\elasticsearch\service\ElasticSearch.exe –Classpath="C:\elasticsearch\lib\elasticsearch-0.90.3.jar;C:\elasticsearch\lib\*;C:\elasticsearch\lib\sigar\*" –Jvm="C:\Program Files\Java\jre7\bin\server\jvm.dll" –JvmMx=512 –JvmOptions="-Xms256m;-Xmx1g;-XX:+UseCompressedOops;-Xss128k;-XX:+UseParNewGC;-XX:+UseConcMarkSweepGC;-XX:+CMSParallelRemarkEnabled;-XX:SurvivorRatio=8;-XX:MaxTenuringThreshold=1;-XX:CMSInitiatingOccupancyFraction=75;-XX:+UseCMSInitiatingOccupancyOnly;-XX:+HeapDumpOnOutOfMemoryError;-Djline.enabled=false;-Delasticsearch;-Des-foreground=yes;-Des.path.home=C:elasticsearch" –StartMode=jvm –StartClass=org.elasticsearch.bootstrap.Bootstrap –StartMethod=main –StartParams="" –StopMode=jvm –StopClass=org.elasticsearch.bootstrap.Bootstrap –StopMethod=main –StdOutput=auto –StdError=auto –LogLevel=Debug
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cmarat
cmarat / owl2skos.rq
Created April 8, 2014 15:56
A quick and dirty mapping of OWL to SKOS
CONSTRUCT {
?s skos:altLabel ?l .
?s a skos:Concept .
?s skos:broader ?parent
}
WHERE {
?s a owl:Class;
rdfs:label ?l .
OPTIONAL {?s rdfs:subClassOf ?parent} .
}
import csv
import rdflib
g = rdflib.Graph()
label = rdflib.namespace.RDFS['label']
d = csv.reader(open('belief.csv').readlines())
# skip headers
d.next()
@cmarat
cmarat / virtuoso.service
Created April 14, 2014 16:54
virtuoso service config for archlinux (systemd)
[Unit]
Description=Virtuoso Opensource
[Service]
User=virtuoso
Group=virtuoso
Type=forking
ExecStart=/opt/virtuoso7/bin/virtuoso-t +configfile /home/virtuoso/db/virtuoso.ini
[Install]
@cmarat
cmarat / etc_init_virtuoso.conf
Created April 14, 2014 17:46
virtuoso upstart config
description "Virtuoso Opensource 7"
author "cmarat@github"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed