Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Created August 4, 2017 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucaswerkmeister/28608c3667a7064455152959a6e0e4cc to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/28608c3667a7064455152959a6e0e4cc to your computer and use it in GitHub Desktop.
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
SELECT ?author ?authorLabel ?work ?workLabel
WITH {
SELECT ?work ?author WHERE {
{ }
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q20980928 ;
gas:target wd:Q24290415 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q20980928 ;
gas:target wd:Q26720269 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q24290415 ;
gas:target wd:Q24390693 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q24290415 ;
gas:target wd:Q26720269 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q24390693 ;
gas:target wd:Q26720269 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q13520818 ;
gas:target wd:Q20980928 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q13520818 ;
gas:target wd:Q24290415 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q13520818 ;
gas:target wd:Q24390693 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
UNION {
SELECT ?work ?author WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q13520818 ;
gas:target wd:Q26720269 ;
gas:traversalDirection "Undirected" ;
gas:out ?work ;
gas:linkType wdt:P50 ;
}
?work wdt:P50 ?author
}
} # UNION END
}
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,he,jp,nl,no,ru,sv,zh" . }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment