SlideShare una empresa de Scribd logo
1 de 2
#!/usr/local/bin/perl
package GetMyBMI; # a SADI Service for BMI Calculation
use strict;
use warnings;
#use base 'SADI::Simple::AsyncService';
use base 'SADI::Simple::SyncService';
my $config = {
ServiceName => 'GetMyBMI', # any name you like
ServiceURI => 'http://linkeddata.systems/cgi-bin/SADI/GetMyBMI.pl', #URL of this script
Description => 'A BMI calculator',
InputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientData',
OutputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientBMI',
Authority => 'wilkinsonlab.info', # domain of organization providing service
Provider => 'markw@illuminae.com', # contact e-mail address of service provider
};
my $service = GetMyBMI->new(%$config);
$service->handle_cgi_request;
#-----------------------------------------------------------------
# SERVICE IMPLEMENTATION
#-----------------------------------------------------------------
use RDF::Trine::Node::Resource;
use RDF::Trine::Node::Literal;
use RDF::Trine::Statement;
sub process_it {
my ($self, $inputs, $input_model, $output_model) = @_;
# $inputs - ref to an array of RDF::Trine::Node::Resource
# $input_model - an RDF::Trine::Model containing the input RDF data
# $output_model - an RDF::Trine::Model containing the output RDF data
my $heightp = RDF::Trine::Node::Resource->new(
'http://mged.sourceforge.net/ontologies/MGEDOntology.owl#has_height');
my $weightp = RDF::Trine::Node::Resource->new(
'http://linkeddata.systems/ontologies/SADITutorial.owl#has_mass');
my $BMIp = RDF::Trine::Node::Resource->new(
'http://sadiframework.org/examples/bmi.owl#BMI');
foreach my $input (@$inputs) {
# retrieve the height and weight node from each input
my ($height) = $input_model->objects($input, $heightp);
my ($weight) = $input_model->objects($input, $weightp);
$height = $height->value;
$weight = $weight->value;
my $BMI = $weight/($height * $height);
my $BMI_literal = RDF::Trine::Node::Literal->new($BMI);
# The output statement is about the $input as the subject node!!
my $statement = RDF::Trine::Statement->new($input, $BMIp, $BMI_literal);
$output_model->add_statement($statement);
}
}
#!/usr/local/bin/perl
package GetMyBMI;
use strict;
use warnings;
use base 'SADI::Simple::SyncService';
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($WARN);
#Log::Log4perl->easy_init($DEBUG);
my $config = {
ServiceName => 'GetMyBMI', # any name you like
ServiceURI => 'http://linkeddata.systems/cgi-bin/SADI/GetMyBMI.pl',
Description => 'A BMI calculator',
InputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientData',
OutputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientBMI',
Authority => 'wilkinsonlab.info', # domain of organization providing service
Provider => 'markw@illuminae.com', # contact e-mail address of service provider
NanoPublisher => 1, # I want to be a NanoPublisher
};
my $service = GetMyBMI->new(%$config);
$service->handle_cgi_request;
use RDF::Trine::Node::Resource;
use RDF::Trine::Node::Literal;
use RDF::Trine::Statement;
sub process_it {
my ($self, $inputs, $input_model, $output_model) = @_;
# $inputs - ref to an array of RDF::Trine::Node::Resource
# $input_model - an RDF::Trine::Model containing the input RDF data
# $output_model - an RDF::Trine::Model containing the output RDF data
my $heightp = RDF::Trine::Node::Resource->new(
'http://mged.sourceforge.net/ontologies/MGEDOntology.owl#has_height');
my $weightp = RDF::Trine::Node::Resource->new(
'http://linkeddata.systems/ontologies/SADITutorial.owl#has_mass');
my $BMIp = RDF::Trine::Node::Resource->new(
'http://sadiframework.org/examples/bmi.owl#BMI');
foreach my $input (@$inputs) {
my ($height) = $input_model->objects($input, $heightp);
my ($weight) = $input_model->objects($input, $weightp);
$height = $height->value;
$weight = $weight->value;
my $BMI = $weight/($height * $height);
DEBUG("BMI $BMIn");
my $BMI_literal = RDF::Trine::Node::Literal->new($BMI);
my $statement = RDF::Trine::Statement->new($input, $BMIp, $BMI_literal);
$output_model->add_statement($statement, $input);
$output_model->nanopublish_result_for($input);
}
}

Más contenido relacionado

La actualidad más candente

Generating Power with Yield
Generating Power with YieldGenerating Power with Yield
Generating Power with YieldJason Myers
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowKacper Gunia
 
