Created
August 25, 2018 23:21
-
-
Save szarnyasg/057ce788c4a02acd7b0853be50e1b4fd to your computer and use it in GitHub Desktop.
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
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |
PREFIX sn: <http://www.ldbc.eu/ldbc_socialnet/1.0/data/> | |
PREFIX snvoc: <http://www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/> | |
PREFIX sntag: <http://www.ldbc.eu/ldbc_socialnet/1.0/tag/> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX dbpedia: <http://dbpedia.org/resource/> | |
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> | |
SELECT | |
(?tag2Name AS ?tagName) | |
(COUNT(?post) AS ?postCount) | |
WHERE | |
{ | |
BIND("Angola" AS ?tagName) | |
{ | |
SELECT DISTINCT | |
?fr | |
?frId | |
WHERE | |
{ | |
BIND( 30786325583618 AS ?rootId ) . | |
?rootPerson a snvoc:Person . | |
?rootPerson snvoc:id ?rootId . | |
?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson))?/((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr . | |
?fr snvoc:id ?frId . | |
FILTER(?frId != ?rootId) | |
} | |
} . | |
?post a snvoc:Post . | |
?post snvoc:hasCreator ?fr . | |
?post snvoc:hasTag ?tag1 . | |
?tag1 foaf:name ?tagName . | |
?post snvoc:hasTag ?tag2 . | |
?tag2 foaf:name ?tag2Name . | |
FILTER (?tag2Name != ?tagName) . | |
} | |
GROUP BY ?tag2Name | |
ORDER BY DESC(?postCount) ?tag2Name | |
LIMIT 10 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment