Skip to content

Instantly share code, notes, and snippets.

@rdmpage
rdmpage / zotero-wikidata-lookup.js
Last active July 9, 2020 14:27 — forked from zuphilip/zotero-wikidata-lookup.js
Zotero Script for Wikidata Lookup
// Zotero script look up selected items in Wikidata and
// check whether the DOI can be found there. If results
// are found then the QIDs are saved in the corresponding
// items in the extra field. Some warnings are given for the
// other cases; thus watch the Zotero error console as well
// during execution of the script. [CC0]
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var map = [];
@rdmpage
rdmpage / cltools.sh
Created November 10, 2017 16:15 — forked from justinbellamy/cltools.sh
Install Autoconf and Automake on OS X El Capitan
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
@rdmpage
rdmpage / jsonld.sh
Created April 18, 2017 19:29 — forked from jprante/jsonld.sh
JSON-LD in Elasticsearch
curl -XDELETE 'localhost:9200/jsonld'
curl -XPOST 'localhost:9200/jsonld'
curl -XPUT 'localhost:9200/jsonld/doc/1' -d '
{
"@context":
{
"dc": "http://purl.org/dc/elements/1.1/",
@rdmpage
rdmpage / geojson-conversion.sh
Created January 11, 2016 13:15 — forked from benbalter/geojson-conversion.sh
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
= Network versioning using relationnodes
Recently there was a nice blog on versioning networks by Ian Robinson (http://iansrobinson.com/2014/05/13/time-based-versioned-graphs/[read it here]) on using identity nodes and separating structure from state. In this gist I'd like to put in my 2 cents by introducing another approach using _relationnodes_. This is more about structure of a network than about states of nodes, but it treats versioning differently. As Ian states in his blog, there's always a trade-off to be made, since versioning causes an extra load on storage and processing.
== Relationnodes?
=== What are relationnodes?
Relation nodes are intermediary nodes between two network nodes that represents the relation between the nodes.
So, if A and B are two network nodes, instead of connecting them with a relationship of `[:RELTYPE]`,