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

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

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'>.

The URI of the property this attribute represents.
Additional URIs for this attribute that are checked when objects of this class are imported from RDF using the MooseX::Semantic::Role::RdfImport role.
Additional URIs for this attribute that generate additional statements when this object is converted to RDF.
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 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.
CodeRef of a function for coercing the value to a RDF literal. Defaults to the identity function.
CodeRef of a function for parsing the literal value before importing this statement. Defaults to the identity function.

Konstantin Baierer (<kba@cpan.org>)


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.