Skip to content

Instantly share code, notes, and snippets.

View nandana's full-sized avatar

Nandana Mihindukulasooriya nandana

View GitHub Profile
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"ldp": "http://www.w3.org/ns/ldp#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"dcterms": "http://purl.org/dc/terms/",
"foaf": "http://xmlns.com/foaf/0.1/",
"wdrs": "http://www.w3.org/2007/05/powder-s#",
Verifying that +nandana is my openname (Bitcoin username). https://onename.com/nandana
@nandana
nandana / gist:71304f332c320475d8ed
Created June 8, 2015 10:21
Tweets with #eswc2015 hashtag
This file has been truncated, but you can view the full file.
Time:8 Jun 2015 09:20:50 GMT
User:rmeusel, Followers: 114, Following: 136, Description: Big Data Juggler, Software Engineer, Researcher, Cineaste, Gamer, RL Addict
Location:null
Text:Heuristics For Fixing Common Errors In Deployed http://t.co/qQ07dwEuZP Microdata http://t.co/smf9QDcizv #eswc2015
Lang:en
isReweet:false
Retweet count:0
Fav. count:0
Source:<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>
HashTags:eswc2015
@nandana
nandana / elastic-export.conf
Last active August 29, 2015 14:25
Logstash configuration for connecting to elasticsearch
input {
elasticsearch {
hosts => ["localhost"]
scan => false
query => '{ "query": { "match_all": {} }, "fields": ["property", "triple_count"] }'
index => "rindex"
type => "property"
}
}
@nandana
nandana / gist:98e6627de44ff51080ba
Created July 15, 2015 15:50
logstash-error.log
nandana@nandana-oeg:~/tools/logstash-1.5.2/bin$ ./logstash -f ../conf/elastic-export.conf -v --debug
Reading config file {:file=>"logstash/agent.rb", :level=>:debug, :line=>"295", :method=>"local_config"}
Compiled pipeline code:
@inputs = []
@filters = []
@outputs = []
@periodic_flushers = []
@shutdown_flushers = []
PREFIX lemon: <http://www.lemon-model.net/lemon#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX lexvo: <http://lexvo.org/id/iso639-3/>
PREFIX dbnary: <http://kaiko.getalp.org/dbnary#>
select distinct ?word (count (distinct ?synonym) as ?synonymCount)
(group_concat(distinct ?synonym;separator="; ") as ?synonyms) where {
?lexicalEntry a lemon:LexicalEntry;
dbnary:synonym ?synonym .
?word dbnary:refersTo ?lexicalEntry .
@nandana
nandana / openaire_download.sh
Last active May 14, 2016 11:33
Open AIRE RDF dump download script
#! /bin/bash
#download data from http://dx.doi.org/10.5281/zenodo.51077
for i in $(seq -f "%06g" 1 134)
do
wget https://zenodo.org/record/51077/files/output$i.nq.gz
done
#extract the zip files
gzip -d *.nq.gz
@nandana
nandana / tql2reif.sh
Last active February 7, 2017 14:04
RDF reification of DBpedia TQL files along with template and attribute fields
#! /bin/bash
#The script expects a single tql file
if [ "$#" -ne 1 ]; then
echo "tql2rec - generates rectified statements from DBpedia tql files including template and infobox attributes."
echo "Usage: tql2rec <tql-file-to-be-used>"
exit 1;
fi
#Regex used to extract the template and the property from the context.
regex1='.*<(.*)&template=(.*)&property=(.*)&split(.*)>'
#Sometimes split parameter is not present.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xml:base="http://www.ontogrid.net/StickyNote#"
xmlns="http://www.ontogrid.net/StickyNote#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="#event1">
</rdf:Description>
<rdf:Description rdf:about="#event2">
</rdf:Description>
<rdf:Description rdf:about="#event3">
@nandana
nandana / patent-search-client.js
Created February 1, 2017 16:37
patent search client
//A simple node client that consume dummy patent search service.
var http = require('http');
//Search query parameters. Only two optional parameters are used.
var post_data = JSON.stringify( {
"keywords": [
"bluetooth", "beacon", "rfid"
],
"dateFrom": "20140101",