@rubeneschauzier/solidbench 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +211 -0
  3. package/bin/solidbench +2 -0
  4. package/bin/solidbench.d.ts +2 -0
  5. package/bin/solidbench.js +6 -0
  6. package/bin/solidbench.js.map +1 -0
  7. package/lib/CliRunner.d.ts +1 -0
  8. package/lib/CliRunner.js +20 -0
  9. package/lib/CliRunner.js.map +1 -0
  10. package/lib/Generator.d.ts +76 -0
  11. package/lib/Generator.js +231 -0
  12. package/lib/Generator.js.map +1 -0
  13. package/lib/Server.d.ts +19 -0
  14. package/lib/Server.js +34 -0
  15. package/lib/Server.js.map +1 -0
  16. package/lib/Templates.d.ts +14 -0
  17. package/lib/Templates.js +19 -0
  18. package/lib/Templates.js.map +1 -0
  19. package/lib/commands/CommandGenerate.d.ts +5 -0
  20. package/lib/commands/CommandGenerate.js +77 -0
  21. package/lib/commands/CommandGenerate.js.map +1 -0
  22. package/lib/commands/CommandServe.d.ts +5 -0
  23. package/lib/commands/CommandServe.js +50 -0
  24. package/lib/commands/CommandServe.js.map +1 -0
  25. package/lib/index.d.ts +4 -0
  26. package/lib/index.js +21 -0
  27. package/lib/index.js.map +1 -0
  28. package/package.json +68 -0
  29. package/templates/enhancer-config-pod.json +29 -0
  30. package/templates/enhancer-similarities-config-pod.json +39 -0
  31. package/templates/fragmenter-config-pod.json +525 -0
  32. package/templates/fragmenter-config-subject.json +63 -0
  33. package/templates/params.ini +5 -0
  34. package/templates/queries/README.md +43 -0
  35. package/templates/queries/interactive-complex-1.sparql +138 -0
  36. package/templates/queries/interactive-complex-10.sparql +89 -0
  37. package/templates/queries/interactive-complex-11.sparql +43 -0
  38. package/templates/queries/interactive-complex-12.sparql +36 -0
  39. package/templates/queries/interactive-complex-2.sparql +48 -0
  40. package/templates/queries/interactive-complex-3-duration-as-function.sparql +85 -0
  41. package/templates/queries/interactive-complex-3.sparql +85 -0
  42. package/templates/queries/interactive-complex-4-duration-as-function.sparql +36 -0
  43. package/templates/queries/interactive-complex-4.sparql +36 -0
  44. package/templates/queries/interactive-complex-5.sparql +55 -0
  45. package/templates/queries/interactive-complex-6.sparql +41 -0
  46. package/templates/queries/interactive-complex-7.sparql +84 -0
  47. package/templates/queries/interactive-complex-8.sparql +36 -0
  48. package/templates/queries/interactive-complex-9.sparql +45 -0
  49. package/templates/queries/interactive-discover-1.sparql +23 -0
  50. package/templates/queries/interactive-discover-2.sparql +23 -0
  51. package/templates/queries/interactive-discover-3.sparql +22 -0
  52. package/templates/queries/interactive-discover-4.sparql +23 -0
  53. package/templates/queries/interactive-discover-5.sparql +19 -0
  54. package/templates/queries/interactive-discover-6.sparql +22 -0
  55. package/templates/queries/interactive-discover-7.sparql +23 -0
  56. package/templates/queries/interactive-discover-8.sparql +22 -0
  57. package/templates/queries/interactive-short-1-nocity.sparql +33 -0
  58. package/templates/queries/interactive-short-1.sparql +34 -0
  59. package/templates/queries/interactive-short-2.sparql +39 -0
  60. package/templates/queries/interactive-short-3-unidir.sparql +27 -0
  61. package/templates/queries/interactive-short-3.sparql +32 -0
  62. package/templates/queries/interactive-short-4-creator.sparql +21 -0
  63. package/templates/queries/interactive-short-4.sparql +20 -0
  64. package/templates/queries/interactive-short-5.sparql +23 -0
  65. package/templates/queries/interactive-short-6.sparql +32 -0
  66. package/templates/queries/interactive-short-7.sparql +39 -0
  67. package/templates/query-config-single-pod.json +46 -0
  68. package/templates/query-config.json +778 -0
  69. package/templates/query-sequence-config.json +183 -0
  70. package/templates/refinements/interactive-discover-1.json +144 -0
  71. package/templates/refinements/interactive-discover-2.json +200 -0
  72. package/templates/refinements/interactive-discover-3.json +254 -0
  73. package/templates/refinements/interactive-discover-4.json +156 -0
  74. package/templates/refinements/interactive-discover-5.json +10 -0
  75. package/templates/refinements/interactive-discover-6.json +10 -0
  76. package/templates/refinements/interactive-discover-7.json +10 -0
  77. package/templates/refinements/interactive-discover-8.json +10 -0
  78. package/templates/refinements/interactive-short-1-bak.json +180 -0
  79. package/templates/refinements/interactive-short-1.json +65 -0
  80. package/templates/refinements/interactive-short-2.json +3 -0
  81. package/templates/server-config.json +72 -0
  82. package/templates/validation-config.json +644 -0
