-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update query to retrieve list of meetups
Update query to retrieve list of meetups
- Loading branch information
1 parent
c6139c5
commit c98fd9b
Showing
2 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# ========================= TOP PEOPLE | ||
|
||
prefix mtp: <http://w3id.org/polifonia/ontology/meetups-ontology#> | ||
|
||
select ( count( ?participant) as ?num_people ) ?participant | ||
from <http://data.open.ac.uk/context/meetups> | ||
where | ||
{ VALUES ?subject { <http://dbpedia.org/resource/Edward_Elgar> } | ||
?s rdf:type mtp:Meetup ; | ||
mtp:hasSubject ?subject ; | ||
mtp:hasParticipant ?participant . | ||
FILTER (!regex (str(?participant), str(?subject) ) ) . | ||
} | ||
|
||
GROUP BY ?participant | ||
ORDER BY DESC(?num_people) ?participant | ||
LIMIT 2 | ||
|
||
# ========================= TOP PLACES | ||
prefix mtp: <http://w3id.org/polifonia/ontology/meetups-ontology#> | ||
select ( count( ?place) as ?number_place ) ?place | ||
from <http://data.open.ac.uk/context/meetups> | ||
where | ||
{ ?s rdf:type mtp:Meetup ; | ||
mtp:hasSubject <http://dbpedia.org/resource/Edward_Elgar> ; | ||
mtp:hasPlace ?place . | ||
} | ||
|
||
GROUP BY ?place | ||
ORDER BY DESC(?number_place) | ||
LIMIT 2 | ||
|
||
|
||
# ========================= TOP TIME | ||
|
||
|
||
|
||
# ========================= TOP THEMES | ||
## ======================= Version 0.2 concatenate the place name when more than one, does not include lat and long | ||
prefix mtp: <http://w3id.org/polifonia/ontology/meetups-ontology#> | ||
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
prefix geo: <https://www.w3.org/2003/01/geo/wgs84_pos> | ||
|
||
select ?s ?evidence_text ?purpose | ||
(GROUP_CONCAT( DISTINCT ?participant; separator=", " ) as ?participants_URI ) | ||
(GROUP_CONCAT( DISTINCT ?participant_label; separator=", " ) as ?participants_label ) | ||
(GROUP_CONCAT( DISTINCT ?location_uri; separator=", " ) as ?locations_URI ) | ||
(GROUP_CONCAT( DISTINCT ?location_label; separator=", " ) as ?locations_label ) | ||
( MIN (?time_expression ) AS ?time_expression_URI ) | ||
from <http://data.open.ac.uk/context/meetups> | ||
where | ||
{ VALUES ?subject { <http://dbpedia.org/resource/Al_Wilson_(singer)> } | ||
?s rdf:type mtp:Meetup ; | ||
mtp:hasSubject ?subject ; | ||
mtp:hasParticipant ?participant ; | ||
mtp:happensAt ?time_expression ; | ||
mtp:hasAPurpose ?purpose_uri ; | ||
mtp:hasEvidenceText ?evidence_text ; | ||
mtp:hasPlace ?location_uri . | ||
FILTER (!regex (str(?participant), str(?subject) ) ) . | ||
?participant rdfs:label ?participant_label . | ||
?location_uri rdfs:label ?location_label . | ||
?purpose_uri rdfs:label ?purpose | ||
} | ||
|
||
group by ?s ?evidence_text ?purpose ?time_expression_URI | ||
|
||
|
||
## ======================= Version 0.1 includes lat and long, works only for meetups with one place | ||
prefix mtp: <http://w3id.org/polifonia/ontology/meetups-ontology#> | ||
select ( count( ?meetupType) as ?number_mt ) ?meetupType | ||
from <http://data.open.ac.uk/context/meetups> | ||
where | ||
{ ?s rdf:type mtp:Meetup ; | ||
mtp:hasSubject <http://dbpedia.org/resource/Edward_Elgar> ; | ||
mtp:hasAPurpose ?meetupType . | ||
#?meetupType rdfs:label ?meetupTypeName . | ||
} | ||
|
||
GROUP BY ?meetupType | ||
ORDER BY DESC(?number_mt) |