1、下载Protege工具
https://protege.stanford.edu/
2、安装JDK,并在配置好JDK环境变量
3、打开Protege
4、在Active Ontology页面,填写两个IRI,我分别填写了下面的数值
#Ontology IRI http://www.neohope.com/hansen/ontologies/2018/movies #Ontology Version IRI http://www.neohope.com/hansen/ontologies/2018/movies/1.0.0
5、在Entities页面,切换到Classes,新建三个Class
Genre Movie Person
6、Entities页面,切换到Data properties,新建以下属性
genereId{Domain=Genre,Ranges=xsd:string} genereName{Domain=Genre,Ranges=xsd:string} movieId{Domain=Movie,Ranges=xsd:string} movieIntroduction{Domain=Movie,Ranges=xsd:string} movieRating{Domain=Movie,Ranges=xsd:string} movieReleaseDate{Domain=Movie,Ranges=xsd:string} movieTitile{Domain=Movie,Ranges=xsd:string} personAppellation{Domain=Person,Ranges=xsd:string} ->personEnglishName{Domain=Person,Ranges=xsd:string} ->personName{Domain=Person,Ranges=xsd:string} personBiography{Domain=Person,Ranges=xsd:string} personbirthDay{Domain=Person,Ranges=xsd:string} personBirthPlace{Domain=Person,Ranges=xsd:string} personDeathDay{Domain=Person,Ranges=xsd:string} personId{Domain=Person,Ranges=xsd:string}
7、Entities页面,切换到Object Properties,新建以下属性
hasActedIn{Domain=Person,Range=Movie,InverseOf=hasActor} hasActor{Domain=Movie,Range=Person} hasGenre{Domain=Person,Range=Genre}
8、保存为Movies.owl,这个文件可以在后面jena的例子中用到
9、建模后的结果,可以在这里获取:
https://github.com/neohope/kg-demo-for-movie/tree/master/protege
参考链接:
https://zhuanlan.zhihu.com/knowledgegraph
https://github.com/SimmerChan/KG-demo-for-movie