Skip to content

Instantly share code, notes, and snippets.


Knut Behrends knbknb

View GitHub Profile
knbknb /
Last active Mar 2, 2021 — forked from bueckl/wget
wget examples - from
###### Spider Websites with Wget 20 Practical Examples
# original, from 2019:
###### Spider Websites with Wget 20 Practical Examples
# wget is extremely powerful, but like with most other command line programs,
# the plethora of options it supports can be intimidating to new users.
# Thus what we have here are a collection of wget commands that you can use
# to accomplish common tasks from downloading single files to mirroring entire websites.
# It will help if you can read through the wget manual but for the busy souls,
knbknb / all-graphs.rq
Last active Dec 21, 2020
basic SPARQL queries
View all-graphs.rq
# show all graphs accessiblefrom a SPARQL endpoint
# no "base" prefix is needed
# from anzograph tutorial.
# query works in anzograph running on localhost,
# but not on, wikidata and other public endpoints
# on dbpedia running on localhost:8890/sparql this returns 54261 rows
knbknb /
Last active Dec 20, 2020 : codesnippets / examples for bash
#!/usr/bin/env bash
##### Query Wikidata Entities from bash - alternative
# returns only very basic graphs NOT via the SPARQL endpoint
# knb 2020
echo $WGE >&2
#curl -s: means --silent
View common-RDF-sparql-prefixes.rq
# more RDF prefixes, also very common
base <http://localhost:8180/sparql/> # anzograph
prefix xsd: <>
prefix skos: <>
prefix rdfs: <>
prefix rdf: <>
prefix owl: <>
prefix hint: <>
knbknb / igsn-1-0-schema.xsd
Last active Dec 18, 2020
IGSN is theInternational Geo Sample Number
View igsn-1-0-schema.xsd
<!-- saved here as a gist, for reference in case it gets changed or is taken offline -->
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="" xmlns:xsi="" xmlns="" targetNamespace="" elementFormDefault="qualified" xml:lang="EN" version="1.0">
<xs:include schemaLocation="include/accessType.xsd"/>
<xs:include schemaLocation="include/collectionType.xsd"/>
<xs:include schemaLocation="include/contributorType.xsd"/>
<xs:include schemaLocation="include/featureType.xsd"/>
<xs:include schemaLocation="include/geometryType.xsd"/>
<xs:include schemaLocation="include/identifierType.xsd"/>
knbknb / wikidata-1-entity-key-value-pairs-table.rq
Last active Dec 20, 2020
Wikidata SPARQL Queries from Stackoverflow, Blogposts, ForumPosts, Lecture Notes (e.g.2020 OpenHPI course "Knowledge Graphs")
View wikidata-1-entity-key-value-pairs-table.rq
PREFIX wd: <>
PREFIX wdt: <>
PREFIX wikibase: <>
PREFIX p: <>
PREFIX ps: <>
PREFIX pq: <>
PREFIX rdfs: <>
PREFIX bd: <>
# list all properts, in clear text, with
knbknb /
Last active Dec 18, 2020
# some examples of quering dbpedia from thecommand line
# knb 20201218
# show serialization formats that dbpedia can return
# (other than text/turtle)
# HTTP HEAD request
curl --no-progress-meter --head --header "Accept: text/turtle" ""
# --no-progress-meter and -s are the same, --head and -I are the same.
# shorter version of previous command:
knbknb / dbpedia-queries.sparql
Last active Dec 20, 2020
Simple sparql queries for use at https:://
View dbpedia-queries.sparql
# for more prefixes
# (wikidata, common)
# see also
# "Notable works" of a writer
PREFIX rdf: <>
PREFIX rdfs: <>
PREFIX dbo: <>
knbknb / R-package-creation-template.R
Created Apr 5, 2020
R package creation scaffold accoding to Bob Rudis
View R-package-creation-template.R
# Writing Frictionless R Package Wrappers — Building A Basic R Package
# in any RStudio R Console session
# in the newly created package RStudio R Console session:
usethis::use_mit_license() # need a LICENSE file
usethis::use_roxygen_md() # use {roxygen2} for documentation and configuration
usethis::use_package_doc() # setup a package-level manual page
knbknb /
Last active Dec 18, 2020
bash-fragments. Notes on EdX course "Unix Tools: Data, Software and Production Engineering" by D. Spinellis

Shell Command Language

Which option of the uniq command allows you to specify the number of fields to ignore in its comparisons?

uniq -f

  -f, --skip-fields=N   avoid comparing the first N fields
      --group[=METHOD]  show all items, separating groups with an empty line;