/[suikacvs]/messaging/manakai/lib/Message/Util/DIS.dis
Suika

Contents of /messaging/manakai/lib/Message/Util/DIS.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Thu Mar 3 11:19:07 2005 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.7: +653 -17 lines
Some methods reconstructed from lib/manakai/dis.pl implemented

1 wakaba 1.1 Module:
2     @QName:
3     Util:DIS
4     @FullName:
5     @@lang: en
6     @@@:
7     <QUOTE::DIS> Object Model
8     @Namespace:
9     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
10    
11     @Description:
12     @@lang:en
13     @@@:
14     This module provides an object model for <QUITE::dis> document format.
15    
16     @Author:
17     @@FullName: Wakaba
18     @@Mail: w@suika.fam.cx
19     @License:
20     @@@:
21     license:Perl+MPL
22     @@Original:
23     @@@FullName:
24     manakai <CODE::lib/manakai/dis.pl>
25     @@@Year:2004
26     @@@Author:
27     @@@@FullName:Wakaba
28     @@@@Mail:w@suika.fam.cx
29     @Date:
30     @@@:
31 wakaba 1.8 $Date: 2005/03/02 07:46:31 $
32 wakaba 1.1 @@ContentType:
33     dis:Date.RCS
34    
35     @Require:
36     @@Module:
37     @@@Name: SuikaWikiConfig21
38 wakaba 1.5 @@@QName:
39     Markup:SuikaWikiConfig21
40 wakaba 1.1 @@@WithFor:
41 wakaba 1.3 swcfg21:ForLatest
42     @@Module:
43     @@@Name: DIS
44     @@@WithFor:
45     DIS:ForLatest
46    
47     @DefaultFor:
48     DIS:ForLatest
49 wakaba 1.1
50     Namespace:
51     @DIS:
52     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
53     @dis:
54     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
55     @dis2pm:
56     http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm#
57 wakaba 1.5 @DISlib:
58     http://suika.fam.cx/~wakaba/archive/2004/dis/
59 wakaba 1.3 @DOMCore:
60     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
61     @DOMLS:
62     http://suika.fam.cx/~wakaba/archive/2004/dom/ls#
63     @DOMMain:
64     http://suika.fam.cx/~wakaba/archive/2004/dom/main#
65     @infoset:
66     http://www.w3.org/2001/04/infoset#
67 wakaba 1.1 @lang:
68     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
69     @license:
70     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
71     @ManakaiDOM:
72     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
73 wakaba 1.5 @Markup:
74     http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup#
75 wakaba 1.3 @MDOMX:
76     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
77 wakaba 1.1 @owl:
78     http://www.w3.org/2002/07/owl#
79     @Perl:
80     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
81     @rdf:
82     http://www.w3.org/1999/02/22-rdf-syntax-ns#
83     @rdfs:
84     http://www.w3.org/2000/01/rdf-schema#
85 wakaba 1.3 @swcfg21:
86     http://suika.fam.cx/~wakaba/archive/2005/swcfg21#
87 wakaba 1.1 @TreeCore:\
88     @Util:
89     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
90    
91     ## -- "For" definitions
92    
93     ForDef:
94     @QName:
95     DIS:ForLatest
96     @Description:
97     @@lang:en
98     @@@:
99     For latest version of the <Module::Util:DIS> module implementation
100     @ISA:
101     ManakaiDOM:Perl
102    
103     ## -- Features
104    
105     ElementTypeBinding:
106     @Name: FeatureDef
107     @ElementType:
108     dis:ResourceDef
109     @ShadowContent:
110     @@rdf:type:
111     DOMMain:DOMFeature
112     @@AliasFor:
113     @@@@:
114     ::ManakaiDOM:all
115     @@@For:
116     !=ManakaiDOM:all
117    
118     ElementTypeBinding:
119     @Name: FeatureVerDef
120     @ElementType:
121     dis:ResourceDef
122     @ShadowContent:
123     @@rdf:type:
124     DOMMain:DOMFeature
125    
126     ElementTypeBinding:
127     @Name: featureQName
128     @ElementType:
129     dis:AppName
130     @ShadowContent:
131     @@ContentType:
132     dis:TypeQName
133    
134     FeatureDef:
135     @QName: Core
136     @FeatureVerDef:
137     @@QName: CoreFeature10
138     @@Version: 1.0
139     @@ISA: Core
140     @@FullName:
141     @@@lang:en
142     @@@@:
143     The <QUOTE::dis> object model, version 1.0
144     @@Description:
145     @@@lang:en
146     @@@@:
147     The <QUOTE::dis> object model, version 1.0.
148     @@DOMMain:requireFeature:
149     swcfg21:CoreFeature21
150    
151     ## -- SuikaWikiConfig/2.1 extended classes
152    
153     ClsDef:
154     @ClsQName: ManakaiDISImplementation
155     @ClsISA:
156 wakaba 1.3 swcfg21:ManakaiSWCFGImplementation::swcfg21:ForLatest
157 wakaba 1.1 @Description:
158     @@lang:en
159     @@@:
160     A <QUOTE::dis> implementation object.
161    
162     @Method:
163     @@Name: createDISDocument
164     @@Description:
165     @@@lang:en
166     @@@@:
167     Creates an empty <Class::ManakaiDISDocument> object.
168     @@Return:
169     @@@Type:ManakaiDISDocument
170     @@@Description:
171     @@@@lang:en
172     @@@@@:
173     The newly created <QUOTE::dis> document object.
174     @@@PerlDef:
175 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
176     .createSWCFGDocument>;
177     $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
178     .defaultElementTypeNamespaceURI>
179 wakaba 1.1 (<Q::dis:>);
180    
181     @Method:
182 wakaba 1.2 @@Name: createDISParser
183     @@Description:
184     @@@lang:en
185     @@@@:
186 wakaba 1.1 Creates a <Class::ManakaiDISParser> object.
187 wakaba 1.2 @@Return:
188     @@@Type: ManakaiDISParser
189     @@@Description:
190     @@@@lang:en
191     @@@@@:
192 wakaba 1.1 A newly created <QUOTE::dis> parser.
193 wakaba 1.2 @@@PerlDef:
194 wakaba 1.3 $r = bless $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
195     .createSWCFGParser>,
196 wakaba 1.1 <ClassName::ManakaiDISParser>;
197    
198     @Method:
199 wakaba 1.2 @@Name: createDISDatabase
200 wakaba 1.1 @@Description:
201     @@@lang:en
202     @@@@:
203 wakaba 1.2 Creates a new <QUOTE::dis> database.
204 wakaba 1.1 @@Return:
205 wakaba 1.2 @@@Type:ManakaiDISDatabase
206 wakaba 1.4 @@@Description:
207     @@@@lang:en
208     @@@@@:
209 wakaba 1.2 A newly created <QUOTE::dis> parser.
210 wakaba 1.4 @@@PerlDef:
211 wakaba 1.2 $r = bless {
212     forDef => {
213 wakaba 1.5 <Q::ManakaiDOM:all> => bless ({
214 wakaba 1.2 uri => <Q::ManakaiDOM:all>,
215     isa => {<Q::ManakaiDOM:all> => 1},
216     revISA => {},
217 wakaba 1.5 }, <ClassName::ManakaiDISForDefinition>),
218 wakaba 1.2 },
219     resDef => {},
220 wakaba 1.3 }, <ClassName::ManakaiDISDatabase>;
221    
222     @Method:
223     @@Name: tfurisToURI
224     @@Description:
225     @@@lang:en
226     @@@@:
227     Converts a pair of name URI reference and <QUOTE::for> URI reference
228     into a <TYPE::dis:TFQNames>-expanded URI reference.
229     @@Param:
230     @@@Name: typeURI
231     @@@Type: NameURI
232     @@@Description:
233     @@@@lang:en
234     @@@@@:
235     A URI reference to identify a resource.
236     @@@InCase:
237     @@@@Value:
238     @@@@@is-null:1
239     @@@@Description:
240     @@@@@lang:en
241     @@@@@@:
242     Equivalent to <Q::DOMMain:any> (for historical reason).
243     @@Param:
244     @@@Name: forURI
245     @@@Type: ForURI
246     @@@Description:
247     @@@@lang:en
248     @@@@@:
249     A <QUOTE::for> URI reference.
250     @@@InCase:
251     @@@@Value:
252     @@@@@is-null:1
253     @@@@Description:
254     @@@@@lang:en
255     @@@@@@:
256     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
257     @@Return:
258     @@@Type:
259     DISCore:TFURI::ManakaiDOM:all
260     @@@Description:
261     @@@@lang:en
262     @@@@@:
263     The <TYPE::dis:TFQNames>-expanded URI references.
264     @@@PerlDef:
265     $typeURI = <Q::DOMMain:any> unless defined $typeURI;
266     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
267 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
268    
269     @ResourceDef:
270     @@QName: tfurisToURI
271     @@rdf:type:
272     dis2pm:BlockCode
273     @@enDesc:
274     Converts a pair of name URI reference and <QUOTE::for> URI reference
275     into a <TYPE::dis:TFQNames>-expanded URI reference.
276     @@PerlDef:
277     if ($furi eq <Q::ManakaiDOM:all>) {
278     $uri = $turi;
279 wakaba 1.3 } else {
280     ## NOTE: [RFC 3986]
281     ## fragment := *(pchar / "/" / "?")
282     ## pchar := unreserved / pct-encoded / sub-delims / [:@]
283     ## unreserved := ALPHA / DIGIT / [._~-]
284     ## sub-delims := [!$&'()*+,;=]
285     ## NOTE: [XPointer Framework]
286     ## SchemeData := *EscapedData
287     ## EscapedData := NormalChar / "^(" / "^)" / "^^"
288     ## / "(" SchemeData ")"
289     ## NormalChar := UnicodeChar - [()^]
290 wakaba 1.5 my $__turi = $turi;
291     my $__furi = $furi;
292     for my $__uri ($__turi, $__furi) {
293 wakaba 1.4 $__uri =~ s{([^0-9A-Za-z:;?=_./-])}{sprintf '%%%02X', ord $1}ge;
294 wakaba 1.3 }
295 wakaba 1.4 $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
296 wakaba 1.5 qq<t:tf($__turi,$__furi)>;
297 wakaba 1.3 }
298 wakaba 1.2
299 wakaba 1.5 @ResourceDef:
300 wakaba 1.6 @@QName: tfpurisToURI
301     @@rdf:type:
302     dis2pm:BlockCode
303     @@enDesc:
304     Converts a set of name URI reference and <QUOTE::for> URI reference
305     and <QUOTE::for+> URI references into a URi reference.
306     @@PerlDef:
307     if ($furi eq <Q::ManakaiDOM:all> and @{$forp} == 0) {
308     $uri = $turi;
309     } elsif (@{$forp}) {
310     my $__turi = $turi;
311     my $__furi = $furi;
312     for my $__uri ($__turi, $__furi) {
313     $__uri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}{sprintf '%%%02X', ord $1}ge;
314     }
315     my @__fp;
316     for my $__uri (@{$forp}) {
317     my $__fpuri = $__uri;
318     $__fpuri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}
319     {sprintf '%%%02X', ord $1}ge;
320     push @__fp, $__fpuri;
321     }
322     $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
323     qq<t:tfp($__turi,$__furi,>.join (',', @__fp).q<)>;
324     } else {
325     my $__turi = $turi;
326     my $__furi = $furi;
327     for my $__uri ($__turi, $__furi) {
328     $__uri =~ s{([^0-9A-Za-z:;?=_./-])}{sprintf '%%%02X', ord $1}ge;
329     }
330     $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
331     qq<t:tf($__turi,$__furi)>;
332     }
333    
334     @ResourceDef:
335 wakaba 1.5 @@QName: getChildResourceURI
336     @@rdf:type:
337     dis2pm:BlockCode
338     @@enDesc:
339     Gets an anonymous URI reference of a child resource of another
340     resource.
341     @@PerlDef:
342     my $__parent = $parentURI;
343     my $__ln = $localName;
344     for my $__uri ($__parent, $__ln) {
345 wakaba 1.6 $__uri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}{sprintf '%%%02X', ord $1}ge;
346 wakaba 1.5 }
347     $result = q<data:,200411tf#xmlns(t=data:,200411tf%23)>.
348     qq<t:child($__parent,$__ln)>;
349    
350 wakaba 1.8 @IntMethod:
351     @@Name: camelCaseToUnderscoreName
352     @@enDesc:
353     Converts a camelCase name to a underscored_name.
354     @@ManakaiDOM:isStatic:1
355     @@Param:
356     @@@Name: camelName
357     @@@Type:
358     DISLang:String
359     @@@enDesc:
360     The source name.
361     @@Return:
362     @@@Type:
363     DISLang:String
364     @@@enDesc:
365     The result name.
366     @@@PerlDef:
367     $r = $camelName;
368     $r =~ s/^([A-Z0-9]+)$/lc $1/ge;
369     $r =~ s/([A-Z][A-Z0-9]*)$/"_".lc $1/ge;
370     $r =~ s/([A-Z0-9])([A-Z0-9]*)([A-Z0-9])/$1.lc ($2)."_".lc $3/ge;
371     $r =~ s/([A-Z])/"_".lc $1/ge;
372     $r =~ s/(?=[0-9](?!$))/_/g;
373    
374 wakaba 1.1 ##DISImplementation
375    
376     ClsDef:
377     @ClsQName: ManakaiDISParser
378     @ClsISA:
379 wakaba 1.3 swcfg21:ManakaiSWCFGParser::swcfg21:ForLatest
380 wakaba 1.1 @Description:
381     @@lang:en
382     @@@:
383     A SuikaWikiConfig/2.1 parser that returns <QUOTE::dis> object.
384     @Method:
385 wakaba 1.3 @@Name: parse
386     @@Description:
387     @@@lang:en
388     @@@@:
389 wakaba 1.1 Parses a <QUOTE::dis> document and returns it as an object tree.
390 wakaba 1.3 @@Param:
391     @@@Name: input
392     @@@Type:
393     DOMLS:LSInput::ManakaiDOM:ManakaiDOM3
394     @@@Description:
395     @@@@lang:en
396     @@@@@:
397 wakaba 1.1 The input source.
398 wakaba 1.3 @@Return:
399     @@@Type: ManakaiDISDocument
400     @@@Description:
401     @@@@lang:en
402     @@@@@:
403 wakaba 1.1 The <QUOTE::dis> document object created from the <P::input>.
404     @@@RaiseException:
405     @@@@@:
406     swcfg21:SWCFG_PARSE_ERR
407     @@@@Description:
408     @@@@@lang:en
409     @@@@@@:
410     The <IF::swcfg21:SWCFGParser> was unable to load the SuikaWikiConfig
411     document.
412     @@@PerlDef:
413     __DEEP{
414 wakaba 1.3 $r = $self-><M::swcfg21:ManakaiSWCFGParser
415     ::swcfg21:ForLatest.parse> ($input);
416 wakaba 1.1 }__;
417     if (defined $r) {
418     $r = bless $r, <ClassName::ManakaiDISDocument>;
419 wakaba 1.4 $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
420     .defaultElementTypeNamespaceURI>
421     (<Q::dis:>);
422 wakaba 1.1 }
423     ##DISParser
424    
425     ClsDef:
426     @ClsQName: ManakaiDISNode
427     @Description:
428     @@lang:en
429     @@@:
430     <QUOTE::dis> node objects.
431 wakaba 1.7 @ImplNote:
432     @@lang:en
433     @@@:
434     This class does not inherit
435     <Class::swcfg21:ManakaiSWCFGNode::swcfg21:ForLatest>, since
436     inheriting classes such as <Class::ManakaiDISElement> indirectly
437     inherit it.
438 wakaba 1.1
439     @MethodRedef:
440     @@Name:lookupNamespacePrefix
441     @@Description:
442     @@@lang:en
443     @@@@:
444     Looks up the namespace prefix associated to the given
445     namespace URI. The default namespaces are ignored.
446     @@Param:
447     @@@Name:namespaceURI
448 wakaba 1.3 @@@Type: AnyURI
449 wakaba 1.1 @@@Description:
450     @@@@lang:en
451     @@@@@:
452     The namespace URI to look for.
453     @@@InCase:
454     @@@@Value:
455     @@@@@is-null:1
456     @@@@Description:
457     @@@@@lang:en
458     @@@@@@:
459     The <DOM::null> namespace.
460     @@NamedParam:
461     @@@Name: makeNewBinding
462     @@@Type:
463     DOMMain:boolean
464     @@@Description:
465     @@@@lang:en
466     @@@@@:
467     Whether a new namespace prefix should be bound when
468     no namespace URI has been associated yet.
469     @@@InCase:
470     @@@@Value:true
471     @@@@Description:
472     @@@@@lang:en
473     @@@@@@:
474     New binding is made if no prefix associated.
475     @@@InCase:
476     @@@@Value:false
477     @@@@Description:
478     @@@@@lang:en
479     @@@@@@:
480     Simply returns the <DOM::null> if no prefix associated.
481     @@Return:
482     @@@Type:
483 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
484 wakaba 1.1 @@@Description:
485     @@@@lang:en
486     @@@@@:
487     An associated namespace prefix. If more than one prefix
488     are associated to the namespace URI, the returned prefix
489     is implementation dependent.
490     @@@InCase:
491     @@@@Value:
492     @@@@@is-null:1
493     @@@@Description:
494     @@@@@lang:en
495     @@@@@@:
496     No associated namespace prefix found.
497     @@@PerlDef:
498     $r = null;
499 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
500     .ownerDocument> || $self;
501 wakaba 1.7 my $binds = $od->{<Q::TreeCore:node>}->{<Q::swcfg21:nsBinding>};
502 wakaba 1.1 if (defined $namespaceURI) {
503     FIND: {
504     for my $prefix (keys %$binds) {
505     if (defined $binds->{$prefix} and
506     $binds->{$prefix} eq $namespaceURI) {
507     $r = $prefix;
508     last FIND;
509     }
510     }
511 wakaba 1.7
512     ## From module list
513     try {
514     my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
515     -><AG::ManakaiDISDocument.disDatabase>;
516     for my $mod_uri (keys %{$db->{modDef}}) {
517     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
518     my $mod_ln = $mod-><AG::ManakaiDISModuleDefinition.localName>;
519     next if exists $binds->{$mod_ln};
520     my $ns_uri = $mod-><M::ManakaiDISPropertyAccessor
521     .getPropertyText>
522     (<Q::dis:Namespace>, '');
523     if ($ns_uri eq $namespaceURI) {
524     $r = $mod_ln;
525     last FIND;
526     }
527     }
528     } catch <Class::ManakaiDISException> with {
529     my $err = shift;
530     $err->throw
531     unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_DB_ASSOCIATED_ERR>;
532     };
533    
534 wakaba 1.1 last FIND unless $makeNewBinding;
535     ## Not found
536     if ($namespaceURI =~ /(\w+)$/) {
537     my $prefix = $1;
538     unless (exists $binds->{$prefix}) {
539     $binds->{$prefix} = $namespaceURI;
540     $r = $prefix;
541     last FIND;
542     }
543     }
544     my $i = 1;
545     {
546     unless (exists $binds->{'ns'.$i}) {
547     $binds->{$r = 'ns'.$i} = $namespaceURI;
548     last FIND;
549     }
550     $i++;
551     redo;
552     }
553     } # FIND
554     } else { ## Null namespace
555     FIND: {
556     if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) {
557     $r = 'nu'.'ll';
558     last FIND;
559     }
560     for my $prefix (keys %$binds) {
561     if (not defined $prefix) {
562     $r = $prefix;
563     last FIND;
564     }
565     }
566     last FIND unless $makeNewBinding;
567     ## Not found
568     my $i = '';
569     {
570     unless (exists $binds->{'nu'.'ll'.$i}) {
571     $binds->{$r = 'nu'.'ll'.$i} = null;
572     last FIND;
573     }
574     $i++;
575     redo;
576     }
577     }
578     }
579    
580     @MethodRedef:
581     @@Name:lookupNamespaceURI
582     @@Description:
583     @@@lang:en
584     @@@@:
585     Looks up the namespace URI associated to the given prefix.
586     @@Param:
587     @@@Name:prefix
588     @@@Type:
589 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
590 wakaba 1.1 @@@Description:
591     @@@@lang:en
592     @@@@@:
593     The namespace URI to look for.
594     @@NamedParam:
595     @@@Name: makeNewBinding
596     @@@Type:
597     DOMMain:boolean
598     @@@Description:
599     @@@@lang:en
600     @@@@@:
601     Whether a new binding should be created if no namespace URI
602     is associated with the <P::prefix> or not.
603     @@@InCase:
604     @@@@Value:true
605     @@@@Description:
606     @@@@@lang:en
607     @@@@@@:
608     A new binding to the temporary namespace URI
609     exactly same as <P::prefix> is created
610     if no binding found.
611     @@@InCase:
612     @@@@Value:false
613     @@@@Description:
614     @@@@@lang:en
615     @@@@@@:
616     No new binding is created if no binding found. Note that
617     even if no association newly created, this method
618     returns the <DOM::null> value.
619     @@Return:
620 wakaba 1.3 @@@Type: AnyURI
621 wakaba 1.1 @@@Description:
622     @@@@lang:en
623     @@@@@:The associated namespace URI.
624     @@@InCase:
625     @@@@Value:
626     @@@@@is-null:1
627     @@@@Description:
628     @@@@@lang:en
629     @@@@@@:
630 wakaba 1.3 No namespace URI is associated to the prefix or
631 wakaba 1.1 the <DOM::null> namespace is associated.
632     @@@PerlDef:
633 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
634     .ownerDocument> || $self;
635 wakaba 1.7 my $binds = $od->{<Q::TreeCore:node>}->{<Q::swcfg21:nsBinding>};
636 wakaba 1.1 if (exists $binds->{$prefix}) {
637     $r = $binds->{$prefix};
638     } else {
639 wakaba 1.7 ## From module list
640     FIND: {
641     try {
642     my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
643     -><AG::ManakaiDISDocument.disDatabase>;
644     for my $mod_uri (keys %{$db->{modDef}}) {
645     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
646     if ($mod-><AG::ManakaiDISModuleDefinition.localName>
647     eq $prefix) {
648     $r = $mod-><M::ManakaiDISPropertyAccessor
649     .getPropertyText>
650     (<Q::dis:Namespace>, null);
651     last FIND;
652     }
653     }
654     } catch <Class::ManakaiDISException> with {
655     my $err = shift;
656     $err->throw
657     unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_DB_ASSOCIATED_ERR>;
658     };
659     if ($makeNewBinding) {
660     $r = $binds->{$prefix} = $prefix;
661     } else {
662     $r = null;
663     }
664     } # FIND
665 wakaba 1.1 }
666    
667     @IntMethod:
668     @@Name:getNodeReference
669     @@Description:
670     @@@lang:en
671     @@@@:
672     Returns a new reference to the node object.
673     @@ManakaiDOM:isStatic:1
674     @@Param:
675     @@@Name:object
676     @@@Type:
677     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
678     @@@Description:
679     @@@@lang:en
680     @@@@@:
681     The node object to be referred.
682     @@Return:
683     @@@Type: ManakaiDISNode
684     @@@Description:
685     @@@@lang:en
686     @@@@@:
687     A newly created reference.
688     @@@PerlDef:
689     my $class;
690 wakaba 1.5 if ($object->{<Q::swcfg21:nodeType>} eq '#element') {
691 wakaba 1.1 $class = <ClassName::ManakaiDISElement>;
692 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#comment') {
693 wakaba 1.1 $class = <ClassName::ManakaiDISComment>;
694 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#document') {
695 wakaba 1.1 $class = <ClassName::ManakaiDISDocument>;
696 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#fragment') {
697 wakaba 1.1 $class = <ClassName::ManakaiDISDocumentFragment>;
698     } else {
699     __ASSERT{DISPerl:invariant::
700 wakaba 1.5 msg => {qq[Node type: "$object->{<Q::swcfg21:nodeType>}" ].
701 wakaba 1.1 qq[(ref: "@{[ref $object]}")]},
702     }__;
703     }
704     $r = $object-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
705     .newReference> ($class);
706    
707 wakaba 1.2 @Attr:
708     @@Name:ownerDISDocument
709     @@Description:
710     @@@lang:en
711     @@@@:
712     The <QUOTE::dis> document object associated with this node.
713     @@Get:
714 wakaba 1.3 @@@Type:ManakaiDISDocument
715 wakaba 1.2 @@@Description:
716     @@@@lang:en
717     @@@@@:
718     The document object associated with this node.
719     @@@InCase:
720     @@@@Value:
721     @@@@@is-null:1
722     @@@@Description:
723     @@@@@lang:en
724     @@@@@@:
725     This node is a document node.
726     @@@PerlDef:
727     $r = <ClassM::ManakaiDISNode.getNodeReference>
728     ($self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>})
729     if $self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>};
730 wakaba 1.1 ##DISNode
731    
732     ClsDef:
733     @ClsQName: ManakaiDISElement
734 wakaba 1.7 @ClsISA: ManakaiDISNode
735 wakaba 1.1 @ClsISA:
736 wakaba 1.3 swcfg21:ManakaiSWCFGElement::swcfg21:ForLatest
737 wakaba 1.1 @Description:
738     @@lang:en
739     @@@:
740     <QUOTE::dis> element node objects.
741    
742     @Method:
743     @@Name: forMatch
744     @@Description:
745     @@@lang:en
746     @@@@:
747     Tests whether this element is for a <QUOTE::for> or not.
748     @@Param:
749     @@@Name: forArg
750     @@@Type: ForURI
751     @@@Description:
752     @@@@lang:en
753     @@@@@:
754     The <QUOTE::For> URI reference to test against.
755     @@Param:
756     @@@Name: forpArg
757     @@@Type: ForURIList
758     @@@Description:
759     @@@@lang:en
760     @@@@@:
761     The <QUOTE::For+> URI references to test against.
762     @@@InCase:
763     @@@@Value:
764     @@@@@is-null:1
765     @@@@Description:
766     @@@@@lang:en
767     @@@@@@:
768     No additional <QUOTE::For> URI reference.
769 wakaba 1.3 Equivalent to an empty array reference.
770 wakaba 1.1 @@Return:
771     @@@Type:
772     DOMMain:boolean
773     @@@Description:
774     @@@@lang:en
775     @@@@@:
776     Whether this element is for <P::forArg> and <P::forpArg> or not.
777 wakaba 1.2 @@@UndeclaredPrefixException:
778     @@@NoDBException:
779     @@@PerlDef:
780 wakaba 1.3 $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
781     $forpArg ||= [];
782 wakaba 1.2
783     FORMATCH: {
784     __DEEP{
785 wakaba 1.4 my @ce = @{$self-><M::ManakaiDISElement.disChildElements>};
786 wakaba 1.2 for my $ce (@ce) {
787 wakaba 1.3 my $et = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
788     .expandedURI>;
789 wakaba 1.2 if ($et eq <Q::dis:ForCheck>) {
790 wakaba 1.3 my $for = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
791     ::swcfg21:ForLatest.value>];
792 wakaba 1.2 FCs: for my $f (@$for) {
793     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
794     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
795     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
796     -><AG::ManakaiDISDocument.disDatabase>
797     -><M::ManakaiDISDatabase.getFor> ($uri);
798     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
799 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
800 wakaba 1.2 if ($uri eq $arg_uri) {
801     $r = false;
802     last FORMATCH;
803     }
804     }
805     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
806     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
807     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
808     -><AG::ManakaiDISDocument.disDatabase>
809     -><M::ManakaiDISDatabase.getFor> ($uri);
810     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
811 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
812 wakaba 1.2 if ($f-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
813     $r = false;
814     last FORMATCH;
815     }
816     }
817     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
818     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
819     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
820     -><AG::ManakaiDISDocument.disDatabase>
821     -><M::ManakaiDISDatabase.getFor> ($uri);
822     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
823 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
824 wakaba 1.2 if ($arg_uri eq $uri) {
825     next FCs;
826     }
827     }
828     $r = false;
829     last FORMATCH;
830     } else { ## -- ISA
831     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
832     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
833     -><AG::ManakaiDISDocument.disDatabase>
834     -><M::ManakaiDISDatabase.getFor> ($uri);
835     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
836 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
837 wakaba 1.2 if ($f-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
838     next FCs;
839     }
840     }
841     $r = false;
842     last FORMATCH;
843     }
844     } # FCs
845     } # dis:ForCheck
846     } # children
847    
848     my $has_for = false;
849     for my $ce (@ce) {
850 wakaba 1.3 if ($self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
851     .expandedURI> eq
852 wakaba 1.2 <Q::dis:For>) {
853 wakaba 1.3 my $for = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
854     ::swcfg21:ForLatest.value>];
855 wakaba 1.2 my $ok = true;
856     $has_for = true;
857     AFOR: for my $f (@$for) {
858     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
859     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
860     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
861     -><AG::ManakaiDISDocument.disDatabase>
862     -><M::ManakaiDISDatabase.getFor> ($uri);
863     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
864 wakaba 1.3 if ($uri eq $forArg) {
865 wakaba 1.2 $ok = false;
866     last AFOR;
867     }
868     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
869     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
870     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
871     -><AG::ManakaiDISDocument.disDatabase>
872     -><M::ManakaiDISDatabase.getFor> ($uri);
873     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
874 wakaba 1.3 if ($f-><M::ManakaiDISForDefinition.isaURI> ($forArg)) {
875 wakaba 1.2 $ok = false;
876     last AFOR;
877     }
878     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
879     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
880     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
881     -><AG::ManakaiDISDocument.disDatabase>
882     -><M::ManakaiDISDatabase.getFor> ($uri);
883     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
884 wakaba 1.3 unless ($uri eq $forArg) {
885 wakaba 1.2 $ok = false;
886     last AFOR;
887     }
888     } else { ## -- ISA
889     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
890     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
891     -><AG::ManakaiDISDocument.disDatabase>
892     -><M::ManakaiDISDatabase.getFor> ($uri);
893     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
894 wakaba 1.3 unless ($f-><M::ManakaiDISForDefinition.isaURI> ($forArg)) {
895 wakaba 1.2 $ok = false;
896     last AFOR;
897     }
898     }
899     } # AFOR
900 wakaba 1.3 if ($ok) {
901     $r = true;
902     last FORMATCH;
903     }
904 wakaba 1.2 } # dis:For
905     } # $ce
906     $r = $has_for ? false : true;
907     }__;
908     } # FORMATCH
909 wakaba 1.1
910     @Method:
911     @@Name: mediaTypeMatch
912     @@Description:
913     @@@lang:en
914     @@@@:
915     Tests whether the content media type of this element matches to
916     a type or not.
917     @@Param:
918     @@@Name: mediaType
919     @@@Type: MediaTypeURI
920     @@@Description:
921     @@@@lang:en
922     @@@@@:
923     A media type URI reference to test against.
924     @@Param:
925 wakaba 1.3 @@@Name: defaultMediaType
926 wakaba 1.1 @@@Type: MediaTypeURI
927     @@@Description:
928     @@@@lang:en
929     @@@@@:
930     The default media type for this element.
931     @@@InCase:
932     @@@@Value:
933     @@@@@is-null:1
934     @@@@Description:
935     @@@@@lang:en
936     @@@@@@:
937     No default type provided. All <P::mediaType> will match.
938     @@Return:
939     @@@Type:
940     DOMMain:boolean
941     @@@Description:
942     @@@@lang:en
943     @@@@@:
944     Whether this element is of <P::mediaType> or not.
945 wakaba 1.2 @@@PerlDef:
946     if (defined $mediaType) {
947     __DEEP{
948     my $ctn = $self-><M::ManakaiDISElement.disGetAttribute>
949     (<Q::dis:ContentType>);
950     my $ct;
951     $ct = $ctn-><AG::ManakaiDISElement.qnameValueURI> if $ctn;
952     $ct = $defaultMediaType unless defined $ct;
953     my $res = $self-><AG::ManakaiDISNode.ownerDISDocument>
954     -><AG::ManakaiDISDocument.disDatabase>
955     -><M::ManakaiDISDatabase.getResource> ($ct);
956     $res-><AS::ManakaiDISResourceDefinition.isReferred> ($ctn or $self);
957 wakaba 1.7 unless ($res-><M::ManakaiDISResourceDefinition
958     .isSubsetOfURI> ($ct)) {
959 wakaba 1.2 $r = false;
960     } else {
961     $r = true;
962     }
963     }__;
964     } else {
965     $r = true;
966     }
967 wakaba 1.1
968     @Method:
969     @@Name: prefixToURI
970     @@Description:
971     @@@lang:en
972     @@@@:
973     Converts a namespace prefix into associated URI reference.
974     @@Param:
975     @@@Name: prefix
976     @@@Type:
977 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
978 wakaba 1.1 @@@Description:
979     @@@@lang:en
980     @@@@@:
981     A namespace prefix to look for.
982     @@@InCase:
983     @@@@Value:
984     @@@@@is-null:1
985     @@@@Description:
986     @@@@@lang:en
987     @@@@@@:
988     Returns the default namespace URI.
989     @@NodeParam:
990     @@Return:
991 wakaba 1.3 @@@Type: AnyURI
992 wakaba 1.1 @@@Description:
993     @@@@lang:en
994     @@@@@: The URI references associated.
995     @@@UndeclaredPrefixException:
996     @@@PerlDef:
997 wakaba 1.3 if (defined $prefix) {
998 wakaba 1.1 __DEEP{
999 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1000     .lookupNamespaceURI> ($prefix);
1001 wakaba 1.1 }__;
1002     unless (defined $r) {
1003     __EXCEPTION{UNDECLARED_NS_PREFIX_ERR::
1004     infoset:prefix => {$prefix},
1005     MDOMX:param-name => 'prefix',
1006     DIS:sourceNode => {$node},
1007     }__;
1008     }
1009 wakaba 1.7 } else { ## Default namespace
1010     __DEEP{
1011     $r = ($self-><AG::ManakaiDISNode.ownerDISDocument> || $self)
1012     -><AG::ManakaiDISDocument.moduleElement>
1013     -><AG::ManakaiDISModuleElement.definingNamespaceURI>;
1014     }__;
1015 wakaba 1.1 }
1016    
1017     @Method:
1018     @@QName: qnameToURI
1019     @@Description:
1020     @@@lang:en
1021     @@@@:
1022     Converts a qualified name (<TYPE::dis:TypeQName>) to
1023     an expanded URI reference.
1024     @@Param:
1025     @@@Name: qname
1026     @@@Type:
1027     dis:TypeQName
1028     @@@Description:
1029     @@@@lang:en
1030     @@@@@:
1031     A qualified name.
1032     @@NodeParam:
1033     @@Return:
1034     @@@Type: AnyURI
1035     @@@Description:
1036     @@@@lang:en
1037     @@@@@:
1038     The expanded URI reference.
1039     @@@UndeclaredPrefixException:
1040     @@@PerlDef:
1041     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1042     my ($prefix, $lname) = split /:/, $qname;
1043     __DEEP{
1044     if (defined $lname) {
1045     $r = $self-><M::ManakaiDISElement.prefixToURI> ($prefix) . $lname;
1046     } else { ## In default namespace
1047     $r = $self-><M::ManakaiDISElement.prefixToURI> (null) . $prefix;
1048     }
1049 wakaba 1.4 }__;
1050 wakaba 1.1
1051     @Method:
1052     @@QName: qnameToPair
1053     @@Description:
1054     @@@lang:en
1055     @@@@:
1056     Converts a qualified name (<TYPE::dis:TypeQName>) to
1057     a pair of namespace URI and local name.
1058     @@Param:
1059     @@@Name: qname
1060     @@@Type:
1061     dis:TypeQName
1062     @@@Description:
1063     @@@@lang:en
1064     @@@@@:
1065     A qualified name.
1066     @@NodeParam:
1067     @@Return:
1068     @@@Type:
1069     Perl:ARRAY
1070     @@@Description:
1071     @@@@lang:en
1072     @@@@@:
1073     A list of namespace URI and local name.
1074     @@@UndeclaredPrefixException:
1075     @@@PerlDef:
1076     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1077     my ($prefix, $lname) = split /:/, $qname;
1078     __DEEP{
1079     if (defined $lname) {
1080     $r = [$self-><M::ManakaiDISElement.prefixToURI> ($prefix), $lname];
1081     } else { ## In default namespace
1082     $r = [$self-><M::ManakaiDISElement.prefixToURI> (null), $prefix];
1083     }
1084 wakaba 1.4 }__;
1085 wakaba 1.1
1086     @Method:
1087 wakaba 1.3 @@Name: tfqnamesToURI
1088 wakaba 1.1 @@Description:
1089     @@@lang:en
1090     @@@@:
1091 wakaba 1.3 Converts a <TYPE::dis:TFQNames>
1092 wakaba 1.1 into an expanded URI reference.
1093     @@Param:
1094     @@@Name: tfqnames
1095     @@@Type:
1096 wakaba 1.3 dis:TFQNames
1097 wakaba 1.1 @@@Description:
1098     @@@@lang:en
1099     @@@@@:
1100 wakaba 1.3 A <TYPE::dis:TFQNames> to identify a resource.
1101 wakaba 1.1 @@Param:
1102     @@@Name: defaultTypeURI
1103     @@@Type: NameURI
1104     @@@Description:
1105     @@@@lang:en
1106     @@@@@:
1107     A name URI reference used if it is missing from
1108     <P::tfqnames>.
1109     @@@InCase:
1110     @@@@Value:
1111     @@@@@is-null:1
1112     @@@@Description:
1113     @@@@@lang:en
1114     @@@@@@:
1115     Equivalent to <Q::DOMMain:any>.
1116     @@Param:
1117     @@@Name: defaultForURI
1118     @@@Type: ForURI
1119     @@@Description:
1120     @@@@lang:en
1121     @@@@@:
1122     A <QUOTE::for> URI reference used if it is missing from
1123     <P::tfqnames>.
1124     @@@InCase:
1125     @@@@Value:
1126     @@@@@is-null:1
1127     @@@@Description:
1128     @@@@@lang:en
1129     @@@@@@:
1130     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1131     @@NodeParam:
1132     @@Return:
1133     @@@Type:
1134 wakaba 1.3 DISCore:TFURI::ManakaiDOM:all
1135 wakaba 1.1 @@@Description:
1136     @@@@lang:en
1137     @@@@@:
1138 wakaba 1.3 The <TYPE::dis:TFQNames>-expanded URI references.
1139 wakaba 1.1 @@@UndeclaredPrefixException:
1140     @@@PerlDef:
1141     my ($typeq, $forq) = split /\s*::\s*/, $tfqnames, 2;
1142     my ($typeURI, $forURI);
1143     if (defined $forq) {
1144     __DEEP{
1145     $typeURI = $typeq eq ''
1146     ? defined $defaultTypeURI ? $defaultTypeURI
1147     : <Q::DOMMain:any>
1148     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1149     }__;
1150     if (length $forq) {
1151     $forURI = $self-><M::ManakaiDISElement.qnameToURI> ($forq, %opt);
1152     } else {
1153     $forURI = <Q::ManakaiDOM:all>;
1154     }
1155     } else { ## "For" omitted
1156     __DEEP{
1157     $typeURI = $typeq eq ''
1158     ? defined $defaultTypeURI ? $defaultTypeURI
1159     : <Q::DOMMain:any>
1160     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1161     }__;
1162 wakaba 1.3 $forURI = defined $defaultForURI ? $defaultForURI
1163     : <Q::ManakaiDOM:all>;
1164 wakaba 1.1 }
1165 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
1166 wakaba 1.2
1167     @Method:
1168     @@Name: disGetAttribute
1169     @@enDesc:
1170     Gets an attribute node.
1171     @@Param:
1172     @@@Name: attrName
1173     @@@Type: AnyURI
1174     @@@enDesc:
1175     The name expanded URI of the node to retrieve.
1176     @@ForParam:
1177     @@ForpParam:
1178     @@MediaTypeParam:
1179     @@MediaTypeDefaultParam:
1180     @@Return:
1181     @@@Type: ManakaiDISElement
1182     @@@enDesc:
1183     The attribute (property) element node.
1184     @@@nullCase:
1185     @@@@enDesc:
1186     No attribute node found.
1187     @@@PerlDef:
1188 wakaba 1.5 for my $c (@{$self-><M::ManakaiDISElement.disChildElements>}) {
1189 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1190     .expandedURI> eq $attrName and
1191 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1192     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1193 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1194 wakaba 1.2 $r = $c;
1195     last;
1196     }
1197     }
1198    
1199     @Method:
1200     @@Name: disGetAttributeList
1201     @@enDesc:
1202     Gets attribute nodes.
1203 wakaba 1.3 @@Param:
1204     @@@Name: attrName
1205     @@@Type: AnyURI
1206     @@@enDesc:
1207     The name expanded URI of the node to retrieve.
1208 wakaba 1.2 @@ForParam:
1209     @@ForpParam:
1210     @@MediaTypeParam:
1211     @@MediaTypeDefaultParam:
1212     @@Return:
1213     @@@Type: ManakaiDISElementList
1214     @@@enDesc:
1215     The attribute (property) element nodes.
1216     @@@PerlDef:
1217     $r = bless [], <ClassName::ManakaiDISElementList>;
1218 wakaba 1.5 for my $c (@{$self-><M::ManakaiDISElement.disChildElements>}) {
1219 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1220     .expandedURI> eq $attrName and
1221 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1222     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1223 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1224 wakaba 1.2 push @$r, $c;
1225     }
1226     }
1227    
1228 wakaba 1.4 @Method:
1229 wakaba 1.2 @@Name: disChildElements
1230     @@enDesc:
1231     A list of child elements.
1232 wakaba 1.4 @@ForParam:
1233     @@ForpParam:
1234     @@Return:
1235     @@@Type: ManakaiDISElementList
1236 wakaba 1.2 @@@enDesc:
1237     The current snapshot of child nodes.
1238     @@@PerlDef:
1239 wakaba 1.4 $r = bless [], <ClassName::ManakaiDISElementList>;
1240     __DEEP{
1241     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1242     .childNodes>}) {
1243     ## $cn is an #element.
1244     my $dn = $cn->{<Q::TreeCore:node>}
1245     -><M::ManakaiDOM:ManakaiDOMNodeObject
1246     ::ManakaiDOM:Perl.newReference>
1247     (<ClassName::ManakaiDISElement>);
1248     next unless $dn-><M::ManakaiDISElement.forMatch> ($forArg, $forpArg);
1249     push @$r, $dn;
1250     }
1251     }__;
1252 wakaba 1.5
1253 wakaba 1.2 @Attr:
1254     @@Name: qnameValueURI
1255     @@enDesc:
1256     The element value (written as <TYPE::dis:TypeQName>), as URI reference.
1257     \
1258     {NOTE:: What should be if list value?
1259     \
1260     }
1261     @@Get:
1262     @@@Type:AnyURI
1263     @@@nullCase:
1264     @@@@enDesc:
1265     No value.
1266     @@@UndeclaredPrefixException:
1267 wakaba 1.3 @@@PerlDef:
1268 wakaba 1.4 __DEEP{
1269     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1270     if (defined $v and not ref $v eq 'ARRAY') {
1271     $r = $self-><AG::ManakaiDISElement.qnameToURI> ($v, node => $self);
1272     } else {
1273     $r = null;
1274     }
1275     }__;
1276    
1277     @Attr:
1278     @@Name: qnameValueLocalName
1279     @@enDesc:
1280     The local name part of the element value (assumed as
1281     written as <TYPE::dis:TypeQName>).
1282     \
1283     {NOTE:: What should be if list value?
1284     \
1285     }
1286     @@Get:
1287     @@@Type:
1288     DISCore:LocalName
1289     @@@nullCase:
1290     @@@@enDesc:
1291     No value.
1292     @@@PerlDef:
1293     __DEEP{
1294     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1295     if (defined $v and not ref $v eq 'ARRAY') {
1296     my ($n, $v) = split /:/, $v, 2;
1297     $r = defined $v ? $v : $n;
1298     } else {
1299     $r = null;
1300     }
1301     }__;
1302    
1303     @Attr:
1304     @@Name: qnameValueNamespaceURI
1305     @@enDesc:
1306     The namespace URI of the element value (assumed as written
1307     in <TYPE::dis:TypeQName>).
1308     \
1309     {NOTE:: What should be if list value?
1310     \
1311     }
1312     @@Get:
1313     @@@Type:AnyURI
1314     @@@nullCase:
1315     @@@@enDesc:
1316     No value.
1317     @@@UndeclaredPrefixException:
1318     @@@PerlDef:
1319     __DEEP{
1320     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1321     if (defined $v and not ref $v eq 'ARRAY') {
1322     my ($p, $v) = split /:/, $v, 2;
1323     $r = $self-><AG::ManakaiDISElement.prefixToURI>
1324     (defined $v ? $p : null);
1325     } else {
1326     $r = null;
1327     }
1328     }__;
1329 wakaba 1.2
1330 wakaba 1.6 @Method:
1331 wakaba 1.3 @@Name: tfqnamesValueURI
1332 wakaba 1.2 @@enDesc:
1333 wakaba 1.3 The element value (written as <TYPE::dis:TFQNames>),
1334 wakaba 1.2 as URI reference.
1335     \
1336     {NOTE:: What should be if list value?
1337     \
1338     }
1339 wakaba 1.6 @@Param:
1340     @@@Name: defaultTypeURI
1341     @@@Type: NameURI
1342     @@@Description:
1343     @@@@lang:en
1344     @@@@@:
1345     A name URI reference used if it is missing from
1346     <P::tfqnames>.
1347     @@@InCase:
1348     @@@@Value:
1349     @@@@@is-null:1
1350     @@@@Description:
1351     @@@@@lang:en
1352     @@@@@@:
1353     Equivalent to <Q::DOMMain:any>.
1354     @@Param:
1355     @@@Name: defaultForURI
1356     @@@Type: ForURI
1357     @@@Description:
1358     @@@@lang:en
1359     @@@@@:
1360     A <QUOTE::for> URI reference used if it is missing from
1361     <P::tfqnames>.
1362     @@@InCase:
1363     @@@@Value:
1364     @@@@@is-null:1
1365     @@@@Description:
1366     @@@@@lang:en
1367     @@@@@@:
1368     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1369     @@Return:
1370 wakaba 1.2 @@@Type:ResourceURI
1371     @@@nullCase:
1372     @@@@enDesc:
1373     No value.
1374     @@@UndeclaredPrefixException:
1375 wakaba 1.3 @@@PerlDef:
1376     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1377 wakaba 1.2 if (defined $v and not ref $v eq 'ARRAY') {
1378     __DEEP{
1379 wakaba 1.6 $r = $self-><AG::ManakaiDISElement.tfqnamesToURI>
1380     ($v, $defaultTypeURI, $defaultForURI);
1381 wakaba 1.2 }__;
1382     } else {
1383     $r = null;
1384     }
1385 wakaba 1.7
1386     @Method:
1387     @@Name: elementTypeMatch
1388     @@enDesc:
1389     Returns whether the element type of this element matches
1390     with another element type (either the same element type or
1391     this type is a subtype of another type).
1392     @@Param:
1393     @@@Name: etype
1394     @@@Type: ResourceURI
1395     @@@enDesc:
1396     An element type name URI reference to test.
1397     @@Return:
1398     @@@Type:
1399     DOMMain:boolean
1400     @@@TrueCase:
1401     @@@@enDesc:
1402     Either the element type expanded URI reference of this element is
1403     same as <P::etype> or it is a sub-element type of <P::etype>.
1404     @@@FalseCase:
1405     @@@@enDesc:
1406     This element is not of <P::etype>.
1407     @@@NoDBException:
1408     @@@PerlDef:
1409     __DEEP{
1410     my $et = $self-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
1411     .expandedURI>;
1412     my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1413     -><AG::ManakaiDISDocument.disDatabase>
1414     -><M::ManakaiDISDatabase.getResource> ($et);
1415     $r = $rdef-><M::ManakaiDISResourceDefinition.isSubsetOfURI> ($etype);
1416     }__;
1417    
1418     @Attr:
1419     @@Name: isResourceElement
1420     @@enDesc:
1421     Whether this element defines a resource or not.
1422     \
1423     {NOTE:: An element defines a resource if its element type is
1424     <Q::dis:ResourceDef> or its subtype.
1425     \
1426     }
1427     @@Get:
1428     @@@Type:
1429     DOMMain:boolean
1430     @@@TrueCase:
1431     @@@@enDesc:
1432     This element defines a resource.
1433     @@@FalseCase:
1434     @@@@enDesc:
1435     This element does not define any resource.
1436     @@@NoDBException:
1437     @@@PerlDef:
1438     __DEEP{
1439     $r = $self-><M::ManakaiDISElement.elementTypeMatch>
1440     (<Q::dis:ResourceDef>);
1441     }__;
1442    
1443     @Attr:
1444     @@Name: isPropertyElement
1445     @@enDesc:
1446     Whether this element is a property or not.
1447     \
1448     {NOTE:: An element is a property if its element type is
1449     <Q::rdf:type> or if its element type's <Q::rdf:type>
1450     property is <Q::rdf:Property> or is <Q::dis:subsetOf>
1451     <Q::rdf:Property>.
1452     \
1453     }
1454     @@Get:
1455     @@@Type:
1456     DOMMain:boolean
1457     @@@TrueCase:
1458     @@@@enDesc:
1459     This element is a property.
1460     @@@FalseCase:
1461     @@@@enDesc:
1462     This element is not a property.
1463     @@@NoDBException:
1464     @@@PerlDef:
1465     __DEEP{
1466     my $xn = $self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1467     .expandedURI>;
1468     if ($xn eq <Q::rdf:type>) {
1469     $r = true;
1470     } else {
1471     my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1472     -><AG::ManakaiDISDocument.disDatabase>
1473     -><M::ManakaiDISDatabase.getResource> ($xn);
1474     $r = $rdef-><M::ManakaiDISResourceDefinition.isTypeURI>
1475     (<Q::rdf:Resource>);
1476     }
1477     }__;
1478 wakaba 1.1 ##DISElement
1479    
1480     ClsDef:
1481 wakaba 1.4 @ClsQName: ManakaiDISModuleElement
1482     @ClsISA: ManakaiDISElement
1483     @enDesc:
1484     The <Q::dis:Module> elements.
1485    
1486     @Attr:
1487     @@Name: requireElement
1488     @@enDesc:
1489     The <Q::dis:Require> child element. The element is
1490     newly created if not exist.
1491     @@Type: ManakaiDISElement
1492     @@Get:
1493     @@@PerlDef:
1494     __DEEP{
1495     $r = $self-><M::swcfg21:SWCFGNode
1496     ::swcfg21:ForLatest.getAttributeNS>
1497     (<Q::dis:>, 'Require', make_new_node => true);
1498     }__;
1499    
1500     @Attr:
1501     @@Name: defaultForURI
1502     @@enDesc:
1503     The value of <Q::dis:DefaultFor> attribute.
1504     @@Type: ForURI
1505     @@Get:
1506     @@@enDesc:
1507     The value of <Q::dis:DefaultFor> child element. If missing,
1508     <Q::ManakaiDOM:all> is returned.
1509     @@@PerlDef:
1510     __DEEP{
1511     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1512     .getAttributeNS>
1513     (<Q::dis:>, 'DefaultFor');
1514     if ($df) {
1515     $r = $df-><AG::ManakaiDISElement.qnameValueURI>
1516     || <Q::ManakaiDOM:all>;
1517     } else {
1518     $r = <Q::ManakaiDOM:all>;
1519     }
1520     }__;
1521     @@Set:
1522     @@@PerlDef:
1523     __DEEP{
1524     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
1525     (<Q::dis:>, 'DefaultFor' => $given);
1526     }__;
1527 wakaba 1.7
1528     @Attr:
1529     @@Name: definingNamespaceURI
1530     @@enDesc:
1531     The value of <Q::dis:NamespaceURI> attribute, i.e.
1532     the URI reference of the namespace that this module primary
1533     defines.
1534     \
1535     {NOTE:: Defining namespace URI is <QUOTE::for> independent.
1536     \
1537     }
1538     @@Type: AnyURI
1539     @@Get:
1540     @@@PerlDef:
1541     __DEEP{
1542     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1543     .getAttributeNS>
1544     (<Q::dis:>, 'Namespace');
1545     if ($df) {
1546     $r = $df-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1547     } else {
1548     __ASSERT{DISPerl:invariant::
1549     msg => {qq["dis:Namespace" attribute not found]},
1550     }__;
1551     }
1552     }__;
1553     @@Set:
1554     @@@PerlDef:
1555     __DEEP{
1556     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
1557     (<Q::dis:>, 'Namespace' => $given);
1558     }__;
1559 wakaba 1.4 ##DISModuleElement
1560    
1561     ClsDef:
1562 wakaba 1.2 @ClsQName: ManakaiDISElementList
1563     @enDesc:
1564     @@lang:en
1565     @@@:
1566     Lists of elements.
1567     \
1568     {NOTE:: <Class::ManakaiDISElementList> is <QUOTE::dead>;
1569     later changes to the tree does not affect this type of objects.
1570     \
1571     }
1572     ##DISElementList
1573    
1574     ClsDef:
1575 wakaba 1.1 @ClsQName: ManakaiDISComment
1576 wakaba 1.7 @ClsISA: ManakaiDISNode
1577 wakaba 1.1 @ClsISA:
1578 wakaba 1.3 swcfg21:ManakaiSWCFGComment::swcfg21:ForLatest
1579 wakaba 1.1 @Description:
1580     @@lang:en
1581     @@@:
1582     <QUOTE::dis> comment node objects.
1583     ##DISComment
1584    
1585     ClsDef:
1586     @ClsQName: ManakaiDISDocumentFragment
1587 wakaba 1.7 @ClsISA: ManakaiDISNode
1588 wakaba 1.1 @ClsISA:
1589 wakaba 1.3 swcfg21:ManakaiSWCFGDocumentFragment::swcfg21:ForLatest
1590 wakaba 1.1 @Description:
1591     @@lang:en
1592     @@@:
1593     <QUOTE::dis> document fragment node objects.
1594     ##DISDocumentFragment
1595    
1596     ClsDef:
1597     @ClsQName: ManakaiDISDocument
1598 wakaba 1.7 @ClsISA: ManakaiDISNode
1599 wakaba 1.1 @ClsISA:
1600 wakaba 1.3 swcfg21:ManakaiSWCFGDocument::swcfg21:ForLatest
1601 wakaba 1.1 @Description:
1602     @@lang:en
1603     @@@:
1604     <QUOTE::dis> document node objects.
1605 wakaba 1.2
1606     @Attr:
1607 wakaba 1.4 @@Name: moduleElement
1608     @@enDesc:
1609     The <Q::dis:Module> element in this document. The element is
1610     newly created if not exist.
1611     @@Type: ManakaiDISModuleElement
1612     @@Get:
1613     @@@PerlDef:
1614     __DEEP{
1615     $r = $self-><M::swcfg21:SWCFGNode
1616     ::swcfg21:ForLatest.getAttributeNS>
1617     (<Q::dis:>, 'Module', make_new_node => true);
1618     }__;
1619     $r = bless $r, <ClassName::ManakaiDISModuleElement>;
1620    
1621     @Attr:
1622 wakaba 1.2 @@Name: disDatabase
1623     @@enDesc:
1624     Associated <QUOTE::dis> database.
1625    
1626     @@Type: ManakaiDISDatabase
1627     @@Get:
1628     @@@NoDBException:
1629     @@@PerlDef:
1630     if ($self->{<Q::TreeCore:node>}->{<Q::db>}) {
1631 wakaba 1.5 $r = $self->{<Q::TreeCore:node>}->{<Q::db>};
1632 wakaba 1.2 } else {
1633     __EXCEPTION{NO_ASSOCIATED_DB_ERR}__;
1634     }
1635     @@Set:
1636     @@@PerlDef:
1637     $self->{<Q::TreeCore:node>}->{<Q::db>} = $given;
1638     require Scalar::Util;
1639     Scalar::Util::weaken ($self->{<Q::TreeCore:node>}->{<Q::db>});
1640 wakaba 1.5
1641     @Method:
1642     @@Name: disChildElements
1643     @@enDesc:
1644     A list of child elements.
1645     @@ForParam:
1646     @@ForpParam:
1647     @@Return:
1648     @@@Type: ManakaiDISElementList
1649     @@@enDesc:
1650     The current snapshot of child nodes.
1651     @@@PerlDef:
1652     $r = bless [], <ClassName::ManakaiDISElementList>;
1653     __DEEP{
1654     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1655     .childNodes>}) {
1656     next unless $cn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1657     .nodeType> eq '#element';
1658     my $dn = $cn->{<Q::TreeCore:node>}
1659     -><M::ManakaiDOM:ManakaiDOMNodeObject
1660     ::ManakaiDOM:Perl.newReference>
1661     (<ClassName::ManakaiDISElement>);
1662     next unless $dn-><M::ManakaiDISElement.forMatch> ($forArg, $forpArg);
1663     push @$r, $dn;
1664     }
1665     }__;
1666 wakaba 1.1 ##DISDocument
1667 wakaba 1.2
1668     PropDef:
1669     @QName: db
1670     @enDesc:
1671     Associated <QUOTE::dis> database.
1672     @rdfs:domain: ManakaiDISDocument
1673     @rdfs:range: ManakaiDISDatabase
1674    
1675     ## -- Definition object database
1676    
1677     ClsDef:
1678     @ClsQName: ManakaiDISDatabase
1679     @enDesc:
1680     Resource database created from <QUOTE::dis> source data.
1681 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1682 wakaba 1.2
1683     @Method:
1684     @@Name: getModule
1685     @@Description:
1686     @@@lang:en
1687     @@@@:
1688     Returns a <QUOTE::dis> module definition.
1689     @@Param:
1690     @@@Name: modURI
1691     @@@Type: ModuleURI
1692     @@@Description:
1693     @@@@lang:en
1694     @@@@@:
1695     A <QUOTE::dis> module URI reference.
1696     @@Return:
1697     @@@Type: ManakaiDISModuleDefinition
1698     @@@Description:
1699     @@@@lang:en
1700     @@@@@:
1701     The module definition.
1702     @@@PerlDef:
1703     if (defined $self->{modDef}->{$modURI}) {
1704     $r = $self->{modDef}->{$modURI};
1705     } else {
1706     $r = $self->{modDef}->{$modURI}
1707     = bless {
1708     uri => $modURI,
1709     db => $self,
1710     for => <Q::ManakaiDOM:all>,
1711     forp => [],
1712     }, <ClassName::ManakaiDISModuleDefinition>;
1713     require Scalar::Util;
1714     Scalar::Util::weaken ($r->{db});
1715     }
1716    
1717     @Method:
1718     @@Name: getFor
1719     @@Description:
1720     @@@lang:en
1721     @@@@:
1722     Returns a <QUOTE::for> definition object.
1723     @@Param:
1724     @@@Name: forURI
1725     @@@Type: ForURI
1726     @@@Description:
1727     @@@@lang:en
1728     @@@@@:
1729     A <QUOTE::for> URI reference.
1730     @@@InCase:
1731     @@@@Value:
1732     @@@@@is-null:1
1733     @@@@Description:
1734     @@@@@lang:en
1735     @@@@@@:
1736     Defaulted to <Q::ManakaiDOM:all>.
1737     @@Return:
1738     @@@Type: ManakaiDISForDefinition
1739     @@@PerlDef:
1740     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
1741     if (defined $self->{forDef}->{$forURI}) {
1742     $r = $self->{forDef}->{$forURI};
1743     } else {
1744     $r = $self->{forDef}->{$forURI}
1745     = bless {
1746     uri => $forURI,
1747     isa => {<Q::ManakaiDOM:all> => true},
1748     revISA => {},
1749     db => $self,
1750     }, <ClassName::ManakaiDISForDefinition>;
1751     $self->{forDef}->{<Q::ManakaiDOM:all>}->{revISA}->{$forURI} = true;
1752     require Scalar::Util;
1753     Scalar::Util::weaken ($r->{db});
1754     }
1755    
1756     @Method:
1757     @@Name: getResource
1758     @@Description:
1759     @@@lang:en
1760     @@@@:
1761     Returns a <QUOTE::dis> resource definition.
1762     @@Param:
1763     @@@Name: resURI
1764     @@@Type: ResourceURI
1765     @@@Description:
1766     @@@@lang:en
1767     @@@@@:
1768     A <QUOTE::dis> resource URI reference.
1769 wakaba 1.3 @@@nullCase:
1770 wakaba 1.2 @@@@Description:
1771     @@@@@lang:en
1772     @@@@@@:
1773     Defaulted to <Q::DOMMain:any>.
1774     @@Return:
1775     @@@Type: ManakaiDISResourceDefinition
1776     @@@Description:
1777     @@@@lang:en
1778     @@@@@:
1779     The resource definition.
1780     @@@PerlDef:
1781     $resURI = <Q::DOMMain:any> unless defined $resURI;
1782     if (defined $self->{resDef}->{$resURI}) {
1783     $r = $self->{resDef}->{$resURI};
1784     } else {
1785     $r = $self->{resDef}->{$resURI}
1786     = bless {
1787     uri => $resURI,
1788 wakaba 1.6 aliasURI => {$resURI => true},
1789 wakaba 1.2 subOf => {},
1790     supOf => {},
1791     db => $self,
1792     for => <Q::ManakaiDOM:all>,
1793     forp => [],
1794     }, <ClassName::ManakaiDISResourceDefinition>;
1795     require Scalar::Util;
1796     Scalar::Util::weaken ($r->{db});
1797     }
1798 wakaba 1.3
1799     @Method:
1800     @@Name: getSourceFile
1801     @@enDesc:
1802     Gets <QUOTE::dis> source document.
1803     @@Param:
1804     @@@Name: fileName
1805     @@@Type: FileURI
1806     @@@enDesc:
1807     A URI reference identifying a file.
1808     @@Return:
1809     @@@Type: ManakaiDISDocument
1810     @@@enDesc:
1811     The <QUOTE::dis> source document.
1812     @@@nullCase:
1813     @@@@enDesc:
1814     No document associated with that <P::fileName>.
1815     @@@PerlDef:
1816     $r = $self->{<Q::sourceFile>}->{$fileName};
1817     @Method:
1818     @@Name: setSourceFile
1819     @@enDesc:
1820     Puts <QUOTE::dis> source document object.
1821     @@Param:
1822     @@@Name: fileName
1823     @@@Type: FileURI
1824     @@@enDesc:
1825 wakaba 1.4 A URI reference identifying a file. If there is already a
1826 wakaba 1.3 source document, then the association has been updated.
1827     @@Param:
1828     @@@Name: doc
1829     @@@Type: ManakaiDISDocument
1830     @@@enDesc:
1831     The document object to set.
1832     @@Return:
1833     @@@PerlDef:
1834     $self->{<Q::sourceFile>}->{$fileName} = $doc;
1835 wakaba 1.4
1836     @Method:
1837     @@Name: loadModule
1838     @@enDesc:
1839     Loads definitions from a <QUOTE::dis> document.
1840     @@Param:
1841     @@@Name: doc
1842     @@@Type:ManakaiDISDocument
1843     @@@enDesc:
1844     The source <QUOTE::dis> document object. Its
1845     <A::ManakaiDISDocument.disDatabase> must be this database.
1846     @@Param:
1847     @@@Name: resolver
1848     @@@Type: DISModuleResolver
1849     @@@enDesc:
1850     The resolver to convert module name into <QUOTE::dis> document object.
1851     @@ForParam:
1852     @@Return:
1853     @@@RaiseException:
1854     @@@@@: NO_MODULE_QNAME_ERR
1855     @@@@enDesc:
1856     The <Q::dis:Module> element must have a <Q::dis:QName> attribute.
1857     @@@RaiseException:
1858     @@@@@: UNABLE_TO_GET_MODULE_ERR
1859     @@@@enDesc:
1860     The implementation is unable to get a module source.
1861 wakaba 1.5 @@@ForDefDupException:
1862     @@@ForDefNoQNameException:
1863     @@@ResDefDupException:
1864     @@@ElementNotAllowedException:
1865 wakaba 1.7 @@@RaiseException:
1866     @@@@@:NO_REQUIRED_ATTR_ERR
1867     @@@@enDesc:
1868     The <Q::dis:Module> element does not have
1869     <Q::dis:Namespace> attribute.
1870 wakaba 1.4 @@@PerlDef:
1871     $resolver = bless $resolver, <ClassName::ManakaiDISModuleResolver>
1872     if ref $resolver eq 'CODE';
1873     ## -- Module Name, URI
1874     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
1875     my $mod_node;
1876     my $mod_name_node;
1877     __DEEP{
1878     $mod_node = $doc-><AG::ManakaiDISDocument.moduleElement>;
1879     $mod_name_node = $mod_node-><M::swcfg21:SWCFGNode
1880     ::swcfg21:ForLatest.getAttributeNS>
1881     (<Q::dis:>, 'QName');
1882     unless ($mod_name_node) {
1883     __UNDEEP{
1884     __EXCEPTION{NO_MODULE_QNAME_ERR::
1885     DIS:sourceNode => {$mod_node},
1886     }__;
1887     }__;
1888     }
1889     my $mod_uri;
1890 wakaba 1.5 my $mod_name_uri = $mod_name_node
1891     -><AG::ManakaiDISElement.qnameValueURI>;
1892 wakaba 1.4 __CODE{tfurisToURI:: $turi => $mod_name_uri, $furi => $forArg,
1893     $uri => $mod_uri}__;
1894 wakaba 1.5 my $mod = $self-><M::ManakaiDISDatabase.getModule> ($mod_uri);
1895 wakaba 1.4
1896     unless ($mod-><M::ManakaiDISModuleDefinition.isDefined>) {
1897     ## -- Initializes Module Definition Object
1898     $mod->{nameURI} = $mod_name_uri;
1899     $mod->{localName} = $mod_name_node-><AG::ManakaiDISElement
1900     .qnameValueLocalName>;
1901     $mod->{namespaceURI} = $mod_name_node-><AG::ManakaiDISElement
1902     .qnameValueNamespaceURI>;
1903     $mod->{for} = $forArg;
1904     $mod->{src} = $mod_node;
1905 wakaba 1.5 $mod->{<Q::isDefined>} = true;
1906 wakaba 1.4 $self-><M::ManakaiDISDatabase.setSourceFile>
1907 wakaba 1.5 ($mod->{nameURI} => $doc);
1908    
1909    
1910     ## -- Loads "for all"
1911     my $nuri = $mod->{nameURI};
1912     my $forall = <Q::ManakaiDOM:all>;
1913     my $uri;
1914     __CODE{tfurisToURI:: $turi => $nuri, $furi => $forall,
1915     $uri => $uri}__;
1916     my $rmod = $self-><M::ManakaiDISDatabase.getModule> ($uri);
1917     unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
1918     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
1919     ($self, $uri, $mod->{namespaceURI},
1920     $mod->{localName}, $forall);
1921     unless ($rdoc) {
1922     __UNDEEP{
1923     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
1924     DIS:uri => {$uri},
1925     DIS:namespaceURI => {$mod->{namespaceURI}},
1926     DIS:localName => {$mod->{localName}},
1927     DIS:for => {$forall},
1928     DIS:sourceNode => {$mod->{src}},
1929     }__;
1930     }__;
1931     }
1932     $self-><M::ManakaiDISDatabase.loadModule>
1933     ($rdoc, $resolver, for_arg => $forall);
1934     } # Unless "for all" loaded
1935 wakaba 1.4
1936     ## -- Loads Required Modules
1937     my $req_node = $mod_node-><AG::ManakaiDISModuleElement
1938     .requireElement>;
1939     for my $rm (@{$req_node-><M::ManakaiDISElement.disChildElements>}) {
1940     next unless $rm-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1941     .expandedURI> eq <Q::dis:Module>;
1942     my ($uri, $nuri, $ln, $for);
1943     my $mqn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1944     .getAttributeNS> (<Q::dis:>, 'QName');
1945     if ($mqn) {
1946     my $mqv = $mqn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1947     .value>;
1948     my $mqp = $mqn-><AG::ManakaiDISElement.qnameToPair>
1949     ($mqv, node => $mqn);
1950     ($nuri, $ln) = @$mqp;
1951     } else {
1952     my $mn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1953     .getAttributeNS> (<Q::dis:>, 'Name');
1954     if ($mn) {
1955     $nuri = $mod->{namespaceURI};
1956     $ln = $mn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1957     } else {
1958     $nuri = $mod->{namespaceURI};
1959     $ln = $mod->{localName};
1960     }
1961     }
1962     my $wfn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1963     .getAttributeNS> (<Q::dis:>, 'WithFor');
1964     if ($wfn) {
1965     $for = $wfn-><AG::ManakaiDISElement.qnameValueURI>;
1966     } else {
1967     $for = $mod->{for};
1968     }
1969     my $xuri = $nuri . $ln;
1970     __CODE{tfurisToURI:: $turi => $xuri, $furi => $for,
1971     $uri => $uri}__;
1972     my $rmod = $self-><M::ManakaiDISDatabase.getModule> ($uri);
1973     unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
1974     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
1975     ($self, $uri, $nuri, $ln, $for);
1976     unless ($rdoc) {
1977     __UNDEEP{
1978     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
1979     DIS:uri => {$uri},
1980     DIS:namespaceURI => {$nuri},
1981     DIS:localName => {$ln},
1982     DIS:for => {$for},
1983     DIS:sourceNode => {$rm},
1984     }__;
1985     }__;
1986     }
1987     $self-><M::ManakaiDISDatabase.loadModule>
1988     ($rdoc, $resolver, for_arg => $for);
1989     }
1990     } # Child Module elements
1991    
1992 wakaba 1.5 my $root_elements = $doc-><M::ManakaiDISDocument.disChildElements>;
1993     if ($mod->{for} eq <Q::ManakaiDOM:all>) {
1994     ## -- Loads "for" definitions
1995     for my $el (@$root_elements) {
1996     next unless $el-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
1997     .expandedURI> eq <Q::dis:ForDef>;
1998     $self-><M::ManakaiDISDatabase.loadFor> ($mod, $el);
1999     }
2000     }
2001    
2002     for my $el (@$root_elements) {
2003 wakaba 1.7 if ($el-><M::ManakaiDISElement.isResourceElement>) {
2004     $self-><M::ManakaiDISDatabase.loadResource>
2005     ($mod, null, $mod, $el,
2006     for_arg => $forArg);
2007     } else {
2008     my $et = $el-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
2009     .expandedURI>;
2010     if ({
2011 wakaba 1.5 <Q::dis:ForDef> => 1,
2012     <Q::dis:Module> => 1,
2013     <Q::dis:ImplNote> => 1,
2014 wakaba 1.7 }->{$et}) {
2015     #
2016     } else {
2017     __UNDEEP{
2018     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2019     DIS:elementType => {$et},
2020     DIS:sourceNode => {$el},
2021     DIS:uri => {$mod->{uri}},
2022     }__;
2023 wakaba 1.5 }__;
2024 wakaba 1.7 }
2025     } # element types
2026     }
2027    
2028     my $dn = $mod_node-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
2029     .getAttributeNS>
2030     (<Q::dis:>, 'Namespace');
2031     unless ($dn and defined $dn-><AG::swcfg21:SWCFGNode
2032     ::swcfg21:ForLatest.value>) {
2033     __UNDEEP{
2034     __EXCEPTION{NO_REQUIRED_ATTR_ERR::
2035     DIS:elementType => {<Q::dis:Namespace>},
2036     DIS:sourceNode => {$mod_node},
2037 wakaba 1.5 }__;
2038 wakaba 1.7 }__;
2039 wakaba 1.5 }
2040     } # Unless this module loaded
2041     }__; # Deep
2042    
2043     @Method:
2044     @@Name: loadFor
2045     @@enDesc:
2046     Loads definition of a <QUOTE::for> from a <Q::dis:ForDef> element.
2047     @@Param:
2048     @@@Name: mod
2049     @@@Type: ManakaiDISModuleDefinition
2050     @@@enDesc:
2051     The module in which the <QUOTE::for> to load is defined.
2052     @@Param:
2053     @@@Name: el
2054     @@@Type:ManakaiDISElement
2055     @@@enDesc:
2056     The source <QUOTE::dis> <Q::dis:ForDef> element object.
2057     @@Return:
2058     @@@ForDefDupException:
2059     @@@ForDefNoQNameException:
2060     @@@ElementNotAllowedException:
2061     @@@PerlDef:
2062     __DEEP{
2063     my $qn_node = $el-><M::swcfg21:SWCFGNode
2064     ::swcfg21:ForLatest.getAttributeNS>
2065     (<Q::dis:>, 'QName');
2066     unless ($qn_node) {
2067     __UNDEEP{
2068     __EXCEPTION{NO_FOR_QNAME_ERR::
2069     DIS:sourceNode => {$qn_node},
2070     }__;
2071     }__;
2072     }
2073     my $qn_uri = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
2074     my $for = $self-><M::ManakaiDISDatabase.getFor> ($qn_uri);
2075    
2076     unless ($for-><M::ManakaiDISForDefinition.isDefined>) {
2077     ## -- Initializes For Definition Object
2078     $for->{src} = $el;
2079     $for->{<Q::isDefined>} = true;
2080     $for->{<Q::definingModule>} = $mod->{uri};
2081    
2082     for my $ce (@{$el-><M::ManakaiDISElement.disChildElements>}) {
2083     my $xn = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
2084     .expandedURI>;
2085     if ($xn eq <Q::dis:ISA> or $xn eq <Q::dis:Implement>) {
2086     my $sfor = $self-><M::ManakaiDISDatabase.getFor>
2087 wakaba 1.7 ($ce-><AG::ManakaiDISElement.qnameValueURI>);
2088 wakaba 1.5 $for-><M::ManakaiDISForDefinition.addISA> ($sfor);
2089 wakaba 1.7 $sfor-><M::ManakaiDISForDefinition.isReferred> ($ce);
2090 wakaba 1.5 ## TODO: warn if dis:Implement
2091     } elsif ({
2092     <Q::dis:Description> => 1,
2093     <Q::dis:ImplNote> => 1,
2094     <Q::dis:FullName> => 1,
2095     <Q::dis:QName> => 1,
2096     }->{$xn}) {
2097     #
2098     } else {
2099     __UNDEEP{
2100     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2101     DIS:elementType => {$xn},
2102     DIS:sourceNode => {$ce},
2103     DIS:uri => {$mod->{uri}},
2104     }__;
2105     }__;
2106     }
2107     }
2108     } else {
2109     __UNDEEP{
2110     __EXCEPTION{FOR_ALREADY_DEFINED_ERR::
2111     DIS:sourceNode => {$el},
2112     DIS:anotherSourceNode => {$for->{src}},
2113     }__;
2114     }__;
2115     } # isDefine?
2116     }__; # DEEP
2117    
2118     @Method:
2119     @@Name: loadResource
2120     @@enDesc:
2121     Loads definition of a <QUOTE::dis> resource from a
2122     <Q::dis:ResourceDef> element.
2123     @@Param:
2124     @@@Name: mod
2125     @@@Type: ManakaiDISModuleDefinition
2126     @@@enDesc:
2127     The module in which the resource to load is defined.
2128     @@Param:
2129     @@@Name: parentResource
2130     @@@Type: ManakaiDISResourceDefinition
2131     @@@enDesc:
2132 wakaba 1.7 The (static) parent resource in which the resource to load is defined.
2133 wakaba 1.5 @@@nullCase:
2134     @@@@enDesc:
2135     The resource to load is a root resource, i.e. <P::el> is
2136     a direct child of the document node.
2137     @@Param:
2138 wakaba 1.7 @@@Name: dynParent
2139     @@@Type:
2140     DOMMain:Object
2141     @@@enDesc:
2142     The dynamic parent resource of the resource to load.
2143     @@@InCase:
2144     @@@@Type: ManakaiDISResourceDefinition
2145     @@@@enDesc:
2146     If this resource is one of representations of
2147     <Q::dis:MultileResource>, then <P::dynParent> is that <QUOTE::multiple>
2148     resource definition. Otherwise, same as <P::parentResource>.
2149     @@@InCase:
2150     @@@@Type: ManakaiDISModuleDefinition
2151     @@@@enDesc:
2152     If this resource is a root resource, then <P::dynParent> is
2153     the module in which the resource is defined, i.e. same
2154     as <P::mod>.
2155     @@Param:
2156 wakaba 1.5 @@@Name: el
2157     @@@Type:ManakaiDISElement
2158     @@@enDesc:
2159     The source <QUOTE::dis> <Q::dis:ResourceDef> element object.
2160     @@ForParam:
2161     @@ForpParam:
2162     @@Return:
2163     @@@ResDefDupException:
2164     @@@ElementNotAllowedException:
2165     @@@PerlDef:
2166     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
2167     $forpArg ||= [];
2168     __DEEP{
2169 wakaba 1.6 ## -- Node names
2170    
2171     ## Unique resource identifier generated from node id
2172     my $node_id = $el-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.nodeID>;
2173     my $node_uri;
2174     __CODE{tfpurisToURI:: $turi => $node_id, $furi => $forArg,
2175     $forp => $forpArg, $uri => $node_uri}__;
2176    
2177     ## User defined resource identifiers
2178 wakaba 1.5 my $qn_node = $el-><M::ManakaiDISElement.disGetAttribute>
2179     (<Q::dis:QName>, for_arg => $forArg,
2180     forp_arg => $forpArg);
2181     my $res;
2182     if ($qn_node) {
2183     my $qn_uri = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
2184 wakaba 1.4 my $uri;
2185 wakaba 1.5 __CODE{tfurisToURI:: $turi => $qn_uri, $furi => $forArg,
2186 wakaba 1.4 $uri => $uri}__;
2187 wakaba 1.5 $res = $self-><M::ManakaiDISDatabase.getResource> ($uri);
2188     if ($res-><M::ManakaiDISForDefinition.isDefined>) {
2189     __UNDEEP{
2190     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2191     DIS:uri => {$uri},
2192     DIS:sourceNode => {$qn_node},
2193     DIS:anotherSourceNode => {$res->{src}},
2194     }__;
2195 wakaba 1.6 }__;
2196 wakaba 1.5 }
2197     $res->{nameURI} = $qn_uri;
2198     $res->{localName} = $qn_node-><AG::ManakaiDISElement
2199     .qnameValueLocalName>;
2200     $res->{namespaceURI} = $qn_node-><AG::ManakaiDISElement
2201     .qnameValueNamespaceURI>;
2202     } else { ## Anonymous or local
2203     my $n_node = $el-><M::ManakaiDISElement.disGetAttribute>
2204     (<Q::dis:Name>, for_arg => $forArg,
2205     forp_arg => $forpArg);
2206     if ($n_node) {
2207     if ($parentResource) {
2208     my $puri = $parentResource->{uri};
2209     my $ru;
2210     my $ln = $res->{localName};
2211     __CODE{getChildResourceURI:: $parentURI => $puri,
2212     $localName => $ln,
2213     $result => $ru}__;
2214     my $uri;
2215     __CODE{tfurisToURI:: $turi => $ru, $furi => $forArg,
2216     $uri => $uri}__;
2217     $res = $self-><M::ManakaiDISDatabase.getResource> ($uri);
2218     $res->{nameURI} = $ru;
2219 wakaba 1.6 $res->{localName} = $n_node-><AG::swcfg21:SWCFGNode
2220     ::swcfg21:ForLatest.value>;
2221 wakaba 1.5 $res->{<Q::isAnon>} = true;
2222 wakaba 1.6 $res->{aliasURI}->{$node_uri} = true;
2223     $self->{resDef}->{$node_uri} = $res;
2224 wakaba 1.5 } else { ## Root local name resource
2225 wakaba 1.7 my $ln = $n_node-><AG::swcfg21:SWCFGNode
2226     ::swcfg21:ForLatest.value>;
2227     my $ns_uri = $mod-><M::ManakaiDISPropertyAccessor
2228     .getPropertyText>
2229     (<Q::dis:Namespace>, null);
2230     my $qn_uri = $ns_uri . $ln;
2231 wakaba 1.6 my $uri;
2232     __CODE{tfurisToURI:: $turi => $qn_uri, $furi => $forArg,
2233     $uri => $uri}__;
2234     $res = $self-><M::ManakaiDISDatabase.getResource> ($uri);
2235     if ($res-><M::ManakaiDISForDefinition.isDefined>) {
2236     __UNDEEP{
2237     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2238     DIS:uri => {$uri},
2239     DIS:sourceNode => {$n_node},
2240     DIS:anotherSourceNode => {$res->{src}},
2241     }__;
2242     }__;
2243     }
2244     $res->{nameURI} = $qn_uri;
2245 wakaba 1.7 $res->{namespaceURI} = $ns_uri;
2246     $res->{localName} = $ln;
2247 wakaba 1.5 }
2248     } else {
2249 wakaba 1.6 $res = $self-><M::ManakaiDISDatabase.getResource> ($node_uri);
2250 wakaba 1.5 $res->{<Q::isAnon>} = true;
2251     }
2252 wakaba 1.6 } # anon
2253 wakaba 1.5 $res->{for} = $forArg;
2254     $res->{forp} = $forpArg;
2255     $res->{src} = $el;
2256     $res->{<Q::definingModule>} = $mod->{uri};
2257 wakaba 1.8 $res->{<Q::dis2pm:parentResource>}
2258     = $parentResource ? $parentResource->{uri} : null;
2259     $res->{<Q::dynamicParentResource>}
2260     = UNIVERSAL::isa ($dynParent,
2261     <ClassName::ManakaiDISResourceDefinition>)
2262     ? $dynParent->{uri} : null;
2263 wakaba 1.6 $res->{aliasURI}->{$node_uri} = true;
2264     $self->{resDef}->{$node_uri} = $res;
2265 wakaba 1.7 $res->{<Q::isDefined>} = true;
2266 wakaba 1.6
2267     ## -- Alias
2268     my $al_node = $el-><M::ManakaiDISElement.disGetAttribute>
2269     (<Q::dis:AliasFor>, for_arg => $forArg,
2270     forp_arg => $forpArg);
2271     if ($al_node) {
2272     my $canon_uri = $al_node-><M::ManakaiDISElement.tfqnamesValueURI>
2273     ($node_id, $forArg);
2274     my $canon_res = $self-><M::ManakaiDISDatabase.getResource>
2275     ($canon_uri);
2276     $canon_res-><M::ManakaiDISResourceDefinition.isReferred> ($al_node);
2277     $canon_res-><M::ManakaiDISResourceDefinition.mergeAsAlias> ($res);
2278     $res = $canon_res;
2279     }
2280 wakaba 1.5
2281 wakaba 1.7 my $is_multires = false;
2282     my @props;
2283     my @cres;
2284     my @ce0 = @{$el-><M::ManakaiDISElement.disChildElements>};
2285     while (@ce0) {
2286     my $ce = shift @ce0;
2287     if ($ce-><M::ManakaiDISElement.elementTypeMatch> (<Q::rdf:type>)) {
2288     my $type_uri = $ce-><AG::ManakaiDISElement.qnameValueURI>;
2289     $res->{<Q::rdf:type>}->{$type_uri} = true;
2290     my $type = $self-><M::ManakaiDISDatabase.getResource> ($type_uri);
2291     $type-><M::ManakaiDISResourceDefinition.isReferred> ($ce);
2292     if ($type-><M::ManakaiDISResourceDefinition.isSubsetOfURI>
2293     (<Q::dis:MultipleResource>)) {
2294     $is_multires = true;
2295     }
2296     } elsif ($ce-><M::ManakaiDISElement.elementTypeMatch>
2297     (<Q::dis:subsetOf>)) {
2298     my $sres = $self-><M::ManakaiDISDatabase.getResource>
2299     ($ce-><M::ManakaiDISElement.tfqnamesValueURI>
2300     ($node_id, $forArg));
2301     $res-><M::ManakaiDISResourceDefinition.addSuperResource> ($sres);
2302     } elsif ($ce-><M::ManakaiDISElement.isResourceElement>) {
2303     push @cres, $ce;
2304     } else {
2305     ## Property and invalid element is not checked, since not
2306     ## all property definitions has loaded at this stage.
2307     push @props, $ce;
2308     }
2309     } # @ce0
2310    
2311     ## -- Child resources
2312     unless ($is_multires) {
2313     for my $re (@cres) {
2314     unless ($al_node) {
2315     $self-><M::ManakaiDISDatabase.loadResource>
2316     ($mod, $res, $res, $re,
2317     for_arg => $forArg, forp_arg => $forpArg);
2318 wakaba 1.5 } else {
2319 wakaba 1.7 my $ac = $re-><M::ManakaiDISElement.disGetAttribute>
2320     (<Q::dis:aliasChild>, for_arg => $forArg,
2321     forp_arg => $forpArg);
2322     if ($ac and $ac-><M::swcfg21:SWCFGNode
2323     ::swcfg21:ForLatest.value>) {
2324     $self-><M::ManakaiDISDatabase.loadResource>
2325     ($mod, $res, $res, $re,
2326     for_arg => $forArg, forp_arg => $forpArg);
2327     }
2328 wakaba 1.4 }
2329     }
2330 wakaba 1.7 }
2331 wakaba 1.5
2332 wakaba 1.7 ## -- Multiple representations
2333     if ($is_multires) {
2334     for my $pe (@props) {
2335     if ($pe-><M::ManakaiDISElement.elementTypeMatch>
2336     (<Q::dis:ResourceFor>)) {
2337     my $for_uri = $pe-><M::ManakaiDISElement.qnameValueURI>;
2338     my $for = $self-><M::ManakaiDISDatabase.getFor> ($for_uri);
2339     $for-><M::ManakaiDISForDefinition.isReferred> ($pe);
2340     $self-><M::ManakaiDISDatabase.loadResource>
2341     ($mod, $parentResource, $res, $el,
2342     for_arg => $forArg,
2343     forp_arg => [@{$forpArg}, $for_uri]);
2344     }
2345     }
2346     }
2347 wakaba 1.5 }__; # DEEP
2348 wakaba 1.8
2349     @Method:
2350     @@Name: checkUndefinedResource
2351     @@enDesc:
2352     Checks whether there is referred but undefined resource or not.
2353     @@Return:
2354     @@@RaiseException:
2355     @@@@@: FOR_NOT_DEFINED_ERR
2356     @@@@enDesc:
2357     There is a <QUOTE::for> that is referred but not defined.
2358     @@@RaiseException:
2359     @@@@@: RESOURCE_NOT_DEFINED_ERR
2360     @@@@enDesc:
2361     There is a resource that is referred but not defined.
2362     @@@PerlDef:
2363     for my $fd (values %{$self->{forDef}}) {
2364     if (my $ref = $fd-><AG::ManakaiDISForDefinition.isReferred> and
2365     not $fd-><AG::ManakaiDISForDefinition.isDefined>) {
2366     __EXCEPTION{FOR_NOT_DEFINED_ERR::
2367     DIS:uri => {$fd->{uri}},
2368     DIS:sourceNode => {$ref},
2369     }__;
2370     }
2371     }
2372     for my $fd (values %{$self->{resDef}}) {
2373     if (my $ref = $fd-><AG::ManakaiDISResourceDefinition.isReferred> and
2374     not $fd-><AG::ManakaiDISResourceDefinition.isDefined>) {
2375     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2376     DIS:uri => {$fd->{uri}},
2377     DIS:sourceNode => {$ref},
2378     }__;
2379     }
2380     }
2381 wakaba 1.5
2382 wakaba 1.2 ##DISDatabase
2383    
2384 wakaba 1.8 PropDef:
2385     @QName:
2386     dis2pm:parentResource
2387     @enDesc:
2388     Static parent resource. No parent for root resources.
2389    
2390     PropDef:
2391     @QName: dynamicParentResource
2392     @enDesc:
2393     Dynamic parent resource. No parent for root resources.
2394    
2395 wakaba 1.5 ElementTypeBinding:
2396     @Name: ForDefDupException
2397     @ElementType:
2398     ManakaiDOM:raises
2399     @ShadowContent:
2400     @@@: FOR_ALREADY_DEFINED_ERR
2401     @@Description:
2402     @@@lang:en
2403     @@@@:
2404     The <QUOTE::for> is already defined elsewhere.
2405    
2406     ElementTypeBinding:
2407     @Name: ForDefNoQNameException
2408     @ElementType:
2409     ManakaiDOM:raises
2410     @ShadowContent:
2411     @@@: NO_FOR_QNAME_ERR
2412     @@Description:
2413     @@@lang:en
2414     @@@@:
2415     A <Q::dis:ForDef> element must have a <Q::dis:QName> attribute.
2416    
2417     ElementTypeBinding:
2418     @Name: ResDefDupException
2419     @ElementType:
2420     ManakaiDOM:raises
2421     @ShadowContent:
2422     @@@: RESOURCE_ALREADY_DEFINED_ERR
2423     @@Description:
2424     @@@lang:en
2425     @@@@:
2426     The <QUOTE::dis> resource is already defined elsewhere.
2427    
2428     ElementTypeBinding:
2429     @Name: ElementNotAllowedException
2430     @ElementType:
2431     ManakaiDOM:raises
2432     @ShadowContent:
2433     @@@: ELEMENT_NOT_ALLOWED_ERR
2434     @@Description:
2435     @@@lang:en
2436     @@@@:
2437     An element has found where it is not allowed.
2438    
2439 wakaba 1.4 IFClsDef:
2440     @QName:
2441     @@@: DISModuleResolver
2442     @@ForCheck: ForIF
2443     @QName:
2444     @@@: ManakaiDISModuleResolver
2445     @@ForCheck: ForClass
2446     @enDesc:
2447     Objects implementing <IF::DISModuleResolver> interface
2448     are used to convert module name into <QUOTE::dis> document object.
2449     \
2450     {NOTE:: It is also acceptable to pass a <Perl::CODE> reference
2451     as a method parameter where <IF::DISModuleResolver> is
2452     expected.
2453     \
2454     }
2455     @Method:
2456     @@Name: uriToDocument
2457     @@enDesc:
2458     Returns a <QUOTE::dis> document from module name information.
2459     @@Param:
2460     @@@Name: disDB
2461     @@@Type: ManakaiDISDatabase
2462     @@@enDesc:
2463     The <QUOTE::dis> database.
2464     @@Param:
2465     @@@Name: moduleURI
2466     @@@Type: ModuleURI
2467     @@@enDesc:
2468     The URI reference of the module.
2469     \
2470     {NOTE:: This parameter is redundant, since it can be
2471     composed from other three parameters.
2472     \
2473     }
2474     @@Param:
2475     @@@Name: moduleNamespaceURI
2476     @@@Type: AnyURI
2477     @@@enDesc:
2478     The namespace URI of the module name.
2479     @@Param:
2480     @@@Name: moduleLocalName
2481     @@@Type:
2482     DISCore:LocalName
2483     @@@enDesc:
2484     The local name of the module name.
2485     @@Param:
2486     @@@Name: moduleFor
2487     @@@Type: ForURI
2488     @@@enDesc:
2489     The <QUOTE::for> URI reference for which the module is defined.
2490     @@Return:
2491     @@@Type: ManakaiDISDocument
2492     @@@enDesc:
2493     The <QUOTE::dis> document. It don't have to be a newly created
2494     object.
2495     @@@nullCase:
2496     @@@@enDesc:
2497     The method is unable to resolve the reference.
2498     @@@PerlDef:
2499     $r = $self->(@_);
2500     @ManakaiDOM:inputNormalizer:
2501     @@ContentType:
2502     lang:Perl
2503     @@@:
2504     $INPUT = bless $INPUT, <ClassName::ManakaiDISModuleResolver>
2505     if ref $INPUT eq 'CODE';
2506     @@ImplNote:
2507     @@@lang:en
2508     @@@@:
2509     <FILE::cdis2pm.pl> does not support non-datatype input normalizers yet.
2510     ##DISModuleResolver
2511    
2512 wakaba 1.3 PropDef:
2513     @QName: sourceFile
2514     @enDesc:
2515     Source <QUOTE::dis> documents.
2516     @rdfs:domain: ManakaiDISDatabase
2517     @rdfs:range: ManakaiDISDocument
2518    
2519 wakaba 1.2 ClsDef:
2520     @ClsQName: ManakaiDISModuleDefinition
2521     @enDesc:
2522     <QUOTE::dis> module definitions.
2523     @ClsISA: ManakaiDISPropertyAccessor
2524 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2525 wakaba 1.2
2526     @Attr:
2527     @@Name: uri
2528     @@Type: ModuleURI
2529     @@Description:
2530     @@@lang:en
2531     @@@@:
2532     The URI reference of this <QUOTE::dis> module.
2533     @@Get:
2534     @@@PerlDef:
2535     $r = $self->{uri};
2536    
2537     @Attr:
2538     @@Name: nameURI
2539     @@Type: NameURI
2540     @@enDesc:
2541     The URI reference of this module, without
2542     <QUOTE::for> identifier.
2543     @@Get:
2544 wakaba 1.3 @@@PerlDef:
2545 wakaba 1.4 $r = $self->{nameURI};
2546 wakaba 1.2
2547     @Attr:
2548     @@Name: localName
2549     @@enDesc:
2550     The local name of this module.
2551     @@Type:
2552 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
2553 wakaba 1.2 @@Get:
2554     @@@PerlDef:
2555     $r = $self->{localName};
2556    
2557     @Attr:
2558     @@Name: namespaceURI
2559     @@Type: AnyURI
2560     @@enDesc:
2561     The namespace URI of the name of this resource.
2562     @@Get:
2563     @@@PerlDef:
2564     $r = $self->{namespaceURI};
2565    
2566     @Attr:
2567     @@Name: forURI
2568     @@Type: ForURI
2569     @@enDesc:
2570     The <QUOTE::for> URI reference for which this module is defined.
2571     @@Get:
2572     @@@PerlDef:
2573     $r = $self->{for};
2574    
2575     @Attr:
2576     @@Name: isDefined
2577     @@Description:
2578     @@@lang:en
2579     @@@@:
2580     Whether this module is defined or not.
2581     @@Type:
2582     DOMMain:boolean
2583     @@Get:
2584     @@@PerlDef:
2585     $r = $self->{<Q::isDefined>};
2586 wakaba 1.8
2587     @Attr:
2588     @@Name: plFullyQualifiedName
2589     @@enDesc:
2590     The fully-qualified Perl class package name.
2591     @@Type:
2592     Perl:package-name::ManakaiDOM:all
2593     @@Get:
2594     @@@NoPerlModuleNameException:
2595     @@@PerlDef:
2596     __DEEP{
2597     my $mg = $self->{db}-><M::ManakaiDISDatabase.getResource>
2598     ($self->{namespaceURI});
2599     unless ($self-><AG::ManakaiDISResourceDefinition.isDefined>) {
2600     __UNDEEP{
2601     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2602     DIS:uri => {$self->{namespaceURI}},
2603     DIS:sourceNode => {$self->{src}},
2604     }__;
2605     }__;
2606     }
2607     my $an = $mg->{src}-><M::ManakaiDISElement.disGetAttribute>
2608     (<Q::dis:AppName>, for_arg => $self->{for},
2609     media_type => <Q::lang:Perl>);
2610     if ($an) {
2611     $r = $an-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2612     $r =~ s/::$//g;
2613     $r .= '::' . $self->{localName};
2614     my $sf = $an-><M::ManakaiDISElement.disGetAttribute>
2615     (<Q::ManakaiDOM:moduleSuffix>,
2616     for_arg => $self->{for},
2617     media_type => <Q::lang:Perl>,
2618     default_media_type => <Q::lang:Perl>);
2619     if ($sf) {
2620     $r .= $sf-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2621     }
2622     } else {
2623     $r = $mg->{localName} . '::' . $self->{localName};
2624     }
2625     }__;
2626    
2627     @Attr:
2628     @@Name: plInterfaceName
2629     @@enDesc:
2630     The fully-qualified Perl interface package name.
2631     @@Type:
2632     Perl:package-name::ManakaiDOM:all
2633     @@Get:
2634     @@@NoPerlModuleNameException:
2635     @@@PerlDef:
2636     __DEEP{
2637     my $mg = $self->{db}-><M::ManakaiDISDatabase.getResource>
2638     ($self->{namespaceURI});
2639     unless ($self-><AG::ManakaiDISResourceDefinition.isDefined>) {
2640     __UNDEEP{
2641     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2642     DIS:uri => {$self->{namespaceURI}},
2643     DIS:sourceNode => {$self->{src}},
2644     }__;
2645     }__;
2646     }
2647     my $an = $mg->{src}-><M::ManakaiDISElement.disGetAttribute>
2648     (<Q::dis:AppName>, for_arg => $self->{for},
2649     forp_arg => [<Q::ManakaiDOM:ForIF>],
2650     media_type => <Q::lang:Perl>);
2651     if ($an) {
2652     $r = $an-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2653     $r =~ s/::$//g;
2654     $r .= '::' . $self->{localName};
2655     my $sf = $an-><M::ManakaiDISElement.disGetAttribute>
2656     (<Q::ManakaiDOM:moduleSuffix>,
2657     for_arg => $self->{for},
2658     forp_arg => [<Q::ManakaiDOM:ForIF>],
2659     media_type => <Q::lang:Perl>,
2660     default_media_type => <Q::lang:Perl>);
2661     if ($sf) {
2662     $r .= $sf-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2663     }
2664     } else {
2665     $r = $self-><M::ManakaiDISModuleDefinition.plFullyQualifiedName>;
2666     }
2667     }__;
2668 wakaba 1.2 ##DISModuleDefinition
2669    
2670 wakaba 1.8 ElementTypeBinding:
2671     @Name: NoPerlModuleNameException
2672     @ElementType:
2673     ManakaiDOM:raises
2674     @ShadowContent:
2675     @@@: RESOURCE_NOT_DEFINED_ERR
2676     @@Description:
2677     @@@lang:en
2678     @@@@:
2679     The module group corresponding to the namespace URI
2680     of this module is not defined.
2681    
2682 wakaba 1.2 ClsDef:
2683     @ClsQName: ManakaiDISForDefinition
2684     @Description:
2685     @@lang:en
2686     @@@:
2687     <QUOTE::dis> <QUOTE::for> definitions.
2688 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2689 wakaba 1.2
2690     @Attr:
2691     @@Name: uri
2692     @@Type: ForURI
2693     @@Description:
2694     @@@lang:en
2695     @@@@:
2696     The URI reference of this <QUOTE::for>.
2697     @@Get:
2698     @@@PerlDef:
2699     $r = $self->{uri};
2700    
2701     @Method:
2702     @@Name: isaURI
2703     @@Description:
2704     @@@lang:en
2705     @@@@:
2706     Whether this <QUOTE::for> is-a another <QUOTE::for> or not.
2707     @@Param:
2708     @@@Name: superURI
2709     @@@Type: ForURI
2710     @@@Description:
2711     @@@@lang:en
2712     @@@@@:
2713     Another <QUOTE::for> URI reference to test.
2714     @@Return:
2715     @@@Type:
2716     DOMMain:boolean
2717     @@@TrueCase:
2718     @@@@enDesc:
2719     <P::superURI> is a super-<QUOTE::for> of this <QUOTE::for>.
2720     @@@FalseCase:
2721     @@@@enDesc:
2722     <P::superURI> is not a super-<QUOTE::for> of this <QUOTE::for>.
2723     @@@PerlDef:
2724     $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI};
2725    
2726     @Attr:
2727     @@Name: isDefined
2728     @@Description:
2729     @@@lang:en
2730     @@@@:
2731     Whether this <QUOTE::for> is already defined or not.
2732     @@Type:
2733     DOMMain:boolean
2734     @@Get:
2735     @@@TrueCase:
2736     This <QUOTE::for> is already defined.
2737     @@@FalseCase:
2738     This <QUOTE::for> is not defined.
2739     @@@PerlDef:
2740     $r = $self->{<Q::isDefined>};
2741    
2742     @Attr:
2743     @@Name: isReferred
2744     @@Description:
2745     @@@lang:en
2746     @@@@:
2747     Whether this <QUOTE::for> is referred somewhere or not.
2748     @@Type:
2749     DOMMain:any
2750     @@Get:
2751     @@@InCase:
2752     @@@@Type:ManakaiDISElement
2753     @@@@enDesc:
2754     This <QUOTE::for> is referred by the element.
2755     @@@nullCase:
2756     This <QUOTE::for> is not referred.
2757     @@@PerlDef:
2758     $r = $self->{<Q::isReferred>};
2759     @@Set:
2760     @@@InCase:
2761     @@@@Type:ManakaiDISElement
2762     @@@@enDesc:
2763     This <QUOTE::for> is referred by the element.
2764     @@@PerlDef:
2765     $self->{<Q::isReferred>} = true if $given;
2766    
2767     @Attr:
2768     @@Name: definingModule
2769     @@Description:
2770     @@@lang:en
2771     @@@@:
2772     The <QUOTE::dis> module in which this <QUOTE::for> is defined.
2773     @@Type: ManakaiDISModuleDefinition
2774     @@Get:
2775     @@@Description:
2776     @@@@lang:en
2777     @@@@@:
2778     The module object.
2779 wakaba 1.3 @@@nullCase:
2780 wakaba 1.2 @@@@Description:
2781     @@@@@lang:en
2782     @@@@@@:
2783     This <QUOTE::for> is not associated to any module.
2784     @@@PerlDef:
2785     $r = $self->{db}
2786     -><M::ManakaiDISDatabase.getResource>
2787     ($self->{<Q::definingModule>})
2788     if defined $self->{<Q::definingModule>};
2789 wakaba 1.5
2790 wakaba 1.2 @Method:
2791 wakaba 1.5 @@Name: addISA
2792 wakaba 1.2 @@enDesc:
2793 wakaba 1.5 Adds a <QUOTE::for> to the list of super-<QUOTE::for> of this
2794     <QUOTE::for>.
2795 wakaba 1.2 @@Param:
2796 wakaba 1.5 @@@Name: superFor
2797     @@@Type: ManakaiDISForDefinition
2798     @@@enDesc:
2799     A <QUOTE::for> definition object.
2800 wakaba 1.2 @@Return:
2801     @@@PerlDef:
2802 wakaba 1.5 my @from = ($self->{uri},
2803     grep {$self->{revISA}->{$_}} keys %{$self->{revISA}});
2804     my @to = ($superFor->{uri},
2805     grep {$superFor->{isa}->{$_}} keys %{$superFor->{isa}});
2806 wakaba 1.7 __DEEP{
2807     for my $from (@from) {
2808     for my $to (@to) {
2809     $self->{db}-><M::ManakaiDISDatabase.getFor>
2810     ($from)->{isa}->{$to} = true;
2811     $self->{db}-><M::ManakaiDISDatabase.getFor>
2812     ($to)->{revISA}->{$from} = true;
2813     }
2814 wakaba 1.5 }
2815 wakaba 1.7 }__;
2816 wakaba 1.5
2817 wakaba 1.2 ##DISForDefinition
2818    
2819     ClsDef:
2820     @ClsQName: ManakaiDISResourceDefinition
2821     @enDesc:
2822     <QUOTE::dis> resource definitions.
2823     @ClsISA: ManakaiDISPropertyAccessor
2824 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2825 wakaba 1.2
2826     @Attr:
2827     @@Name: uri
2828     @@Type: ResourceURI
2829     @@Description:
2830     @@@lang:en
2831     @@@@:
2832     The URI reference of this <QUOTE::dis> resource.
2833     @@Get:
2834     @@@PerlDef:
2835     $r = $self->{uri};
2836    
2837     @Attr:
2838     @@Name: nameURI
2839     @@Type: NameURI
2840     @@enDesc:
2841     The URI reference of this <QUOTE::dis> resource, without
2842     <QUOTE::for> identifier.
2843     @@Get:
2844     @@@nullCase:
2845     @@@@enDesc:
2846     This resource does not have its name URI reference.
2847 wakaba 1.3 @@@PerlDef:
2848 wakaba 1.4 $r = $self->{nameURI};
2849 wakaba 1.2
2850     @Attr:
2851     @@Name: localName
2852     @@enDesc:
2853     The local name of this resource.
2854     @@Type:
2855 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
2856 wakaba 1.2 @@Get:
2857     @@@nullCase:
2858     @@@@enDesc:
2859     This resource does not have its local name.
2860     @@@PerlDef:
2861     $r = $self->{localName};
2862    
2863     @Attr:
2864     @@Name: namespaceURI
2865     @@Type: AnyURI
2866     @@enDesc:
2867     The namespace URI of the name of this resource.
2868     @@Get:
2869     @@@nullCase:
2870     The name of this resource does not have its namespace
2871     or this resource does not have its name.
2872     @@@PerlDef:
2873     $r = $self->{namespaceURI};
2874    
2875     @Attr:
2876     @@Name: isAnonymous
2877     @@enDesc:
2878     Whether this <QUOTE::dis> resource has name or not.
2879     @@Type:
2880     DOMMain:boolean
2881     @@Get:
2882     @@@TrueCase:
2883     This resource does not have any global unique name.
2884     <A::ManakaiDISResourceDefinition.uri> is a temporary URI reference.
2885     @@@FalseCase:
2886     This resource does have its formal name.
2887     <A::ManakaiDISResourceDefinition.uri> is a URI reference
2888     generated from the name and the <QUOTE::for> URI reference
2889     of this resource.
2890     @@@PerlDef:
2891     $r = $self->{<Q::isAnon>};
2892    
2893     @Attr:
2894     @@Name: forURI
2895     @@enDesc:
2896     The <QUOTE::for> URI reference for which this resource is defined.
2897     @@Type:ForURI
2898     @@Get:
2899     @@@PerlDef:
2900     $r = $self->{for};
2901    
2902     @Attr:
2903     @@Name: forpURI
2904     @@enDesc:
2905     The <QUOTE::for+> URI references for which this resource is defined.
2906     @@Type: ForURIList
2907     @@Get:
2908 wakaba 1.3 @@@PerlDef:
2909 wakaba 1.2 $r = $self->{forp};
2910    
2911     @Method:
2912 wakaba 1.7 @@Name: isSubsetOfURI
2913 wakaba 1.2 @@Description:
2914     @@@lang:en
2915     @@@@:
2916     Whether this resource is a subset of another resource or not.
2917     @@Param:
2918     @@@Name: superURI
2919     @@@Type: ResourceURI
2920     @@@Description:
2921     @@@@lang:en
2922     @@@@@:
2923     Another resource URI reference to test.
2924     @@Return:
2925     @@@Type:
2926     DOMMain:boolean
2927     @@@TrueCase:
2928     @@@@enDesc:
2929     <P::superURI> is a super-resource of this resource.
2930     @@@FalseCase:
2931     @@@@enDesc:
2932     <P::superURI> is not a super-resource of this resource.
2933     @@@PerlDef:
2934 wakaba 1.6 $r = $self->{aliasURI}->{$superURI} || $self->{subOf}->{$superURI};
2935 wakaba 1.2
2936 wakaba 1.7 @Method:
2937     @@Name: addSuperResource
2938     @@enDesc:
2939     Adds a <QUOTE::dis> resource to the list of super-resource
2940     of this <QUOTE::dis> resource.
2941     @@Param:
2942     @@@Name: superRes
2943     @@@Type: ManakaiDISResourceDefinition
2944     @@@enDesc:
2945     A <QUOTE::dis> resource definition object.
2946     @@Return:
2947     @@@PerlDef:
2948     my @from = ($self->{uri},
2949     grep {$self->{supOf}->{$_}} keys %{$self->{supOf}});
2950     my @to = ($superRes->{uri},
2951     grep {$superRes->{subOf}->{$_}} keys %{$superRes->{subOf}});
2952     __DEEP{
2953     for my $from (@from) {
2954     for my $to (@to) {
2955     $self->{db}-><M::ManakaiDISDatabase.getResource>
2956     ($from)->{subOf}->{$to} = true;
2957     $self->{db}-><M::ManakaiDISDatabase.getResource>
2958     ($to)->{supOf}->{$from} = true;
2959     }
2960     }
2961     }__;
2962    
2963 wakaba 1.2 @Attr:
2964     @@Name: isDefined
2965     @@Description:
2966     @@@lang:en
2967     @@@@:
2968     Whether this resource is already defined or not.
2969     @@Type:
2970     DOMMain:boolean
2971     @@Get:
2972     @@@TrueCase:
2973     This resource is already defined.
2974     @@@FalseCase:
2975     This resource is not defined.
2976     @@@PerlDef:
2977     $r = $self->{<Q::isDefined>};
2978    
2979     @Attr:
2980     @@Name: isReferred
2981     @@Description:
2982     @@@lang:en
2983     @@@@:
2984     Whether this resource is referred or not.
2985 wakaba 1.7 @@Type: ManakaiDISElement
2986 wakaba 1.2 @@Get:
2987 wakaba 1.7 @@@enDesc:
2988     This resource is referred by the element.
2989 wakaba 1.2 @@@nullCase:
2990     This resource is not referred.
2991     @@@PerlDef:
2992     $r = $self->{<Q::isReferred>};
2993     @@Set:
2994 wakaba 1.7 @@@enDesc:
2995     This resource is referred by this element.
2996 wakaba 1.2 @@@PerlDef:
2997 wakaba 1.7 $self->{<Q::isReferred>} = true if $given;
2998 wakaba 1.2
2999     @Attr:
3000     @@Name: definingModule
3001     @@Description:
3002     @@@lang:en
3003     @@@@:
3004     The <QUOTE::dis> module in which this resource is defined.
3005 wakaba 1.8 \
3006     {NOTE:: Method name should have been <CODE::ownerModule> or some.
3007     \
3008     }
3009 wakaba 1.2 @@Type: ManakaiDISModuleDefinition
3010     @@Get:
3011     @@@Description:
3012     @@@@lang:en
3013     @@@@@:
3014     The module object.
3015 wakaba 1.3 @@@nullCase:
3016 wakaba 1.2 @@@@Description:
3017     @@@@@lang:en
3018     @@@@@@:
3019     This resource is not associated to any module.
3020     @@@PerlDef:
3021     $r = $self->{db}
3022     -><M::ManakaiDISDatabase.getModule>
3023     ($self->{<Q::definingModule>})
3024     if defined $self->{<Q::definingModule>};
3025     @@Set:
3026     @@@Description:
3027     @@@@lang:en
3028     @@@@@:
3029     The module object to which the <QUOTE::defining module> is set.
3030     @@@PerlDef:
3031     $self->{<Q::defininingModule>}
3032     = $given-><AG::ManakaiDISModuleDefinition.uri>;
3033    
3034 wakaba 1.6 @Method:
3035     @@Name: mergeAsAlias
3036     @@enDesc:
3037     Merges another resource definition as an alias of this resource.
3038     @@Param:
3039     @@@Name: aliasResource
3040     @@@Type: ManakaiDISResourceDefinition
3041     @@@enDesc:
3042     A resource to merge.
3043     \
3044     {NOTE:: After merging all references to <P::aliasResource>
3045     should be discarded.
3046     \
3047     }
3048     @@Return:
3049     @@@PerlDef:
3050     for my $uri ($aliasResource->{uri},
3051     grep {$aliasResource->{aliasURI}->{$_}}
3052     keys %{$aliasResource->{aliasURI}}) {
3053     $self->{aliasURI}->{$uri} = true;
3054     $self->{db}->{resDef}->{$uri} = $self;
3055     $self->{subOf}->{$uri} = true;
3056     $self->{supOf}->{$uri} = true;
3057     }
3058     for my $uri (grep {$aliasResource->{subOf}->{$_}}
3059     keys %{$aliasResource->{subOf}}) {
3060     $self->{subOf}->{$uri} = true;
3061     }
3062     for my $uri (grep {$aliasResource->{supOf}->{$_}}
3063     keys %{$aliasResource->{supOf}}) {
3064     $self->{supOf}->{$uri} = true;
3065     }
3066     my @from = grep {$self->{supOf}->{$_}} keys %{$self->{supOf}};
3067     my @to = grep {$self->{subOf}->{$_}} keys %{$self->{subOf}};
3068     __DEEP{
3069     for my $from (@from) {
3070     for my $to (@to) {
3071     $self->{db}-><M::ManakaiDISDatabase.getResource>
3072     ($from)->{subOf}->{$to} = true;
3073     $self->{db}-><M::ManakaiDISDatabase.getResource>
3074     ($to)->{supOf}->{$from} = true;
3075     }
3076     }
3077     }__;
3078 wakaba 1.7
3079     @Method:
3080     @@Name: isTypeURI
3081     @@enDesc:
3082     Tests whether this resource is of a type or not.
3083     @@Param:
3084     @@@Name: typeURI
3085     @@@Type: ResourceURI
3086     @@@enDesc:
3087     A type URI reference to test.
3088     @@Return:
3089     @@@Type:
3090     DOMMain:boolean
3091     @@@TrueCase:
3092     @@@@enDesc:
3093     This is a <P::typeURI> resource.
3094     @@@FalseCase:
3095     @@@@enDesc:
3096     This is not a <P::typeURI> resource.
3097     @@@PerlDef:
3098 wakaba 1.8 if ($self->{<Q::rdf:type>}->{$typeURI}) {
3099     $r = $self->{<Q::rdf:type>}->{$typeURI};
3100     } else {
3101     for my $t_type_uri (grep {$self->{<Q::rdf:type>}->{$_}}
3102     keys %{$self->{<Q::rdf:type>}}) {
3103     my $t_type = $self->{db}-><M::ManakaiDISDatabase.getResource>
3104     ($t_type_uri);
3105     if ($t_type-><M::ManakaiDISResourceDefinition.isSubsetOfURI>
3106     ($typeURI)) {
3107     $self->{<Q::rdf:type>}->{$typeURI} = $r = true;
3108     last;
3109     }
3110 wakaba 1.7 }
3111     }
3112 wakaba 1.8
3113     @Attr:
3114     @@Name: plName
3115     @@enDesc:
3116     The Perl name of this resource.
3117     @@Get:
3118     @@@Type:
3119     DISLang:String
3120     @@@enDesc:
3121     - <Q::ManakaiDOM:Const>::: Constant function (local) name.
3122     \
3123     - <Q::ManakaiDOM:ConstGroup>::: Export group name (without
3124     <CHAR::COLON> prefix).
3125     \
3126     - <Q::DISLang:Attribute>::: Method name.
3127     \
3128     - <Q::DISLang:Method>::: Method name.
3129     @@@nullCase:
3130     @@@@enDesc:
3131     Either the type of this resource is not listed above
3132     or this Perl constructure is anonymous.
3133     @@@RaiseException:
3134     @@@@@: NO_LOCAL_NAME_ERR
3135     @@@@enDesc:
3136     The type of this resource is either
3137     <Q::ManakaiDOM:Const> or <Q::ManakaiDOM:ConstGroup> and
3138     the local name of this resource is not defined.
3139     @@@RaiseException:
3140     @@@@@: RESERVED_PERL_METHOD_NAME_ERR
3141     @@@@enDesc:
3142     The Perl method name constructed from the source
3143     result in a reserved name.
3144     @@@PerlDef:
3145     __DEEP{
3146     if (exists $self->{<Q::dis2pm:name>}) {
3147     $r = $self->{<Q::dis2pm:name>};
3148     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3149     (<Q::ManakaiDOM:Const>) or
3150     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3151     (<Q::ManakaiDOM:ConstGroup>)) {
3152     $r = $self->{localName};
3153     unless (defined $r) {
3154     __UNDEEP{
3155     __EXCEPTION{NO_LOCAL_NAME_ERR::
3156     DIS:sourceNode => {$self->{src}},
3157     }__;
3158     }__;
3159     }
3160     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3161     (<Q::DISLang:Method>) or
3162     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3163     (<Q::DISLang:Attribute>)) {
3164     if (defined $self->{localName}) {
3165     $r = <ClassM::ManakaiDISImplementation.camelCaseToUnderscoreName>
3166     ($self->{localName});
3167     if ($self-><M::ManakaiDISPropertyAccessor.getPropertyBoolean>
3168     (<Q::ManakaiDOM:isForInternal>, false)) {
3169     $r = '_' . $r;
3170     }
3171     if ({
3172     import => 1,
3173     unimport => 1,
3174     isa => 1,
3175     can => 1,
3176     new => 1,
3177     as_string => 1,
3178     stringify => 1,
3179     clone => 1,
3180     }->{$r} or $r =~ /^___/) {
3181     __UNDEEP{
3182     __EXCEPTION{RESERVED_PERL_METHOD_NAME_ERR::
3183     DIS:uri => {$self->{uri}},
3184     DIS:soruceNode => {$self->{src}},
3185     DIS:generatedName => {$r},
3186     }__;
3187     }__;
3188     } elsif (my $op_uri = $self-><AG::ManakaiDISResourceDefinition
3189     .plMethodOperator>) {
3190     $r = {
3191     <Q::ManakaiDOM:MUErrorHandler> => '___report_error',
3192     <Q::DISPerl:AsStringMethod> => 'as_string',
3193     <Q::DISPerl:AsNewMethod> => 'new',
3194     <Q::DISPerl:AsCloneMethod> => 'clone',
3195     }->{$op_uri};
3196     $r = $op_uri if $op_uri =~ /^[A-Z]+$/;
3197     }
3198     } else {
3199     $r = null;
3200     }
3201     } else {
3202     $r = null;
3203     }
3204     $self->{<Q::dis2pm:name>} = $r;
3205     }__;
3206    
3207     @Attr:
3208     @@Name: plFullyQualifiedName
3209     @@enDesc:
3210     The fully-qualified Perl name of this resource.
3211     @@Type:
3212     DISLang:String::ManakaiDOM:all
3213     @@Get:
3214     @@@enDesc:
3215     Fully-qualified name.
3216     \
3217     - <Q::ManakaiDOM:Class>::: Class package name.
3218     \
3219     - <Q::ManakaiDOM:IF>::: Interface package name.
3220     \
3221     - <Q::DISPerl:ScalarVariable>::: Variable name (without variable
3222     type symbol such as <CODE::$>).
3223     @@@nullCase:
3224     @@@@enDesc:
3225     Otherwise.
3226     @@@NoPerlModuleNameException:
3227     @@@RaiseException:
3228     @@@@@: NO_LOCAL_NAME_ERR
3229     @@@@enDesc:
3230     The local name of this resource is not defined.
3231     @@@PerlDef:
3232     __DEEP{
3233     if (exists $self->{<Q::dis2pm:name>}) {
3234     $r = $self->{<Q::dis2pm:name>};
3235     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3236     (<Q::ManakaiDOM:Class>) or
3237     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3238     (<Q::ManakaiDOM:IF>) or
3239     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3240     (<Q::DISPerl:ScalarVariable>)) {
3241     my $an_node = $self->{src}-><AG::ManakaiDISElement.disGetAttribute>
3242     (<Q::dis:AppName>, for_arg => $self->{for},
3243     forp_arg => $self->{forp},
3244     media_type => <Q::lang:Perl>);
3245     if ($an_node) {
3246     ## NOTE: "lang:Perl" is fully-qualified name by definition
3247     $r = $an_node-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3248     } else {
3249     if ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3250     (<Q::ManakaiDOM:IF>)) {
3251     $r = $self-><AG::ManakaiDISResourceDefinition.definingModule>
3252     -><M::ManakaiDISModuleDefinition.plInterfaceName>
3253     . '::' . $self->{localName};
3254     } else {
3255     $r = $self-><AG::ManakaiDISResourceDefinition.definingModule>
3256     -><M::ManakaiDISModuleDefinition.plFullyQualifiedName>
3257     . '::' . $self->{localName};
3258     }
3259     unless (defined $r) {
3260     __UNDEEP{
3261     __EXCEPTION{NO_LOCAL_NAME_ERR::
3262     DIS:sourceNode => {$self->{src}},
3263     }__;
3264     }__;
3265     }
3266     }
3267     } else {
3268     $r = null;
3269     }
3270     $self->{<Q::dis2pm:name>} = $r;
3271     }__;
3272    
3273     @Attr:
3274     @@Name: plMethodOperator
3275     @@enDesc:
3276     The operator to overload by this method.
3277     @@Type:
3278     DISLang:String::ManakaiDOM:all
3279     @@Get:
3280     @@@enDesc:
3281     The operator, either Perl <CODE::use operator> operator name
3282     of manakai operator URI reference.
3283     @@@nullCase:
3284     @@@@enDesc:
3285     Either this resource does not define a Perl method or
3286     this method does not overload any operator.
3287     @@@UndeclaredPrefixException:
3288     @@@RaiseException:
3289     @@@@@: UNSUPPORTED_MEDIA_TYPE_ERR
3290     @@@@enDesc:
3291     Media type of the <Q::dis:Operator> node is not supported.
3292     @@@PerlDef:
3293     __DEEP{
3294     if (exists $self->{<Q::dis:Operator>}) {
3295     $r = $self->{<Q::dis:Operator>};
3296     } else {
3297     my $op_node = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3298     (<Q::dis:Operator>, for_arg => $self->{for},
3299     forp_arg => $self->{forp});
3300     if ($op_node) {
3301     if ($op_node-><M::ManakaiDISElement.mediaTypeMatch>
3302     (<Q::lang:Perl>)) {
3303     $r = $op_node-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3304     } elsif ($op_node-><M::ManakaiDISElement.mediaTypeMatch>
3305     (<Q::dis:TypeQName>)) {
3306     $r = $op_node-><AG::ManakaiDISElement.qnameValueURI>;
3307     } else {
3308     my $ct = $op_node-><M::ManakaiDISElement.disGetAttribute>
3309     (<Q::dis:ContentType>, for_arg => $self->{for},
3310     forp_arg => $self->{forp});
3311     my $ct_uri = $ct-><AG::ManakaiDISElement.qnameValueURI> if $ct;
3312     __UNDEEP{
3313     __EXCEPTION{UNSUPPORTED_MEDIA_TYPE_ERR::
3314     DIS:uri => {$ct_uri},
3315     DIS:sourceNode => {$ct || $self->{src}},
3316     }__;
3317     }__;
3318     }
3319     } else {
3320     $r = null;
3321     }
3322     $self->{<Q::dis:Operator>} = $r;
3323     }
3324     }__;
3325    
3326     @Attr:
3327     @@Name: disDataTypeResource
3328     @@enDesc:
3329     <Q::dis:Type> attribute value of this resource.
3330     @@Type: ManakaiDISResourceDefinition
3331     @@Get:
3332     @@@RaiseException:
3333     @@@@@:NO_DIS_TYPE_ERR
3334     @@@@enDesc:
3335     <Q::dis:Type> attribute is not specified.
3336     @@@PerlDef:
3337     __DEEP{
3338     if (defined $self->{<Q::dis:Type>}) {
3339     $r = $self->{<Q::dis:Type>};
3340     } else {
3341     $self->{<Q::dis2pm:TypeNode>}
3342     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3343     (<Q::dis:Type>, for_arg => $self->{for},
3344     forp_arg => $self->{forp});
3345     if ($self->{<Q::dis2pm:TypeNode>}) {
3346     $r = $self->{<Q::dis:Type>}
3347     = $self->{<Q::dis2pm:TypeNode>}
3348     -><AG::ManakaiDISElement.qnameValueURI>;
3349     } else {
3350     my $pr = $self-><M::ManakaiDISPropertyAccessor
3351     .getPropertyResource>
3352     (<Q::DIS:dynamicParentResource>);
3353     if ($pr) {
3354     $r = $pr-><AG::ManakaiDISResourceDefinition
3355     .disDataTypeResource>;
3356     $self->{<Q::dis2pm:TypeNode>}
3357     = $pr->{<Q::dis2pm:TypeNode>};
3358     } else { ## No parent
3359     __UNDEEP{
3360     __EXCEPTION{NO_DIS_TYPE_ERR::
3361     DIS:sourceNode => {$self->{src}},
3362     }__;
3363     }__;
3364     }
3365     }
3366     }
3367     }__;
3368    
3369     @Attr:
3370     @@Name: disDataTypeNode
3371     @@enDesc:
3372     <Q::dis:Type> node for this resource.
3373     @@Get:
3374     @@@Type: ManakaiDISElement
3375     @@@RaiseException:
3376     @@@@@:NO_DIS_TYPE_ERR
3377     @@@@enDesc:
3378     <Q::dis:Type> attribute is not specified.
3379     @@@PerlDef:
3380     __DEEP{
3381     $self-><AG::ManakaiDISResourceDefinition.disDataTypeNode>;
3382     }__;
3383     $r = $self->{<Q::dis2pm:TypeNode>};
3384    
3385     @Attr:
3386     @@Name: disActualDataTypeResource
3387     @@enDesc:
3388     <Q::dis:actualType> attribute value of this resource.
3389     @@Type: ManakaiDISResourceDefinition
3390     @@Get:
3391     @@@RaiseException:
3392     @@@@@:NO_DIS_TYPE_ERR
3393     @@@@enDesc:
3394     <Q::dis:actualType> attribute is not specified,
3395     and <Q::dis:Type> attribute, neigher.
3396     @@@PerlDef:
3397     __DEEP{
3398     if (defined $self->{<Q::dis:actualType>}) {
3399     $r = $self->{<Q::dis:actualType>};
3400     } else {
3401     $self->{<Q::dis2pm:actualTypeNode>}
3402     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3403     (<Q::dis:actualType>, for_arg => $self->{for},
3404     forp_arg => $self->{forp});
3405     if ($self->{<Q::dis2pm:actualTypeNode>}) {
3406     $r = $self->{<Q::dis:actualType>}
3407     = $self->{<Q::dis2pm:actualTypeNode>}
3408     -><AG::ManakaiDISElement.qnameValueURI>;
3409     } elsif (defined $self->{<Q::dis:Type>}) {
3410     $r = $self->{<Q::dis:actualType>} = $self->{<Q::dis:Type>};
3411     $self->{<Q::dis2pm:actualTypeNode>}
3412     = $self->{<Q::dis2pm:TypeNode>};
3413     } else {
3414     $self->{<Q::dis2pm:actualTypeNode>}
3415     = $self->{<Q::dis2pm:TypeNode>}
3416     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3417     (<Q::dis:Type>, for_arg => $self->{for},
3418     forp_arg => $self->{forp});
3419     if ($self->{<Q::dis2pm:TypeNode>}) {
3420     $r = $self->{<Q::dis:actualType>}
3421     = $self->{<Q::dis:Type>}
3422     = $self->{<Q::dis2pm:TypeNode>}
3423     -><AG::ManakaiDISElement.qnameValueURI>;
3424     } else {
3425     my $pr = $self-><M::ManakaiDISPropertyAccessor
3426     .getPropertyResource>
3427     (<Q::DIS:dynamicParentResource>);
3428     if ($pr) {
3429     $r = $self->{<Q::dis:actualType>}
3430     = $pr-><AG::ManakaiDISResourceDefinition
3431     .disActualDataTypeResource>;
3432     $self->{<Q::dis2pm:actualTypeNode>}
3433     = $pr->{<Q::dis2pm:actualTypeNode>};
3434     } else { ## No parent
3435     __UNDEEP{
3436     __EXCEPTION{NO_DIS_TYPE_ERR::
3437     DIS:sourceNode => {$self->{src}},
3438     }__;
3439     }__;
3440     }
3441     }
3442     }
3443     }
3444     }__;
3445    
3446     @Attr:
3447     @@Name: disActualDataTypeNode
3448     @@enDesc:
3449     <Q::dis:actualType> node for this resource.
3450     @@Get:
3451     @@@Type: ManakaiDISElement
3452     @@@RaiseException:
3453     @@@@@:NO_DIS_TYPE_ERR
3454     @@@@enDesc:
3455     <Q::dis:actualType> attribute is not specified,
3456     and <Q::dis:Type> attribute, neigher.
3457     @@@PerlDef:
3458     __DEEP{
3459     $self-><AG::ManakaiDISResourceDefinition.disActualDataTypeNode>;
3460     }__;
3461     $r = $self->{<Q::dis2pm:actualTypeNode>};
3462 wakaba 1.2 ##DISResourceDefinition
3463    
3464 wakaba 1.8 XParamDef:
3465     @QName: generatedName
3466     @enDesc:
3467     A generated name.
3468    
3469 wakaba 1.2 ClsDef:
3470     @ClsQName: ManakaiDISPropertyAccessor
3471 wakaba 1.3 @enDesc:
3472 wakaba 1.2 Accessor methods for resource or module properties.
3473    
3474     @Method:
3475 wakaba 1.8 @@Name: getPropertyBoolean
3476     @@enDesc:
3477     Gets boolean property value.
3478     @@PropNameParam:
3479     @@Param:
3480     @@@Name:default
3481     @@@Type:
3482     DOMMain:boolean::ManakaiDOM:all
3483     @@@enDesc:
3484     The default value that is returned if no explicit property
3485     value specification found for this resource.
3486     @@Return:
3487     @@@Type:
3488     DOMMain:boolean::ManakaiDOM:all
3489     @@@enDesc:
3490     The property value.
3491     @@@PerlDef:
3492     if (exists $self->{$propName}) {
3493     $r = defined $self->{$propName} ? $self->{$propName} : $default;
3494     } elsif ($self->{src}) {
3495     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3496     ($propName, for_arg => $self->{for},
3497     forp_arg => $self->{forp});
3498     $self->{$propName} = $r;
3499     $r = $default unless defined $r;
3500     } else {
3501     $r = $default;
3502     }
3503    
3504     @Method:
3505 wakaba 1.2 @@Name: getPropertyText
3506     @@enDesc:
3507     Gets property value text.
3508     @@PropNameParam:
3509     @@Param:
3510     @@@Name:default
3511     @@@Type:
3512 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
3513 wakaba 1.2 @@@enDesc:
3514     The default value that is returned if no explicit property
3515     value specification found for this resource.
3516     @@@nullCase:
3517     @@@@enDesc:
3518     No default value supplied; <DOM::null> is returned if
3519     no value specified.
3520     @@Return:
3521     @@@Type:
3522 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
3523 wakaba 1.2 @@@enDesc:
3524     The property value string.
3525     @@@nullCase:
3526     @@@@enDesc:
3527     No value nor default value has specified.
3528     @@@PerlDef:
3529     if (exists $self->{$propName}) {
3530     $r = defined $self->{$propName} ? $self->{$propName} : $default;
3531     } elsif ($self->{src}) {
3532     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3533     ($propName, for_arg => $self->{for},
3534     forp_arg => $self->{forp});
3535 wakaba 1.8 if ($r) {
3536     $r = $self->{$propName}
3537     = $r-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3538     $r = $default unless defined $r;
3539     } else {
3540     $r = $default;
3541     $self->{$propName} = null;
3542     }
3543 wakaba 1.2 } else {
3544     $r = $default;
3545     }
3546    
3547     @Method:
3548     @@Name: getPropertyResource
3549     @@enDesc:
3550     Gets property value resource.
3551     @@PropNameParam:
3552     @@Return:
3553     @@@Type: ManakaiDISResourceDefinition
3554     @@@enDesc:
3555     The property value resource.
3556     @@@nullCase:
3557     @@@@enDesc:
3558     No value has specified.
3559 wakaba 1.8 @@@UndeclaredPrefixException:
3560 wakaba 1.2 @@@PerlDef:
3561     if (defined $self->{$propName}) {
3562 wakaba 1.8 $r = $self->{$propName};
3563     } elsif ($self->{src}) {
3564     __DEEP{
3565     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3566     ($propName, for_arg => $self->{for},
3567     forp_arg => $self->{forp});
3568     if ($r) {
3569     $r = $self->{$propName}
3570     = $r-><AG::ManakaiDISElement.qnameValueURI>;
3571     }
3572     }__;
3573     }
3574     if ($r) {
3575     $r = $self->{db}-><M::ManakaiDISDatabase.getResource> ($r);
3576 wakaba 1.2 }
3577    
3578     @Method:
3579     @@Name: addPropertyResourceList
3580     @@enDesc:
3581     Adds a resource to a resource-list property value.
3582     \
3583     {ISSUE:: Should an exception be thrown if the property is
3584     not of list?
3585     \
3586     }
3587     @@PropNameParam:
3588     @@Param:
3589     @@@Name: res
3590     @@@Type: ManakaiDISResourceDefinition
3591     @@@enDesc:
3592     A resource to add.
3593     @@Return:
3594     @@@PerlDef:
3595     if (ref $self->{$propName} eq 'ARRAY') {
3596     push @{$self->{$propName}}, $res->{uri};
3597     } elsif (not defined $self->{$propName}) {
3598     $self->{$propName} = [$res->{uri}];
3599     }
3600    
3601 wakaba 1.3 ElementTypeBinding:
3602     @Name: PropNameParam
3603     @ElementType:
3604     dis:ResourceDef
3605     @ShadowContent:
3606     @@rdf:type:
3607     DISLang:MethodParameter
3608     @@Name: propName
3609     @@Type: ResourceURI
3610     @@Description:
3611     @@@lang:en
3612     @@@@:
3613     The name of the property.
3614    
3615 wakaba 1.2 ##DISPropertyAccessor
3616    
3617     PropDef:
3618     @QName:isAnon
3619     @Description:
3620     @@lang:en
3621     @@@:
3622     Whether the subject resource is anonymous or not.
3623     @Type:
3624     DOMMain:boolean
3625    
3626     PropDef:
3627     @QName:isDefined
3628     @Description:
3629     @@lang:en
3630     @@@:
3631     Whether the subject resource is defined or not.
3632    
3633     PropDef:
3634 wakaba 1.3 @QName:isReferred
3635 wakaba 1.2 @Description:
3636     @@lang:en
3637     @@@:
3638     Whether the subject resource is referred or not.
3639     @Type:
3640     DOMMain:any
3641    
3642     PropDef:
3643     @QName:definingModule
3644     @Description:
3645     @@lang:en
3646     @@@:
3647     The <QUOTE::dis> module in which the subject resource is defined.
3648     @rdfs:domain:
3649     DISCore:Module
3650 wakaba 1.1
3651     ## -- Datatypes
3652    
3653     URITypeDef:
3654 wakaba 1.3 @QName: AnyURI
3655     @Description:
3656     @@lang:en
3657     @@@:
3658     Any URI references.
3659    
3660     URITypeDef:
3661     @QName: FileURI
3662     @enDesc:
3663     URI references identifying file.
3664    
3665     URITypeDef:
3666 wakaba 1.1 @QName: ForURI
3667     @Description:
3668     @@lang:en
3669     @@@:
3670     <QUOTE::For> URI references.
3671    
3672     DataTypeDef:
3673     @QName: ForURIList
3674     @Description:
3675     @@lang:en
3676     @@@:
3677     References to the array containing <QUOTE::for> URI references.
3678    
3679     URITypeDef:
3680 wakaba 1.3 @QName: ResourceURI
3681     @Description:
3682     @@lang:en
3683     @@@:
3684     A URI reference for a <QUOTE::dis> resource.
3685    
3686     URITypeDef:
3687 wakaba 1.1 @QName: MediaTypeURI
3688     @Description:
3689     @@lang:en
3690     @@@:
3691     Media type URI references.
3692 wakaba 1.3 @rdfs:subClassOf: ResourceURI
3693    
3694     URITypeDef:
3695     @QName: ModuleURI
3696     @enDesc:
3697     URI references for <QUOET::dis> modules.
3698     @rdfs:subClassOf: ResourceURI
3699    
3700     URITypeDef:
3701     @QName: NameURI
3702     @enDesc:
3703     URI references identifying a resource.
3704     @rdfs:subClassOf: ResourceURI
3705    
3706     ElementTypeBinding:
3707     @Name: DataTypeDef
3708     @ElementType:
3709     dis:ResourceDef
3710     @ShadowContent:
3711     @@rdf:type:
3712     ManakaiDOM:DataType
3713    
3714     ElementTypeBinding:
3715     @Name: URITypeDef
3716     @ElementType:
3717     dis:ResourceDef
3718     @ShadowContent:
3719     @@rdf:type:
3720     ManakaiDOM:DataType
3721     @@rdfs:subClassOf: AnyURI
3722 wakaba 1.1
3723     ## -- Exceptions
3724    
3725     XParamDef:
3726     @QName: sourceNode
3727     @Description:
3728     @@lang:en
3729     @@@:
3730 wakaba 1.4 The node in which an error has occurred.
3731 wakaba 1.5 @Type: ManakaiDISNode
3732    
3733     XParamDef:
3734     @QName: anotherSourceNode
3735     @enDesc:
3736     Another source node in which an error has occurred. In cases
3737     of <QUOTE::already defined> errors, it is the node that
3738     defines the resource first.
3739     @Type: ManakaiDISNode
3740 wakaba 1.3
3741     ExceptionDef:
3742     @ClsQName: ManakaiDISException
3743     @enDesc:
3744     Exceptions for the <QUOTE::dis> operations.
3745 wakaba 1.4 @ClsISA:
3746     ManakaiDOM:ManakaiDOMException::ManakaiDOM:Perl
3747 wakaba 1.3 @XConstGroupDef:
3748     @@ClsQName: ManakaiDISExceptionCode
3749     @@enDesc:
3750     Exception codes for <Class::ManakaiDISException>.
3751     @@XConstDef:
3752 wakaba 1.8 @@@Name: NOT_SUPPORTED_ERR
3753     @@@Value:9
3754     @@@enDesc:
3755     An attempt is made to do something the implementation does not support.
3756     @@@XSubTypeDef:
3757     @@@@QName: UNSUPPORTED_MEDIA_TYPE_ERR
3758     @@@@enDesc:
3759     The implementation does not support the media type.
3760     @@@@XParam:
3761     @@@@@QName: uri
3762     @@@@@enDesc:
3763     The URI reference of the media type that is not supported.
3764     @@@@XSourceNodeParam:
3765     @@XConstDef:
3766 wakaba 1.3 @@@Name: NAMESPACE_ERR
3767     @@@Value:14
3768     @@@enDesc:
3769     An error related to namespaces has occurred.
3770     @@@XSubTypeDef:
3771     @@@@QName: UNDECLARED_NS_PREFIX_ERR
3772     @@@@enDesc:
3773     The implementation has encounted an undeclared namespace
3774     prefix.
3775 wakaba 1.7 @@@@XParam:
3776     @@@@@QName:
3777     infoset:prefix
3778     @@@@@enDesc:
3779     The namespace prefix.
3780     @@@@enMufDef:
3781     Namespace prefix "%p (name => {<Q::infoset:prefix>});" is
3782     not declared
3783 wakaba 1.3 @@XConstDef:
3784     @@@Name: INVALID_STATE_ERR
3785     @@@Value:11
3786     @@@enDesc:
3787     An attempt is made to use an object that is not (or no longer) usable.
3788     @@@XSubTypeDef:
3789     @@@@QName: NO_ASSOCIATED_DB_ERR
3790     @@@@enDesc:
3791     No <QUOTE::dis> database has been associated with this document.
3792 wakaba 1.4 @@XConstDef:
3793     @@@Name: INVALID_SOURCE_ERR
3794     @@@Value: 200
3795     @@@enDesc:
3796     The source input is well-formed but invalid.
3797     @@@XSubTypeDef:
3798     @@@@QName: NO_MODULE_QNAME_ERR
3799     @@@@enDesc:
3800     The <Q::dis:Module> element must have its <Q::dis:QName>
3801     attribute.
3802 wakaba 1.8 @@@@XSourceNodeParam:
3803     @@@XSubTypeDef:
3804     @@@@QName: NO_LOCAL_NAME_ERR
3805     @@@@enDesc:
3806     The resource does not have a local name.
3807     @@@@XSourceNodeParam:
3808 wakaba 1.4 @@@XSubTypeDef:
3809     @@@@QName: UNABLE_TO_GET_MODULE_ERR
3810     @@@@enDesc:
3811     The implementation is unable to get the module source.
3812     @@@@Def:
3813     @@@@@ContentType:
3814     lang:muf
3815     @@@@@lang:en
3816     @@@@@@:
3817     Unable to get the module source of <%p (name => {<Q::DIS:uri>});>
3818     @@@@XParam:
3819     @@@@@QName: uri
3820     @@@@@enDesc:
3821     The URI reference of the module.
3822     @@@@XParam:
3823     @@@@@QName: namespaceURI
3824     @@@@@enDesc:
3825     The namespace URI of the module name.
3826     @@@@XParam:
3827     @@@@@QName: localName
3828     @@@@@enDesc:
3829     The local name of the module name.
3830     @@@@XParam:
3831     @@@@@QName: for
3832     @@@@@enDesc:
3833     The <QUOTE::for> of the module.
3834 wakaba 1.5 @@@XSubTypeDef:
3835     @@@@QName: NO_FOR_QNAME_ERR
3836     @@@@enDesc:
3837     A <Q::dis:ForDef> element must have <Q::dis:QName> attribute.
3838     @@@@XSourceNodeParam:
3839     @@@XSubTypeDef:
3840     @@@@QName: FOR_ALREADY_DEFINED_ERR
3841     @@@@enDesc:
3842     The <QUOTE::for> named as the same URI reference has
3843     already defined.
3844     @@@@XSourceNodeParam:
3845     @@@@XParam:
3846     @@@@@QName: anotherSourceNode
3847     @@@@@enDesc:
3848     The node that defines the <QUOTE::for> URI reference before.
3849 wakaba 1.7 @@@@XParam:
3850     @@@@@Name: uri
3851     @@@@@enDesc:
3852     The URI reference of the <QUOTE::for> attempted to define.
3853     @@@@enMufDef:
3854     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is already defined
3855 wakaba 1.5 @@@XSubTypeDef:
3856     @@@@QName: RESOURCE_ALREADY_DEFINED_ERR
3857     @@@@enDesc:
3858     The <QUOTE::dis> resource named as the same URI reference has
3859     already defined.
3860     @@@@XSourceNodeParam:
3861     @@@@XParam:
3862     @@@@@QName: anotherSourceNode
3863     @@@@@enDesc:
3864     The node that defines the <QUOTE::for> URI reference before.
3865 wakaba 1.7 @@@@XParam:
3866     @@@@@Name: uri
3867     @@@@@enDesc:
3868     The URI reference of the resource attempted to define.
3869     @@@@enMufDef:
3870     Resource <%p (name => {<Q::DIS:uri>});> is already defined
3871 wakaba 1.5 @@@XSubTypeDef:
3872     @@@@QName: ELEMENT_NOT_ALLOWED_ERR
3873     @@@@enDesc:
3874     An element has occured where it is not allowed.
3875     @@@@enMufDef:
3876     Module <%p (name => {<Q::DIS:uri>});>:
3877     Element of type <%p (name => {<Q::DIS:elementType>});>
3878     is not allowed here
3879     @@@@XSourceNodeParam:
3880     @@@@XParam:
3881     @@@@@QName: elementType
3882     @@@@@enDesc:
3883     The expanded element type name of the element.
3884     @@@@XParam:
3885     @@@@@QName: uri
3886     @@@@@enDesc:
3887     The URI reference of the module.
3888 wakaba 1.7 @@@XSubTypeDef:
3889     @@@@QName: NO_REQUIRED_ATTR_ERR
3890     @@@@enDesc:
3891     A required attribute is not specified.
3892     @@@@XSourceNodeParam:
3893     @@@@XParam:
3894     @@@@@QName: elementType
3895     @@@@@enDesc:
3896     The expanded URI reference of the attribute name.
3897     @@@@enMufDef:
3898     Attribute <%p (name => {<Q::DIS:elementType>});> must be specified
3899 wakaba 1.8 @@@XSubTypeDef:
3900     @@@@QName: FOR_NOT_DEFINED_ERR
3901     @@@@enDesc:
3902     A <QUOTE::for> is referred but not defined.
3903     @@@@XSourceNodeParam:
3904     @@@@XParam:
3905     @@@@@QName: uri
3906     @@@@@enDesc:
3907     The URI reference of the <QUOTE::for> that is not defined.
3908     @@@@enMufDef:
3909     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is not defined
3910     @@@XSubTypeDef:
3911     @@@@QName: RESOURCE_NOT_DEFINED_ERR
3912     @@@@enDesc:
3913     A <QUOTE::dis> resource is referred but not defined.
3914     @@@@XSourceNodeParam:
3915     @@@@XParam:
3916     @@@@@QName: uri
3917     @@@@@enDesc:
3918     The URI reference of the resource that is not defined.
3919     @@@@enMufDef:
3920     Resource <%p (name => {<Q::DIS:uri>});> is not defined
3921     @@@XSubTypeDef:
3922     @@@@QName: RESERVED_PERL_METHOD_NAME_ERR
3923     @@@@enDesc:
3924     A reserved Perl method name is used.
3925     @@@@XParam:
3926     @@@@@QName:uri
3927     @@@@@enDesc:
3928     The URI reference of the method resource.
3929     @@@@XSourceNodeParam:
3930     @@@@XParam:
3931     @@@@@QName: generatedName
3932     @@@@@enDesc:
3933     A reserved method name.
3934     @@@XSubTypeDef:
3935     @@@@QName: NO_DIS_TYPE_ERR
3936     @@@@enDesc:
3937     <Q::dis:Type> attribute is not found.
3938     @@@@XSourceNodeParam:
3939 wakaba 1.4 ##DISException
3940 wakaba 1.5
3941     XParamDef:
3942     @QName: elementType
3943     @Type: ResourceURI
3944     @enDesc:
3945     The name of the element type.
3946    
3947     XParamDef:
3948     @QName: uri
3949     @Type: ResourceURI
3950     @enDesc:
3951     The name of the resource, composed from <Q::namespaceURI>,
3952     <Q::localName> and <Q::for>.
3953    
3954     XParamDef:
3955     @QName: localName
3956     @Type:
3957     DISCore:LocalName
3958     @enDesc:
3959     The local name of the resource, unique in <Q::namespaceURI> namespace.
3960    
3961     XParamDef:
3962     @QName: namespaceURI
3963     @Type: AnyURI
3964     @enDesc:
3965     The namespace URI reference of the resource name.
3966    
3967     XParamDef:
3968     @QName: for
3969     @Type: ForURI
3970     @enDesc:
3971     The <QUOTE::for> URI reference of the resource.
3972    
3973     ElementTypeBinding:
3974     @Name: XSourceNodeParam
3975     @ElementType:
3976     ManakaiDOM:exceptionOrWarningParameter
3977     @ShadowContent:
3978     @@QName: sourceNode
3979     @@Description:
3980     @@@lang:en
3981     @@@@:
3982     The node in which an error has occurred.
3983 wakaba 1.4
3984     ClsDef:
3985     @ClsQName: ManakaiDISExceptionTarget
3986     @enDesc:
3987     Objects that is able to be the target of an exception.
3988     @IntMethod:
3989     @@Operator:
3990     @@@@:
3991     ManakaiDOM:MUErrorHandler
3992     @@@ContentType:
3993     dis:TypeQName
3994     @@Description:
3995     @@@lang:en
3996     @@@@:
3997     This method is a generic error handler; all manakai exceptions
3998     and warnings associated to an object are once reported to this method
3999     and then delivered to appropriate entities.
4000     \
4001     If the error is an exception (such as <X::DOMCore:DOMException> or
4002     <X::ManakaiDOM:ManakaiDOMImplementationException>), it is
4003     simply thrown. If the error is only a warning, it is reported
4004     via the <IF::DOMCore:DOMError> interface.
4005     \
4006     See <PerlModule::Message::Util::Error> documentation for more
4007     information on the error reporting mechanism.
4008     \
4009     {NOTE:: This kind of methods are named as <Perl::___report_error>
4010     in the convention of <PerlModule::Message::Util::Error>.
4011     \
4012     }
4013     @@Param:
4014     @@@Name:err
4015     @@@Type:
4016     ManakaiDOM:ManakaiDOMExceptionOrWarning::ManakaiDOM:Perl
4017     @@@Description:
4018     @@@@lang:en
4019     @@@@@:
4020     An exception object that describes what kind of error it is
4021     and how it should be recovered.
4022     \
4023     {NOTE:: Exception objects in manakai implementation
4024     inherit the class <PerlModule::Message::Util::Error>,
4025     that in turn inherits <PerlModule::Error>.
4026     \
4027     }
4028     @@Return:
4029     @@@PerlDef:
4030     if ($err->isa (<ClassName::ManakaiDOM:ManakaiDOMException
4031     ::ManakaiDOM:Perl>)) {
4032     $err->throw;
4033     } else {
4034     \## TODO: Implement warning reporting
4035     warn $err->stringify;
4036     }
4037     ##DISExceptionTarget
4038    
4039     ForDef:
4040     @QName:
4041     DIS:ForIF
4042     ForDef:
4043     @QName:
4044     DIS:ForClass
4045    
4046     ElementTypeBinding:
4047     @Name: IFClsDef
4048     @ElementType:
4049     dis:ResourceDef
4050     @ShadowContent:
4051     @@rdf:type:
4052     @@@@:
4053     dis:MultipleResource
4054     @@@ForCheck: !ForClass !ForIF
4055     @@rdf:type:
4056     @@@@:
4057     ManakaiDOM:IF
4058     @@@ForCheck: ForIF
4059     @@rdf:type:
4060     @@@@:
4061     ManakaiDOM:Class
4062     @@@ForCheck: ForClass
4063     @@resourceFor: ForIF
4064     @@resourceFor:
4065     @@@@: ForClass
4066     @@@ForCheck: ForLatest
4067     @@DOMMain:implementFeature:
4068     @@@@:CoreFeature10
4069     @@@ForCheck: ForClass
4070     @@ForCheck:
4071     ManakaiDOM:Perl
4072 wakaba 1.3
4073     ElementTypeBinding:
4074     @Name: ClsDef
4075     @ElementType:
4076     dis:ResourceDef
4077     @ShadowContent:
4078     @@rdf:type:
4079     ManakaiDOM:Class
4080     @@AliasFor:
4081     @@@@:
4082     ::ForLatest
4083     @@@For:
4084     !=ForLatest
4085     @@ForCheck:
4086     ManakaiDOM:Perl
4087     @@DOMMain:implementFeature: CoreFeature10
4088    
4089     ElementTypeBinding:
4090     @Name: ExceptionDef
4091     @ElementType:
4092     dis:ResourceDef
4093     @ShadowContent:
4094     @@rdf:type:
4095     ManakaiDOM:ExceptionClass
4096     @@AliasFor:
4097     @@@@:
4098     ::ForLatest
4099     @@@For:
4100     !=ForLatest
4101     @@ForCheck:
4102     ManakaiDOM:Perl
4103     @@DOMMain:implementFeature: CoreFeature10
4104    
4105     ElementTypeBinding:
4106     @Name: ClsQName
4107     @ElementType:
4108     dis:QName
4109    
4110     ElementTypeBinding:
4111     @Name: ClsISA
4112     @ElementType:
4113     dis:ISA
4114    
4115     ElementTypeBinding:
4116     @Name: Method
4117     @ElementType:
4118     dis:ResourceDef
4119     @ShadowContent:
4120     @@rdf:type:
4121     DISLang:Method
4122    
4123     ElementTypeBinding:
4124     @Name: IntMethod
4125     @ElementType:
4126     dis:ResourceDef
4127     @ShadowContent:
4128     @@rdf:type:
4129     DISLang:Method
4130     @@ManakaiDOM:isForInternal:1
4131    
4132     ElementTypeBinding:
4133     @Name: Attr
4134     @ElementType:
4135     dis:ResourceDef
4136     @ShadowContent:
4137     @@rdf:type:
4138     DISLang:Attribute
4139    
4140     ElementTypeBinding:
4141     @Name: Return
4142     @ElementType:
4143     dis:ResourceDef
4144     @ShadowContent:
4145     @@rdf:type:
4146     DISLang:MethodReturn
4147    
4148     ElementTypeBinding:
4149     @Name: Get
4150     @ElementType:
4151     dis:ResourceDef
4152     @ShadowContent:
4153     @@rdf:type:
4154     DISLang:AttributeGet
4155    
4156     ElementTypeBinding:
4157     @Name: Set
4158     @ElementType:
4159     dis:ResourceDef
4160     @ShadowContent:
4161     @@rdf:type:
4162     DISLang:AttributeSet
4163    
4164     ElementTypeBinding:
4165     @Name: Param
4166     @ElementType:
4167     dis:ResourceDef
4168     @ShadowContent:
4169     @@rdf:type:
4170     DISLang:MethodParameter
4171    
4172     ElementTypeBinding:
4173     @Name: PerlDef
4174     @ElementType:
4175     dis:Def
4176     @ShadowContent:
4177     @@ContentType:
4178     lang:Perl
4179    
4180     ElementTypeBinding:
4181     @Name: disDef
4182     @ElementType:
4183     dis:Def
4184     @ShadowContent:
4185     @@ContentType:
4186     lang:dis
4187    
4188     ElementTypeBinding:
4189     @Name: InCase
4190     @ElementType:
4191     dis:ResourceDef
4192     @ShadowContent:
4193     @@rdf:type:
4194     ManakaiDOM:InCase
4195    
4196     ElementTypeBinding:
4197     @Name: nullCase
4198     @ElementType:
4199     dis:ResourceDef
4200     @ShadowContent:
4201     @@rdf:type:
4202     ManakaiDOM:InCase
4203     @@Value:
4204     @@@is-null:1
4205    
4206     ElementTypeBinding:
4207     @Name: TrueCase
4208     @ElementType:
4209     dis:ResourceDef
4210     @ShadowContent:
4211     @@rdf:type:
4212     ManakaiDOM:InCase
4213     @@Value:true
4214     @@Type:
4215     DOMMain:boolean
4216    
4217    
4218     ElementTypeBinding:
4219     @Name: FalseCase
4220     @ElementType:
4221     dis:ResourceDef
4222     @ShadowContent:
4223     @@rdf:type:
4224     ManakaiDOM:InCase
4225     @@Value:false
4226     @@Type:
4227     DOMMain:boolean
4228    
4229     ElementTypeBinding:
4230     @Name: enDesc
4231     @ElementType:
4232     dis:Description
4233     @ShadowContent:
4234     @@lang:en
4235    
4236     ElementTypeBinding:
4237     @Name: PropDef
4238     @ElementType:
4239     dis:ResourceDef
4240     @ShadowContent:
4241     @@rdf:type:
4242     rdf:Property
4243     @@AliasFor:
4244     @@@@:
4245     ::ManakaiDOM:all
4246     @@@For:
4247     !=ManakaiDOM:all
4248    
4249     ElementTypeBinding:
4250     @Name: MethodRedef
4251     @ElementType:
4252     dis:ResourceDef
4253     @ShadowContent:
4254     @@rdf:type:
4255     DISLang:Method
4256     @@ManakaiDOM:isRedefining:1
4257    
4258     ElementTypeBinding:
4259     @Name: NamedParam
4260     @ElementType:
4261     dis:ResourceDef
4262     @ShadowContent:
4263     @@rdf:type:
4264     DISLang:MethodParameter
4265     @@DISPerl:isNamedParameter:1
4266    
4267     ElementTypeBinding:
4268     @Name: NodeParam
4269     @ElementType:
4270     dis:ResourceDef
4271     @ShadowContent:
4272     @@rdf:type:
4273     DISLang:MethodParameter
4274     @@DISPerl:isNamedParameter:1
4275     @@Name: node
4276     @@Type: ManakaiDISNode
4277     @@Description:
4278     @@@lang:en
4279     @@@@:
4280     The node in which the name has occurred. It is intended
4281     to be reported when an exception had been raised.
4282     @@ResourceDef:
4283     @@@rdf:type:
4284     ManakaiDOM:InCase
4285     @@@Value:
4286     @@@@is-null:1
4287     @@@Description:
4288     @@@@lang:en
4289     @@@@@:
4290     The source of the name is not a node.
4291    
4292     ElementTypeBinding:
4293     @Name: ForParam
4294     @ElementType:
4295     dis:ResourceDef
4296     @ShadowContent:
4297     @@rdf:type:
4298     DISLang:MethodParameter
4299     @@DISPerl:isNamedParameter:1
4300     @@Name: forArg
4301     @@Type: ForURI
4302     @@Description:
4303     @@@lang:en
4304     @@@@:
4305     The <QUOTE::for> URI reference.
4306     @@ResourceDef:
4307     @@@rdf:type:
4308     ManakaiDOM:InCase
4309     @@@Value:
4310     @@@@is-null:1
4311     @@@Description:
4312     @@@@lang:en
4313     @@@@@:
4314     Equivalent to <Q::ManakaiDOM:all>, i.e. <QUOTE::for all>.
4315    
4316     ElementTypeBinding:
4317     @Name: ForpParam
4318     @ElementType:
4319     dis:ResourceDef
4320     @ShadowContent:
4321     @@rdf:type:
4322     DISLang:MethodParameter
4323     @@DISPerl:isNamedParameter:1
4324     @@Name: forpArg
4325     @@Type: ForURIList
4326     @@Description:
4327     @@@lang:en
4328     @@@@:
4329     An array reference containing additional <QUOTE::for>
4330     constraints (<QUOTE::For+> list).
4331     @@ResourceDef:
4332     @@@rdf:type:
4333     ManakaiDOM:InCase
4334     @@@Value:
4335     @@@@is-null:1
4336     @@@Description:
4337     @@@@lang:en
4338     @@@@@:
4339     Equivalent to the empty array reference.
4340    
4341     ElementTypeBinding:
4342     @Name: MediaTypeParam
4343     @ElementType:
4344     dis:ResourceDef
4345     @ShadowContent:
4346     @@rdf:type:
4347     DISLang:MethodParameter
4348     @@DISPerl:isNamedParameter:1
4349     @@Name: mediaType
4350     @@Type: MediaTypeURI
4351     @@Description:
4352     @@@lang:en
4353     @@@@:
4354     The URI reference identifying a media type.
4355     @@ResourceDef:
4356     @@@rdf:type:
4357     ManakaiDOM:InCase
4358     @@@Value:
4359     @@@@is-null:1
4360     @@@Description:
4361     @@@@lang:en
4362     @@@@@:
4363     No media type specified.
4364    
4365     ElementTypeBinding:
4366     @Name: MediaTypeDefaultParam
4367     @ElementType:
4368     dis:ResourceDef
4369     @ShadowContent:
4370     @@rdf:type:
4371     DISLang:MethodParameter
4372     @@DISPerl:isNamedParameter:1
4373     @@Name: defaultMediaType
4374     @@Type: MediaTypeURI
4375     @@Description:
4376     @@@lang:en
4377     @@@@:
4378     The default media type, i.e. the type used when no explicit
4379     specification is not found in the source tree.
4380     @@ResourceDef:
4381     @@@rdf:type:
4382     ManakaiDOM:InCase
4383     @@@Value:
4384     @@@@is-null:1
4385     @@@Description:
4386     @@@@lang:en
4387     @@@@@:
4388     Defaulted to <Q::DOMMain:any>.
4389    
4390     ElementTypeBinding:
4391     @Name: RaiseException
4392     @ElementType:
4393     ManakaiDOM:raises
4394    
4395     ElementTypeBinding:
4396     @Name: UndeclaredPrefixException
4397     @ElementType:
4398     ManakaiDOM:raises
4399     @ShadowContent:
4400     @@@: UNDECLARED_NS_PREFIX_ERR
4401     @@Description:
4402     @@@lang:en
4403     @@@@:
4404     The implementation has encounted an undeclared namespace prefix.
4405    
4406     ElementTypeBinding:
4407     @Name: NoDBException
4408     @ElementType:
4409     ManakaiDOM:raises
4410     @ShadowContent:
4411     @@@: NO_DB_ASSOCIATED_ERR
4412     @@Description:
4413     @@@lang:en
4414     @@@@:
4415     No <QUOTE::dis> database is associated to this document.
4416    
4417     ElementTypeBinding:
4418     @Name: XConstGroupDef
4419     @ElementType:
4420     dis:ResourceDef
4421     @ShadowContent:
4422     @@rdf:type:
4423     ManakaiDOM:ConstGroup
4424     @@Type:
4425     DOMMain:unsigned-short::ManakaiDOM:all
4426     @@rdfs:subClassOf:
4427     DOMMain:unsigned-short::ManakaiDOM:all
4428    
4429     ElementTypeBinding:
4430     @Name: XConstDef
4431     @ElementType:
4432     dis:ResourceDef
4433     @ShadowContent:
4434     @@rdf:type:
4435     ManakaiDOM:Const
4436    
4437     ElementTypeBinding:
4438     @Name: XSubTypeDef
4439     @ElementType:
4440     dis:ResourceDef
4441     @ShadowContent:
4442     @@rdf:type:
4443     ManakaiDOM:ExceptionOrWarningSubType
4444    
4445     ElementTypeBinding:
4446     @Name: XParam
4447     @ElementType:
4448     ManakaiDOM:exceptionOrWarningParameter
4449    
4450     ElementTypeBinding:
4451     @Name: XParamDef
4452     @ElementType:
4453     dis:ResourceDef
4454     @ShadowContent:
4455     @@rdf:type:
4456     DOMMain:XWParameter
4457     @@AliasFor:
4458     @@@For:
4459     !=ManakaiDOM:all
4460     @@@@:
4461     ::ManakaiDOM:all
4462    
4463     ElementTypeBinding:
4464     @Name: enMufDef
4465     @ElementType:
4466     dis:Def
4467     @ShadowContent:
4468     @@ContentType:
4469     lang:muf
4470     @@lang:en
4471    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24