Skip to content

Instantly share code, notes, and snippets.

Avatar

Peb Ruswono Aryan pebbie

View GitHub Profile
View D2KB_eval.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View camp4northstar_spawn.py
import os
import os.path as path
import sys
import traceback
import json
import zipfile
from urllib.request import urlopen
import shutil
import argparse
@pebbie
pebbie / vis_timeline_with_arror_first_test.html
Created Dec 17, 2021 — forked from JimmyCheng/vis_timeline_with_arror_first_test.html
This is test to see how difficult it would be to add multiple arrows to vis.js timeline view. Can be previewed with https://gistpreview.github.io/?4a6a6feba553e2cbe0396486f157b7bb
View vis_timeline_with_arror_first_test.html
<!DOCTYPE html>
<html>
<head>
<title>Timeline | Group example, with an arrow</title>
<style>
body,
html {
font-family: arial, sans-serif;
@pebbie
pebbie / sparqlqueryviz.py
Last active Aug 30, 2022
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