Introduction to the Pods JSON API
Introduction to the Pods JSON APIIntroduction to the Pods JSON API
Introduction to the Pods JSON APIpodsframework
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016Kacper Gunia
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Arc & Codementor
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matchingJIGAR MAKHIJA
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using CodeceptionJeroen van Dijk
 
ZCPE - PHP Conference 2015
ZCPE   - PHP Conference 2015ZCPE   - PHP Conference 2015
ZCPE - PHP Conference 2015Matheus Marabesi
 
Php server variables
Php server variablesPhp server variables
Php server variablesJIGAR MAKHIJA
 
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...Matheus Marabesi
 

La actualidad más candente (18)

Generating Power with Yield
Generating Power with YieldGenerating Power with Yield
Generating Power with Yield
 
Perl5i
Perl5iPerl5i
Perl5i
 
PHP function
PHP functionPHP function
PHP function
 
PHP 8.1: Enums
PHP 8.1: EnumsPHP 8.1: Enums
PHP 8.1: Enums
 
Php Enums
Php EnumsPhp Enums
Php Enums
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
 
Php functions
Php functionsPhp functions
Php functions
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
 
Introduction to the Pods JSON API
Introduction to the Pods JSON APIIntroduction to the Pods JSON API
Introduction to the Pods JSON API
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
 
Event Sourcing with php
Event Sourcing with phpEvent Sourcing with php
Event Sourcing with php
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
ZCPE - PHP Conference 2015
ZCPE   - PHP Conference 2015ZCPE   - PHP Conference 2015
ZCPE - PHP Conference 2015
 
Php server variables
Php server variablesPhp server variables
Php server variables
 
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
 

Destacado

Numéricable : Module 3
Numéricable : Module 3Numéricable : Module 3
Numéricable : Module 3Marion IIM
 
Porque é importante_a_filosofia
Porque é importante_a_filosofiaPorque é importante_a_filosofia
Porque é importante_a_filosofiaMarcio Rodrigues
 
PURCHASE OF AGRICULTURAL LAND
PURCHASE OF AGRICULTURAL LANDPURCHASE OF AGRICULTURAL LAND
PURCHASE OF AGRICULTURAL LANDReal estate
 
Gamayun For SCT 13.04.2010
Gamayun For SCT 13.04.2010Gamayun For SCT 13.04.2010
Gamayun For SCT 13.04.2010Andrey Sverdlov
 
Mulimedia Final Presentation
Mulimedia Final PresentationMulimedia Final Presentation
Mulimedia Final Presentationchrissavo
 
Save time on your Email Marketing Campaign with Mailchimp
Save time on your Email Marketing Campaign with MailchimpSave time on your Email Marketing Campaign with Mailchimp
Save time on your Email Marketing Campaign with MailchimpKristine Grace Gerongco
 
La vuelta al mundo
La vuelta al mundoLa vuelta al mundo
La vuelta al mundoiesasorey
 
Study PCS and PPSC
Study PCS and PPSCStudy PCS and PPSC
Study PCS and PPSCEXAM PUNJAB
 
Seedsampling and seed testing in East Timor
Seedsampling and seed testing in East TimorSeedsampling and seed testing in East Timor
Seedsampling and seed testing in East Timorsimao belo
 
Jogo da Memória - Rosa e azul
Jogo da Memória - Rosa e azulJogo da Memória - Rosa e azul
Jogo da Memória - Rosa e azuldeasilvia
 
Presentacion De Oportunidad De Negocio Vida Divina
Presentacion De Oportunidad De Negocio Vida DivinaPresentacion De Oportunidad De Negocio Vida Divina
Presentacion De Oportunidad De Negocio Vida DivinaMelissa Diaz
 
Stonnington Flood Management Plan - Grace's revised version October 2013
Stonnington Flood Management Plan - Grace's revised version October 2013Stonnington Flood Management Plan - Grace's revised version October 2013
Stonnington Flood Management Plan - Grace's revised version October 2013Stonnington
 

Destacado (18)

Numéricable : Module 3
Numéricable : Module 3Numéricable : Module 3
Numéricable : Module 3
 
Maritime education week 20
Maritime education week 20 Maritime education week 20
Maritime education week 20
 
FME Final
FME FinalFME Final
FME Final
 
Porque é importante_a_filosofia
Porque é importante_a_filosofiaPorque é importante_a_filosofia
Porque é importante_a_filosofia
 
PURCHASE OF AGRICULTURAL LAND
PURCHASE OF AGRICULTURAL LANDPURCHASE OF AGRICULTURAL LAND
PURCHASE OF AGRICULTURAL LAND
 
