consultas sparql

25
CONSULTAS SPARQL Por: Alex Gonzaga

Upload: alex-gonzaga

Post on 13-Jun-2015

5.175 views

Category:

Education


4 download

DESCRIPTION

sbc10utpl

TRANSCRIPT

Page 1: Consultas sparql

CONSULTAS SPARQL

Por: Alex Gonzaga

Page 2: Consultas sparql

CONSULTAS SPARQL SOBRE DBPEDIA

Page 3: Consultas sparql

CONSULTAS SPARQL

Todas las cosas que escribió Bart en la pizarra en la temporada 1.

SELECT ?episodio,?pizarra WHERE { ?episodio skos:subject

<http://dbpedia.org/resource/Category:The_Simpsons_episodes%2C_season_1>.

?episodio dbpedia2:blackboard ?pizarra}

Page 4: Consultas sparql

CONSULTAS SPARQL

Todo lo que escribió Bart en la pizarra ordenado por temporadas

SELECT ?temporada, ?episodio,?pizarra WHERE { ?episodio skos:subject ?temporada . ?temporada rdfs:label ?titulo_temporada . ?episodio dbpedia2:blackboard ?pizarra . FILTER (regex(?titulo_temporada, "The

Simpsons episodes, season")) . }ORDER BY ?temporada

Page 5: Consultas sparql

CONSULTAS SPARQL

Mangas escritas por el mismo creador de Tokyo Mew Mew describiendo además su génerog

PREFIX dbprop: <http://dbpedia.org/property/> PREFIX db: <http://dbpedia.org/resource/> SELECT ?creador ?serie ?genero WHERE { db:Tokyo_Mew_Mew dbprop:illustrator ?creador . ?serie dbpprop:author ?creador . OPTIONAL { ?serie dbpprop:genre ?genero } . }

Page 6: Consultas sparql

CONSULTAS SPARQL

Todos los Presidentes del Ecuador

SELECT ?Nombre WHERE { ?Nombre skos:subject

<http://dbpedia.org/resource/Category:Presidents_of_Ecuador>.

}

Page 7: Consultas sparql

CONSULTAS SPARQL

Presidentes de USA con sus fechas de nacimiento e inicio de sus mandatos

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>PREFIX dbpedia2: <http://dbpedia.org/property/>SELECT ?Nombre,?nacimiento, ?inicioMandato WHERE { ?Nombre skos:subject

<http://dbpedia.org/resource/Category:Presidents_of_the_United_States>;

dbpedia2:birth ?nacimiento; dbpedia2:presidentStart ?inicioMandato.}

Page 8: Consultas sparql

CONSULTAS SPARQL

Albums de bandas Californianas

SELECT ?artista ?titulo_album WHERE {?album dbpedia2:artist ?artist. ?album rdfs:label ?titulo_album. ?artist rdfs:label ?artista. ?artist dbpedia2:origin ?origin. FILTER (?origin =

<http://dbpedia.org/resource/California> ). FILTER (lang(?artista)="en")}

Page 9: Consultas sparql

CONSULTAS SPARQL

Capítulos de la Serie “Los Soprano” con fecha, # de episodio y temporada

SELECT * WHERE { ?capitulo <http://dbpedia.org/ontology/series>

<http://dbpedia.org/resource/The_Sopranos> . ?capitulo <http://dbpedia.org/ontology/releaseDate> ?fecha

. ?capitulo <http://dbpedia.org/ontology/episodeNumber> ?

episodio_num . ?capitulo <http://dbpedia.org/ontology/seasonNumber> ?

temporada }ORDER BY DESC(?date)

Page 10: Consultas sparql

CONSULTAS SPARQL

Empresas de software de California

SELECT * WHERE { ?company a

<http://dbpedia.org/ontology/Organisation> . ?company <http://dbpedia.org/ontology/foundationPlace>

<http://dbpedia.org/resource/California> . ?product <http://dbpedia.org/ontology/developer> ?

company . ?product a

<http://dbpedia.org/ontology/Software> }

Page 11: Consultas sparql

CONSULTAS SPARQL

Todos los libros escritos por autores nacidos en Berlin en el siglo 19

SELECT ?nombre ?nacimiento ?descripcion WHERE {?person dbpedia:birthplace

<http://dbpedia.org/resource/city/Paris> . ?person dbpedia:birth ?nacimiento . ?person foaf:name ?nombre . ?person rdfs:comment ?descripcion . FILTER (?nacimiento < "1900-01-01"^^xsd:date ) .}ORDER BY ?nombre

Page 12: Consultas sparql

CONSULTAS SPARQL

¿Qué películas ha protagonizado Tom Hanks.

SELECT ?subject ?label ?released ?abstract WHERE {?subject rdf:type <http://dbpedia.org/ontology/Film>.?subject dbpedia2:starring

<http://dbpedia.org/resource/Tom_Hanks>.?subject rdfs:comment ?abstract.?subject rdfs:label ?label.FILTER(lang(?abstract) = "en" && lang(?label) = "en").?subject <http://dbpedia.org/ontology/releaseDate> ?

released.} ORDER BY ?released

Page 13: Consultas sparql

CONSULTAS SPARQL

Las coincidencias para la búsqueda de “Thierry Henry”

SELECT ?coincidencias WHERE { optional { ?redireccion dbpedia2:redirect

<http://dbpedia.org/resource/Thierry_Henry>. ?redireccion rdfs:label ?coincidencias . } . optional { <http://dbpedia.org/resource/Lionel_Messi>

foaf:name ?coincidencias} .}

Page 14: Consultas sparql

CONSULTAS SPARQL

Temas de METALLICA

select *where{<http://dbpedia.org/resource/Metallica>

<http://dbpedia.org/property/title> ?Temas_de_Metallica

}

Page 15: Consultas sparql

CONSULTAS SPARQL

¿Qué películas ha protagonizado Sandra Bullock en el siglo pasado, descripción y fecha de lanzamiento.

SELECT ?subject ?label ?released ?abstract WHERE {?subject rdf:type <http://dbpedia.org/ontology/Film>.?subject dbpedia2:starring

<http://dbpedia.org/resource/Sandra_Bullock>.?subject rdfs:comment ?abstract.?subject rdfs:label ?label.FILTER(lang(?abstract) = "en" && lang(?label) = "en").?subject <http://dbpedia.org/ontology/releaseDate> ?released.FILTER(xsd:date(?released) < "2000-01-01"^^xsd:date).} ORDER BY ?released

Page 16: Consultas sparql

CONSULTAS SPARQL

¿Qué ciudades del mundo tienen más de 5 000 000 de habitantes?

SELECT ?subject ?population WHERE { {?subject rdf:type <http://dbpedia.org/class/yago/City108524735>.?subject dbpedia2:population ?population.FILTER (xsd:integer(?population) > 5000000)} UNION {?subject rdf:type <http://dbpedia.org/class/yago/City108524735>.?subject dbpedia2:populationUrban ?population.FILTER (xsd:integer(?population) > 5000000)} }ORDER BY DESC(xsd:integer(?population))

Page 17: Consultas sparql

CONSULTAS SOBRE LA ONTOLOGIA DISPONIBLE EN:http://www.fileden.com/files/2007/6/14/1177570//ClasificacionV3.owl

Es una ontología referente a algoritmos de clasificación.

Page 18: Consultas sparql

CONSULTAS SPARQL

¿Qué algoritmos se utilizaron?

PREFIX algor: <http://localhost/default#>PREFIX subc: <http://www.w3.org/1999/02/22-rdf-syntax-

ns#type>SELECT ?Algoritmos WHERE {{?Algoritmos subc:

algor:Arboles} UNION {?Algoritmos subc: algor:Por_Vecindad} UNION {?Algoritmos subc: algor:Redes_Bayesianas} UNION {?Algoritmos subc: algor:Reglas_de_Decision} UNION {?Algoritmos subc: algor:Redes_Neuronales} UNION{?Algoritmos subc: algor:Particionales} UNION{?Algoritmos subc: algor:Jerarquicos}}

Page 19: Consultas sparql

CONSULTAS SPARQL

¿Cuáles son las familias de algoritmos Supervisados Utilizados?

PREFIX algor: <http://localhost/default#>PREFIX subc:

<http://www.w3.org/2000/01/rdf-schema#>SELECT ?Algoritmos WHERE {?Algoritmos

subc:subClassOf algor:Supervisada}

Page 20: Consultas sparql

CONSULTAS SPARQL

¿Cuáles son las familias de algoritmos No Supervisados Utilizados?

PREFIX algor: <http://localhost/default#>PREFIX subc:

<http://www.w3.org/2000/01/rdf-schema#>SELECT ?Algoritmos WHERE {?Algoritmos

subc:subClassOf algor:No_Supervisada}

Page 21: Consultas sparql

CONSULTAS SPARQL

¿Cuáles son los algoritmos Supervisados Utilizados?

PREFIX algor: <http://localhost/default#>PREFIX subc: <http://www.w3.org/1999/02/22-rdf-

syntax-ns#type>SELECT ?Algoritmos WHERE {{?Algoritmos subc:

algor:Arboles}UNION {?Algoritmos subc: algor:Por_Vecindad} UNION {?Algoritmos subc: algor:Redes_Bayesianas} UNION {?Algoritmos subc: algor:Reglas_de_Decision} UNION {?Algoritmos subc: algor:Redes_Neuronales}}

Page 22: Consultas sparql

CONSULTAS SPARQL

¿Cuáles son los algoritmos No Supervisados Utilizados?

PREFIX algor: <http://localhost/default#>PREFIX subc:

<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>

SELECT ?Algoritmos WHERE {{?Algoritmos subc: algor:Particionales} UNION {?Algoritmos subc: algor:Jerarquicos}}

Page 23: Consultas sparql

CONSULTAS SPARQL

¿Qué algoritmo es el mas preciso?

PREFIX a: <http://localhost/default#>PREFIX algor: <http://localhost/default#>SELECT ?a ?Precision WHERE {?a

algor:precision ?Precision . OPTIONAL {?s algor:precision ?otraPrec} .

FILTER (?otraPrec < ?Precision) . FILTER (!bound(?otraPrec) )}

Page 24: Consultas sparql

CONSULTAS SPARQL

¿Cuáles son los algoritmos Supervisados Utilizados?

PREFIX algor: <http://localhost/default#>PREFIX subc: <http://www.w3.org/1999/02/22-rdf-

syntax-ns#type>SELECT ?Algoritmos WHERE {{?Algoritmos subc:

algor:Arboles}UNION {?Algoritmos subc: algor:Por_Vecindad} UNION {?Algoritmos subc: algor:Redes_Bayesianas} UNION {?Algoritmos subc: algor:Reglas_de_Decision} UNION {?Algoritmos subc: algor:Redes_Neuronales}}

Page 25: Consultas sparql

CONSULTAS SPARQL

¿Qué algoritmo es el mas veloz?

PREFIX a: <http://localhost/default#>PREFIX algor: <http://localhost/default#>SELECT ?a ?Velocidad WHERE {?a

algor:velocidad ?velocidad . OPTIONAL {?s algor:velocidad ?otraVeloc} .

FILTER (?otraVeloc < ?Velocidad) . FILTER (!bound(?Velocidad) )}