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 / SacramentocrimeJanuary2006.csv
Last active September 17, 2018 22:33
Exercises for Tarql
We can't make this file beautiful and searchable because it's too large.
cdatetime,address,district,beat,grid,crimedescr,ucr_ncic_code,latitude,longitude
1/1/06 0:00,3108 OCCIDENTAL DR,3,3C ,1115,10851(A)VC TAKE VEH W/O OWNER,2404,38.55042047,-121.3914158
1/1/06 0:00,2082 EXPEDITION WAY,5,5A ,1512,459 PC BURGLARY RESIDENCE,2204,38.47350069,-121.4901858
1/1/06 0:00,4 PALEN CT,2,2A ,212,10851(A)VC TAKE VEH W/O OWNER,2404,38.65784584,-121.4621009
1/1/06 0:00,22 BECKFORD CT,6,6C ,1443,476 PC PASS FICTICIOUS CHECK,2501,38.50677377,-121.4269508
1/1/06 0:00,3421 AUBURN BLVD,2,2A ,508,459 PC BURGLARY-UNSPECIFIED,2299,38.6374478,-121.3846125
1/1/06 0:00,5301 BONNIEMAE WAY,6,6B ,1084,530.5 PC USE PERSONAL ID INFO,2604,38.52697863,-121.4513383
1/1/06 0:00,2217 16TH AVE,4,4A ,957,459 PC BURGLARY VEHICLE,2299,38.537173,-121.4875774
1/1/06 0:00,3547 P ST,3,3C ,853,484 PC PETTY THEFT/INSIDE,2308,38.56433456,-121.4618826
1/1/06 0:00,3421 AUBURN BLVD,2,2A ,508,459 PC BURGLARY BUSINESS,2203,38.6374478,-121.3846125
@jaw111
jaw111 / frame1.jsonld
Last active August 29, 2018 19:01
example skos tree in JSON-LD
{
"@context": {
"skos": "http://www.w3.org/2004/02/skos/core#"
},
"@type": "skos:ConceptScheme",
"skos:hasTopConcept": {
"@type": "skos:Concept"
}
}
@jaw111
jaw111 / sample.csv
Created August 22, 2018 21:22
Using SPARQL 1.1 Federation with Tarql
familyName x
Allwood 10
Brandon 20
Caiazza 30
@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" } }|'
@jaw111
jaw111 / skos.jsonld
Created July 27, 2014 13:15
SKOS JSON-LD context
{
"@context": {
"@vocab": "http://www.w3.org/2004/02/skos/core#",
"broadMatch": { "@type": "@id" },
"broader": { "@type": "@id" },
"broaderTransitive": { "@type": "@id" },
"closeMatch": { "@type": "@id" },
"exactMatch": { "@type": "@id" },
"hasTopConcept": { "@type": "@id" },
"inScheme": { "@type": "@id" },
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 ;