ODO::Ontology::RDFS - RDFS to Perl code generator frontend.
use ODO::Node; use ODO::Graph::Simple; use ODO::Ontology::RDFS; my $schema = ODO::Graph::Simple->Memory(name=> 'Schema Model'); my $source_data = ODO::Graph::Simple->Memory(name=> 'Source Data model'); my ($statements, $imports) = ODO::Parser::XML->parse_file('/path/to/a/file.xml'); $schema->add($statements); print STDERR "Generating Perl schema\n"; my $SCHEMA = ODO::Ontology::RDFS->new(graph=> $source_data, schema_graph=> $schema); # $SCHEMA is_a ODO::Ontology::RDFS::PerlEntity my $resource = RDFS::Resource->new(ODO::Node::Resource->new('http://tempuri.org/someResource'), $source_data); my $klass = RDFS::Class->new(ODO::Node::Resource->new('http://tempuri.org/someClassDefinition'), $source_data);
Get all class data:
1. Get all subjects with type Class - the name of the class is provided by the label - the comment is a description of the class - the definition is a URI where you can find the actual definition of the the object (definition and isDefinedBy should be methods) - record any explicit subclasses with the subClassOf triple 2. Get all properties with their domain being in the class from step 1 - Access them with a general property( $name, [ $value ] ) method ? 3. Build objects
Finding properties of a particular class means finding all triples that have the class's subject URI and the form <any, rdfs:domain> <subject URI>
Finds all of the triples that fit the form: (subject, <rdf:type>, <rdfs:Class>) Semantically: all of the RDFS classes in the graph.
Finds all triples that fit the form: (<URI>, <rdf:type>, <rdf:Property>). Semantically: Find all of the rdf:Properties in this graph.
Finds all of the triples that fit the form: (<ownerSubjectURI>, <rdf:type>, <rdfs:domain>) Semantically: All subjects that have a domain restriction that is the owner class. These should be <rdf:Properties>
Copyright (c) 2005-2006 IBM Corporation.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
To install PLUTO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PLUTO
CPAN shell
perl -MCPAN -e shell install PLUTO
For more information on module installation, please visit the detailed CPAN module installation guide.