/[suikacvs]/messaging/manakai/bin/dis2rdf.pl
Suika

Diff of /messaging/manakai/bin/dis2rdf.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wakaba, Sun Nov 7 07:22:16 2004 UTC revision 1.3 by wakaba, Sun Nov 7 13:07:53 2004 UTC
# Line 8  GetOptions ( Line 8  GetOptions (
8    'for=s' => \$Opt{For},    'for=s' => \$Opt{For},
9    'help' => \$Opt{help},    'help' => \$Opt{help},
10    'no-undef-check' => \$Opt{no_undef_check},    'no-undef-check' => \$Opt{no_undef_check},
   'output-class' => \$Opt{output_class},  
11    'output-for' => \$Opt{output_for},    'output-for' => \$Opt{output_for},
12    'output-local-class' => \$Opt{output_local_class},    'output-local-resource' => \$Opt{output_local_resource},
13    'output-module' => \$Opt{output_module},    'output-module' => \$Opt{output_module},
14      'output-resource' => \$Opt{output_resource},
15  ) or pod2usage (2);  ) or pod2usage (2);
16  if ($Opt{help}) {  if ($Opt{help}) {
17    pod2usage (0);    pod2usage (0);
# Line 98  for (keys %{$State->{For}}) { Line 98  for (keys %{$State->{For}}) {
98    }    }
99  }}  }}
100    
101  if ($Opt{output_class}) {  if ($Opt{output_resource}) {
102    sub class_to_rdf ($;%);    sub class_to_rdf ($;%);
103    sub class_to_rdf ($;%) {    sub class_to_rdf ($;%) {
104      my ($mod, %opt) = @_;      my ($mod, %opt) = @_;
# Line 110  if ($Opt{output_class}) { Line 110  if ($Opt{output_class}) {
110                             n3_literal $mod->{Name}) if length $mod->{Name};                             n3_literal $mod->{Name}) if length $mod->{Name};
111        $result->add_triple ($uri =>ExpandedURI q<d:NameURI>=> $mod->{NameURI})        $result->add_triple ($uri =>ExpandedURI q<d:NameURI>=> $mod->{NameURI})
112          if defined $mod->{NameURI};          if defined $mod->{NameURI};
113        $result->add_triple ($uri =>ExpandedURI q<d:parentClass>=>        $result->add_triple ($uri =>ExpandedURI q<d:parentResource>=>
114                             $opt{parent_class_uri})                             $opt{parent_class_uri})
115          if defined $opt{parent_class_uri};          if defined $opt{parent_class_uri};
116        for (keys %{$mod->{Type}}) {        for (keys %{$mod->{Type}}) {
# Line 122  if ($Opt{output_class}) { Line 122  if ($Opt{output_class}) {
122        for (keys %{$mod->{Implement}}) {        for (keys %{$mod->{Implement}}) {
123          $result->add_triple ($uri =>ExpandedURI q<d:Implement>=> $_);          $result->add_triple ($uri =>ExpandedURI q<d:Implement>=> $_);
124        }        }
125        if ($Opt{output_local_class}) {        if ($Opt{output_local_resource}) {
126          for (keys %{$mod->{Class}}) {          for (keys %{$mod->{Class}}) {
127            class_to_rdf ($mod->{Class}->{$_}, parent_class => $mod,            class_to_rdf ($mod->{Class}->{$_}, parent_class => $mod,
128                          parent_class_uri => $uri,                          parent_class_uri => $uri,

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24