Skip to content

Instantly share code, notes, and snippets.

View niklasl's full-sized avatar

Niklas Lindström niklasl

View GitHub Profile
@niklasl
niklasl / rdfa-stats.xslt
Created November 13, 2011 16:47
Using XSLT to extract RDFa usage statistics
<!DOCTYPE xsl:stylesheet [
<!ENTITY tab "&#9;">
<!ENTITY lf "&#10;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings">
<xsl:param name="base-url">&lt;stdin&gt;</xsl:param>
<xsl:param name="include-header">yes</xsl:param>
@niklasl
niklasl / v6n7p.html
Created January 13, 2012 23:42
Experimental version of <http://lod.taxonconcept.org/ses/v6n7p.rdf> as RDFa 1.1 in HTML5
<!DOCTYPE html>
<html vocab="http://lod.taxonconcept.org/ontology/txn.owl#"
prefix="dwc_terms: http://rs.tdwg.org/dwc/terms/index.htm# uniprot: http://purl.uniprot.org/core/"
lang="en">
<head typeof="http://purl.org/ontology/bibo/Webpage" about="/ses/v6n7p.html">
<base href="http://lod.taxonconcept.org/" />
<link rel="dc:isPartOf" href="/ontology/void#TaxonConcept" />
<title property="dc:title">About: Species Puma concolor se:v6n7p HTML Version</title>
<link rel="dc:publisher" href="/ontology/txn.owl#TaxonConcept_Knowledge_Base_Project" />
<link rel="dc:creator" href="/ontology/people.owl#Peter_J_DeVries" />
@niklasl
niklasl / tune_shadow.html
Created January 26, 2012 15:18
CURIE overshadowing
<!DOCTYPE html>
<html prefix="tune: http://footscroll.com/tunes">
<head>
<base href="http://blographosphere.net/user/011235813" />
</head>
<body>
<ul rel="foaf:interest">
<li about="tune://sprinklydo.com/music/alberto_balsalm">
<p property="rdfs:label">Alberto Balsalm</p>
</li>
@niklasl
niklasl / students-jumping-in-front-of-memorial-bell-tower.html
Created February 9, 2012 00:16
An HTML5+RDFa1.1 version of an example article by Jason Ronallo
<!-- An RDFa 1.1 version of the data presented in the article
"HTML5 Microdata and Schema.org" at
<http://journal.code4lib.org/articles/6400>.
The article is licensed under a Creative Commons Attribution 3.0 United
States License. This example code should be consired a remix thereof. -->
<div id="main" role="main" class="container_12" vocab="http://schema.org/" resource="" typeof="ItemPage">
<h2 id="page_name" property="name">
Students jumping in front of Memorial Bell Tower
</h2>
<div class="grid_5" resource="http://www.freebase.com/m/026twjv">
@niklasl
niklasl / validate_curie_pattern.py
Created April 27, 2012 07:31
Validate CURIE regexp patterns
import re
valid_curies = [
"pfx:abc",
":",
"pfx:",
"abc",
":abc",
"",
"pfx:/abc",
@niklasl
niklasl / context.json
Created July 4, 2012 08:53
ORE description of an issue as JSON-LD
{
"@context": {
"uri": "@id",
"type": "@type",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"dc": "http://purl.org/dc/terms/",
"ore": "http://www.openarchives.org/ore/terms/",
"bibo": "http://purl.org/ontology/bibo/",
"name": {"@id": "http://www.w3.org/2000/01/rdf-schema#label", "@language": "en"},
"created": {"@id": "dc:created", "@type": "xsd:dateTime"},
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "Usage: $(basename $0) [pause|play|next track|previous track|set sound volume to [0-100]] [HOST]"
exit 0
fi
action=$1
host=$2
cmd="osascript -e 'tell application \"iTunes\" to $action'"
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body vocab="http://schema.org/">
<div resource="_:TShirtModel">
<div property="owl:unionOf" inlist typeof>
<link property="owl:onProperty" resource="schema:name"/>
<html>
<head>
<meta charset="utf-8"/>
<title>Dynamics of Intraocular IFN-?, IL-17 and IL-10-Producing Cell Populations during Relapsing and Monophasic Rat Experimental Autoimmune Uveitis.</title>
<link rel="alternate" href="http://dx.doi.org/10.1371/journal.pone.0049008"/>
<link rel="canonical" href="http://pubmed.gov/23155443"/>
</head>
<body>
<article resource="info:pmid:23155443" vocab="http://schema.org/" typeof="MedicalScholarlyArticle">
<header><h1 property="name"><a property="url" href="http://pubmed.gov/23155443">Dynamics of Intraocular ...</a></h1>
@niklasl
niklasl / rdfa_prototypes.html
Created December 9, 2012 08:52
HTML5+RDFa version of <http://d.lib.ncsu.edu/collections/catalog/mc00096-001-ff0155-000-001_0001> using experimental RDFa prototypes
<!DOCTYPE html>
<html>
<head>
<base href="http://d.lib.ncsu.edu/collections/catalog/mc00096-001-ff0155-000-001_0001" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width; initial-scale=1.0">