NAME

RDF::Server::Model::RDFCore

SYNOPSIS

DESCRIPTION

Manages a triple store based on RDF::Core. Support is included for using the model as a resource itself for the RDF semantic.

CONFIGURATION

namespace

The default namespace in which resources are located. While the store can support resources in other namespaces, the RDF::Server modules expect resources to be in this namespace.

store

The store is a RDF::Core::Model object that manages the triples.

METHODS

has_triple ($s, $p, $o)

Given a subject, predicate, and object, returns true if the store contains the triple. Any of the parameters may be undefined to serve as wildcards.

Each parameter may be a single value or an array ref.

If the subject or predicate are an array ref, then the referenced array consists of two elements: the namespace and the local name. Otherwise, the string is the URI (namespace and local name combined) of the parameter.

If the object is a string, then it is considered a literal. Otherwise, it is interpreted in the same manner as the other parameters.

get_triples ($s, $p, $o)
add_triple ($s, $p, $o)
get_value

This method is only valid in resources that are part of a model.

resource ( $id | [ $namespace, $id ] )

Returns a RDF::Server::Resource::RDFCore object representing all the triples in the store that are associated with the given either an array reference containing the namespace and the local name, or a string containing the local name. The default namespace is the one defined for the model.

This will return an object regardless of the existance of the resource. It is not an error to have an empty RDF document associated with a URL.

resources ( $namespace )

Returns an iterator (see Iterator::Simple) that will iterate over the resources in the store in the provided namespace (or the model's namespace if none is given). Each iteration will return a RDF::Server::Resource::RDFCore object.

resource_exists ( $namespace, $id )

Returns true if there is at least one triple in the store associated with the provided namespace and local name.

fetch

Returns the RDF document representing all of the triples within the model.

data

Returns a refernce to an array of hashes, one for each resource in the model.

update
purge
render
delete
modify
replace
remove

AUTHOR

James Smith, <jsmith@cpan.org>

LICENSE

Copyright (c) 2008 Texas A&M University.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.