SlideShare ist ein Scribd-Unternehmen logo
1 von 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);
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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...
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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...
 

Kürzlich hochgeladen

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

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