Skip to content

Instantly share code, notes, and snippets.

View csarven's full-sized avatar
👽
https://csarven.ca/#i

Sarven Capadisli csarven

👽
https://csarven.ca/#i
View GitHub Profile
@csarven
csarven / gist:4650969
Last active December 11, 2015 19:48
tdb.sdmx.ttl
Imported data to named graphs into TDB using the following assembler files:
tdb.5B0.ttl
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
/usr/lib/jena/trunk/apache-jena$ sudo mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Jena - Distribution
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [remote-resources:process {execution: default}]
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [assembly:single {execution: create-jena-download}]
[INFO] Reading assembly descriptor: assembly-jena-zip.xml
@csarven
csarven / gist:5198926
Created March 19, 2013 18:43
org.apache.jena.riot.RiotException: No graph writer for null
[2013-03-19 19:39:05] INFO Fuseki :: [1] GET http://localhost:3030/dataset/query?query=%0ADESCRIBE+%3Chttp%3A%2F%2Fexample.info%2Fid%2F1000%3E%0A&output=html
[2013-03-19 19:39:05] INFO Fuseki :: [1] Host localhost:3030
[2013-03-19 19:39:05] INFO Fuseki :: [1] Accept */*
[2013-03-19 19:39:05] INFO Fuseki :: [1] Query =
DESCRIBE <http://example.info/id/1000>
[2013-03-19 19:39:05] DEBUG TDB :: Txn[1]/R: begin$
[2013-03-19 19:39:05] DEBUG info :: Triple table: SPO :: SPO,POS,OSP
[2013-03-19 19:39:05] DEBUG info :: Quad table: GSPO :: GSPO,GPOS,GOSP,POSG,OSPG,SPOG
@csarven
csarven / gist:5221536
Last active December 15, 2015 07:09
Exports of goods and services (BoP, current US$) for CH
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>
@csarven
csarven / gist:5657055
Created May 27, 2013 13:29
Apache LogFormat in RDF Turtle
LogFormat "[\
a http:Request;\
:referrer \"%{Referer}i\";\
:useragent \"%{User-agent}i\";\
:remotehost \"%h\";\
:remotehostip \"%a\";\
:remoteuser \"%u\";\
time:inXSDDateTime \"%{%Y-%m-%dT%T%z}t\";\
:canonicalservername \"%v\";\
:querystring \"%q\";\
@csarven
csarven / NoOptimizer.java
Last active December 17, 2015 18:59
Activating Optimize.noOptimizer() for Fuseki
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
SELECT ?datasetTitle ?source
WHERE {
{SERVICE <http://worldbank.270a.info/sparql> {
SELECT ?datasetTitle ?source
WHERE {
?dataset a qb:DataSet ; dcterms:title ?datasetTitle
BIND("1" AS ?source)
}
ORDER BY LCASE(?datasetTitle)
}}
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/linked-data/cube#Observation> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://purl.org/linked-data/cube#dataSet> <http://eurostat.270a.info/dataset/tps00001> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://eurostat.270a.info/property/FREQ> <http://purl.org/linked-data/sdmx/2009/code#freq-A> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://eurostat.270a.info/property/indic_de> <http://eurostat.270a.info/code/1.0/CL_INDIC_DE/JAN> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://eurostat.270a.info/property/geo> <http://eurostat.270a.info/code/1.0/CL_GEO/AT> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://eurostat.270a.info/property/TIME_PERIOD> <http://reference.data.gov.uk/id/year/2012> .
<http://eurostat.270a.info/dataset/tps00001/A/JAN/AT/2012> <http://eurostat.270a.info/property/OBS_
<qb:Observation rdf:about="/data/migr_asydcfstq#Q,AD,F,TOTAL,GENCONV,AT,2013Q2">
<qb:dataSet rdf:resource="/data/migr_asydcfstq"></qb:dataSet>
<sdmx-dimension:freq rdf:resource="http://purl.org/linked-data/sdmx/2009/code#freq-Q"></sdmx-dimension:freq>
<property:citizen rdf:resource="/dic/citizen#AD"></property:citizen>
<property:sex rdf:resource="/dic/sex#F"></property:sex>
<property:age rdf:resource="/dic/age#TOTAL"></property:age>
<property:decision rdf:resource="/dic/decision#GENCONV"></property:decision>
<property:geo rdf:resource="/dic/geo#AT"></property:geo>
<sdmx-dimension:timePeriod rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2013-04-01</sdmx-dimension:timePeriod>
<sdmx-measure:obsValue>0</sdmx-measure:obsValue>
@csarven
csarven / gist:8711388
Created January 30, 2014 15:44
install.shiny-server.sh
#!/bin/bash
# Install Node.js
sudo apt-get update
sudo apt-get install software-properties-common python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
# Install R