Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Grouping results
Aggregation
Aggregation and projection
1
2
3
4
5
6
7
8
9
PREFIX yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?name (COUNT(?role) AS ?nb_roles)
WHERE {
?actor rdf:type yaco:Actor;
rdfs:label ?name;
yaco:playsRole ?role.
} GROUP BY ?actor
Enter to Rename, Shift+Enter to Preview
1
@prefix yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#> .
Enter to Rename, Shift+Enter to Preview
Who is he oldest actor?
1
2
3
4
5
6
7
8
9
PREFIX yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?name (MIN(?year) as ?minYear)
WHERE {
?actor rdf:type yaco:Actor;
rdfs:label ?name;
yaco:birthYear ?year.
}
Enter to Rename, Shift+Enter to Preview
1
@prefix yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#> .
Enter to Rename, Shift+Enter to Preview
Group filtering
Who are the actors who played in at least two movies?
1
2
3
4
5
6
7
8
9
10
PREFIX yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?name
WHERE {
?actor rdf:type yaco:Actor;
rdfs:label ?name;
yaco:playsRole ?role.
} GROUP BY ?actor
HAVING (COUNT(?role) > 2)
Enter to Rename, Shift+Enter to Preview
1
@prefix yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#> .
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content