Skip to content

Instantly share code, notes, and snippets.

@nezuQ
Last active December 16, 2015 11:08
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 nezuQ/5424654 to your computer and use it in GitHub Desktop.
Save nezuQ/5424654 to your computer and use it in GitHub Desktop.
国立国会図書館典拠データ検索・提供サービスに、芥川龍之介の生年・没年をRのSPARQLパッケージで尋ねる。
library(SPARQL)
endpoint <- "http://id.ndl.go.jp/auth/ndla/"
query <-
"
PREFIX rda: <http://RDVocab.info/ElementsGr2/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT
?birth ?death
WHERE {
?uri foaf:name ?name.
?uri rda:dateOfBirth ?birth.
?uri rda:dateOfDeath ?death.
FILTER regex(?name,'芥川(龍|竜)之介')
}
"
res <- SPARQL(url=endpoint, query)$results
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment