mysql导出为图谱数据

Table actor

map:actor a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "actor/@@actor.actor_id@@";

d2rq:class vocab:actor;

d2rq:class :actor;
d2rq:classDefinitionLabel "actor";
.

map:actor__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property rdfs:label;
d2rq:pattern "actor #@@actor.actor_id@@";
.
map:actor_actor_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;

d2rq:property vocab:actor_actor_id;

d2rq:property :actor_actor_id;
d2rq:propertyDefinitionLabel "actor actor_id";
d2rq:column "actor.actor_id";
d2rq:datatype xsd:integer;
.

map:actor_actor_bio a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_bio;
d2rq:propertyDefinitionLabel "actor actor_bio";
d2rq:column "actor.actor_bio";
.
map:actor_actor_chName a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_chName;
d2rq:propertyDefinitionLabel "actor actor_chName";
d2rq:column "actor.actor_chName";
.
map:actor_actor_foreName a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_foreName;
d2rq:propertyDefinitionLabel "actor actor_foreName";
d2rq:column "actor.actor_foreName";
.
map:actor_actor_nationality a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_nationality;
d2rq:propertyDefinitionLabel "actor actor_nationality";
d2rq:column "actor.actor_nationality";
.
map:actor_actor_constellation a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_constellation;
d2rq:propertyDefinitionLabel "actor actor_constellation";
d2rq:column "actor.actor_constellation";
.
map:actor_actor_birthPlace a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_birthPlace;
d2rq:propertyDefinitionLabel "actor actor_birthPlace";
d2rq:column "actor.actor_birthPlace";
.
map:actor_actor_birthDay a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_birthDay;
d2rq:propertyDefinitionLabel "actor actor_birthDay";
d2rq:column "actor.actor_birthDay";
.
map:actor_actor_repWorks a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_repWorks;
d2rq:propertyDefinitionLabel "actor actor_repWorks";
d2rq:column "actor.actor_repWorks";
.
map:actor_actor_achiem a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_achiem;
d2rq:propertyDefinitionLabel "actor actor_achiem";
d2rq:column "actor.actor_achiem";
.
map:actor_actor_brokerage a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor;
d2rq:property :actor_actor_brokerage;
d2rq:propertyDefinitionLabel "actor actor_brokerage";
d2rq:column "actor.actor_brokerage";
.

Table actor_to_movie

map:actor_to_movie a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "actor_to_movie/@@actor_to_movie.actor_movie_id@@";
d2rq:class :actor_to_movie;
d2rq:classDefinitionLabel "actor_to_movie";
.
map:actor_to_movie__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor_to_movie;
d2rq:property rdfs:label;
d2rq:pattern "actor_to_movie #@@actor_to_movie.actor_movie_id@@";
.
map:actor_to_movie_actor_movie_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor_to_movie;
d2rq:property :actor_to_movie_actor_movie_id;
d2rq:propertyDefinitionLabel "actor_to_movie actor_movie_id";
d2rq:column "actor_to_movie.actor_movie_id";
d2rq:datatype xsd:integer;
.
map:actor_to_movie_actor_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor_to_movie;
d2rq:property :actor_to_movie_actor_id;
d2rq:propertyDefinitionLabel "actor_to_movie actor_id";
d2rq:column "actor_to_movie.actor_id";
d2rq:datatype xsd:integer;
.
map:actor_to_movie_movie_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:actor_to_movie;
d2rq:property :actor_to_movie_movie_id;
d2rq:propertyDefinitionLabel "actor_to_movie movie_id";
d2rq:column "actor_to_movie.movie_id";
d2rq:datatype xsd:integer;
.

Table genre

map:genre a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "genre/@@genre.genre_id@@";
d2rq:class :genre;
d2rq:classDefinitionLabel "genre";
.
map:genre__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:genre;
d2rq:property rdfs:label;
d2rq:pattern "genre #@@genre.genre_id@@";
.
map:genre_genre_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:genre;
d2rq:property :genre_genre_id;
d2rq:propertyDefinitionLabel "genre genre_id";
d2rq:column "genre.genre_id";
d2rq:datatype xsd:integer;
.
map:genre_genre_name a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:genre;
d2rq:property :genre_genre_name;
d2rq:propertyDefinitionLabel "genre genre_name";
d2rq:column "genre.genre_name";
.

