Skip to content

Instantly share code, notes, and snippets.

View stain's full-sized avatar

Stian Soiland-Reyes stain

View GitHub Profile
@stain
stain / paq2svg.sh
Last active December 15, 2015 11:49
#!/bin/bash
set -e
PROVTOOLBOX="$HOME/software/provToolbox"
PROVCONVERT="$PROVTOOLBOX/bin/provconvert"
provUri=`curl -s -I $1 | grep ^Link:.*has_provenance | sed 's/.*<//' | sed 's/>.*//' | head -n 1`
provn=/tmp/$$.provn
@stain
stain / gist:5262169
Last active December 15, 2015 12:39
Example of using PAV
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix pav: <http://purl.org/pav/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix : <http://example.com/blog#> .
<http://example.com/blog.html>
pav:createdBy :alice ;
pav:createdWith :wordpress ;
@prefix pav: <http://purl.org/pav/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix prv: <http://purl.org/net/provenance/core#> .
@prefix prvTypes: <http://purl.org/net/provenance/types#> .
@prefix http: <http://www.w3.org/2006/http#> .
<http://example.com/data.csv> a prv:DataItem, prov:Entity ;
pav:retrievedFrom <http://example.org/originalData> ;
prv:retrievedBy [ a prvTypes:HTTPBasedDataAccess ;
prv:accessedResource <http://example.org/originalData> ;
@stain
stain / TestZipFS.java
Last active December 17, 2015 09:59
Not sure if this is a feature or bug in ZipFS.. a path can be both a file and folder at the same time -- kind of.
import static org.junit.Assert.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
package org.purl.wf4ever.robundle.fs;
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
import java.nio.file.FileSystemNotFoundException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix nsl: <http://purl.org/ontology/storyline/> .
<> a owl:Ontology ;
@stain
stain / gist:5639385
Created May 23, 2013 21:00
ORCID API updated to show (very) minimal FOAF profile. Do NOT pull - tidyup needed! :-)) https://github.com/stain/ORCID-Source/tree/rdf
stain@vmint ~ $ curl -H "Accept: application/rdf+xml" http://localhost:8080/orcid-pub-web-1.1.5-SNAPSHOT/0000-0001-5533-6255
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
<rdf:Description rdf:about="http://localhost:8080/orcid-web/0000-0001-5533-6255">
<foaf:familyName>Doe</foaf:familyName>
<foaf:givenName>John</foaf:givenName>
@stain
stain / manifest.ttl
Created May 29, 2013 13:30
Suggestion on how to do ORE aggregation with snapshots - for RO bundles - https://w3id.org/bundle https://twitter.com/edsu/status/339727143053426689 Here snapshots/9e9c036c... is a non-aggregated snapshot retrieved from the aggregated absolute URI <http://example.com/comments.txt>, and the aggregated </README.txt> has been retrieved from the non…
@base <app://2b9486f0-54d8-4274-b241-7669538b0d2f/.ro/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix pav: <http://purl.org/pav/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
This file has been truncated, but you can view the full file.
{
"@context" : [ "https://w3id.org/scufl2/context", {
"@base" : "http://ns.taverna.org.uk/2010/workflowBundle/064fcb33-cb4c-424c-a608-258c8529652e/"
} ],
"id" : "http://ns.taverna.org.uk/2010/workflowBundle/064fcb33-cb4c-424c-a608-258c8529652e/",
"workflow" : {
"id" : "workflow/Generic_ENM_workflow/",
"name" : "Generic_ENM_workflow",
"revisions" : [ {
"id" : "http://ns.taverna.org.uk/2010/workflow/064fcb33-cb4c-424c-a608-258c8529652e/",
@stain
stain / configuration.json
Created June 12, 2013 08:10
Proposal: JSON as SCUFL2's configuration format. <configuration.json> represents a complete configuration of the REST activity. This JSON validates according to the JSON Schema <schema.json>. <context.json> is a JSON-LD context (linked to with "@context") that can be used to create the RDF in <rdf-from-json.ttl>. This RDF shows clearly a very si…
{
"@context": "http://ns.taverna.org.uk/2010/activity/rest.context",
"outgoingDataFormat": "String",
"escapeParameters": false,
"request": {
"httpMethod": "POST",
"headers": [
{ "header": "Accept",
"value": "audio/mpeg" },
{ "header": "Content-Type",