Gamayun For SCT 13.04.2010
Gamayun For SCT 13.04.2010Gamayun For SCT 13.04.2010
Gamayun For SCT 13.04.2010
 
Mulimedia Final Presentation
Mulimedia Final PresentationMulimedia Final Presentation
Mulimedia Final Presentation
 
Simbolos patrios del perú
Simbolos patrios del perúSimbolos patrios del perú
Simbolos patrios del perú
 
Save time on your Email Marketing Campaign with Mailchimp
Save time on your Email Marketing Campaign with MailchimpSave time on your Email Marketing Campaign with Mailchimp
Save time on your Email Marketing Campaign with Mailchimp
 
La vuelta al mundo
La vuelta al mundoLa vuelta al mundo
La vuelta al mundo
 
Study PCS and PPSC
Study PCS and PPSCStudy PCS and PPSC
Study PCS and PPSC
 
Seedsampling and seed testing in East Timor
Seedsampling and seed testing in East TimorSeedsampling and seed testing in East Timor
Seedsampling and seed testing in East Timor
 
Cubismo
CubismoCubismo
Cubismo
 
Brochoure gustavo guerra asmarketingg
Brochoure gustavo guerra   asmarketinggBrochoure gustavo guerra   asmarketingg
Brochoure gustavo guerra asmarketingg
 
Jogo da Memória - Rosa e azul
Jogo da Memória - Rosa e azulJogo da Memória - Rosa e azul
Jogo da Memória - Rosa e azul
 
Presentacion De Oportunidad De Negocio Vida Divina
Presentacion De Oportunidad De Negocio Vida DivinaPresentacion De Oportunidad De Negocio Vida Divina
Presentacion De Oportunidad De Negocio Vida Divina
 
Stonnington Flood Management Plan - Grace's revised version October 2013
Stonnington Flood Management Plan - Grace's revised version October 2013Stonnington Flood Management Plan - Grace's revised version October 2013
Stonnington Flood Management Plan - Grace's revised version October 2013
 
Network Radius
Network RadiusNetwork Radius
Network Radius
 

Similar a Sadi service

What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)James Titcumb
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with PerlDave Cross
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012D
 
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략Jeen Lee
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Anatoly Sharifulin
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesAlbert Jessurum
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Masahiro Nagano
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplicationolegmmiller
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Restshravan kumar chelika
 

Similar a Sadi service (20)

What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
CakePHP workshop
CakePHP workshopCakePHP workshop
CakePHP workshop
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
Xmpp prebind
Xmpp prebindXmpp prebind
Xmpp prebind
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 

Más de Mark Wilkinson

FAIR Metrics - Presentation to NIH KC1
FAIR Metrics - Presentation to NIH KC1FAIR Metrics - Presentation to NIH KC1
FAIR Metrics - Presentation to NIH KC1Mark Wilkinson
 
Introducing the fair evaluator
Introducing the fair evaluatorIntroducing the fair evaluator
Introducing the fair evaluatorMark Wilkinson
 
FAIR Projector Builder
FAIR Projector BuilderFAIR Projector Builder
FAIR Projector BuilderMark Wilkinson
 
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...Tech. session : Interoperability and Data FAIRness emerges from a novel combi...
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...Mark Wilkinson
 
smartAPIs: EUDAT Semantic Working Group Presentation @ RDA 9th Plenary
smartAPIs:  EUDAT Semantic Working Group Presentation @ RDA 9th PlenarysmartAPIs:  EUDAT Semantic Working Group Presentation @ RDA 9th Plenary
smartAPIs: EUDAT Semantic Working Group Presentation @ RDA 9th PlenaryMark Wilkinson
 
IBC FAIR Data Prototype Implementation slideshow
IBC FAIR Data Prototype Implementation   slideshowIBC FAIR Data Prototype Implementation   slideshow
IBC FAIR Data Prototype Implementation slideshowMark Wilkinson
 
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...Mark Wilkinson
 
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015Mark Wilkinson
 
Sample data and other ur ls
Sample data and other ur lsSample data and other ur ls
Sample data and other ur lsMark Wilkinson
 
Example code for the SADI BMI Calculator Web Service
Example code for the SADI BMI Calculator Web ServiceExample code for the SADI BMI Calculator Web Service
Example code for the SADI BMI Calculator Web ServiceMark Wilkinson
 
Tutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-servicesTutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-servicesMark Wilkinson
 
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015Mark Wilkinson
 
