Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Latest commit

 

History

History
256 lines (180 loc) · 7.28 KB

workshop.org

File metadata and controls

256 lines (180 loc) · 7.28 KB

WS-LDN-2 workshop notes

Parallel processing

pmap

Like map, but parallel. Like map, except f is applied in parallel. Only useful for computationally intensive functions where the time of fn dominates the coordination overhead

Reducers

Async

Built-ins

delay

Delays execution of body until needed / deref’d

agent

Update value with given fn in separate thread

future

Invokes body in new thread, when obtaining result blocks calling thread until future is realized

promise / deliver

Returns a promise object that can be deref’d, and set, once only, with deliver.

realized?

comparison matrix between prims

core.async

Advanced core.async operations:

CSP

Aleph & Manifold

Graphs

Linked Data

Resource Description Framework (RDF)

RDFa
Vocabularies
Tools

SPARQL

Datastores
Query endpoints & examples
UK ONS
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sdef: <http://statistics.data.gov.uk/def/>
PREFIX sg: <http://statistics.data.gov.uk/def/statistical-geography#>
PREFIX sid: <http://statistics.data.gov.uk/id/statistical-geography/>

CONSTRUCT {
  ?item rdfs:label ?id ;
        sg:officialName ?name ;
        sg:hasExteriorLatLongPolygon ?poly .
}
WHERE {
  ?item a sdef:statistical-geography ;
        rdfs:label ?id ;
        sg:officialname ?name;
        sg:parentcode sid:E12000007 ;
        sg:hasExteriorLatLongPolygon ?poly .
}
ORDER BY ASC(?id)

Query for thi.ng/fabric: (doesn’t include sdef:statistical-geography and sg:parentcode sub-queries, since we didn’t use those in the CONSTRUCT phase of the above query:

{:prefixes {"rdf"  "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            "sdef" "http://statistics.data.gov.uk/def/"
            "sg"   "http://statistics.data.gov.uk/def/statistical-geography#"
            "sid"  "http://statistics.data.gov.uk/id/statistical-geography/"}
 :q        [{:where [[?item "rdfs:label" ?id]
                     [?item "sg:officialName" ?name]
                     [?item "sg:hasExteriorLatLongPolygon" ?poly]]}]
 :select   [?id ?name ?poly]
 :order    ?id}
DBpedia
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>

SELECT DISTINCT ?p
WHERE {
  ?p a dbo:MusicalArtist ;
  dbo:genre dbr:Techno ;
  dbo:birthPlace ?bp .
  ?bp dbo:country dbr:Germany
}

Books

Tools, frameworks, stores

Other graph databases

Neo4j

Query languages

Others

Clojurescript

CodeMirror

Google Maps API

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=INIT_FN"></script>

Replace YOUR_API_KEY & INIT_FN

Datasets

  1. London borough boundary shapes from ONS SPARQL endpoint (see query above)
  2. http://data.london.gov.uk/dataset/average-house-prices-borough (Each house sale in London 1995-2014, 190MB CSV, link near bottom of page)

Launching server from REPL

(require '[ws-ldn-2.core])
(in-ns 'ws-ldn-2.core)

(launch)