LoginSignup
2
4

More than 5 years have passed since last update.

SPARQL覚書:プロ野球選手系のもろもろ

Posted at

DBPedia Japanからデータをいろいろとってくる。
DBPedia Japanに反映されている情報を元にしているので、最新のデータと乖離があるかもしれないのはご容赦くださいませ。

全球団からHR打った選手一覧

PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?name (group_concat(DISTINCT ?teamName; separator = ",") AS ?teams) (group_concat(DISTINCT ?positionName; separator = ",") AS ?positionNames)  ?battingSide ?throwingSide ?comment 
WHERE {
?link dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/全球団から本塁打>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/BaseballPlayer>;
 rdfs:label ?name;
dbo:position ?position;
dbo:battingSide ?battingSide;
dbo:throwingSide ?throwingSide;
rdfs:comment ?comment;
dbo:team ?team.
?team rdfs:label ?teamName;
dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/日本プロ野球>.
?position rdfs:label ?positionName
}
order by rand()

MVPとった選手

PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?name (group_concat(DISTINCT ?teamName; separator = ",") AS ?teams) (group_concat(DISTINCT ?positionName; separator = ",") AS ?positionNames)  ?battingSide ?throwingSide ?comment 
WHERE {
?link dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/最優秀選手_(日本プロ野球)>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/BaseballPlayer>;
 rdfs:label ?name;
dbo:position ?position;
dbo:battingSide ?battingSide;
dbo:throwingSide ?throwingSide;
rdfs:comment ?comment;
dbo:team ?team.
?team rdfs:label ?teamName;
dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/日本プロ野球>.
?position rdfs:label ?positionName
}
order by rand()

阪神タイガースの永久欠番

PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?name (group_concat(DISTINCT ?teamName; separator = ",") AS ?teams) (group_concat(DISTINCT ?positionName; separator = ",") AS ?positionNames)  ?battingSide ?throwingSide ?comment 
WHERE {
?link dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/野球界の永久欠番>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/BaseballPlayer>;
 rdfs:label ?name;
dbo:position ?position;
dbo:battingSide ?battingSide;
dbo:throwingSide ?throwingSide;
rdfs:comment ?comment;
dbo:team <http://ja.dbpedia.org/resource/阪神タイガース>;
dbo:team ?team.
?team rdfs:label ?teamName;
dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/日本プロ野球>.
?position rdfs:label ?positionName
}
order by rand()
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4