Force11 JDDCP workshop presentation, @ Force2015, Oxford
Force11 JDDCP workshop presentation, @ Force2015, OxfordForce11 JDDCP workshop presentation, @ Force2015, Oxford
Force11 JDDCP workshop presentation, @ Force2015, OxfordMark Wilkinson
 
Presentation to the J. Craig Venter Institute, Dec. 2014
Presentation to the J. Craig Venter Institute, Dec. 2014Presentation to the J. Craig Venter Institute, Dec. 2014
Presentation to the J. Craig Venter Institute, Dec. 2014Mark Wilkinson
 
Enhancing Reproducibility and Transparency in Clinical Research through Seman...
Enhancing Reproducibility and Transparency in Clinical Research through Seman...Enhancing Reproducibility and Transparency in Clinical Research through Seman...
Enhancing Reproducibility and Transparency in Clinical Research through Seman...Mark Wilkinson
 
Web Science 2.0 - in silico science
Web Science 2.0 - in silico scienceWeb Science 2.0 - in silico science
Web Science 2.0 - in silico scienceMark Wilkinson
 
Web Science - ISoLA 2012
Web Science - ISoLA 2012Web Science - ISoLA 2012
Web Science - ISoLA 2012Mark Wilkinson
 
Web Science, SADI, and the Singularity
Web Science, SADI, and the SingularityWeb Science, SADI, and the Singularity
Web Science, SADI, and the SingularityMark Wilkinson
 
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...Mark Wilkinson
 

Más de Mark Wilkinson (20)

FAIR Metrics - Presentation to NIH KC1
FAIR Metrics - Presentation to NIH KC1FAIR Metrics - Presentation to NIH KC1
FAIR Metrics - Presentation to NIH KC1
 
Introducing the fair evaluator
Introducing the fair evaluatorIntroducing the fair evaluator
Introducing the fair evaluator
 
FAIR Projector Builder
FAIR Projector BuilderFAIR Projector Builder
FAIR Projector Builder
 
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...Tech. session : Interoperability and Data FAIRness emerges from a novel combi...
Tech. session : Interoperability and Data FAIRness emerges from a novel combi...
 
smartAPIs: EUDAT Semantic Working Group Presentation @ RDA 9th Plenary
smartAPIs:  EUDAT Semantic Working Group Presentation @ RDA 9th PlenarysmartAPIs:  EUDAT Semantic Working Group Presentation @ RDA 9th Plenary
smartAPIs: EUDAT Semantic Working Group Presentation @ RDA 9th Plenary
 
IBC FAIR Data Prototype Implementation slideshow
IBC FAIR Data Prototype Implementation   slideshowIBC FAIR Data Prototype Implementation   slideshow
IBC FAIR Data Prototype Implementation slideshow
 
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...
FAIR Data Prototype - Interoperability and FAIRness through a novel combinati...
 
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015
Building SADI Services Tutorial - SIB Workshop, Geneva, December 2015
 
Sample data and other ur ls
Sample data and other ur lsSample data and other ur ls
Sample data and other ur ls
 
Example code for the SADI BMI Calculator Web Service
Example code for the SADI BMI Calculator Web ServiceExample code for the SADI BMI Calculator Web Service
Example code for the SADI BMI Calculator Web Service
 
Tutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-servicesTutorial - Creating SADI semantic-web-services
Tutorial - Creating SADI semantic-web-services
 
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015
Data FAIRport Prototype & Demo - Presentation to Elsevier, Jul 10, 2015
 
Force11 JDDCP workshop presentation, @ Force2015, Oxford
Force11 JDDCP workshop presentation, @ Force2015, OxfordForce11 JDDCP workshop presentation, @ Force2015, Oxford
Force11 JDDCP workshop presentation, @ Force2015, Oxford
 
Presentation to the J. Craig Venter Institute, Dec. 2014
Presentation to the J. Craig Venter Institute, Dec. 2014Presentation to the J. Craig Venter Institute, Dec. 2014
Presentation to the J. Craig Venter Institute, Dec. 2014
 
Enhancing Reproducibility and Transparency in Clinical Research through Seman...
Enhancing Reproducibility and Transparency in Clinical Research through Seman...Enhancing Reproducibility and Transparency in Clinical Research through Seman...
Enhancing Reproducibility and Transparency in Clinical Research through Seman...
 
SADI CSHALS 2013
SADI CSHALS 2013SADI CSHALS 2013
SADI CSHALS 2013
 
Web Science 2.0 - in silico science
Web Science 2.0 - in silico scienceWeb Science 2.0 - in silico science
Web Science 2.0 - in silico science
 
Web Science - ISoLA 2012
Web Science - ISoLA 2012Web Science - ISoLA 2012
Web Science - ISoLA 2012
 
