Skip to content

Instantly share code, notes, and snippets.

View nandana's full-sized avatar

Nandana Mihindukulasooriya nandana

View GitHub Profile
@nandana
nandana / commands.md
Last active September 28, 2019 16:50
Some useful day-to-day commands

Linux disk usage


  • df - report file system disk space usage
df -h

@nandana
nandana / example_onto.ttl
Last active July 12, 2019 22:50
A toy example to play with WebOWL
@prefix ex: <http://nandana.org/example/ontology/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dc11: <http://purl.org/dc/elements/1.1/> .
@prefix schema: <http://schema.org/> .
ex:
a owl:Ontology ;
dc11:title "An example ontology" ;
dc11:description "A toy example to play with WebOWL" .
A quick hack to get over https://github.com/openlink/virtuoso-opensource/issues/295
Removes the CRS URI from the property value.
grep -Erl '"<http:\/\/www\.wikidata\.org\/entity\/Q[[:digit:]]+>\s' . | xargs sed -i -E 's,"<http:\/\/www\.wikidata\.org\/entity\/Q[[:digit:]]+>\s,",g'
@nandana
nandana / duplicate-org-names.csv
Created August 18, 2017 19:58
Duplicate org names
name c
Mcdonald'S 11
MC Donald'S 5
Tgi Friday'S 3
Holiday Inn Express 3
Tim Hortons 3
Smashburger 3
Southern Asphalt Inc 2
Evangelical Lutheran Good Samaritan Society 2
Superior Door Service Inc 2
@nandana
nandana / duplicate-urls.csv
Created August 18, 2017 19:56
Duplicate URLs
url count
http://www.mcdonalds.com 78
http://www.chevron.com 23
http://www.wendys.com 19
http://www.bk.com 18
http://www.shell.us 16
http://www.kfc.com 14
http://www.holidayinn.com 12
http://www.exxon.com 10
http://www.texaco.com 10
{
"annotation":{
"@text":"No. 1 Pudong Avenue, Pudong New District SHANGHAI SHANGHAI 200120 China (Mainland) ",
"surfaceForm":[
{
"@name":"Avenue",
"@offset":"13",
"resource":[
{
"@label":"Avenue (archaeology)",
@nandana
nandana / query.rq
Created June 7, 2017 18:59
Entities mapped to Wikidata entities
Endpoint:
http://dbpedia.org/sparql
Query:
PREFIX owl: <http://www.w3.org/2002/07/owl#>
select count (distinct ?s) as ?c where {
?s owl:sameAs ?sWikidata .
FILTER regex(str(?sWikidata),'http://www.wikidata.org/entity/','i')
}
@nandana
nandana / open-data.txt
Created March 28, 2017 10:45
Open Data Repositories
https://datahub.io/
https://dev.socrata.com/data/
http://publicdata.eu/
https://www.quandl.com/
https://app.enigma.io/
https://data.world/
https://www.kaggle.com/datasets
@nandana
nandana / profile-result.ttl
Created March 14, 2017 16:37
RDF Data Profile - DBpedia Mappings in MappingPedia
@prefix rtc: <http://data.loupe.linkeddata.es/rtc/> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix pp: <http://data.loupe.linkeddata.es/pp/> .
@prefix loupe: <http://ont-loupe.linkeddata.es/def/core/> .
@prefix formats: <http://www.w3.org/ns/formats/> .
@prefix ps: <http://data.loupe.linkeddata.es/ps/> .
@prefix lld: <http://download.lodlaundromat.org/> .
@prefix loupe-ext: <http://ont-loupe.linkeddata.es/def/ext/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ltp: <http://data.loupe.linkeddata.es/ltp/> .
@nandana
nandana / mappings-download.sh
Created March 10, 2017 17:35
Download DBpedia mappings
#! /bin/bash
declare -a langs=( 'ar' 'az' 'be' 'bg' 'bn' 'ca' 'cs' 'cy' 'da' 'de' 'el' 'en' 'eo' 'es' 'et' 'eu' 'fa' 'fi' 'fr' 'ga' 'gl' 'hi' 'hr' 'hu' 'hy' 'id' 'it' 'ja' 'ko' 'lt' 'lv' 'mk' 'mt' 'nl' 'pl' 'pt' 'ro' 'ru' 'sk' 'sl' 'sr' 'sv' 'tr' 'uk' 'ur' 'vi' 'war' 'zh')
for i in ${langs[@]}
do
wget http://mappings.dbpedia.org/server/mappings/${i}/pages/rdf/all -O ${i}-mappings.ttl
done