Skip to content

Commit 1601cf5

Browse files
committed
INT Query1 (SPARQL and SQL) and profile view query for SQL
1 parent f9a3dc7 commit 1601cf5

File tree

6 files changed

+95
-0
lines changed

6 files changed

+95
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
select ?person ?last ?bday ?since ?gen ?browser ?locationIP #Q1
2+
((select group_concat (?email, ", ")
3+
where {
4+
?person snvoc:email ?email
5+
}
6+
group by ?person)) as ?email
7+
((select group_concat (?lng, ", ")
8+
where {
9+
?person snvoc:speaks ?lng
10+
}
11+
group by ?person)) as ?lng
12+
?based
13+
((select group_concat ( bif:concat (?o_name, " ", ?year, " ", ?o_country), ", ")
14+
where {
15+
?person snvoc:studyAt ?w .
16+
?w snvoc:classYear ?year .
17+
?w snvoc:hasOrganisation ?org .
18+
?org snvoc:isLocatedIn ?o_countryURI .
19+
?o_countryURI foaf:name ?o_country .
20+
?org foaf:name ?o_name
21+
}
22+
group by ?person)) as ?studyAt
23+
((select group_concat ( bif:concat (?o_name, " ", ?year, " ", ?o_country), ", ")
24+
where {
25+
?person snvoc:workAt ?w .
26+
?w snvoc:workFrom ?year .
27+
?w snvoc:hasOrganisation ?org .
28+
?org snvoc:isLocatedIn ?o_countryURI .
29+
?o_countryURI foaf:name ?o_country .
30+
?org foaf:name ?o_name
31+
}
32+
group by ?person)) as ?workAt
33+
{
34+
?person a snvoc:Person .
35+
?person snvoc:firstName "%Name%" .
36+
?person snvoc:isLocatedIn ?basedURI .
37+
?basedURI foaf:name ?based .
38+
?person snvoc:birthday ?bday .
39+
?person snvoc:creationDate ?since .
40+
?person snvoc:gender ?gen .
41+
?person snvoc:lastName ?last .
42+
?person snvoc:locationIP ?locationIP .
43+
?person snvoc:browserUsed ?browser .
44+
}
45+
order by ?last ?person
46+
limit 10
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
QueryType=Select
2+
3+
PersonURIString=person
4+
5+
Name=PersonName
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
select p_firstname, p_lastname, p_birthday, p_creationdate, p_gender, p_browserused,
2+
bit_shift(bit_and(p_locationip, 4278190080), -24) || '.' ||
3+
bit_shift(bit_and(p_locationip, 16711680), -16) || '.' ||
4+
bit_shift(bit_and(p_locationip, 65280), -8) || '.' ||
5+
bit_and(p_locationip, 255) as ip,
6+
(select group_concat (pe_email, ', ') from person_email where pe_personid = p1.p_personid group by pe_personid) as emails,
7+
(select group_concat (plang_language, ', ') from person_language where plang_personid = p1.p_personid group by plang_personid) as languages,
8+
(select group_concat (p2.p_firstname || ' ' || p2.p_lastname , ', ') from knows, person p2 where k_person1id = p1.p_personid and k_person2id = p2.p_personid group by k_person1id) as friends,
9+
pl_name
10+
from person p1, place
11+
where
12+
p1.p_personid = @Person@ and
13+
p1.p_placeid = pl_placeid
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
QueryType=Select
2+
3+
Person=PersonURI
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
select top 10 cast (p_personid as varchar), p_lastname, p_birthday, p_creationdate, p_gender, p_browserused,
2+
bit_shift(bit_and(p_locationip, 4278190080), -24) || '.' ||
3+
bit_shift(bit_and(p_locationip, 16711680), -16) || '.' ||
4+
bit_shift(bit_and(p_locationip, 65280), -8) || '.' ||
5+
bit_and(p_locationip, 255) as ip,
6+
group_concat_distinct (pe_email, ', ') as emails,
7+
group_concat_distinct (plang_language, ', ') as languages,
8+
p1.pl_name,
9+
group_concat_distinct (o2.o_name || ' ' || pu_classyear || ' ' || p2.pl_name, ', ') as university,
10+
group_concat_distinct (o3.o_name || ' ' || pc_workfrom || ' ' || p3.pl_name, ', ') as company
11+
from person, place p1, person_email, person_language,
12+
person_university, organisation o2, place p2,
13+
person_company, organisation o3, place p3
14+
where
15+
p_firstname = '@Name@' and
16+
p_placeid = p1.pl_placeid and
17+
p_personid = pe_personid and
18+
p_personid = plang_personid and
19+
p_personid = pu_personid and
20+
pu_organisationid = o2.o_organisationid and
21+
o2.o_placeid = p2.pl_placeid and
22+
p_personid = pc_personid and
23+
pc_organisationid = o3.o_organisationid and
24+
o3.o_placeid = p3.pl_placeid
25+
order by p_lastname, 1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
QueryType=Select
2+
3+
Name=PersonName

0 commit comments

Comments
 (0)