From 86d4e0087f7026806ab1d13784b51a50f392500f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Thu, 15 Mar 2012 16:10:54 +0100 Subject: [PATCH] Deleted old files --- bin/index.js | 4 ---- lib/hook.io-dbpedia.coffee | 41 -------------------------------------- 2 files changed, 45 deletions(-) delete mode 100644 bin/index.js delete mode 100644 lib/hook.io-dbpedia.coffee diff --git a/bin/index.js b/bin/index.js deleted file mode 100644 index 0f4d4bb..0000000 --- a/bin/index.js +++ /dev/null @@ -1,4 +0,0 @@ -require('coffee-script') -var Hook = require('../lib/hook.io-dbpedia').DBPediaHook -var SparHook = new Hook() -SparHook.start() diff --git a/lib/hook.io-dbpedia.coffee b/lib/hook.io-dbpedia.coffee deleted file mode 100644 index ae07f90..0000000 --- a/lib/hook.io-dbpedia.coffee +++ /dev/null @@ -1,41 +0,0 @@ -# Imports -sparql = require 'sparql' -Hook = require('hook.io').Hook - -examplequery = " - SELECT DISTINCT ?label ?abstract ?population - WHERE { ?place rdf:type dbpedia-owl:PopulatedPlace. - ?place foaf:name ?label. - ?place dbpprop:population ?population. - OPTIONAL{ - ?place dbpedia-owl:abstract ?abstract. - FILTER langMatches( lang(?abstract), 'en') - } - } LIMIT 10" - - -class DBPediaHook extends Hook - constructor: (options) -> - self = this - Hook.call(self, options) - @client = new sparql.Client 'http://dbpedia.org/sparql' - #Set some initial namespaces - @client.prefix_map.dbprop = 'http://dbpedia.org/property/' - @client.prefix_map.dbpedia = 'http://dbpedia.org/resource/' - @client.prefix_map.rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' - @client.prefix_map.dbpedia-owl = 'http://dbpedia.org/ontology/' - - self.on 'hook::ready', -> - self.on '*::query', (data,fn) -> - @queryDBPedia data , (res) -> - console.log res - fn res - console.log "Created" - - - queryDBPedia: (query, cb) -> - console.log ">>Going to query" - @client.rows query, (err, res) -> - cb res - -exports.DBPediaHook = DBPediaHook