Skip to content

Commit

Permalink
Merge remote-tracking branch 'LDBC/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnau committed Jan 31, 2014
2 parents c8b8800 + 34851d9 commit 43bdc3b
Show file tree
Hide file tree
Showing 42 changed files with 585 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ldbc_socialnet_qgen/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ done

export CLASSPATH

./sibdriver -t 300000 -idir td_data -uqp query -uc sib/int -mt 1 -runs 1 http://localhost:8607/sparql -printres -q -defaultparams
./sibdriver -t 300000 -idir td_data -uqp query -uc sib/int -mt 1 -runs 1 http://localhost:8619/sparql -printres -pq -defaultparams
23 changes: 23 additions & 0 deletions ldbc_socialnet_qgen/run_sql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

basedir=${0%/*}
libdir=${basedir}/lib
SEP=':'

if [ -z "$CLASSPATH" ]
then
CLASSPATH=${basedir}/bin # for development version only
else
CLASSPATH=$CLASSPATH$SEP${basedir}/bin # for development version only
fi

if [ "$(uname)" = "Cygwin" ]; then SEP=';'; fi
for jar in $libdir/*.jar
do
if [ ! -e "$jar" ]; then continue; fi
CLASSPATH="$CLASSPATH$SEP$jar"
done

export CLASSPATH

./sibdriver -t 300000 -idir td_data -uc sib/int_sql -mt 1 -runs 1 -sql jdbc:virtuoso://localhost:1205/UID=dba/PWD=dba -dbdriver virtuoso.jdbc4.Driver -printres -pq -defaultparams
Empty file modified ldbc_socialnet_qgen/sib/int/query1.txt
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion ldbc_socialnet_qgen/sib/int/query10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ select ?first ?last #Q10
filter (!exists {%Person% snvoc:hasInterest ?tag})
}
)) as ?score)
?fof ?gender ?based
?fof ?gender ?locationname
from <sib>
where {
{select distinct ?fof
Expand All @@ -30,6 +30,7 @@ where {
?fof snvoc:gender ?gender .
?fof snvoc:birthday ?bday .
?fof snvoc:isLocatedIn ?based .
?based foaf:name ?locationname .
filter (1 = if (bif:month (?bday) = %HS0%, if (bif:dayofmonth (?bday) > 21, 1, 0), if (bif:month (?bday) = %HS1%, if (bif:dayofmonth(?bday) < 22, 1, 0), 0)))
}
order by desc(3) ?fof
Expand Down
7 changes: 4 additions & 3 deletions ldbc_socialnet_qgen/sib/int/query12.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select ?exp ?first ?last ?tag count (*) #Q12
select ?exp ?first ?last ?tagname count (*) #Q12
where {
%Person% snvoc:knows ?exp .
?exp snvoc:firstName ?first . ?exp snvoc:lastName ?last .
Expand All @@ -7,7 +7,8 @@ where {
filter (!exists {?org_post snvoc:replyOf ?xx}) .
?org_post snvoc:hasTag ?tag .
?tag a %TagType% .
?tag foaf:name ?tagname .
}
group by ?exp ?first ?last ?tag
order by desc(5) ?exp ?tag
group by ?exp ?first ?last ?tagname
order by desc(5) ?exp ?tagname
limit 20
1 change: 1 addition & 0 deletions ldbc_socialnet_qgen/sib/int/query2.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ where {
%Person% snvoc:knows ?fr.
?fr snvoc:firstName ?first. ?fr snvoc:lastName ?last .
?post snvoc:hasCreator ?fr.
?post a snvoc:Post.
{ {?post snvoc:content ?content } union { ?post snvoc:imageFile ?content }} .
?post snvoc:creationDate ?date.
filter (?date <= "%Date0%"^^xsd:date).
Expand Down
2 changes: 1 addition & 1 deletion ldbc_socialnet_qgen/sib/int/query3.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
select ?fr ?first ?last ?ct1 ?ct2 (?ct1 + ?ct2) as ?sum #Q3
from <sib>
where {
{select ?fr
{select distinct ?fr ?first ?last
(((select count (*)
where {
?post snvoc:hasCreator ?fr .
Expand Down
7 changes: 4 additions & 3 deletions ldbc_socialnet_qgen/sib/int/query4.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
select ?tag count (*) #Q4
select ?tagname count (*) #Q4
from <sib>
where {
?post snvoc:hasCreator ?fr .
?post snvoc:hasTag ?tag .
?tag foaf:name ?tagname .
?post snvoc:creationDate ?date .
%Person% snvoc:knows ?fr .
filter (?date >= "%Date0%"^^xsd:date && ?date <= bif:dateadd ("day", %Duration%, "%Date0%"^^xsd:date) ) .
Expand All @@ -13,6 +14,6 @@ where {
?post2 snvoc:creationDate ?date2 .
filter (?date2 < "%Date0%"^^xsd:date)})
}
group by ?tag
order by desc(2) ?tag
group by ?tagname
order by desc(2) ?tagname
limit 10
9 changes: 5 additions & 4 deletions ldbc_socialnet_qgen/sib/int/query5.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select ?group count (*) #Q5
select ?title count (*) #Q5
from <sib>
where {
{select distinct ?fr
Expand All @@ -12,8 +12,9 @@ where {
?mem snvoc:joinDate ?date .
filter (?date >= "%Date0%"^^xsd:date) .
?post snvoc:hasCreator ?fr .
?group snvoc:containerOf ?post
?group snvoc:containerOf ?post .
?group snvoc:title ?title.
}
group by ?group
order by desc(2) ?group
group by ?title
order by desc(2) ?title
limit 20
7 changes: 4 additions & 3 deletions ldbc_socialnet_qgen/sib/int/query6.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select ?tag count (*) #Q6
select ?tagname count (*) #Q6
from <sib>
where {
{ select distinct ?fr
Expand All @@ -11,8 +11,9 @@ where {
?post snvoc:hasTag ?tag .
filter (?tag != %Tag%) .
?post snvoc:hasTag %Tag% .
?tag foaf:name ?tagname .
}
group by ?tag
order by desc(2) ?tag
group by ?tagname
order by desc(2) ?tagname
limit 10

1 change: 1 addition & 0 deletions ldbc_socialnet_qgen/sib/int/query9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ where {
?fr snvoc:firstName ?first . ?fr snvoc:lastName ?last .
?post snvoc:hasCreator ?fr.
?post snvoc:creationDate ?date.
?post a snvoc:Post.
filter (?date < "%Date0%"^^xsd:date).
{{?post snvoc:content ?content} union {?post snvoc:imageFile ?content}} .
}
Expand Down
2 changes: 1 addition & 1 deletion ldbc_socialnet_qgen/sib/int/querymix.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
2 3 4 5 6 7 8 9 10 11 12
25 changes: 25 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
select top 10 p_personid, p_lastname, p_birthday, p_creationdate, p_gender, p_browserused,
bit_shift(bit_and(p_locationip, 4278190080), -24) || '.' ||
bit_shift(bit_and(p_locationip, 16711680), -16) || '.' ||
bit_shift(bit_and(p_locationip, 65280), -8) || '.' ||
bit_and(p_locationip, 255) as ip,
group_concat_distinct (pe_email, ', ') as emails,
group_concat_distinct (plang_language, ', ') as languages,
p1.pl_name,
group_concat_distinct (o2.o_name || ' ' || pu_classyear || ' ' || p2.pl_name, ', ') as university,
group_concat_distinct (o3.o_name || ' ' || pc_workfrom || ' ' || p3.pl_name, ', ') as company
from person, place p1, person_email, person_language,
person_university, organisation o2, place p2,
person_company, organisation o3, place p3
where
p_firstname = '@Name@' and
p_placeid = p1.pl_placeid and
p_personid = pe_personid and
p_personid = plang_personid and
p_personid = pu_personid and
pu_organisationid = o2.o_organisationid and
o2.o_placeid = p2.pl_placeid and
p_personid = pc_personid and
pc_organisationid = o3.o_organisationid and
o3.o_placeid = p3.pl_placeid
order by p_lastname, p_personid
29 changes: 29 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
select top 10 p_firstname, p_lastname,
( select count(distinct ps_postid)
from post, post_tag pt1
where
ps_creatorid = p_personid and ps_postid = pst_postid and
exists (select * from person_tag where pt_personid = @Person@ and pt_tagid = pt1.pst_tagid)
) -
( select count(distinct ps_postid)
from post, post_tag pt1
where
ps_creatorid = p_personid and ps_postid = pst_postid and
not exists (select * from person_tag where pt_personid = @Person@ and pt_tagid = pt1.pst_tagid)
) as score,
p_personid, p_gender, pl_name
from person, place,
( select distinct k2.k_person2id
from knows k1, knows k2
where
k1.k_person1id = @Person@ and k1.k_person2id = k2.k_person1id and k2.k_person2id <> @Person@ and
not exists (select * from knows where k_person1id = @Person@ and k_person2id = k2.k_person2id)
) f
where
p_placeid = pl_placeid and
p_personid = f.k_person2id and
case month(p_birthday) when @HS0@ then (case when dayofmonth(p_birthday) > 21 then 1 else 0 end)
when @HS1@ then (case when dayofmonth(p_birthday) < 22 then 1 else 0 end)
else 0
end
order by 3 desc, p_personid
7 changes: 7 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query10desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
QueryType=Select

PersonURIString=fof

Person=PersonID
HS0=HoroscopeSign_0
HS1=HoroscopeSign_1
20 changes: 20 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
select top 10 p_firstname, p_lastname, pc_workfrom, o_name, p_personid
from person, person_company, organisation, place,
( select k_person2id
from knows
where
k_person1id = @Person@
union
select k2.k_person2id
from knows k1, knows k2
where
k1.k_person1id = @Person@ and k1.k_person2id = k2.k_person1id and k2.k_person2id <> @Person@
) f
where
p_personid = f.k_person2id and
p_personid = pc_personid and
pc_organisationid = o_organisationid and
pc_workfrom < @Date0@ and
o_placeid = pl_placeid and
pl_url = '@Country@'
order by pc_workfrom, p_personid, o_name
7 changes: 7 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query11desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
QueryType=Select

PersonURIString=fr

Person=PersonID
Country=CountrySQLURI
Date0=WorkFromDate_0_100
16 changes: 16 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
select top 20 p_personid, p_firstname, p_lastname, t_name, count(*)
from person, comment, knows, post, post_tag, tag_tagclass, tagclass, tag
where
k_person1id = @Person@ and
k_person2id = p_personid and
p_personid = c_creatorid and
c_replyofpost = ps_postid and
ps_postid = pst_postid and
pst_tagid = t_tagid and
pst_tagid = ttc_tagid and
ttc_tagclassid = tc_tagclassid and
tc_url = '@TagType@'
group by p_personid, p_firstname, p_lastname, t_name
order by 5 desc, p_personid, t_name


6 changes: 6 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query12desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
QueryType=Select

PersonURIString=exp

Person=PersonID
TagType=TagTypeSQLURI
3 changes: 3 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query1desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QueryType=Select

Name=PersonName
8 changes: 8 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
select top 20 p_personid, p_firstname, p_lastname, ps_postid, ps_content || ps_imagefile, ps_creationdate
from person, post, knows
where
p_personid = ps_creatorid and
ps_creationdate <= stringdate('@Date0@') and
k_person1id = @Person@ and
k_person2id = p_personid
order by ps_creationdate desc, ps_postid
4 changes: 4 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query2desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
QueryType=Select

Person=PersonID
Date0=CreationPostDate_33_66
59 changes: 59 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
select top 20 p_personid, p_firstname, p_lastname, ct1, ct2, total
from
( select k_person2id
from knows
where
k_person1id = @Person@
union
select k2.k_person2id
from knows k1, knows k2
where
k1.k_person1id = @Person@ and k1.k_person2id = k2.k_person1id and k2.k_person2id <> @Person@
) f, person, place p1, place p2,
(
select chn.ps_c_creatorid, ct1, ct2, ct1 + ct2 as total
from
(
select ps_c_creatorid, sum(ct1) as ct1
from
(
select ps_creatorid as ps_c_creatorid, count(*) as ct1 from post, place
where
ps_locationid = pl_placeid and pl_name = '@Country1@' and
ps_creationdate between stringdate('2011-03-02') and dateadd ('day', 366, stringdate('2011-03-02'))
group by ps_c_creatorid
union
select c_creatorid as ps_c_creatorid, count(*) as ct1 from comment, place
where
c_locationid = pl_placeid and pl_name = '@Country1@' and
c_creationdate between stringdate('2011-03-02') and dateadd ('day', 366, stringdate('2011-03-02'))
group by ps_c_creatorid
) tmp
group by ps_c_creatorid
) chn,
(
select ps_c_creatorid, sum(ct1) as ct2
from
(
select ps_creatorid as ps_c_creatorid, count(*) as ct1 from post, place
where
ps_locationid = pl_placeid and pl_name = '@Country2@' and
ps_creationdate between stringdate('2011-03-02') and dateadd ('day', 366, stringdate('2011-03-02'))
group by ps_c_creatorid
union
select c_creatorid as ps_c_creatorid, count(*) as ct1 from comment, place
where
c_locationid = pl_placeid and pl_name = '@Country2@' and
c_creationdate between stringdate('2011-03-02') and dateadd ('day', 366, stringdate('2011-03-02'))
group by ps_c_creatorid
) tmp
group by ps_c_creatorid
) ind
where CHN.ps_c_creatorid = IND.ps_c_creatorid
) cpc
where
f.k_person2id = p_personid and p_placeid = p1.pl_placeid and
p1.pl_containerplaceid = p2.pl_placeid and p2.pl_name <> '@Country1@' and p2.pl_name <> '@Country2@' and
f.k_person2id = cpc.ps_c_creatorid
order by 6 desc, p_personid

9 changes: 9 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query3desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
QueryType=Select

PersonURIString=fr

Person=PersonID
Date0=CreationPostDate_0_66
Duration=TotalDaysOfCreationPost_33_33
Country1=CountryPairSQL_1
Country2=CountryPairSQL_2
19 changes: 19 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
select top 10 t_name, count(*)
from tag, post, post_tag, knows
where
ps_postid = pst_postid and
pst_tagid = t_tagid and
ps_creatorid = k_person2id and
k_person1id = @Person@ and
ps_creationdate between stringdate('@Date0@') and dateadd ('day', @Duration@, stringdate('@Date0@')) and
not exists (
select * from post, post_tag, knows
where
k_person1id = @Person@ and
k_person2id = ps_creatorid and
pst_postid = ps_postid and
pst_tagid = t_tagid and
ps_creationdate < '@Date0@'
)
group by t_name
order by 2 desc, t_name
5 changes: 5 additions & 0 deletions ldbc_socialnet_qgen/sib/int_sql/query4desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
QueryType=Select

Person=PersonID
Date0=CreationPostDate_0_95
Duration=TotalDaysOfCreationPost_2_4
Loading

0 comments on commit 43bdc3b

Please sign in to comment.