Table movie

map:movie a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "movie/@@movie.movie_id@@";
d2rq:class :movie;
d2rq:classDefinitionLabel "movie";
.
map:movie__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property rdfs:label;
d2rq:pattern "movie #@@movie.movie_id@@";
.
map:movie_movie_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_id;
d2rq:propertyDefinitionLabel "movie movie_id";
d2rq:column "movie.movie_id";
d2rq:datatype xsd:integer;
.
map:movie_movie_bio a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_bio;
d2rq:propertyDefinitionLabel "movie movie_bio";
d2rq:column "movie.movie_bio";
.
map:movie_movie_chName a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_chName;
d2rq:propertyDefinitionLabel "movie movie_chName";
d2rq:column "movie.movie_chName";
.
map:movie_movie_foreName a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_foreName;
d2rq:propertyDefinitionLabel "movie movie_foreName";
d2rq:column "movie.movie_foreName";
.
map:movie_movie_prodTime a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_prodTime;
d2rq:propertyDefinitionLabel "movie movie_prodTime";
d2rq:column "movie.movie_prodTime";
.
map:movie_movie_prodCompany a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_prodCompany;
d2rq:propertyDefinitionLabel "movie movie_prodCompany";
d2rq:column "movie.movie_prodCompany";
.
map:movie_movie_director a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_director;
d2rq:propertyDefinitionLabel "movie movie_director";
d2rq:column "movie.movie_director";
.
map:movie_movie_screenwriter a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_screenwriter;
d2rq:propertyDefinitionLabel "movie movie_screenwriter";
d2rq:column "movie.movie_screenwriter";
.
map:movie_movie_genre a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_genre;
d2rq:propertyDefinitionLabel "movie movie_genre";
d2rq:column "movie.movie_genre";
.
map:movie_movie_star a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_star;
d2rq:propertyDefinitionLabel "movie movie_star";
d2rq:column "movie.movie_star";
.
map:movie_movie_length a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_length;
d2rq:propertyDefinitionLabel "movie movie_length";
d2rq:column "movie.movie_length";
.
map:movie_movie_rekeaseTime a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_rekeaseTime;
d2rq:propertyDefinitionLabel "movie movie_rekeaseTime";
d2rq:column "movie.movie_rekeaseTime";
.
map:movie_movie_language a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_language;
d2rq:propertyDefinitionLabel "movie movie_language";
d2rq:column "movie.movie_language";
.
map:movie_movie_achiem a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie;
d2rq:property :movie_movie_achiem;
d2rq:propertyDefinitionLabel "movie movie_achiem";
d2rq:column "movie.movie_achiem";
.

Table movie_to_genre

map:movie_to_genre a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "movie_to_genre/@@movie_to_genre.movie_genre_id@@";
d2rq:class :movie_to_genre;
d2rq:classDefinitionLabel "movie_to_genre";
.
map:movie_to_genre__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie_to_genre;
d2rq:property rdfs:label;
d2rq:pattern "movie_to_genre #@@movie_to_genre.movie_genre_id@@";
.
map:movie_to_genre_movie_genre_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie_to_genre;
d2rq:property :movie_to_genre_movie_genre_id;
d2rq:propertyDefinitionLabel "movie_to_genre movie_genre_id";
d2rq:column "movie_to_genre.movie_genre_id";
d2rq:datatype xsd:integer;
.
map:movie_to_genre_movie_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie_to_genre;
d2rq:property :movie_to_genre_movie_id;
d2rq:propertyDefinitionLabel "movie_to_genre movie_id";
d2rq:column "movie_to_genre.movie_id";
d2rq:datatype xsd:integer;
.
map:movie_to_genre_genre_id a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:movie_to_genre;
d2rq:property :movie_to_genre_genre_id;
d2rq:propertyDefinitionLabel "movie_to_genre genre_id";
d2rq:column "movie_to_genre.genre_id";
d2rq:datatype xsd:integer;
.

三,运行截图
owl实体关系可视化

使用python读取ttl

原文地址:https://www.cnblogs.com/2506236179zhw/p/14926489.html