RDF::Cowl - A lightweight API for working with OWL 2 ontologies
version 1.0.0
use RDF::Cowl; use boolean; use constant ONTO => 'corpus/example_pizza.owl'; use constant NS => "http://www.co-ode.org/ontologies/pizza/pizza.owl#"; use constant CLASS_NAME => "Food"; my $manager = RDF::Cowl::Manager->new; my $onto = do { try { $manager->read_path(ONTO) } catch($e) { die "Failed to load ontology @{[ ONTO ]}: $e"; } }; my $cls = RDF::Cowl::Class->from_string(NS . CLASS_NAME); my @subclasses; $onto->iterate_sub_classes( $cls, sub ($subclass) { push @subclasses, $subclass->get_iri->get_rem if $subclass->isa('RDF::Cowl::Class'); return true; }, false ); is \@subclasses, bag { item 'IceCream'; item 'Pizza'; item 'PizzaBase'; item 'PizzaTopping'; end(); }, 'Got Food direct subclasses';
Cowl provides an API for parsing, querying, editing, and writing OWL 2 ontologies. It currently supports processing OWL2 Functional Syntax.
For now, the best place to look for example code is the tests under the t/upstream directory.
t/upstream
Cowl documentation
Alien::Cowl
Zakariyya Mughal <zmughal@cpan.org>
Copyright (C) 2024 by Auto-Parallel Technologies, Inc..
This is free software, licensed under Eclipse Public License - v 2.0.
To install RDF::Cowl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::Cowl
CPAN shell
perl -MCPAN -e shell install RDF::Cowl
For more information on module installation, please visit the detailed CPAN module installation guide.