Web Science, SADI, and the Singularity
Web Science, SADI, and the SingularityWeb Science, SADI, and the Singularity
Web Science, SADI, and the Singularity
 
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...
Evaluating Hypotheses using SPARQL-DL as an abstract workflow language to cho...
 

Último

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 

Último (20)

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 

Sadi service

  • 1. #!/usr/local/bin/perl package GetMyBMI; # a SADI Service for BMI Calculation use strict; use warnings; #use base 'SADI::Simple::AsyncService'; use base 'SADI::Simple::SyncService'; my $config = { ServiceName => 'GetMyBMI', # any name you like ServiceURI => 'http://linkeddata.systems/cgi-bin/SADI/GetMyBMI.pl', #URL of this script Description => 'A BMI calculator', InputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientData', OutputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientBMI', Authority => 'wilkinsonlab.info', # domain of organization providing service Provider => 'markw@illuminae.com', # contact e-mail address of service provider }; my $service = GetMyBMI->new(%$config); $service->handle_cgi_request; #----------------------------------------------------------------- # SERVICE IMPLEMENTATION #----------------------------------------------------------------- use RDF::Trine::Node::Resource; use RDF::Trine::Node::Literal; use RDF::Trine::Statement; sub process_it { my ($self, $inputs, $input_model, $output_model) = @_; # $inputs - ref to an array of RDF::Trine::Node::Resource # $input_model - an RDF::Trine::Model containing the input RDF data # $output_model - an RDF::Trine::Model containing the output RDF data my $heightp = RDF::Trine::Node::Resource->new( 'http://mged.sourceforge.net/ontologies/MGEDOntology.owl#has_height'); my $weightp = RDF::Trine::Node::Resource->new( 'http://linkeddata.systems/ontologies/SADITutorial.owl#has_mass'); my $BMIp = RDF::Trine::Node::Resource->new( 'http://sadiframework.org/examples/bmi.owl#BMI'); foreach my $input (@$inputs) { # retrieve the height and weight node from each input my ($height) = $input_model->objects($input, $heightp); my ($weight) = $input_model->objects($input, $weightp); $height = $height->value; $weight = $weight->value; my $BMI = $weight/($height * $height); my $BMI_literal = RDF::Trine::Node::Literal->new($BMI); # The output statement is about the $input as the subject node!! my $statement = RDF::Trine::Statement->new($input, $BMIp, $BMI_literal); $output_model->add_statement($statement); } }
  • 2. #!/usr/local/bin/perl package GetMyBMI; use strict; use warnings; use base 'SADI::Simple::SyncService'; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($WARN); #Log::Log4perl->easy_init($DEBUG); my $config = { ServiceName => 'GetMyBMI', # any name you like ServiceURI => 'http://linkeddata.systems/cgi-bin/SADI/GetMyBMI.pl', Description => 'A BMI calculator', InputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientData', OutputClass => 'http://linkeddata.systems/ontologies/SADITutorial.owl#PatientBMI', Authority => 'wilkinsonlab.info', # domain of organization providing service Provider => 'markw@illuminae.com', # contact e-mail address of service provider NanoPublisher => 1, # I want to be a NanoPublisher }; my $service = GetMyBMI->new(%$config); $service->handle_cgi_request; use RDF::Trine::Node::Resource; use RDF::Trine::Node::Literal; use RDF::Trine::Statement; sub process_it { my ($self, $inputs, $input_model, $output_model) = @_; # $inputs - ref to an array of RDF::Trine::Node::Resource # $input_model - an RDF::Trine::Model containing the input RDF data # $output_model - an RDF::Trine::Model containing the output RDF data my $heightp = RDF::Trine::Node::Resource->new( 'http://mged.sourceforge.net/ontologies/MGEDOntology.owl#has_height'); my $weightp = RDF::Trine::Node::Resource->new( 'http://linkeddata.systems/ontologies/SADITutorial.owl#has_mass'); my $BMIp = RDF::Trine::Node::Resource->new( 'http://sadiframework.org/examples/bmi.owl#BMI'); foreach my $input (@$inputs) { my ($height) = $input_model->objects($input, $heightp); my ($weight) = $input_model->objects($input, $weightp); $height = $height->value; $weight = $weight->value; my $BMI = $weight/($height * $height); DEBUG("BMI $BMIn"); my $BMI_literal = RDF::Trine::Node::Literal->new($BMI); my $statement = RDF::Trine::Statement->new($input, $BMIp, $BMI_literal); $output_model->add_statement($statement, $input); $output_model->nanopublish_result_for($input); } }