@@ -0,0 +1,138 @@
1
+ # Transitive friends with certain name
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?friendId)
14
+ (?last AS ?friendLastName)
15
+ (MIN(?dist) AS ?distanceFromPerson)
16
+ (?bday AS ?friendBirthday)
17
+ (?since AS ?friendCreationDate)
18
+ (?gen AS ?friendGender)
19
+ (?browser AS ?friendBrowserUsed)
20
+ (?locationIP AS ?friendLocationIp)
21
+ (?emails AS ?friendEmails)
22
+ (?languages AS ?friendLanguages)
23
+ (?based AS ?friendCityName)
24
+ (?studies AS ?friendUniversities)
25
+ (?jobs AS ?friendCompanies)
26
+ {
27
+ {
28
+ SELECT
29
+ ?fr
30
+ ?emails
31
+ ?dist
32
+ (GROUP_CONCAT(?language;separator=", ") AS ?languages)
33
+ WHERE
34
+ {
35
+ {
36
+ SELECT
37
+ ?fr
38
+ ?dist
39
+ (GROUP_CONCAT(?email;separator=", ") AS ?emails)
40
+ WHERE
41
+ {
42
+ {
43
+ SELECT
44
+ ?fr
45
+ (MIN(?distInner) AS ?dist)
46
+ WHERE
47
+ {
48
+ ?rootPerson a snvoc:Person .
49
+ ?rootPerson snvoc:id ?rootId .
50
+ ?rootPerson snvoc:id ?rootId .
51
+ ?fr a snvoc:Person .
52
+ {
53
+ ?rootPerson (snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson) ?fr .
54
+ BIND( 1 AS ?distOneInner )
55
+ } UNION {
56
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
57
+ BIND( 2 AS ?distTwoInner )
58
+ } UNION {
59
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
60
+ }
61
+ ?fr snvoc:id ?frId .
62
+ FILTER(?frId != ?rootId) .
63
+ ?fr snvoc:firstName $firstName .
64
+ BIND( IF(COALESCE(?distOneInner, 4) < 4, 1, IF(COALESCE(?distTwoInner, 4) < 4, 2, 3)) AS ?distInner)
65
+ }
66
+ GROUP BY ?fr
67
+ }
68
+ ?fr snvoc:email ?email .
69
+ }
70
+ GROUP BY ?fr ?dist
71
+ }
72
+ ?fr snvoc:speaks ?language
73
+ }
74
+ GROUP BY ?fr ?emails ?dist
75
+ }
76
+ ?fr snvoc:id ?frId .
77
+ ?fr snvoc:lastName ?last .
78
+ ?fr snvoc:birthday ?bday .
79
+ ?fr snvoc:isLocatedIn ?basedURI .
80
+ ?basedURI foaf:name ?based .
81
+ ?fr snvoc:creationDate ?since .
82
+ ?fr snvoc:gender ?gen .
83
+ ?fr snvoc:locationIP ?locationIP .
84
+ ?fr snvoc:browserUsed ?browser .
85
+ OPTIONAL {
86
+ {
87
+ SELECT
88
+ (?frInner AS ?frInnerUni)
89
+ (GROUP_CONCAT(CONCAT(?uniName, " ", xsd:string(?classYear), " ", ?uniCountry);separator=", ") AS ?studies)
90
+ {
91
+ SELECT DISTINCT
92
+ ?frInner
93
+ ?uniName
94
+ ?classYear
95
+ ?uniCountry
96
+ {
97
+ ?frInner a snvoc:Person .
98
+ ?frInner snvoc:studyAt ?study .
99
+ ?study snvoc:hasOrganisation ?uni .
100
+ ?uni foaf:name ?uniName .
101
+ ?study snvoc:classYear ?classYear .
102
+ ?uni snvoc:isLocatedIn/foaf:name ?uniCountry .
103
+ }
104
+ }
105
+ GROUP BY ?frInner
106
+ } .
107
+ ?frInnerUni snvoc:id ?frInnerUniId .
108
+ FILTER( ?frId = ?frInnerUniId)
109
+ } .
110
+ OPTIONAL {
111
+ {
112
+ SELECT
113
+ (?frInner AS ?frInnerComp)
114
+ (GROUP_CONCAT(CONCAT(?companyName, " ", xsd:string(?workFrom), " ", ?companyCountry);separator=", ") AS ?jobs)
115
+ {
116
+ SELECT DISTINCT
117
+ ?frInner
118
+ ?companyName
119
+ ?workFrom
120
+ ?companyCountry
121
+ {
122
+ ?frInner a snvoc:Person .
123
+ ?frInner snvoc:workAt ?work .
124
+ ?work snvoc:hasOrganisation ?company .
125
+ ?work snvoc:workFrom ?workFrom .
126
+ ?company snvoc:isLocatedIn/foaf:name ?companyCountry .
127
+ ?company foaf:name ?companyName
128
+ }
129
+ }
130
+ GROUP BY ?frInner
131
+ } .
132
+ ?frInnerComp snvoc:id ?frInnerCompId .
133
+ FILTER( ?frId = ?frInnerCompId)
134
+ }
135
+ }
136
+ GROUP BY ?frId ?last ?bday ?since ?gen ?browser ?locationIP ?based ?studies ?jobs ?emails ?languages
137
+ ORDER BY ?distanceFromPerson ?last ?frId
138
+ LIMIT 20
@@ -0,0 +1,89 @@
1
+ # Friend recommendation
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?first AS ?personFirstName)
15
+ (?last AS ?personLastName)
16
+ (?commonScore AS ?commonInterestScore)
17
+ (?gender AS ?personGender)
18
+ (?locationName AS ?personCityName)
19
+ WHERE
20
+ {
21
+ BIND(IF(?month = 12, 1, ?month + 1) AS ?nextMonth)
22
+ {
23
+ SELECT DISTINCT
24
+ ?fr
25
+ ?frId
26
+ WHERE
27
+ {
28
+ ?rootPerson a snvoc:Person .
29
+ ?rootPerson snvoc:id ?rootId .
30
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
31
+ ?fr snvoc:id ?frId .
32
+ FILTER(?frId != ?rootId) .
33
+ FILTER NOT EXISTS {
34
+ ?rootPerson (snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson) ?fr .
35
+ }
36
+ }
37
+ } .
38
+ ?fr snvoc:firstName ?first .
39
+ ?fr snvoc:lastName ?last .
40
+ ?fr snvoc:gender ?gender .
41
+ ?fr snvoc:birthday ?bday .
42
+ ?fr snvoc:isLocatedIn ?based .
43
+ ?based foaf:name ?locationName .
44
+ FILTER ( (MONTH(?bday) = ?month && DAY(?bday) >= 21) || (MONTH(?bday) = (?nextMonth) && DAY(?bday) < 22) ) .
45
+ OPTIONAL {
46
+ {
47
+ SELECT
48
+ ?frCommonInner
49
+ ?frCommonInnerId
50
+ (COUNT(?post) AS ?commonScoreInner)
51
+ WHERE
52
+ {
53
+ SELECT DISTINCT
54
+ ?frCommonInner
55
+ ?frCommonInnerId
56
+ ?post
57
+ WHERE {
58
+ ?rootPerson a snvoc:Person .
59
+ ?post a snvoc:Post .
60
+ ?post snvoc:hasCreator ?frCommonInner .
61
+ ?frCommonInner snvoc:id ?frCommonInnerId .
62
+ ?post snvoc:hasTag ?tag .
63
+ ?rootPerson snvoc:hasInterest ?tag
64
+ }
65
+ }
66
+ GROUP BY ?frCommonInner ?frCommonInnerId
67
+ }
68
+ FILTER(?frCommonInnerId = ?frId)
69
+ } .
70
+ OPTIONAL {
71
+ {
72
+ SELECT DISTINCT
73
+ ?frTotalInner
74
+ ?frTotalInnerId
75
+ (COUNT(?post) AS ?totalPostCountInner)
76
+ WHERE {
77
+ ?post a snvoc:Post .
78
+ ?post snvoc:hasCreator ?frTotalInner .
79
+ ?frTotalInner a snvoc:Person .
80
+ ?frTotalInner snvoc:id ?frTotalInnerId .
81
+ }
82
+ GROUP BY ?frTotalInner ?frTotalInnerId
83
+ }
84
+ FILTER(?frTotalInnerId = ?frId)
85
+ }
86
+ BIND( 2 * COALESCE(?commonScoreInner, 0) - COALESCE(?totalPostCountInner, 0) AS ?commonScore )
87
+ }
88
+ ORDER BY DESC(?commonScore) ?frId
89
+ LIMIT 10
@@ -0,0 +1,43 @@
1
+ # Job referral
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?first AS ?personFirstName)
15
+ (?last AS ?personLastName)
16
+ (?orgName AS ?organizationName)
17
+ (?startYear AS ?organizationWorkFromYear)
18
+ WHERE {
19
+ {
20
+ SELECT DISTINCT
21
+ ?fr
22
+ ?frId
23
+ WHERE
24
+ {
25
+ ?rootPerson a snvoc:Person .
26
+ ?rootPerson snvoc:id ?rootId .
27
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))?/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
28
+ ?fr snvoc:id ?frId .
29
+ FILTER(?frId != ?rootId)
30
+ }
31
+ } .
32
+ ?fr snvoc:workAt ?work .
33
+ ?work snvoc:workFrom ?startYear .
34
+ FILTER (?startYear < ?workFromYear) .
35
+ ?work snvoc:hasOrganisation ?org .
36
+ ?org foaf:name ?orgName .
37
+ ?org snvoc:isLocatedIn ?country.
38
+ ?country foaf:name ?countryName .
39
+ ?fr snvoc:firstName ?first .
40
+ ?fr snvoc:lastName ?last .
41
+ }
42
+ ORDER BY ?startYear ?frId DESC(?orgName)
43
+ LIMIT 10
@@ -0,0 +1,36 @@
1
+ # Expert search
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?first AS ?personFirstName)
15
+ (?last AS ?personLastName)
16
+ (GROUP_CONCAT(DISTINCT ?tagName;separator=', ') AS ?tagNames)
17
+ (COUNT(DISTINCT ?reply) AS ?replyCount)
18
+ WHERE
19
+ {
20
+ ?rootPerson a snvoc:Person .
21
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
22
+ ?fr snvoc:id ?frId .
23
+ ?fr snvoc:firstName ?first .
24
+ ?fr snvoc:lastName ?last .
25
+ ?reply snvoc:hasCreator ?fr .
26
+ ?reply snvoc:replyOf ?post .
27
+ ?post a snvoc:Post .
28
+ ?post snvoc:hasTag ?tag .
29
+ ?tag foaf:name ?tagName .
30
+ ?tag a ?tagType.
31
+ ?tagType rdfs:subClassOf* ?tagSuperType .
32
+ ?tagSuperType rdfs:label ?tagClassName .
33
+ }
34
+ GROUP BY ?frId ?first ?last
35
+ ORDER BY DESC(?replyCount) ?frId
36
+ LIMIT 20
@@ -0,0 +1,48 @@
1
+ # Recent messages by your friends
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?first AS ?personFirstName)
15
+ (?last AS ?personLastName)
16
+ ?messageId
17
+ (?content AS ?messageContent)
18
+ (?creationDate AS ?messageCreationDate)
19
+ WHERE
20
+ {
21
+ VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
22
+ {
23
+ SELECT DISTINCT
24
+ ?fr
25
+ WHERE {
26
+ ?rootPerson a snvoc:Person .
27
+ ?fr a snvoc:Person .
28
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr
29
+ }
30
+ }
31
+ ?message snvoc:hasCreator ?fr .
32
+ ?message a ?type
33
+ {
34
+ {
35
+ ?message snvoc:content ?content
36
+ } UNION {
37
+ ?message snvoc:imageFile ?content
38
+ }
39
+ } .
40
+ ?message snvoc:creationDate ?creationDate .
41
+ ?message snvoc:id ?messageId .
42
+ FILTER (?creationDate <= ?maxDate) .
43
+ ?fr snvoc:firstName ?first .
44
+ ?fr snvoc:lastName ?last .
45
+ ?fr snvoc:id ?frId .
46
+ }
47
+ ORDER BY DESC(?creationDate) ?message
48
+ LIMIT 20
@@ -0,0 +1,85 @@
1
+ # Friends and friends of friends that have been to given countries
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?firstName AS ?personFirstName)
15
+ (?lastName AS ?personLastName)
16
+ ?xCount
17
+ ?yCount
18
+ (?xCount + ?yCount AS ?count)
19
+ WHERE
20
+ {
21
+ {
22
+ SELECT DISTINCT
23
+ ?fr
24
+ ?frId
25
+ WHERE
26
+ {
27
+ ?rootPerson a snvoc:Person .
28
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))?/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
29
+ ?fr snvoc:id ?frId .
30
+ ?fr snvoc:isLocatedIn/snvoc:isPartOf ?country .
31
+ ?country a dbpedia-owl:Country .
32
+ ?country foaf:name ?countryName .
33
+ FILTER(?fr != ?rootPerson && ?countryName != ?countryXName && ?countryName != ?countryYName)
34
+ }
35
+ }
36
+ {
37
+ SELECT
38
+ (?frId AS ?frIdX)
39
+ (COUNT(*) AS ?xCount)
40
+ WHERE
41
+ {
42
+ BIND( ?startDate AS ?date1 ) .
43
+ BIND( ?date1 + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?date2 ) .
44
+ VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
45
+ ?message a ?type .
46
+ ?message snvoc:creationDate ?creationDate .
47
+ FILTER( ?creationDate >= ?date1 && ?creationDate < ?date2 ) .
48
+ ?message snvoc:hasCreator ?fr .
49
+ ?fr a snvoc:Person .
50
+ ?fr snvoc:id ?frId .
51
+ ?message snvoc:isLocatedIn ?country .
52
+ ?country a dbpedia-owl:Country .
53
+ ?country foaf:name ?countryXName .
54
+ }
55
+ GROUP BY ?frId
56
+ } .
57
+ FILTER( ?frId = ?frIdX ) .
58
+ {
59
+ SELECT
60
+ (?frId AS ?frIdY)
61
+ (COUNT(*) AS ?yCount)
62
+ WHERE
63
+ {
64
+ BIND( ?startDate AS ?date1 ) .
65
+ BIND( ?date1 + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?date2 ) .
66
+ VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
67
+ ?message a ?type .
68
+ ?message snvoc:creationDate ?creationDate .
69
+ FILTER( ?creationDate >= ?date1 && ?creationDate < ?date2 ) .
70
+ ?message snvoc:hasCreator ?fr .
71
+ ?fr a snvoc:Person .
72
+ ?fr snvoc:id ?frId .
73
+ ?message snvoc:isLocatedIn ?country .
74
+ ?country a dbpedia-owl:Country .
75
+ ?country foaf:name ?countryYName .
76
+ }
77
+ GROUP BY ?frId
78
+ } .
79
+ FILTER( ?frId = ?frIdY )
80
+ ?fr snvoc:firstName ?firstName .
81
+ ?fr snvoc:lastName ?lastName
82
+ }
83
+ ORDER BY DESC(?sum) ?fr
84
+ LIMIT 20
85
+
@@ -0,0 +1,85 @@
1
+ # Friends and friends of friends that have been to given countries
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?frId AS ?personId)
14
+ (?firstName AS ?personFirstName)
15
+ (?lastName AS ?personLastName)
16
+ ?xCount
17
+ ?yCount
18
+ (?xCount + ?yCount AS ?count)
19
+ WHERE
20
+ {
21
+ {
22
+ SELECT DISTINCT
23
+ ?fr
24
+ ?frId
25
+ WHERE
26
+ {
27
+ ?rootPerson a snvoc:Person .
28
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))?/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
29
+ ?fr snvoc:id ?frId .
30
+ ?fr snvoc:isLocatedIn/snvoc:isPartOf ?country .
31
+ ?country a dbpedia-owl:Country .
32
+ ?country foaf:name ?countryName .
33
+ FILTER(?fr != ?rootPerson && ?countryName != ?countryXName && ?countryName != ?countryYName)
34
+ }
35
+ }
36
+ {
37
+ SELECT
38
+ (?frId AS ?frIdX)
39
+ (COUNT(*) AS ?xCount)
40
+ WHERE
41
+ {
42
+ BIND( ?startDate AS ?date1 ) .
43
+ BIND( ?date1 + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?date2 ) .
44
+ VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
45
+ ?message a ?type .
46
+ ?message snvoc:creationDate ?creationDate .
47
+ FILTER( ?creationDate >= ?date1 && ?creationDate < ?date2 ) .
48
+ ?message snvoc:hasCreator ?fr .
49
+ ?fr a snvoc:Person .
50
+ ?fr snvoc:id ?frId .
51
+ ?message snvoc:isLocatedIn ?country .
52
+ ?country a dbpedia-owl:Country .
53
+ ?country foaf:name ?countryXName .
54
+ }
55
+ GROUP BY ?frId
56
+ } .
57
+ FILTER( ?frId = ?frIdX ) .
58
+ {
59
+ SELECT
60
+ (?frId AS ?frIdY)
61
+ (COUNT(*) AS ?yCount)
62
+ WHERE
63
+ {
64
+ BIND( ?startDate AS ?date1 ) .
65
+ BIND( ?date1 + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?date2 ) .
66
+ VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
67
+ ?message a ?type .
68
+ ?message snvoc:creationDate ?creationDate .
69
+ FILTER( ?creationDate >= ?date1 && ?creationDate < ?date2 ) .
70
+ ?message snvoc:hasCreator ?fr .
71
+ ?fr a snvoc:Person .
72
+ ?fr snvoc:id ?frId .
73
+ ?message snvoc:isLocatedIn ?country .
74
+ ?country a dbpedia-owl:Country .
75
+ ?country foaf:name ?countryYName .
76
+ }
77
+ GROUP BY ?frId
78
+ } .
79
+ FILTER( ?frId = ?frIdY )
80
+ ?fr snvoc:firstName ?firstName .
81
+ ?fr snvoc:lastName ?lastName
82
+ }
83
+ ORDER BY DESC(?sum) ?fr
84
+ LIMIT 20
85
+
@@ -0,0 +1,36 @@
1
+ # New topics
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ ?tagName
14
+ (COUNT(*) AS ?postCount)
15
+ WHERE {
16
+ BIND( ?startDate + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?endDate ) .
17
+ ?rootPerson a snvoc:Person .
18
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
19
+ ?post a snvoc:Post .
20
+ ?post snvoc:hasCreator ?fr .
21
+ ?post snvoc:hasTag ?tag .
22
+ ?tag foaf:name ?tagName .
23
+ ?post snvoc:creationDate ?creationDate .
24
+ FILTER (?creationDate >= ?startDate && ?creationDate <= ?endDate ) .
25
+ FILTER NOT EXISTS {
26
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr2 .
27
+ ?post2 snvoc:hasCreator ?fr2 .
28
+ ?post2 a snvoc:Post .
29
+ ?post2 snvoc:hasTag ?tag .
30
+ ?post2 snvoc:creationDate ?creationDate2 .
31
+ FILTER (?creationDate2 < ?startDate)
32
+ }
33
+ }
34
+ GROUP BY ?tagName
35
+ ORDER BY DESC(?postCount) ?tagName
36
+ LIMIT 10
@@ -0,0 +1,36 @@
1
+ # New topics
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ ?tagName
14
+ (COUNT(*) AS ?postCount)
15
+ WHERE {
16
+ BIND( ?startDate + STRDT(CONCAT("P", ?durationDays, "D"), xsd:duration) AS ?endDate ) .
17
+ ?rootPerson a snvoc:Person .
18
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
19
+ ?post a snvoc:Post .
20
+ ?post snvoc:hasCreator ?fr .
21
+ ?post snvoc:hasTag ?tag .
22
+ ?tag foaf:name ?tagName .
23
+ ?post snvoc:creationDate ?creationDate .
24
+ FILTER (?creationDate >= ?startDate && ?creationDate <= ?endDate ) .
25
+ FILTER NOT EXISTS {
26
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr2 .
27
+ ?post2 snvoc:hasCreator ?fr2 .
28
+ ?post2 a snvoc:Post .
29
+ ?post2 snvoc:hasTag ?tag .
30
+ ?post2 snvoc:creationDate ?creationDate2 .
31
+ FILTER (?creationDate2 < ?startDate)
32
+ }
33
+ }
34
+ GROUP BY ?tagName
35
+ ORDER BY DESC(?postCount) ?tagName
36
+ LIMIT 10
@@ -0,0 +1,55 @@
1
+ # New groups
2
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
5
+ PREFIX sn: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/data/>
6
+ PREFIX snvoc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
7
+ PREFIX sntag: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/>
8
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
9
+ PREFIX dbpedia: <http://localhost:3000/dbpedia.org/resource/>
10
+ PREFIX dbpedia-owl: <http://localhost:3000/dbpedia.org/ontology/>
11
+
12
+ SELECT
13
+ (?title AS ?forumTitle)
14
+ (SUM(?hasPost) AS ?postCount)
15
+ WHERE
16
+ {
17
+ {
18
+ SELECT DISTINCT
19
+ ?fr
20
+ ?forum
21
+ WHERE
22
+ {
23
+ {
24
+ SELECT DISTINCT
25
+ ?fr
26
+ ?frId
27
+ WHERE
28
+ {
29
+ ?rootPerson a snvoc:Person .
30
+ ?rootPerson snvoc:id ?rootId .
31
+ ?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))?/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr .
32
+ ?fr snvoc:id ?frId .
33
+ FILTER(?frId != ?rootId)
34
+ }
35
+ } .
36
+ ?forum a snvoc:Forum .
37
+ ?forum snvoc:hasMember ?mem .
38
+ ?mem snvoc:hasPerson ?fr .
39
+ ?mem snvoc:joinDate ?date .
40
+ FILTER( ?date >= ?minDate ) .
41
+ }
42
+ }
43
+ OPTIONAL {
44
+ ?post a snvoc:Post .
45
+ ?post snvoc:hasCreator ?fr .
46
+ ?forum snvoc:containerOf ?post .
47
+ BIND( 1 AS ?hasPostInner )
48
+ } .
49
+ ?forum snvoc:title ?title .
50
+ ?forum snvoc:id ?forumId .
51
+ BIND( COALESCE(?hasPostInner, 0) AS ?hasPost )
52
+ }
53
+ GROUP BY ?title ?forumId
54
+ ORDER BY DESC(?postCount) ?forumId
55
+ LIMIT 20