Skip to content

Instantly share code, notes, and snippets.

View labra's full-sized avatar

Jose Emilio Labra Gayo labra

View GitHub Profile
@labra
labra / gist:6387424
Created August 30, 2013 08:05
REPL loop in Scala
import scala.tools.nsc.Settings
import scala.tools.nsc.interpreter.ILoop
object TestConsole extends App {
val settings = new Settings
settings.usejavacp.value = true
settings.deprecation.value = true
new SampleILoop().process(settings)
}
@labra
labra / gist:6446822
Created September 5, 2013 06:57
Example of a file that should not validate RDF Data Cube violating Integrity constraint 4 (Dimensions should have a rdfs:range)
@prefix wi-people: <http://data.webfoundation.org/webindex/people/> .
@prefix indicator: <http://data.webfoundation.org/webindex/v2013/indicator/> .
@prefix sdmxConcept: <http://purl.org/linked-data/sdmx/2009/concept#> .
@prefix sdmxAttribute: <http://purl.org/linked-data/sdmx/2009/attribute#> .
@prefix cex: <http://purl.org/weso/ontology/computex#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix obs: <http://data.webfoundation.org/webindex/v2013/observation/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix sdmxSubject: <http://purl.org/linked-data/sdmx/2009/subject#> .
@labra
labra / ArtistasManieristasDBPedia
Last active August 29, 2015 13:56
Consulta SPARQL DBpedia - Artistas de estilo manierista
# Artistas de estilo manierista que tienen otro estilo diferente al manierista
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT * WHERE {
?x dbo:movement <http://dbpedia.org/resource/Mannerism> .
dbo:movement ?y .
FILTER (?y != <http://dbpedia.org/resource/Mannerism>)
}
@labra
labra / ObrasCreadoresEuropeana
Created March 4, 2014 13:50
Obras y colecciones de España en Europeana
# Creators and collections of Europeana objects from spain
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX ens: <http://www.europeana.eu/schemas/edm/>
PREFIX edm: <http://www.europeana.eu/schemas/edm/>
SELECT *
WHERE {
?object dc:creator ?Creator ;
edm:collectionName ?Collection ;
edm:country "spain" ;
ens:aggregatedCHO ?CHO.
@labra
labra / Country.java
Created March 28, 2014 08:14
Simple Country Model
package models;
import javax.persistence.Entity;
import javax.persistence.Id;
import com.avaje.ebean.Ebean;
import play.db.ebean.Model;
@Entity
@labra
labra / Application.java
Created March 28, 2014 09:37
Application
package controllers;
import models.Country;
import play.data.Form;
import play.mvc.Controller;
import play.mvc.Result;
import views.html.*;
public class Application extends Controller {
@labra
labra / countries.scala.html
Created March 28, 2014 09:38
Countries view
@(countries: List[Country])
<html>
<h1>Vista de países</h1>
<table>
@for(country <- countries) {
<tr>
<td>@country.code</td>
<td>@country.name</td>
</tr>
@labra
labra / country.scala.html
Created March 28, 2014 09:39
Country view
@(country: Country)
<html>
<h1>País</h1>
<p>@country.code - @country.name</p>
</html>
@labra
labra / routes
Created March 28, 2014 09:40
Simple routes file
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET /saluda controllers.Application.saludaEdad(nombre: String, edad: Int)
GET / controllers.Application.index()
@labra
labra / gist:9930141
Created April 2, 2014 08:27
Enlace a guión de observaterraPlay
https://docs.google.com/document/d/1kuIxwcJZdMK2rQZy09N-h-Rbn3g1wDUooKMje9futKE/pub