konstantin baierer > MooseX-Semantic > MooseX::Semantic::Meta::Attribute::Trait

Download:
MooseX-Semantic-0.006.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

MooseX::Semantic::Meta::Attribute::Trait - Attribute trait for semantic attributes

SYNOPSIS ^

    package My::Model::Person;
    use RDF::Trine::Namespace qw(foaf xsd);

    has name => (
        traits => ['Semantic'],
        is => 'rw',
        isa => 'Str',
        uri => $foaf->name,
        rdf_datatype => $xsd->string,
    );

    has knows => (
        traits => ['Semantic'],
        is => 'rw',
        isa => 'My::Model::Person',
        uri => $foaf->knows,
    );

DESCRIPTION ^

Attributes that apply the Semantic trait can be extended using the attributes listed below.

By default, all Semantic attributes are read-write, i.e. is = 'rw'>.

ATTRIBUTES ^

uri

The URI of the property this attribute represents.

uri_reader

Additional URIs for this attribute that are checked when objects of this class are imported from RDF using the MooseX::Semantic::Role::RdfImport role.

uri_writer

Additional URIs for this attribute that generate additional statements when this object is converted to RDF.

rdf_datatype

RDF datatype for this resource.

Makes sense only when the attribute in question is of a literal type, i.e. Str, Num or descendants thereof.

rdf_lang

RDF language for this resource.

Makes sense only when the attribute in question is of a literal type, i.e. Str, Bool, Num or descendants thereof.

rdf_formatter

CodeRef of a function for coercing the value to a RDF literal. Defaults to the identity function.

rdf_parser

CodeRef of a function for parsing the literal value before importing this statement. Defaults to the identity function.

AUTHOR ^

Konstantin Baierer (<kba@cpan.org>)

SEE ALSO ^

MooseX::Semantic

LICENCE AND COPYRIGHT ^

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: