File Coverage

blib/lib/SemanticWeb/Schema/Thing.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1 3     3   1588 use utf8;
  3         6  
  3         21  
2              
3             package SemanticWeb::Schema::Thing;
4              
5             # ABSTRACT: The most generic type of item.
6              
7 3     3   135 use Moo;
  3         6  
  3         25  
8              
9             extends qw/ SemanticWeb::Schema /;
10              
11              
12 3     3   1031 use MooX::JSON_LD 'Thing';
  3         9  
  3         21  
13 3     3   6229 use Ref::Util qw/ is_plain_hashref /;
  3         6  
  3         152  
14             # RECOMMEND PREREQ: Ref::Util::XS
15              
16 3     3   20 use namespace::autoclean;
  3         6  
  3         23  
17              
18             our $VERSION = 'v15.0.0';
19              
20              
21             has additional_type => (
22             is => 'rw',
23             predicate => '_has_additional_type',
24             json_ld => 'additionalType',
25             );
26              
27              
28              
29             has alternate_name => (
30             is => 'rw',
31             predicate => '_has_alternate_name',
32             json_ld => 'alternateName',
33             );
34              
35              
36              
37             has description => (
38             is => 'rw',
39             predicate => '_has_description',
40             json_ld => 'description',
41             );
42              
43              
44              
45             has disambiguating_description => (
46             is => 'rw',
47             predicate => '_has_disambiguating_description',
48             json_ld => 'disambiguatingDescription',
49             );
50              
51              
52              
53             has identifier => (
54             is => 'rw',
55             predicate => '_has_identifier',
56             json_ld => 'identifier',
57             );
58              
59              
60              
61             has image => (
62             is => 'rw',
63             predicate => '_has_image',
64             json_ld => 'image',
65             );
66              
67              
68              
69             has main_entity_of_page => (
70             is => 'rw',
71             predicate => '_has_main_entity_of_page',
72             json_ld => 'mainEntityOfPage',
73             );
74              
75              
76              
77             has name => (
78             is => 'rw',
79             predicate => '_has_name',
80             json_ld => 'name',
81             );
82              
83              
84              
85             has potential_action => (
86             is => 'rw',
87             predicate => '_has_potential_action',
88             json_ld => 'potentialAction',
89             );
90              
91              
92              
93             has same_as => (
94             is => 'rw',
95             predicate => '_has_same_as',
96             json_ld => 'sameAs',
97             );
98              
99              
100              
101             has subject_of => (
102             is => 'rw',
103             predicate => '_has_subject_of',
104             json_ld => 'subjectOf',
105             );
106              
107              
108              
109             has url => (
110             is => 'rw',
111             predicate => '_has_url',
112             json_ld => 'url',
113             );
114              
115              
116              
117              
118              
119             1;
120              
121             __END__
122              
123             =pod
124              
125             =encoding UTF-8
126              
127             =head1 NAME
128              
129             SemanticWeb::Schema::Thing - The most generic type of item.
130              
131             =head1 VERSION
132              
133             version v15.0.0
134              
135             =head1 DESCRIPTION
136              
137             The most generic type of item.
138              
139             =head1 ATTRIBUTES
140              
141             =head2 C<additional_type>
142              
143             C<additionalType>
144              
145             An additional type for the item, typically used for adding more specific
146             types from external vocabularies in microdata syntax. This is a
147             relationship between something and a class that the thing is in. In RDFa
148             syntax, it is better to use the native RDFa syntax - the 'typeof' attribute
149             - for multiple types. Schema.org tools may have only weaker understanding
150             of extra types, in particular those defined externally.
151              
152             A additional_type should be one of the following types:
153              
154             =over
155              
156             =item C<Str>
157              
158             =back
159              
160             =head2 C<_has_additional_type>
161              
162             A predicate for the L</additional_type> attribute.
163              
164             =head2 C<alternate_name>
165              
166             C<alternateName>
167              
168             An alias for the item.
169              
170             A alternate_name should be one of the following types:
171              
172             =over
173              
174             =item C<Str>
175              
176             =back
177              
178             =head2 C<_has_alternate_name>
179              
180             A predicate for the L</alternate_name> attribute.
181              
182             =head2 C<description>
183              
184             A description of the item.
185              
186             A description should be one of the following types:
187              
188             =over
189              
190             =item C<Str>
191              
192             =back
193              
194             =head2 C<_has_description>
195              
196             A predicate for the L</description> attribute.
197              
198             =head2 C<disambiguating_description>
199              
200             C<disambiguatingDescription>
201              
202             A sub property of description. A short description of the item used to
203             disambiguate from other, similar items. Information from other properties
204             (in particular, name) may be necessary for the description to be useful for
205             disambiguation.
206              
207             A disambiguating_description should be one of the following types:
208              
209             =over
210              
211             =item C<Str>
212              
213             =back
214              
215             =head2 C<_has_disambiguating_description>
216              
217             A predicate for the L</disambiguating_description> attribute.
218              
219             =head2 C<identifier>
220              
221             The identifier property represents any kind of identifier for any kind of L<SemanticWeb::Schema::Thing>, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See L<background notes|/docs/datamodel.html#identifierBg> for more details.
222              
223             A identifier should be one of the following types:
224              
225             =over
226              
227             =item C<InstanceOf['SemanticWeb::Schema::PropertyValue']>
228              
229             =item C<Str>
230              
231             =back
232              
233             =head2 C<_has_identifier>
234              
235             A predicate for the L</identifier> attribute.
236              
237             =head2 C<image>
238              
239             An image of the item. This can be a L<SemanticWeb::Schema::URL> or a fully described L<SemanticWeb::Schema::ImageObject>.
240              
241             A image should be one of the following types:
242              
243             =over
244              
245             =item C<InstanceOf['SemanticWeb::Schema::ImageObject']>
246              
247             =item C<Str>
248              
249             =back
250              
251             =head2 C<_has_image>
252              
253             A predicate for the L</image> attribute.
254              
255             =head2 C<main_entity_of_page>
256              
257             C<mainEntityOfPage>
258              
259             Indicates a page (or other CreativeWork) for which this thing is the main
260             entity being described. See [background
261             notes](/docs/datamodel.html#mainEntityBackground) for details.
262              
263             A main_entity_of_page should be one of the following types:
264              
265             =over
266              
267             =item C<InstanceOf['SemanticWeb::Schema::CreativeWork']>
268              
269             =item C<Str>
270              
271             =back
272              
273             =head2 C<_has_main_entity_of_page>
274              
275             A predicate for the L</main_entity_of_page> attribute.
276              
277             =head2 C<name>
278              
279             The name of the item.
280              
281             A name should be one of the following types:
282              
283             =over
284              
285             =item C<Str>
286              
287             =back
288              
289             =head2 C<_has_name>
290              
291             A predicate for the L</name> attribute.
292              
293             =head2 C<potential_action>
294              
295             C<potentialAction>
296              
297             Indicates a potential Action, which describes an idealized action in which
298             this thing would play an 'object' role.
299              
300             A potential_action should be one of the following types:
301              
302             =over
303              
304             =item C<InstanceOf['SemanticWeb::Schema::Action']>
305              
306             =back
307              
308             =head2 C<_has_potential_action>
309              
310             A predicate for the L</potential_action> attribute.
311              
312             =head2 C<same_as>
313              
314             C<sameAs>
315              
316             URL of a reference Web page that unambiguously indicates the item's
317             identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or
318             official website.
319              
320             A same_as should be one of the following types:
321              
322             =over
323              
324             =item C<Str>
325              
326             =back
327              
328             =head2 C<_has_same_as>
329              
330             A predicate for the L</same_as> attribute.
331              
332             =head2 C<subject_of>
333              
334             C<subjectOf>
335              
336             A CreativeWork or Event about this Thing.
337              
338             A subject_of should be one of the following types:
339              
340             =over
341              
342             =item C<InstanceOf['SemanticWeb::Schema::CreativeWork']>
343              
344             =item C<InstanceOf['SemanticWeb::Schema::Event']>
345              
346             =back
347              
348             =head2 C<_has_subject_of>
349              
350             A predicate for the L</subject_of> attribute.
351              
352             =head2 C<url>
353              
354             URL of the item.
355              
356             A url should be one of the following types:
357              
358             =over
359              
360             =item C<Str>
361              
362             =back
363              
364             =head2 C<_has_url>
365              
366             A predicate for the L</url> attribute.
367              
368             =head1 SEE ALSO
369              
370             L<SemanticWeb::Schema>
371              
372             =head1 SOURCE
373              
374             The development version is on github at L<https://github.com/robrwo/SemanticWeb-Schema>
375             and may be cloned from L<git://github.com/robrwo/SemanticWeb-Schema.git>
376              
377             =head1 BUGS
378              
379             Please report any bugs or feature requests on the bugtracker website
380             L<https://github.com/robrwo/SemanticWeb-Schema/issues>
381              
382             When submitting a bug or request, please include a test-file or a
383             patch to an existing test-file that illustrates the bug or desired
384             feature.
385              
386             =head1 AUTHOR
387              
388             Robert Rothenberg <rrwo@cpan.org>
389              
390             =head1 COPYRIGHT AND LICENSE
391              
392             This software is Copyright (c) 2018-2022 by Robert Rothenberg.
393              
394             This is free software, licensed under:
395              
396             The Artistic License 2.0 (GPL Compatible)
397              
398             =cut