Skip to content

Instantly share code, notes, and snippets.

Avatar

Peb Ruswono Aryan pebbie

View GitHub Profile
@pebbie
pebbie / sparqlqueryviz.py
Last active Sep 12, 2020
visualize BGP triples in SPARQL query
View sparqlqueryviz.py
import sys
import os.path as path
from rdflib import Namespace, XSD, RDF, RDFS, OWL
from rdflib.term import Variable, URIRef, BNode, Literal
from rdflib.plugins.sparql.parser import parseQuery
from rdflib.plugins.sparql.parserutils import prettify_parsetree
from rdflib.plugins.sparql import prepareQuery
from rdflib.paths import Path
import pprint
import pygraphviz as pgv
@pebbie
pebbie / export_vocab_from_wb.rq
Last active Jul 22, 2020
first attempt on trying to import/export existing vocabulary into/from wikibase. this query is for exporting annotated wikibase into RDF/OWL using OWL equivalentXX property
View export_vocab_from_wb.rq
CONSTRUCT {
?ss ?pe ?oo .
?ss rdfs:label ?l
}
WHERE {
# original statement
?s ?p ?o.
?s rdfs:label ?l.
# we know there's an equivalent property for p
View wikibase-docker_qs_login_hacks.md

you need to execute these commands inside the quickstatements docker container (e.g. from terminal:

docker exec -it wikibase-docker_quickstatements_1 /bin/bash

) or replace the file using local file mapping in the docker-compose.yml recipe

  1. comment out the require_once line in the /var/www/html/magnustools/public_html/php/wikidata.php for example, using sed :

sed -i 's/require_once/\/\/require_once/' /var/www/html/magnustools/public_html/php/wikidata.php

View rdf2pandas.py
"""
file: rdf2pandas.py
auth: Peb Ruswono Aryan
desc: import data in RDF Data Cube (assumed in particular shape) from Graph to Pandas DataFrame
"""
from rdflib import Graph, Namespace, RDF, RDFS
import pandas as pd
QB = Namespace('http://purl.org/linked-data/cube#')
DCT = Namespace('http://purl.org/dc/terms/')
View extract_raw_kandinsky.py
"""
file: extract.py
auth: Peb Ruswono Aryan
date: 02.10.2019
desc: extract shapes (rectangle,triangle,circle) and raw attributes (color, location and size)
for used in kandinsky test
output tab separated values in the stdout
"""
import numpy as np
import cv2
@pebbie
pebbie / CMakeLists.txt
Last active Mar 4, 2019
CMake build file for building serd on Windows & VS2017 (might be incomplete but works for me)
View CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
PROJECT(serd)
SET(MAJOR 0)
SET(MINOR 30)
SET(PATCH 0)
SET(CMAKE_INCLUDE_CURRENT_DIR 1)
INCLUDE(CheckSymbolExists)
@pebbie
pebbie / web-servers.md
Created Feb 13, 2019 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
View keybase.md

Keybase proof

I hereby claim:

  • I am pebbie on github.
  • I am pebaryan (https://keybase.io/pebaryan) on keybase.
  • I have a public key whose fingerprint is 4FC2 EC77 8E45 84A6 EABC E49A A5BA 8E20 F980 59A5

To claim this, I am signing this object:

@pebbie
pebbie / restbed-vs2017.md
Created Dec 11, 2018
Building restbed in Windows using Visual Studio 2017 (x64)
View restbed-vs2017.md

Building

  1. Install perl (strawberry) and NASM

  2. build openssl

    1. go to dependency\openssl directory
    2. perl Configure VC-WIN64A
    3. run nmake and libssl and libcrypto (lib & dll) will be generated at the dependency\openssl directory
    4. modify cmake\findOpenSsl.cmake and insert libssl.lib and libcrypto.lib
@pebbie
pebbie / proj4-win64-msvc-2017.md
Last active Aug 1, 2020
building proj6 on visual studio 2017 (windows)
View proj4-win64-msvc-2017.md

Howto build PROJ6 on Windows (Visual Studio 2017-x64)

1. Download SQLITE3

  • build sqlite3.dll :cl sqlite3.c /LD

  • generate sqlite3.lib : lib sqlite3.obj

  • build sqlite3.exe : cl shell.c sqlite3.lib -o sqlite3.exe