[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Thu Jul 19 18:26:59 UTC 2007
kawas
Thu Jul 19 14:26:59 EDT 2007
Update of /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies
In directory dev.open-bio.org:/tmp/cvs-serv31521/RDF/Ontologies
Modified Files:
Objects.pm Namespaces.pm Services.pm ServiceTypes.pm
Log Message:
removed rdf:type->owl:Class statements. Read URIs for each ontology from mobycentral.confgi
moby-live/Perl/MOBY/RDF/Ontologies Objects.pm,1.3,1.4 Namespaces.pm,1.2,1.3 Services.pm,1.1,1.2 ServiceTypes.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Objects.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Objects.pm 2007/07/09 20:53:46 1.3
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Objects.pm 2007/07/19 18:26:59 1.4
@@ -21,7 +21,6 @@
use MOBY::RDF::Predicates::DC_PROTEGE;
use MOBY::RDF::Predicates::MOBY_PREDICATES;
use MOBY::RDF::Predicates::OMG_LSID;
-use MOBY::RDF::Predicates::OWL;
use MOBY::RDF::Predicates::RDF;
use MOBY::RDF::Predicates::RDFS;
@@ -74,9 +73,16 @@
# create an object
my $self = bless {}, ref($class) || $class;
- $self->{uri} = 'http://biomoby.org/RESOURCES/MOBY-S/Objects#';
- $self->{uri_comp} =
- 'http://biomoby.org/RESOURCES/MOBY_SUB_COMPONENT/Objects#';
+
+ # save some information retrieved from mobycentral.config
+ my $CONF = MOBY::Config->new;
+ $self->{uri} = $CONF->{mobyobject}->{resourceURL} || 'http://biomoby.org/RESOURCES/MOBY-S/Objects#';
+ $self->{uri} = $self->{uri} . "#" unless $self->{uri} =~ m/^.*(\#{1})$/;
+ $self->{moby_data_handler} = $CONF-> getDataAdaptor( source => "mobyobject" )->dbh;
+
+ $self->{uri_comp} = $self->{uri};
+ $self->{uri_comp} =~ s/\/MOBY\-S\//\/MOBY_SUB_COMPONENT\//;
+
$self->{query_all} = <<END;
SELECT ot1.object_type, rt.relationship_type, ot2.object_type, rt.object2_articlename, ot1.description, ot1.object_lsid, ot1.authority, ot1.contact_email
FROM object as ot1, object_term2term as rt, object as ot2
@@ -121,9 +127,7 @@
# add root of ontology
$self->_addOntologyRoot($model);
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobyobject" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query_all} );
$sth->execute;
@@ -194,9 +198,7 @@
my $node_factory = new RDF::Core::NodeFactory();
do {
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobyobject" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query} );
$sth->execute( ($term) );
@@ -443,9 +445,7 @@
my $termExists = 0;
do {
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobyobject" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query} );
$sth->execute( ($term) );
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Namespaces.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Namespaces.pm 2007/07/16 21:28:09 1.2
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Namespaces.pm 2007/07/19 18:26:59 1.3
@@ -21,7 +21,6 @@
use MOBY::RDF::Predicates::DC_PROTEGE;
use MOBY::RDF::Predicates::MOBY_PREDICATES;
use MOBY::RDF::Predicates::OMG_LSID;
-use MOBY::RDF::Predicates::OWL;
use MOBY::RDF::Predicates::RDF;
use MOBY::RDF::Predicates::RDFS;
@@ -72,7 +71,13 @@
# create an object
my $self = bless {}, ref($class) || $class;
- $self->{uri} = 'http://biomoby.org/RESOURCES/MOBY-S/Namespaces#';
+
+ # save some information retrieved from mobycentral.config
+ my $CONF = MOBY::Config->new;
+ $self->{uri} = $CONF->{mobynamespace}->{resourceURL} || 'http://biomoby.org/RESOURCES/MOBY-S/Namespaces#';
+ $self->{uri} = $self->{uri} . "#" unless $self->{uri} =~ m/^.*(\#{1})$/;
+ $self->{moby_data_handler} = $CONF-> getDataAdaptor( source => "mobynamespace" )->dbh;
+
$self->{query_all} = <<END;
SELECT namespace_type, description, namespace_lsid, authority, contact_email FROM namespace ORDER BY namespace_type asc
END
@@ -115,13 +120,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal("Namespace")
)
@@ -160,9 +158,7 @@
);
}
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobynamespace" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query_all} );
$sth->execute;
@@ -178,13 +174,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal($subject)
)
@@ -276,13 +265,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal("Namespace")
)
@@ -324,9 +306,7 @@
my $node_factory = new RDF::Core::NodeFactory();
do {
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobynamespace" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query} );
$sth->execute( ($term) );
@@ -347,13 +327,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal($subject)
)
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Services.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Services.pm 2007/07/05 17:38:26 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/Services.pm 2007/07/19 18:26:59 1.2
@@ -22,7 +22,6 @@
use MOBY::RDF::Predicates::FETA;
use MOBY::RDF::Predicates::MOBY_PREDICATES;
use MOBY::RDF::Predicates::OMG_LSID;
-use MOBY::RDF::Predicates::OWL;
use MOBY::RDF::Predicates::RDF;
use MOBY::RDF::Predicates::RDFS;
@@ -85,7 +84,11 @@
#TODO - Extract the URIs for Namespaces/ServiceTypes/Objects/ServiceInstances from the moby config file
# create an object
my $self = bless {}, ref($class) || $class;
- $self->{uri} = 'http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#';
+
+ # save some information retrieved from mobycentral.config
+ my $CONF = MOBY::Config->new;
+ $self->{uri} = $CONF->{mobycentral}->{resourceURL} || 'http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#';
+ $self->{uri} = $self->{uri} . "#" unless $self->{uri} =~ m/^.*(\#{1})$/;
# done
return $self;
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/ServiceTypes.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/ServiceTypes.pm 2007/07/05 17:38:26 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/Ontologies/ServiceTypes.pm 2007/07/19 18:26:59 1.2
@@ -21,7 +21,6 @@
use MOBY::RDF::Predicates::DC_PROTEGE;
use MOBY::RDF::Predicates::MOBY_PREDICATES;
use MOBY::RDF::Predicates::OMG_LSID;
-use MOBY::RDF::Predicates::OWL;
use MOBY::RDF::Predicates::RDF;
use MOBY::RDF::Predicates::RDFS;
@@ -73,7 +72,13 @@
# create an object
my $self = bless {}, ref ($class) || $class;
- $self->{uri} = 'http://biomoby.org/RESOURCES/MOBY-S/Services#';
+
+ # save some information retrieved from mobycentral.config
+ my $CONF = MOBY::Config->new;
+ $self->{uri} = $CONF->{mobyservice}->{resourceURL} || 'http://biomoby.org/RESOURCES/MOBY-S/Services#';
+ $self->{uri} = $self->{uri} . "#" unless $self->{uri} =~ m/^.*(\#{1})$/;
+ $self->{moby_data_handler} = $CONF-> getDataAdaptor( source => "mobyservice" )->dbh;
+
$self->{query_all} = <<END;
SELECT ot1.service_type, rt.relationship_type, ot2.service_type, ot1.description, ot1.service_lsid, ot1.authority, ot1.contact_email, ot2.service_lsid
FROM service as ot1, service_term2term as rt, service as ot2
@@ -120,13 +125,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal("Service")
)
@@ -165,9 +163,7 @@
);
}
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobyservice" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query_all} );
$sth->execute;
@@ -186,13 +182,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal($subject)
)
@@ -282,13 +271,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal("Service")
)
@@ -331,9 +313,7 @@
# add the datatype Object to the model
do {
- my $CONF = MOBY::Config->new;
- my $adap = $CONF->getDataAdaptor( source => "mobyservice" );
- my $db = $adap->dbh;
+ my $db = $self->{moby_data_handler};
my $sth = $db->prepare( $self->{query} );
$sth->execute( ($term) );
@@ -358,13 +338,6 @@
$model->addStmt(
new RDF::Core::Statement(
$resource,
- $resource->new( MOBY::RDF::Predicates::RDF->type ),
- new RDF::Core::Resource( MOBY::RDF::Predicates::OWL->Class )
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
$resource->new( MOBY::RDF::Predicates::RDFS->label ),
new RDF::Core::Literal($subject)
)
@@ -418,69 +391,6 @@
);
$term = $object;
} if $relationship =~ m/.*\:isa$/;
-
- # add hasa container relationships
- do {
- my $bnode = $node_factory->newResource;
- my $container =
- new RDF::Core::Resource( $self->{uri}, $object );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
- $resource->new(
- MOBY::RDF::Predicates::MOBY_PREDICATES->hasa
- ),
- $bnode
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $bnode,
- $bnode->new(
- MOBY::RDF::Predicates::MOBY_PREDICATES->articleName
- ),
- new RDF::Core::Literal($articlename)
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $bnode, $bnode->new( MOBY::RDF::Predicates::RDF->type ),
- $container
- )
- );
- } if $relationship =~ m/.*\:hasa$/;
-
- # add has container relationship
- do {
- my $bnode = $node_factory->newResource;
- my $container =
- new RDF::Core::Resource( $self->{uri}, $object );
- $model->addStmt(
- new RDF::Core::Statement(
- $resource,
- $resource->new(
- MOBY::RDF::Predicates::MOBY_PREDICATES->has
- ),
- $bnode
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $bnode,
- $bnode->new(
- MOBY::RDF::Predicates::MOBY_PREDICATES->articleName
- ),
- new RDF::Core::Literal($articlename)
- )
- );
- $model->addStmt(
- new RDF::Core::Statement(
- $bnode, $bnode->new( MOBY::RDF::Predicates::RDF->type ),
- $container
- )
- );
- } if $relationship =~ m/.*\:has$/;
-
}
$sth->finish();
$db->disconnect();
More information about the MOBY-guts
mailing list