SlideShare a Scribd company logo
1 of 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);
}
}

More Related Content

What's hot

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
 

What's hot (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...
 

Viewers also liked

Невероятные способы автоматизации работы в АСУРЭО
Невероятные способы автоматизации работы в АСУРЭОНевероятные способы автоматизации работы в АСУРЭО
Невероятные способы автоматизации работы в АСУРЭОMax Chikhirev
 
Aeroporto de Lisboa nos anos 50
Aeroporto de Lisboa nos anos 50Aeroporto de Lisboa nos anos 50
Aeroporto de Lisboa nos anos 50ppmateus
 
Adopted Glenferrie Road and High Street Structure Plan
Adopted Glenferrie Road and High Street Structure PlanAdopted Glenferrie Road and High Street Structure Plan
Adopted Glenferrie Road and High Street Structure PlanStonnington
 
Y con la familia qué hago
Y con la familia qué hagoY con la familia qué hago
Y con la familia qué hagoRosina Badenes
 
3. el arte contemporáneo frente a la crisis ecológica kom
3. el arte contemporáneo frente a la crisis ecológica kom3. el arte contemporáneo frente a la crisis ecológica kom
3. el arte contemporáneo frente a la crisis ecológica komAmelia Kom Kom
 
Angiomyxoma - A Rare Case Report
Angiomyxoma - A Rare Case ReportAngiomyxoma - A Rare Case Report
Angiomyxoma - A Rare Case ReportApollo Hospitals
 
Princes Gardens Masterplan of Existing Conditions
 Princes Gardens Masterplan of Existing Conditions  Princes Gardens Masterplan of Existing Conditions
Princes Gardens Masterplan of Existing Conditions Stonnington Connect
 
SSG 32 Sustainable Environment Report
SSG 32   Sustainable Environment ReportSSG 32   Sustainable Environment Report
SSG 32 Sustainable Environment ReportStonnington
 
Організація роботи вчителя та учнів по вивченню нового матеріалу
Організація роботи вчителя та учнів по вивченню нового матеріалуОрганізація роботи вчителя та учнів по вивченню нового матеріалу
Організація роботи вчителя та учнів по вивченню нового матеріалуОксана Миколаївна
 
Degree of reaction
Degree of reactionDegree of reaction
Degree of reactionHarshit Jain
 

Viewers also liked (20)

Examem adaptado
Examem adaptadoExamem adaptado
Examem adaptado
 
Невероятные способы автоматизации работы в АСУРЭО
Невероятные способы автоматизации работы в АСУРЭОНевероятные способы автоматизации работы в АСУРЭО
Невероятные способы автоматизации работы в АСУРЭО
 
Biodiesel
BiodieselBiodiesel
Biodiesel
 
Aeroporto de Lisboa nos anos 50
Aeroporto de Lisboa nos anos 50Aeroporto de Lisboa nos anos 50
Aeroporto de Lisboa nos anos 50
 
Marketing Management (EBU2303)
Marketing Management (EBU2303)Marketing Management (EBU2303)
Marketing Management (EBU2303)
 
Adopted Glenferrie Road and High Street Structure Plan
Adopted Glenferrie Road and High Street Structure PlanAdopted Glenferrie Road and High Street Structure Plan
Adopted Glenferrie Road and High Street Structure Plan
 
Y con la familia qué hago
Y con la familia qué hagoY con la familia qué hago
Y con la familia qué hago
 
3. el arte contemporáneo frente a la crisis ecológica kom
3. el arte contemporáneo frente a la crisis ecológica kom3. el arte contemporáneo frente a la crisis ecológica kom
3. el arte contemporáneo frente a la crisis ecológica kom
 
3 AXIS CNC
3 AXIS CNC3 AXIS CNC
3 AXIS CNC
 
Angiomyxoma - A Rare Case Report
Angiomyxoma - A Rare Case ReportAngiomyxoma - A Rare Case Report
Angiomyxoma - A Rare Case Report
 
Princes Gardens Masterplan of Existing Conditions
 Princes Gardens Masterplan of Existing Conditions  Princes Gardens Masterplan of Existing Conditions
Princes Gardens Masterplan of Existing Conditions
 
sohail khan
sohail khansohail khan
sohail khan
 
SSG 32 Sustainable Environment Report
SSG 32   Sustainable Environment ReportSSG 32   Sustainable Environment Report
SSG 32 Sustainable Environment Report
 
Rpp ppkn x bab 3 1516 8 kali jp
Rpp ppkn x bab 3 1516 8 kali jpRpp ppkn x bab 3 1516 8 kali jp
Rpp ppkn x bab 3 1516 8 kali jp
 
NACE-July-6-2015
NACE-July-6-2015NACE-July-6-2015
NACE-July-6-2015
 
project cvs (1)
project cvs (1)project cvs (1)
project cvs (1)
 
Організація роботи вчителя та учнів по вивченню нового матеріалу
Організація роботи вчителя та учнів по вивченню нового матеріалуОрганізація роботи вчителя та учнів по вивченню нового матеріалу
Організація роботи вчителя та учнів по вивченню нового матеріалу
 
Mangosteen
MangosteenMangosteen
Mangosteen
 
Post operatorio
Post operatorioPost operatorio
Post operatorio
 
Degree of reaction
Degree of reactionDegree of reaction
Degree of reaction
 

Similar to Example code for the SADI BMI Calculator Web 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
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
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 to Example code for the SADI BMI Calculator Web 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 테스트전략
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
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
 

More from 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
 
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
 

More from 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
 
Sadi service
Sadi serviceSadi service
Sadi 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...
 

Recently uploaded

Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...tanu pandey
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...nirzagarg
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...SUHANI PANDEY
 

Recently uploaded (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 

Example code for the SADI BMI Calculator Web 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); } }