PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?messageYear ?isComment ?lengthCategory ?messageCount ?averageMessageLength ?sumMessageLength ?percentageOfMessages WHERE { { SELECT ?messageYear ?isComment ?lengthCategory (COUNT(?message) AS ?messageCount) (floor(AVG(?length)) AS ?averageMessageLength) (SUM(?length) AS ?sumMessageLength) WHERE { { ?message a snvoc:Comment . BIND( true AS ?isComment) } UNION { ?message a snvoc:Post . BIND( false AS ?isComment) } . ?message snvoc:length ?length . ?message snvoc:creationDate ?creationDate . FILTER (?creationDate < "2011-07-22T04:00:00Z") . BIND( year(?creationDate) AS ?messageYear) . BIND( IF (?length < 40, 0, IF (?length < 80 , 1, IF(?length < 160, 2, 3))) AS ?lengthCategory) } GROUP BY ?messageYear ?isComment ?lengthCategory } { SELECT (COUNT(?message) as ?totalMessageCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} . ?message a ?type . ?message snvoc:creationDate ?creationDate . FILTER (?creationDate <= "2011-07-22T04:00:00Z") } } BIND ( ?messageCount / ?totalMessageCount AS ?percentageOfMessages) } ORDER BY DESC(?messageYear) ?isComment ?lengthCategory PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?countryName ?messageMonth ?personGender ?ageGroup ?tagName (COUNT(?message) AS ?messageCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} . ?message a ?type . ?message snvoc:creationDate ?creationDate . ?message snvoc:hasCreator ?person . ?message snvoc:hasTag ?tag . ?tag foaf:name ?tagName . ?person a snvoc:Person . ?person snvoc:gender ?personGender . ?person snvoc:birthday ?birthday . ?person snvoc:isLocatedIn ?city . ?city snvoc:isPartOf ?country . ?country foaf:name ?countryName . FILTER ("2010-01-01T05:00:00Z" <= ?creationDate && ?creationDate <= "1974-02-01T02:54:00Z") . FILTER (?countryName = "Ethiopia" || ?countryName = "Spain") . BIND ( IF(month(?birthday) = 1 && day(?birthday) = 1, 2013, 2012 ) AS ?yearFromSubstract) BIND ( FLOOR( (?yearFromSubstract - year(?birthday)) / 5.0) AS ?ageGroup) . BIND ( month(?creationDate) AS ?messageMonth) . } GROUP BY ?countryName ?messageMonth ?personGender ?ageGroup ?tagName HAVING (?messageCount > 100) ORDER BY DESC(?messageCount) ?tagName ?ageGroup ?personGender ?messageMonth ?countryName LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?tagName (SUM(?isFirstInt) AS ?countMonth1) (SUM(?isSecondInt) AS ?countMonth2) (ABS(?countMonth1 - ?countMonth2) AS ?diff) WHERE { VALUES (?year1 ?month1) {(2015 12)} VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message a ?type . ?message snvoc:hasTag/foaf:name ?tagName . ?message snvoc:creationDate ?creationDate . BIND (year(?creationDate) AS ?year). BIND (month(?creationDate) AS ?month). BIND (((?month1 = ?month) && (?year1 = ?year)) AS ?isFirst) BIND ( ( ((?month1 != 12) && (?month = ?month1 + 1) && (?year = ?year1 )) || ((?month1 = 12) && (?month = 1) && (?year = ?year1 + 1)) ) AS ?isSecond ) FILTER (?isFirst || ?isSecond) . BIND (xsd:integer(?isFirst) AS ?isFirstInt) . BIND (xsd:integer(?isSecond) AS ?isSecondInt) } GROUP BY ?tagName ORDER BY DESC(?diff) ?tagName LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?forumId ?forumTitle ?forumCreationDate ?personId (COUNT(DISTINCT ?post) AS ?postCount) WHERE { ?person a snvoc:Person . ?country a dbpedia-owl:Country . ?city a dbpedia-owl:City . ?post a snvoc:Post . ?tag a ?tagClass . ?tagClass a snvoc:TagClass . ?country foaf:name "Netherlands" . ?tagClass rdfs:label "MusicalArtist" . ?person snvoc:isLocatedIn ?city . ?city snvoc:isPartOf ?country . ?forum snvoc:hasModerator ?person . ?forum snvoc:containerOf ?post . ?post snvoc:hasTag ?tag . ?forum snvoc:id ?forumId . ?forum snvoc:title ?forumTitle . ?forum snvoc:creationDate ?forumCreationDate . ?person snvoc:id ?personId . } GROUP BY ?forumId ?forumTitle ?forumCreationDate ?personId ORDER BY DESC(?postCount) ?forumId LIMIT 20 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId ?personFirstName ?personLastName ?personCreationDate (COUNT(DISTINCT ?post) AS ?postCount) WHERE { { SELECT ?forum WHERE { BIND("Ethiopia" AS ?countryName) ?forum a snvoc:Forum . ?forum snvoc:hasMember ?memberSerial . ?memberSerial snvoc:hasPerson ?personId . ?personId a snvoc:Person . ?personId snvoc:isLocatedIn ?city . ?city a dbpedia-owl:City . ?city snvoc:isPartOf ?country . ?country a dbpedia-owl:Country . ?country foaf:name ?countryName } GROUP BY ?forum ORDER BY DESC(COUNT(DISTINCT ?personId)) ?forum LIMIT 100 } { SELECT ?forum2 WHERE { BIND("Ethiopia" AS ?countryName) ?forum2 a snvoc:Forum . ?forum2 snvoc:hasMember ?memberSerial . ?memberSerial snvoc:hasPerson ?personId . ?personId a snvoc:Person . ?personId snvoc:isLocatedIn ?city . ?city a dbpedia-owl:City . ?city snvoc:isPartOf ?country . ?country a dbpedia-owl:Country . ?country foaf:name ?countryName } GROUP BY ?forum2 ORDER BY DESC(COUNT(DISTINCT ?personId)) ?forum2 LIMIT 100 } ?personId a snvoc:Person . ?forum snvoc:hasMember/snvoc:hasPerson ?personId . OPTIONAL { ?post a snvoc:Post . ?post snvoc:hasCreator ?personId . ?forum2 snvoc:containerOf ?post . } ?personId snvoc:firstName ?personFirstName . ?personId snvoc:lastName ?personLastName . ?personId snvoc:creationDate ?personCreationDate } GROUP BY ?personId ?personFirstName ?personLastName ?personCreationDate ORDER BY DESC(?postCount) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId ?likeCount ?messageCount ?replyCount ?score WHERE { { SELECT ?personId (COUNT(DISTINCT ?like) AS ?likeCount) (COUNT(DISTINCT ?message) AS ?messageCount) (COUNT(DISTINCT ?replyComment) AS ?replyCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message a ?type . ?message snvoc:hasTag ?tag . ?tag a ?tagClass . ?tagClass a snvoc:TagClass . ?tag foaf:name "Ehud_Olmert" . OPTIONAL { ?personWhoLiked a snvoc:Person . ?personWhoLiked snvoc:likes ?like . ?like snvoc:hasComment|snvoc:hasPost ?message . } ?personId a snvoc:Person . ?message snvoc:hasCreator ?personId . OPTIONAL { ?replyComment snvoc:replyOf ?message. } } GROUP BY ?personId } BIND( ?messageCount + 2 * ?replyCount + 10 * ?likeCount as ?score) } ORDER BY DESC(?score) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId (SUM(?popularityScore) AS ?authorityScore) WHERE { SELECT DISTINCT ?personId ?person2 ?popularityScore WHERE { ?personId a snvoc:Person . VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message2 a ?type . ?message2 snvoc:hasCreator ?personId . ?message2 snvoc:hasTag/foaf:name "Che_Guevara" . OPTIONAL { ?person2 snvoc:likes/(snvoc:hasPost|snvoc:hasComment) ?message2 . ?message2 snvoc:hasCreator ?personId . ?person2 a snvoc:Person . { SELECT ?person2 (COUNT(DISTINCT ?like2) AS ?popularityScore) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?person2 a snvoc:Person . ?message3 a ?type . ?message3 snvoc:hasCreator ?person2 . ?person3 snvoc:likes ?like2 . ?person3 a snvoc:Person . ?like2 snvoc:hasPost|snvoc:hasComment ?message3 . } GROUP BY ?person2 ORDER BY ?person2 ?like2 } } } } GROUP BY ?personId ?message2 ORDER BY DESC(?authorityScore) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?relatedTagName (COUNT(?comment) AS ?count) WHERE { BIND ("Imelda_Marcos" AS ?tagName) VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message a ?type . ?message snvoc:hasTag/foaf:name ?tagName . ?comment snvoc:replyOf ?message . ?comment snvoc:hasTag/foaf:name ?relatedTagName . FILTER NOT EXISTS {?comment snvoc:hasTag/foaf:name ?tagName} } GROUP BY ?relatedTagName ORDER BY DESC(?count) ?relatedTagName LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?forumId (COUNT(DISTINCT ?post1) AS ?count1) (COUNT(DISTINCT ?post2) AS ?count2) WHERE { #BIND (500 as ?treshold) BIND ("BaseballPlayer" AS ?tagClassName1) BIND ("ChristianBishop" AS ?tagClassName2) ?tag1 a ?tagClass1 . ?tagClass1 rdfs:label ?tagClassName1 . ?tag2 a ?tagClass2 . ?tagClass2 rdfs:label ?tagClassName2 . ?post1 a snvoc:Post . ?post1 snvoc:hasTag ?tag1 . ?post2 a snvoc:Post . ?post2 snvoc:hasTag ?tag2 . ?forumId snvoc:containerOf ?post1 . ?forumId snvoc:containerOf ?post2 . ?forumId snvoc:hasMember/snvoc:hasPerson ?person . } GROUP BY ?forumId HAVING (?count1 > 0 && ?count2 > 0 && COUNT(DISTINCT ?person) > 200) ORDER BY DESC(ABS(?count2 - ?count1)) ?forumId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId (?interestScore + ?messageScore AS ?score) (SUM( ?friendInterestScore + ?friendMessageScore) AS ?friendsScore) WHERE { { SELECT ?personId (MAX(COALESCE(?innerInterestScore,0)) AS ?interestScore) (COALESCE(COUNT(?message),0) AS ?messageScore) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?personId a snvoc:Person . { ?message a ?type . ?message snvoc:hasCreator ?personId . ?message snvoc:hasTag ?tag . ?tag foaf:name "Che_Guevara" . ?message snvoc:creationDate ?creationDate . FILTER (?creationDate > "2011-07-22T04:00:00Z"^^xsd:dateTime) } UNION { ?personId snvoc:hasInterest/foaf:name "Che_Guevara" BIND(100 AS ?innerInterestScore) } } GROUP BY ?personId } OPTIONAL { { SELECT ?friend (MAX(COALESCE(?friendInnerInterestScore,0)) AS ?friendInterestScore) (COALESCE(COUNT(?message),0) AS ?friendMessageScore) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?friend a snvoc:Person . { ?message a ?type . ?message snvoc:hasCreator ?friend . ?message snvoc:hasTag ?tag . ?tag foaf:name "Che_Guevara" . ?message snvoc:creationDate ?creationDate . FILTER (?creationDate > "2011-07-22T04:00:00Z"^^xsd:dateTime) } UNION { ?friend snvoc:hasInterest/foaf:name "Che_Guevara" BIND(100 AS ?friendInnerInterestScore) } } GROUP BY ?friend } { ?friend snvoc:knows/snvoc:hasPerson ?personId } UNION { ?personId snvoc:knows/snvoc:hasPerson ?friend } } } GROUP BY ?personId ?interestScore ?messageScore ORDER BY DESC(?score + ?friendsScore) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId ?tagName (SUM(?likeValue) AS ?likeCount) (COUNT(DISTINCT ?reply) AS ?replyCount) WHERE { { SELECT ?reply WHERE { ?reply a snvoc:Comment . ?reply snvoc:content ?content . FILTER( !REGEX(?content, "(also)") ) ?reply snvoc:hasCreator ?personId . ?personId a snvoc:Person . ?personId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Germany" . ?reply snvoc:hasTag ?tag . ?reply snvoc:replyOf ?original . OPTIONAL { ?original snvoc:hasTag ?tag BIND(1 AS ?commonTagCount) } } GROUP BY ?reply HAVING (SUM(COALESCE(?commonTagCount,0)) = 0) } ?reply snvoc:hasTag ?tag . ?tag foaf:name ?tagName . ?personId a snvoc:Person . ?reply snvoc:hasCreator ?personId . OPTIONAL { ?personIdWhoLiked a snvoc:Person . ?personIdWhoLiked snvoc:likes ?like . ?like snvoc:hasComment ?reply . BIND(1 AS ?likeValue) } } GROUP BY ?personId ?tagName ORDER BY DESC(?likeCount) ?personId ?tagName LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?messageId ?messageCreationDate ?creatorFirstName ?creatorLastName (COUNT(?like) AS ?likeCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message a ?type . ?message snvoc:creationDate ?messageCreationDate . FILTER( ?messageCreationDate > "2011-07-22T04:00:00Z" ) ?message snvoc:id ?messageId . ?message snvoc:hasCreator ?person . ?person a snvoc:Person . ?person snvoc:firstName ?creatorFirstName . ?person snvoc:lastName ?creatorLastName . ?personWhoLikes a snvoc:Person . ?personWhoLikes snvoc:likes ?like . ?like snvoc:hasComment|snvoc:hasPost ?message } GROUP BY ?messageId ?messageCreationDate ?creatorFirstName ?creatorLastName HAVING (?likeCount > 400) ORDER BY DESC(?likeCount) ?messageId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?year ?month (GROUP_CONCAT(?strTagAndPopularity;separator="|") AS ?popularTags) WHERE { { SELECT ?year ?month ?tagName (COUNT(?message) AS ?popularity) WHERE { SELECT ?year ?month ?message ?tagName WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?message a ?type . ?message snvoc:isLocatedIn/foaf:name "Ethiopia" . ?message snvoc:creationDate ?creationDate . OPTIONAL { ?message snvoc:hasTag/foaf:name ?tagName . } BIND( YEAR(?creationDate) AS ?year) BIND( MONTH(?creationDate) AS ?month) } } GROUP BY ?year ?month ?tagName ORDER BY DESC(?popularity) ?tagName } BIND(STR(?popularity) AS ?strPopularity) BIND(CONCAT(?tagName, "#", ?strPopularity) AS ?strTagAndPopularity) } GROUP BY ?year ?month ORDER BY DESC(?year) ?month LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId ?personFirstName ?personLastName (COUNT(DISTINCT ?post) AS ?threadCount) (COUNT(?reply) AS ?messageCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} ?personId a snvoc:Person . ?personId snvoc:firstName ?personFirstName . ?personId snvoc:lastName ?personLastName . ?post snvoc:hasCreator ?personId . ?post snvoc:creationDate ?postCreationDate . ?reply a ?type . ?reply snvoc:replyOf* ?post . ?post a snvoc:Post . ?reply snvoc:creationDate ?replyCreationDate . FILTER (("2012-06-01T04:00:00Z" <= ?postCreationDate && ?postCreationDate <= "2012-07-01T04:00:00Z") && ("2012-06-01T04:00:00Z" <= ?replyCreationDate && ?replyCreationDate <= "2012-07-01T04:00:00Z")) } GROUP BY ?personId ?personFirstName ?personLastName ORDER BY DESC(?messageCount) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId (COUNT(?friend) AS ?count) WHERE { { SELECT (FLOOR(COUNT(?friend) / COUNT(DISTINCT ?personId)) AS ?avgFriendCount) WHERE { ?personId a snvoc:Person . ?personId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" . ?personId snvoc:id ?pId . OPTIONAL { ?friend a snvoc:Person . ?friend snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" . ?friend snvoc:id ?fId . { ?personId snvoc:knows/snvoc:hasPerson ?friend . } UNION { ?friend snvoc:knows/snvoc:hasPerson ?personId . } } } } ?personId a snvoc:Person . ?personId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" . OPTIONAL { ?friend a snvoc:Person . ?friend snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" . { ?personId snvoc:knows/snvoc:hasPerson ?friend . } UNION { ?friend snvoc:knows/snvoc:hasPerson ?personId . } } } GROUP BY ?personId ?avgFriendCount HAVING(?count = ?avgFriendCount) ORDER BY ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId ?tagName ?messageCount WHERE { { SELECT ?personId ?tagName (COUNT(?message) AS ?messageCount) WHERE { { SELECT DISTINCT ?personId ?message WHERE { ?rootPerson a snvoc:Person . ?rootPerson snvoc:id "13194139534730"^^xsd:long . # the next two lines are changed by the driver to UNION of 1-2-... knows "edges" # with the no-repeated-edge (a.k.a. edge isomorphic) matching semantics enforced { { ?rootPerson snvoc:knows ?know1 . ?know1 snvoc:hasPerson ?personId . } UNION { ?personId snvoc:knows ?know1 . ?know1 snvoc:hasPerson ?rootPerson . } } UNION { { ?rootPerson snvoc:knows ?know1 . ?know1 snvoc:hasPerson ?person1 . } UNION { ?person1 snvoc:knows ?know1 . ?know1 snvoc:hasPerson ?rootPerson . } { ?person1 snvoc:knows ?know2 . ?know2 snvoc:hasPerson ?personId . } UNION { ?personId snvoc:knows ?know2 . ?know2 snvoc:hasPerson ?person1 . } FILTER ( ?know1 != ?know2 ) } ?personId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Germany" . VALUES (?type) {(snvoc:Comment) (snvoc:Post)} . ?message a ?type . ?message snvoc:hasCreator ?personId . ?message snvoc:hasTag ?tagInClass . ?tagInClass a/rdfs:label "MusicalArtist" . } } ?message snvoc:hasTag/foaf:name ?tagName } GROUP BY ?personId ?tagName ORDER BY DESC(?messageCount) ?tagName ?personId } ?personId a snvoc:Person } ORDER BY DESC(?messageCount) ?tagName ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT (COUNT(*) AS ?count) WHERE { ?country a dbpedia-owl:Country . ?country foaf:name "Ethiopia" . ?a a snvoc:Person . ?b a snvoc:Person . ?c a snvoc:Person . ?a snvoc:id ?aId . ?b snvoc:id ?bId . ?c snvoc:id ?cId . ?a snvoc:isLocatedIn/snvoc:isPartOf ?country . ?b snvoc:isLocatedIn/snvoc:isPartOf ?country . ?c snvoc:isLocatedIn/snvoc:isPartOf ?country . # (a)-[:knows]-(b) { ?a snvoc:knows/snvoc:hasPerson ?b . ?a snvoc:id ?aId . ?b snvoc:id ?bId FILTER (?aId < ?bId) } UNION { ?b snvoc:knows/snvoc:hasPerson ?a . ?a snvoc:id ?aId . ?b snvoc:id ?bId FILTER (?aId < ?bId) } # (b)-[:knows]-(c) { ?b snvoc:knows/snvoc:hasPerson ?c . ?b snvoc:id ?bId . ?c snvoc:id ?cId FILTER (?bId < ?cId) } UNION { ?c snvoc:knows/snvoc:hasPerson ?b . ?b snvoc:id ?bId . ?c snvoc:id ?cId FILTER (?bId < ?cId) } # (c)-[:knows]-(a) { ?a snvoc:knows/snvoc:hasPerson ?c . ?a snvoc:id ?aId . ?c snvoc:id ?cId FILTER (?aId < ?cId) } UNION { ?c snvoc:knows/snvoc:hasPerson ?a . ?a snvoc:id ?aId . ?c snvoc:id ?cId FILTER (?aId < ?cId) } FILTER (?aId < ?bId && ?bId < ?cId) } GROUP BY ?country PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?messageCount (COUNT(?person) AS ?personCount) WHERE { { SELECT ?person (COUNT(?message) AS ?messageCount) WHERE { VALUES (?language) {("English")} ?person a snvoc:Person OPTIONAL { ?message a snvoc:Comment . ?message snvoc:replyOf* ?post . ?message snvoc:creationDate ?creationDate . FILTER (?creationDate > "2011-07-22T04:00:00Z") . ?post a snvoc:Post . ?post snvoc:language ?language . ?message snvoc:content ?content . ?message snvoc:length ?length . FILTER(STRLEN(?content) > 0 && ?length < 0) ?message snvoc:hasCreator ?person . } } GROUP BY ?person } } GROUP BY ?messageCount ORDER BY DESC(?personCount) DESC(?messageCount) PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?personId (COUNT(DISTINCT ?stranger) AS ?strangerCount) (COUNT(?comment) AS ?interactionCount) WHERE { { SELECT DISTINCT ?stranger WHERE { ?forum1 a snvoc:Forum . ?forum1 snvoc:hasMember/snvoc:hasPerson ?stranger . ?forum1 snvoc:hasTag/a/rdfs:label "MusicalArtist" . ?forum2 a snvoc:Forum . ?forum2 snvoc:hasMember/snvoc:hasPerson ?stranger . ?forum2 snvoc:hasTag/a/rdfs:label "OfficeHolder" . } } ?personId a snvoc:Person . FILTER( ?personId != ?stranger ) . ?personId snvoc:birthday ?personBirthday . FILTER( ?personBirthday > "1989-01-01"^^xsd:date ) . FILTER NOT EXISTS{ {?personId snvoc:knows/snvoc:hasPerson ?stranger} UNION {?stranger snvoc:knows/snvoc:hasPerson ?personId} } VALUES (?type) {(snvoc:Comment) (snvoc:Post)} . ?message a ?type . ?message snvoc:hasCreator ?stranger . ?comment a snvoc:Comment . ?comment snvoc:hasCreator ?personId . ?comment snvoc:replyOf+ ?message . FILTER NOT EXISTS { ?message snvoc:replyOf+/snvoc:hasCreator ?stranger } } GROUP BY ?personId ORDER BY DESC(?interactionCount) ?personId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?tagClassName (COUNT(DISTINCT ?message) AS ?messageCount) WHERE { VALUES (?tagClassName) {("Country")} VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?message a ?type . ?message snvoc:hasTag/a ?tagClass . ?tagClass a snvoc:TagClass . ?tagClass rdfs:subClassOf* ?parentTagClass . ?parentTagClass rdfs:label ?tagClassName } GROUP BY ?tagClassName ORDER BY DESC(?messageCount) ?tagClassName PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?zombieId ?zombieLikeCount (COUNT(DISTINCT ?like) AS ?totalLikeCount) (IF(COUNT(DISTINCT ?like) = 0, 0, ?zombieLikeCount / COUNT(DISTINCT ?like)) AS ?zombieScore) WHERE { { SELECT ?zombieId (COUNT(DISTINCT ?zombieLike) AS ?zombieLikeCount) WHERE { BIND("2013-01-01T05:00:00Z"^^xsd:dateTime AS ?endDate) { SELECT ?zombieId WHERE { BIND("2013-01-01T05:00:00Z"^^xsd:dateTime AS ?endDate) VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?zombieId a snvoc:Person . ?zombieId snvoc:creationDate ?zombieCreationDate . FILTER( ?zombieCreationDate < ?endDate ) ?zombieId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" OPTIONAL { ?message a ?type . ?message snvoc:creationDate ?messageCreationDate . FILTER( ?messageCreationDate < ?endDate ) ?message snvoc:hasCreator ?zombieId . } BIND( YEAR(?endDate) AS ?endYear) BIND( MONTH(?endDate) AS ?endMonth) BIND( YEAR(?zombieCreationDate) AS ?zombieCreationYear) BIND( MONTH(?zombieCreationDate) AS ?zombieCreationMonth) BIND( ((?endYear - ?zombieCreationYear) * 12 + ?endMonth - ?zombieCreationMonth + 1) AS ?monthDiff) } GROUP BY ?zombieId ?monthDiff HAVING (COUNT(DISTINCT ?message)/?monthDiff < 1.0) } { SELECT ?likerZombieId WHERE { BIND("2013-01-01T05:00:00Z"^^xsd:dateTime AS ?endDate) VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?likerZombieId a snvoc:Person . ?likerZombieId snvoc:creationDate ?likerZombieCreationDate . FILTER( ?likerZombieCreationDate < ?endDate ) ?likerZombieId snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" OPTIONAL { ?message a ?type . ?message snvoc:creationDate ?messageCreationDate . FILTER( ?messageCreationDate < ?endDate ) ?message snvoc:hasCreator ?likerZombieId . } BIND( YEAR(?endDate) AS ?endYear) BIND( MONTH(?endDate) AS ?endMonth) BIND( YEAR(?likerZombieCreationDate) AS ?likerZombieCreationYear) BIND( MONTH(?likerZombieCreationDate) AS ?likerZombieCreationMonth) BIND( ((?endYear - ?likerZombieCreationYear) * 12 + ?endMonth - ?likerZombieCreationMonth + 1) AS ?monthDiff) } GROUP BY ?likerZombieId ?monthDiff HAVING (COUNT(DISTINCT ?message)/?monthDiff < 1.0) } OPTIONAL { ?message snvoc:hasCreator ?zombieId . VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?message a ?type . ?likerZombieId snvoc:likes ?zombieLike . ?zombieLike snvoc:hasPost|snvoc:hasComment ?message . } } GROUP BY ?zombieId } OPTIONAL { BIND("2013-01-01T05:00:00Z"^^xsd:dateTime AS ?endDate) VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?message a ?type . ?message snvoc:hasCreator ?zombieId . ?message snvoc:creationDate ?messageCreationDate . FILTER( ?messageCreationDate < ?endDate ) ?person a snvoc:Person . ?person snvoc:creationDate ?personCreationDate . FILTER( ?personCreationDate < ?endDate ) ?person snvoc:likes ?like . ?like snvoc:hasComment|snvoc:hasPost ?message } } GROUP BY ?zombieId ?zombieLikeCount ORDER BY DESC(?zombieScore) ?zombieId LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?person1Id ?person2Id ?city1Name ?score WHERE { { SELECT ?person1Id ?person2Id ?city1Name (MAX(COALESCE(?case1InnerScore,0)) + MAX(COALESCE(?case2InnerScore,0)) + MAX(?case3InnerScore) + MAX(COALESCE(?case4InnerScore,0)) + MAX(COALESCE(?case5InnerScore,0)) AS ?score) WHERE { ?person1Id a snvoc:Person . ?person1Id snvoc:isLocatedIn ?city1 . ?city1 foaf:name ?city1Name . ?city1 snvoc:isPartOf/foaf:name "Mexico" . ?person2Id a snvoc:Person . ?person2Id snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Indonesia" . OPTIONAL { VALUES (?type1) {(snvoc:Comment) (snvoc:Post)} ?message1 a ?type1 . ?message1 snvoc:hasCreator ?person2Id . ?comment1 a snvoc:Comment . ?comment1 snvoc:hasCreator ?person1Id . ?comment1 snvoc:replyOf ?message1 . BIND( 4 AS ?case1InnerScore ) } OPTIONAL { VALUES (?type2) {(snvoc:Comment) (snvoc:Post)} ?message2 a ?type2 . ?message2 snvoc:hasCreator ?person1Id . ?comment2 a snvoc:Comment . ?comment2 snvoc:hasCreator ?person2Id . ?comment2 snvoc:replyOf ?message2 . BIND( 1 AS ?case2InnerScore ) } BIND( IF( EXISTS { { ?person1Id snvoc:knows/snvoc:hasPerson ?person2Id } UNION { ?person2Id snvoc:knows/snvoc:hasPerson ?person1Id } }, 15, 0 ) AS ?case3InnerScore ) OPTIONAL { VALUES (?type4) {(snvoc:Comment) (snvoc:Post)} ?message4 a ?type4 . ?message4 snvoc:hasCreator ?person2Id . ?person1Id snvoc:likes/(snvoc:hasPost|snvoc:hasComment) ?message4 BIND( 10 AS ?case4InnerScore ) } OPTIONAL { VALUES (?type5) {(snvoc:Comment) (snvoc:Post)} ?message5 a ?type5 . ?message5 snvoc:hasCreator ?person1Id . ?person2Id snvoc:likes/(snvoc:hasPost|snvoc:hasComment) ?message5 BIND( 1 AS ?case5InnerScore ) } } GROUP BY ?person1Id ?person2Id ?city1Name } { SELECT ?person1IdHelper ?person2IdHelper ?city1NameHelper (MAX(COALESCE(?case1InnerScore,0)) + MAX(COALESCE(?case2InnerScore,0)) + MAX(?case3InnerScore) + MAX(COALESCE(?case4InnerScore,0)) + MAX(COALESCE(?case5InnerScore,0)) AS ?scoreHelper) WHERE { ?person1IdHelper a snvoc:Person . ?person1IdHelper snvoc:isLocatedIn ?city1 . ?city1 foaf:name ?city1NameHelper . ?city1 snvoc:isPartOf/foaf:name "Mexico" . ?person2IdHelper a snvoc:Person . ?person2IdHelper snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Indonesia" . OPTIONAL { VALUES (?type1) {(snvoc:Comment) (snvoc:Post)} ?message1 a ?type1 . ?message1 snvoc:hasCreator ?person2IdHelper . ?comment1 a snvoc:Comment . ?comment1 snvoc:hasCreator ?person1IdHelper . ?comment1 snvoc:replyOf ?message1 . BIND( 4 AS ?case1InnerScore ) } OPTIONAL { VALUES (?type2) {(snvoc:Comment) (snvoc:Post)} ?message2 a ?type2 . ?message2 snvoc:hasCreator ?person1IdHelper . ?comment2 a snvoc:Comment . ?comment2 snvoc:hasCreator ?person2IdHelper . ?comment2 snvoc:replyOf ?message2 . BIND( 1 AS ?case2InnerScore ) } BIND( IF( EXISTS { { ?person1IdHelper snvoc:knows/snvoc:hasPerson ?person2IdHelper } UNION { ?person2IdHelper snvoc:knows/snvoc:hasPerson ?person1IdHelper } }, 15, 0 ) AS ?case3InnerScore ) OPTIONAL { VALUES (?type4) {(snvoc:Comment) (snvoc:Post)} ?message4 a ?type4 . ?message4 snvoc:hasCreator ?person2IdHelper . ?person1IdHelper snvoc:likes/(snvoc:hasPost|snvoc:hasComment) ?message4 BIND( 10 AS ?case4InnerScore ) } OPTIONAL { VALUES (?type5) {(snvoc:Comment) (snvoc:Post)} ?message5 a ?type5 . ?message5 snvoc:hasCreator ?person1IdHelper . ?person2IdHelper snvoc:likes/(snvoc:hasPost|snvoc:hasComment) ?message5 BIND( 1 AS ?case5InnerScore ) } } GROUP BY ?person1IdHelper ?person2IdHelper ?city1NameHelper } ?person1Id snvoc:id ?p1Id . ?person2Id snvoc:id ?p2Id . ?person1IdHelper snvoc:id ?p1IdHelper . ?person2IdHelper snvoc:id ?p2IdHelper . FILTER( ?city1NameHelper = ?city1Name ) BIND( ?score = ?scoreHelper AS ?scoreEQ ) BIND( ?p1Id = ?p1IdHelper AS ?person1IdEQ ) BIND( IF( ?scoreEQ, IF( ?person1IdEQ, ?p2Id >= ?p2IdHelper, ?p1Id >= ?p1IdHelper ), ?score <= ?scoreHelper ) AS ?isSmaller ) FILTER( ?isSmaller ) } GROUP BY ?person1Id ?person2Id ?city1Name ?score HAVING (COUNT(*) = 1) ORDER BY DESC(?score) ?person1Id ?person2Id PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT ?destinationName ?month (COUNT(?message) AS ?messageCount) WHERE { VALUES (?type) {(snvoc:Comment) (snvoc:Post)} . ?message a ?type . ?message snvoc:hasCreator ?person . ?message snvoc:creationDate ?creationDate . ?person snvoc:gender ?gender . ?person snvoc:birthday ?birthday . ?person snvoc:isLocatedIn/snvoc:isPartOf/foaf:name "Ethiopia" . FILTER NOT EXISTS { ?message snvoc:isLocatedIn/foaf:name "Ethiopia" } ?message snvoc:isLocatedIn/foaf:name ?destinationName BIND(MONTH(?creationDate) AS ?month) } GROUP BY ?destinationName ?month ORDER BY DESC(?messageCount) ?destinationName ?month LIMIT 100 PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX sn: PREFIX snvoc: PREFIX sntag: PREFIX foaf: PREFIX dbpedia: PREFIX dbpedia-owl: SELECT (COUNT(DISTINCT ?message) AS ?messageCount) (COUNT(DISTINCT ?like) AS ?likeCount) ?year ?month ?continentName WHERE { VALUES (?type) {(snvoc:Post) (snvoc:Comment)} ?message a ?type . ?message snvoc:isLocatedIn/snvoc:isPartOf/foaf:name ?continentName . ?message snvoc:hasTag ?tag . ?tag a/rdfs:label "Single" . OPTIONAL { ?person a snvoc:Person . ?person snvoc:likes ?like . ?like (snvoc:hasPost|snvoc:hasComment) ?message } ?message snvoc:creationDate ?messageCreationDate . BIND(YEAR(?messageCreationDate) AS ?year) BIND(MONTH(?messageCreationDate) AS ?month) } GROUP BY ?year ?month ?continentName ORDER BY ?year ?month DESC(?continentName) LIMIT 100