-
Notifications
You must be signed in to change notification settings - Fork 0
/
anime-rules.yml
128 lines (125 loc) · 4.57 KB
/
anime-rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
prefixes:
afn: https://betweenourworlds.org/function/
bow: https://betweenourworlds.org/ontology/
dbo: http://dbpedia.org/ontology/
idlab-fn: http://example.com/idlab/function/
dcterms: http://purl.org/dc/terms/
base: https://betweenourworlds.org/generation-rule/
sources:
anime_source:
access: anime-0.json
referenceFormulation: jsonpath
iterator: $.data[*]
stream_source:
access: streams-0.json
referenceFormulation: jsonpath
iterator: $.[*]
episode_source:
access: episodes-0.json
referenceFormulation: jsonpath
iterator: $.[*]
season_source:
access: seasons-0.json
referenceFormulation: jsonpath
iterator: $.[*]
mappings:
anime:
source: anime_source
s: https://betweenourworlds.org/anime/$(attributes.slug)
po:
- [a, [dbo:Work, dbo:Cartoon, dbo:Anime, schema:Thing, schema:CreativeWork]]
- [[schema:name, rdfs:label, dbo:title, dcterms:title], $(attributes.canonicalTitle)]
- [[schema:name, rdfs:label, dbo:title, dcterms:title], $(attributes.titles.en), en~lang]
- [[schema:name, rdfs:label, dbo:title, dcterms:title], $(attributes.titles.en_jp), ja~lang]
- [[schema:name, rdfs:label, dbo:title, dcterms:title], $(attributes.titles.ja_jp), ja~lang]
- [[schema:numberOfEpisodes, dbo:numberOfEpisodes], $(attributes.episodeCount)]
- [schema:contentRating, [$(attributes.ageRating), $(attributes.ageRatingGuide)]]
- [schema:image, $(attributes.coverImage.original), schema:URL]
- [schema:endDate, $(attributes.endDate), schema:Date]
- [schema:startDate, $(attributes.startDate), schema:Date]
- [[rdfs:comment, schema:description, dcterms:description], $(attributes.synopsis)]
- [schema:mainEntityOfPage, https://kitsu.io/anime/$(attributes.slug), schema:URL]
- [schema:mainEntityOfPage, $(otherWebsites), schema:URL]
- [schema:mainEntityOfPage, $(streams), schema:URL]
- p: a
o:
function: afn:getClasses
parameters:
- [idlab-fn:str, $(attributes.subtype)]
- p: schema:trailer
o:
mapping: trailer
condition:
function: equal
parameters:
- [str1, $(attributes.slug)]
- [str2, $(attributes.slug)]
- [bow:character, "https://betweenourworlds.org/character/$(characters[*])~iri"]
trailer:
source: anime_source
s: https://betweenourworlds.org/trailer/$(attributes.slug)
po:
- [a, [schema:VideoObject, schema:Thing, schema:CreativeWork, schema:MediaObject]]
- [schema:url, https://www.youtube.com/watch?v=$(attributes.youtubeVideoId)]
stream:
source: stream_source
s: https://betweenourworlds.org/stream/$(slug)-$(service)
po:
- [a, bow:Stream]
- [schema:url, $(url), schema:URL]
- p: bow:providedBy
o:
function: afn:getStreamAgent
parameters:
- [idlab-fn:str, $(service)]
type: iri
- p: bow:object
o:
mapping: anime
condition:
function: equal
parameters:
- [str1, $(slug)]
- [str2, $(attributes.slug)]
episode:
source: episode_source
s: https://betweenourworlds.org/episode/$(anime_slug)-$(attributes.number)
po:
- [a, [schema:Episode, schema:CreativeWork, schema:Thing]]
- [[schema:name, rdfs:label, dbo:title, dcterms:title], $(attributes.canonicalTitle)]
- [schema:episodeNumber, $(attributes.relativeNumber), schema:Integer]
- [[rdfs:comment, schema:description, dcterms:description], $(attributes.synopsis)]
- p: schema:partOfSeason
o:
mapping: season
condition:
- function: equal
parameters:
- [str1, $(attributes.seasonNumber)]
- [str2, $(seasonNumber)]
- function: equal
parameters:
- [str1, $(anime_id)]
- [str2, $(anime.id)]
- p: schema:about
o:
- mapping: anime
condition:
function: equal
parameters:
- [str1, $(anime_id)]
- [str2, $(id)]
season:
source: season_source
s: https://betweenourworlds.org/season/$(anime.slug)-$(seasonNumber)
po:
- [a, [schema:Season, schema:CreativeWork, schema:Thing]]
- [schema:seasonNumber, $(seasonNumber), schema:Integer]
- p: schema:about
o:
- mapping: anime
condition:
function: equal
parameters:
- [str1, $(anime.id)]
- [str2, $(id)]