Skip to content
Snippets Groups Projects
Commit a58998f6 authored by alvaro's avatar alvaro
Browse files

Removing examples from visualbox

restoring defaults in LODSPK
parent e7a10a5a
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 254 deletions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Largest cities by area</title>
<style>
body{font: 11px sans-serif;}
</style>
</head>
<body>
<h2>Largest cities by area</h2>
{{models.main|GoogleMaps:"latitude,longitude,areaAndName,width=800"}}
</body>
</html>
\ No newline at end of file
#Get the 10 largest cities by area in the US
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX sch: <http://schema.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?city SAMPLE(?lat) AS ?latitude SAMPLE(?long) AS ?longitude CONCAT(?city, "<br>(", xsd:string(?area), " SqKM)") AS ?areaAndName WHERE{
?city a sch:City ;
<http://dbpedia.org/ontology/country> <http://dbpedia.org/resource/United_States> ;
geo:lat ?lat ;
geo:long ?long;
dbp:areaTotalKm ?area .
}GROUP BY ?city ?area
ORDER BY DESC(?area)
LIMIT 10
{%include "../../includes/header.inc"%}
<div class="container-fluid">
<h1>Classes available</h1>
<ul>
{% for row in models.main %}
<li><a href="{{lodspk.baseUrl}}instances/{{ row.resource.curie }}">{{row.resource.curie}}</a></li>
{% endfor %}
</ul>
</div>
</body>
</html>
SELECT DISTINCT ?resource WHERE {
{
GRAPH ?g {
?x a ?resource .
}
}UNION{
?x a ?resource .
}
}order by ?resource
LIMIT {{lodspk.maxResults}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>People influenced by Robert Heinlein and Ray Bradbury</title>
<style>body{font: 10px sans-serif;}</style>
</head>
<body>
<h2>People influenced by Robert Heinlein and Ray Bradbury</h2>
{{models.main|D3ForceGraph:"child,parent"}}
</body>
</html>
#Get all the people that has been influenced by Heinlein AND Bradbury
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbp: <http://dbpedia.org/ontology/>
PREFIX d: <http://dbpedia.org/resource/>
SELECT DISTINCT ?child ?parent WHERE{
?childNode dbp:influencedBy ?parentNode;
dbp:influencedBy d:Robert_A._Heinlein;
dbp:influencedBy d:Ray_Bradbury;
rdfs:label ?child .
?parentNode rdfs:label ?parent .
FILTER(LANG(?child) = "en" && LANG(?parent) = "en")
FILTER(?parentNode = d:Robert_A._Heinlein || ?parentNode = d:Ray_Bradbury )
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My visualization</title>
</head>
<body>
<!--
The width=1000, color=steelblue and dateFormat='%Y' are optional
-->
{{models.main|Timeknot:"releaseDate,label,color=steelblue,width=1000,dateFormat='%Y'"}} </body>
</html>
#Get all the movies directed by Stanley Kubrick that have a release date
#The MAX function is a tricky way of obtaining just one value in case there are multiple dates associated
PREFIX dbp: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?movie ?label MAX(?r) AS ?releaseDate WHERE{
?movie dbo:director dbp:Stanley_Kubrick ;
rdfs:label ?label;
dbo:releaseDate ?r .
#Filter forces to get only the label in english
FILTER( LANG(?label) = "en")
}GROUP BY ?movie ?label
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Measures of different models of Lamborghini cars</title>
<style>body{font: 11px sans-serif;}</style>
</head>
<body>
<h2>Measures of different models of Lamborghini cars</h2>
{{models.main|D3ParallelCoordinates:"carLabel,wheelbase,carWidth,carLength,transmission,height=300"}}
</body>
</html>
#Get a bunch of numbers related to Lamborghini cars
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?carLabel ?wheelbase ?carWidth ?carLength ?transmission WHERE {
?car dcterms:subject <http://dbpedia.org/resource/Category:Lamborghini_vehicles>;
<http://dbpedia.org/ontology/Automobile/wheelbase> ?wheelbase;
<http://dbpedia.org/ontology/MeanOfTransportation/height> ?carWidth;
<http://dbpedia.org/ontology/MeanOfTransportation/length> ?carLength;
<http://dbpedia.org/property/transmission> ?transmission;
rdfs:label ?carLabel.
FILTER(LANG(?carLabel) = "en")
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Total of Nobel laureates in Physics by country</title>
<style>
body{font: 11px sans-serif;}
</style>
</head>
<body>
<h2>Total of Nobel laureates in Physics by country</h2>
{{models.main|GoogleVizPieChart:"countryLabel,total,width=900,height=500"}}
</body>
</html>
\ No newline at end of file
#Number of nobel prize winners by country
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX sch: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?countryLabel (COUNT(?nobel) as ?total) WHERE {
?nobel dcterms:subject <http://dbpedia.org/resource/Category:Nobel_laureates_in_Physics>;
a foaf:Person;
dbp:placeOfBirth ?country .
?country a sch:Country ;
rdfs:label ?countryLabel
FILTER(LANG(?countryLabel) = "en")
}GROUP BY ?country ?countryLabel
ORDER BY DESC(?total)
LIMIT 100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>People influenced by Pablo Neruda</title>
<style>body{font: 10px sans-serif}</style>
</head>
<body>
<h2>People influenced by Pablo Neruda</h2>
{{models.main|D3Dendrogram:"child,parent"}}
</body>
</html>
#People influenced by Pablo Neruda
#Beware this query is tricky, in SPARQL 1.1 it should be much simpler
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbp: <http://dbpedia.org/ontology/>
PREFIX d: <http://dbpedia.org/resource/>
SELECT DISTINCT ?child ?parent WHERE{
{
?childNode dbp:influencedBy ?mid ;
rdfs:label ?child .
?mid dbp:influencedBy ?parentNode;
rdfs:label ?parent .
FILTER(LANG(?parent) = "en" && ?parentNode = d:Pablo_Neruda)
}UNION{
?childNode dbp:influencedBy d:Pablo_Neruda;
dbp:influencedBy ?parentNode;
rdfs:label ?child .
?parentNode rdfs:label ?parent .
FILTER(LANG(?parent) = "en" && ?parentNode = d:Pablo_Neruda)
}UNION{
d:Pablo_Neruda rdfs:label ?child
}
FILTER(LANG(?child) = "en")
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Places in Rensselaer county by area</title>
<style>body{font: 10px sans-serif}</style>
</head>
<body>
<h2>Places in Rensselaer county by area</h2>
{{models.main|D3CirclePacking:"s,c,area"}}
</body>
</html>
\ No newline at end of file
#Get places in Rensselaer county and their area
PREFIX d: <http://dbpedia.org/ontology/>
SELECT max(?sLabel) as ?s max(?cLabel) as ?c (max(?t) as ?area) WHERE{
{
?s d:isPartOf <http://dbpedia.org/resource/Rensselaer_County,_New_York>;
d:areaTotal ?t ;
rdfs:label ?sLabel;
d:isPartOf ?c .
?c rdfs:label ?cLabel.
FILTER(?c = <http://dbpedia.org/resource/Rensselaer_County,_New_York>)
FILTER(lang(?cLabel) = "en")
}UNION{
?s rdfs:label ?sLabel .
FILTER(?s = <http://dbpedia.org/resource/Rensselaer_County,_New_York>)
}
FILTER(lang(?sLabel) = "en")
}group by ?sLabel ?cLabel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My visualization</title>
</head>
<body>
{{models.main|D3WordCloud:"words"}} </body>
</html>
#Words in any literal related to Rush
SELECT ?words WHERE{
<http://dbpedia.org/resource/Rush_(band)> ?p ?words .
FILTER(LANG(?words) = "en")
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
{{models.education_uk.main|GoogleMaps:"lat,long,name"}}
</body>
</html>
#Get schools in the City of London district, including geolocation and name
PREFIX sch-ont: <http://education.data.gov.uk/def/school/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT ?school ?name ?lat ?long WHERE {
?school a sch-ont:School;
sch-ont:establishmentName ?name;
geo:lat ?lat;
geo:long ?long;
sch-ont:districtAdministrative <http://statistics.data.gov.uk/id/local-authority-district/00AA>.
}
ORDER BY ?name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment