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
 
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 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 테스트전략
 
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
 

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

Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Onlineanilsa9823
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 

Recently uploaded (20)

Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 

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); } }