Skip to content

Instantly share code, notes, and snippets.

View dvcama's full-sized avatar

Diego Valerio Camarda dvcama

View GitHub Profile
@mdread
mdread / mkString.java
Created July 23, 2012 16:53
make a string from an iterator or array using an optional separator and prefix-suffix values
public static String mkString(Iterable<?> values, String start, String sep, String end){
// if the array is null or empty return an empty string
if(values == null || !values.iterator().hasNext())
return "";
// move all non-empty values from the original array to a new list (empty is a null, empty or all-whitespace string)
List<String> nonEmptyVals = new LinkedList<String>();
for (Object val : values) {
if(val != null && val.toString().trim().length() > 0){
nonEmptyVals.add(val.toString());
@PaulHuygen
PaulHuygen / gist:10016200
Last active June 7, 2016 19:02
Install Virtuoso 7.1.0 on a clean Centos 6.5 system.
The following script installs Virtuoso on a clean Centos 6.5 system.
#!/bin/bash
yum update
yes | yum install autoconf automake libtool flex bison gperf git openssl-devel readline-devel
export VIRTUOSO_NAME=virtuoso-opensource
export VIRTUOSO_VERSION=7.1.0
export VIRTUOSO_FULLNAME=$VIRTUOSO_NAME-$VIRTUOSO_VERSION
export VIRTUOSO_TARBALL=$VIRTUOSO_FULLNAME.tar.gz
@hectorcorrea
hectorcorrea / ldp_containers.md
Last active May 7, 2024 17:35
A summary of the basic differences between the different kind of containers that LDP supports.

This document is a summary of the basic differences between the different kind of containers that Linked Data Platform (LDP) supports.

LDP specifies three types of containers:

  1. Basic Container
  2. Direct Container
  3. Indirect Container.

This documents describes the differences between the three types of containers by showing what triples are added by an LDP Server when adding a new element to each kind of container.

In particular we assume we have a fictitious blog entry (/blog/entry1/) and we want to add a comment to it. We start by showing what happens if the blog entry is a Basic Container, then we show what happens if the blog entry was instead a Direct Container, and lastly if it was an Indirect Container.