Skip to content

Instantly share code, notes, and snippets.

View jaw111's full-sized avatar

John Walker jaw111

  • Semaku
  • Eindhoven
View GitHub Profile
@jaw111
jaw111 / rss.context.jsonld.json
Last active July 1, 2018 09:44
Examples of RSS using RDF with rdf:List instead of rdf:Seq
{
"@context": {
"@vocab": "http://purl.org/rss/1.0/",
"items": {
"@container": "@list"
},
"type": "@type",
"iri": "@id",
"data": "@graph"
}
@jaw111
jaw111 / shape.ttl
Last active June 19, 2018 10:01
SHACL example
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <http://example.com/ns#> .
ex:Shape a sh:NodeShape ;
sh:targetClass ex:MyClass ;
sh:property [
# list of allowed values and meaning for ex:prop1
sh:path ex:prop1 ;
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix ns1: <http://www.w3.org/2004/02/skos/core#>.
@prefix ns2: <http://purl.org/dc/terms/>.
@prefix ns3: <http://www.w3.org/ns/shacl#>.
@prefix n69: <https://www.rijksoverheid.nl/documenten/kamerstukken/2011/01/10/>.
@prefix n72: <https://www.kadaster.nl/documents/32706/37743/bag+handreiking+aansluiten/>.
@prefix n73: <https://www.kadaster.nl/documents/20838/87954/BAG+processenhandboek+2013/>.
@prefix n74: <https://www.kadaster.nl/documents/20838/87954/BAG+objectenhandboek+2009+inclusief+besluiten+zorg-+en+studentencomplexen/>.
cat myFile.nt | \
sed -E 's|<(.*)> <(.*)> <(.*)> \.|{ "@id": "\1", "\2": { "@id": "\3" } }|' | \
sed -E 's|<(.*)> <(.*)> "(.*)" \.|{ "@id": "\1", "\2": "\3" }|' | \
sed -E 's|<(.*)> <(.*)> "(.*)"\^\^<http://www.w3.org/2001/XMLSchema#string> \.|{ "@id": "\1", "\2": "\3" }|' | \
sed -E 's|<(.*)> <(.*)> "(.*)"\^\^<(.*)> \.|{ "@id": "\1", "\2": { "@values": "\3", "@type": "\4" } }|'
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
prefix : <http://data.cubiss.nl/genealogy/>
CONSTRUCT {
?Child schema:parent ?Parent .
?Parent schema:children ?Child .
}
WHERE {
graph <http://data.cubiss.nl/genealogy/> {
@jaw111
jaw111 / construct_verblijfsobject.rq
Last active February 27, 2017 21:27
Queries for retsadak.nl
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix schema: <http://schema.org/>
prefix bag: <http://bag.basisregistraties.overheid.nl/def/bag#>
prefix gsp: <http://www.opengis.net/ont/geosparql#>
construct {
$verblijfsobject a schema:Place , ?Schema_class ;
schema:name ?place_name ;
schema:address ?nummeraanduiding ;
schema:containedIn ?woonplaats .
?nummeraanduiding a schema:PostalAddress ;
@jaw111
jaw111 / README.md
Last active October 17, 2015 11:32
Hackalod 2015

Hackalod 2015

Some sample SPARQL queries for KB endpoint

Cover art lookup service:

http://coverservice.bibliotheek.nl/cover/image/{isbn}

Examples:

#List of RDF classes and for each, the number of instances
#Liste des classes RDF et pour chacune, le nombre d'instances
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
select distinct ?class (count(?thing) as ?numInstances) where {
graph <http://www.data.maudry.com> {
<template id="footer">
<div class="container-fluid">
<div class="contact">
<h2 class="contact__title">Contact us</h2>
<p class="contact__text"><strong>Semaku B.V.</strong> SFJ4.009 Gebouw Videolab | Torenallee 20, 5617BC Eindhoven | <a href="mailto:info@semaku.com">info@semaku.com</a></p>
<ul class="social__icons">
<li><a href="https://twitter.com/semaku"><i class="fa fa-twitter fa-2x"></i></a></li>
<li><a href="https://www.linkedin.com/company/semaku"><i class="fa fa-linkedin fa-2x"></i></a></li>
<li><a href="https://github.com/semaku"><i class="fa fa-github fa-2x"></i></a></li>
</ul>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="ta_vp_BUK7Y8R7-60E" lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta>
<meta content="(C) Copyright 2005" name="copyright"></meta>
<meta content="(C) Copyright 2005" name="DC.rights.owner"></meta>
<meta content="p-topic" name="DC.Type"></meta>
<meta content="Applications" name="DC.Title"></meta>