Wikipedia Category Ontology (WCO)

updated on June 9, 2020

Japanese explanation follows with English explanation.

日本語の説明は、英語の後にあります。

Summary

Wikipedia Category Ontology (WCO) is an ontology for reprsenting Wikipedia category information from knowledge engineering aspect. At this moment, All categories of Japanese Wikipedia (Dump: 2017/10/20) are organized as instances of the ontology. This ontology can be used for manipulating Wikipedia category (e.g., extracting transitive category hierarchy, selection of topic/set categories). As a result you can also obtain class-subclass hierarchy used for the ontological engineering.

Download (2020/06/09 version)

SPARQL Endpoint

Example of resources (only for Japanese category now)

Example SPARQL queries

Category Type of Hokkaido(北海道:Using language link)

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
  select distinct * where {?s owl:sameAs ewcor:Hokkaido .
  ?p rdf:type ?o .}

Set categories which are divided or subclass of "Universities and colleges in Japan"(日本の大学)(This result doesn't include set categories which don't have language link to English Wikipedia)

PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor: <http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>

select distinct ?jcc,?eng where {
  ?jc owl:sameAs ewcor:Universities_and_colleges_in_Japan .
  ?jcc
  (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive | wcoc:geography |wcoc:age )+ ?jc.
  ?jcc owl:sameAs ?eng .
  FILTER regex(?eng, "http://en.wcontology.org") .
  }

Topic categories which are instances of the set categories which are divided from or subclass of "Universities and colleges in Japan"(日本 の大学)(This result does not include topic categories which don't have language link to English Wikipedia)

PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor: <http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>

select distinct ?s,?eng where {
  ?jc owl:sameAs ewcor:Universities_and_colleges_in_Japan .
  ?jcc
  (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive | wcoc:geography |wcoc:age )+ ?jc.
  ?s wcoc:instanceOf ?jcc .
  ?s owl:sameAs ?eng .
  FILTER regex(?eng, "http://en.wcontology.org") .
}

Set categories which are subclss of "People"(人物)(This result not return set categories which don't have language link to English Wikipedia)

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc: <http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>

select distinct ?s,?eng where {
  ?jc owl:sameAs ewcor:People .
  ?s (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive |wcoc:geography |wcoc:age )+ ?jc .
  ?s rdf:type wcoc:setCategory .
  ?s owl:sameAs ?eng .
  FILTER regex(?eng, "http://en.wcontology.org") .
  }

Set categories which are subclss of "People"(人物) and have no usedForConstraint relationship with parent category.(This result not return set categories which don't have language link to English Wikipedia)

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc: <http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>

select distinct ?s,?eng where {
  ?jc owl:sameAs ewcor:People .
  ?s (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive |wcoc:geography |wcoc:age )+ ?jc .
  FILTER NOT EXISTS {?s wcoc:usedForConstraint ?c} .
  ?s rdf:type wcoc:setCategory .
  ?s owl:sameAs ?eng .
  FILTER regex(?eng, "http://en.wcontology.org") .
}

List of ancestor set categories of (candidates of the class for) "Hokkaido University"(北海道大学)

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>
PREFIX ewcor:<http://en.wcontology.org/resource/Category:>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
  
select distinct ?s,?eng where {
  ?jc owl:sameAs ewcor:Hokkaido_University .
  ?jc (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint |wcoc:narrowerTransitive |wcoc:geography |wcoc:age | wcoc:instanceOf)+ ?s .
  ?s rdf:type wcoc:setCategory .
  ?s owl:sameAs ?eng .
  FILTER regex(?eng, "http://en.wcontology.org") .
  }

概要

Wikipedia Category OntologyはWikipediaのページの分類に用いられるカテゴリの情報を知識工学的観点から再整理したWikipedia Categoryとその階層関係を表現するためのontologyです。 2017/10/20版のWikipediaのダンプデータに基いてています。

Download (2020/06/09 version)

SPARQL Endpoint

SPARQL endpointを用いて利用できます。

リソース例

SPARQL例

「北海道」のカテゴリタイプ

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>

select distinct * where {jwcor:北海道 rdf:type ?o .}

「日本の大学」から分割されたもしくはサブクラスとなるsetカテゴリ一覧

PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor: <http://ja.wcontology.org/resource/Category:>

select distinct ?jcc where {
  ?jcc
  (wcoc:subClassOf |  wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive | wcoc:geography |wcoc:age )+ jwcor:日本の大学 .
  }

「日本の大学」に該当するtopicカテゴリ一覧

PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor: <http://ja.wcontology.org/resource/Category:>

select distinct ?s where {
  ?jcc
  (wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint | wcoc:narrowerTransitive | wcoc:geography |wcoc:age )+ jwcor:日本の大学 .
  ?s wcoc:instanceOf ?jcc .
  }

人物の下位クラスに属するsetカテゴリの一覧

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc: <http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>

select distinct * where {?s 
(wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint |
wcoc:narrowerTransitive |wcoc:geography |wcoc:age )+ jwcor:人物 .
 ?s rdf:type wcoc:setCategory}

人物の下位クラスに属するsetカテゴリの一覧から制約条件の関係を持つカテゴリを削除

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc: <http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>

select distinct * where {?s 
(wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint |
wcoc:narrowerTransitive |wcoc:geography |wcoc:age )+ jwcor:人物 .
 FILTER NOT EXISTS {?s wcoc:usedForConstraint ?c} .
 ?s rdf:type wcoc:setCategory}

北海道大学が属する概念にあたるsetカテゴリ

PREFIX rdf:<http://www.w3.org/1992/02/22-rdf-syntax-ns#>
PREFIX wcoc:<http://wcontology.org/core#>
PREFIX jwcor:<http://ja.wcontology.org/resource/Category:>
  
select distinct * where {jwcor:北海道大学
(wcoc:subClassOf | wcoc:addConstraint | wcoc:specifiedConstraint |wcoc:narrowerTransitive |wcoc:geography |wcoc:age | wcoc:instanceOf)+
?o .
?o rdf:type wcoc:setCategory}

クリ
  エイティブ・コモンズ・ライセンス
Wikipedia Category Ontology by Knowledge base laboratory, Hokkaido University is licensed under a Creative Commons CC BY SA License.

Hosted by Knowledge base laboratory, Hokkaido University