GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RDFSTORE::MODEL (3)

.ds Aq ’

NAME

RDFStore::Model - An implementation of the Model RDF API using tied hashes and implementing free-text search on literals

CONTENTS

SYNOPSIS



        use RDFStore::NodeFactory;
        my $factory= new RDFStore::NodeFactory();
        my $statement = $factory->createStatement(
                                $factory->createResource(http://perl.org),
                                $factory->createResource(http://iscool.org/schema/1.0/,label),
                                $factory->createLiteral(Cool Web site)
                                );
        my $statement1 = $factory->createStatement(
                                $factory->createResource("http://www.altavista.com"),
                                $factory->createResource("http://pen.jrc.it/schema/1.0/,author),
                                $factory->createLiteral("Who? :-)")
                                );

        my $statement2 = $factory->createStatement(
                                $factory->createUniqueResource(),
                                $factory->createUniqueResource(),
                                $factory->createLiteral("")
                                );

        use RDFStore::Model;
        my $model = new RDFStore::Model( Name => store, FreeText => 1 );

        $model->add($statement);
        $model->add($statement1);
        $model->add($statement2);
        my $model1 = $model->duplicate();

        print $model1->getDigest->equals( $model1->getDigest );
        print $model1->getDigest->hashCode;

        my $found = $model->find($statement2->subject,undef,undef);
        my $found1 = $model->find(undef,undef,undef,undef,Cool); #free-text search on literals :)

        #get Statements
        foreach ( @{$found->elements} ) {
                print $_->getLabel(),"\n";
        };

        #or faster
        my $fetch;
        foreach ( @{$found->elements} ) {
                my $fetch=$_;  #avoid too many fetches from RDFStore::Model::Statements
                print $fetch->getLabel(),"\n";
        };

        #or
        my($statements)=$found1->elements;
        for ( 0..$#{$statements} ) {
                print $statements->[$_]->getLabel(),"\n";
        };

        #get RDFNodes
        foreach ( keys %{$found->elements}) {
                print $found->elements->{$_}->getLabel(),"\n";
        };

        # set operations
        my $set = new RDFStore::Model( Name => setmodel );

        $set=$set->interset($other_model);
        $set=$set->unite($other_model);
        $set=$set->subtract($other_model);



DESCRIPTION

An RDFStore::Model implementation using RDFStore(3) to store triplets.

CONSTRUCTORS

The following methods construct/tie RDFStore::Model storages and objects:
$model = new RDFStore::Model( %whateveryoulikeit ); Create an new RDFStore::Model object and tie up the RDFStore(3). The %whateveryoulikeit hash contains a set of configuration options about how and where store actual data.

Possible additional options are the following:
Name This is a label used to identify a <B>PersistentB> storage by name. It might correspond to a physical file system directory containing the indexes DBs. By default if no <B>NameB> option is given the storage is assumed to be <B>in-memoryB> (e.g. RDFStore::Storage::find method return result sets as in-memory models by default unless specified differently). For local persistent storages a directory named liek this option is created in the current working directory with mode 0666)
Sync Sync the RDFStore::Model with the underling Data::MagciTie GDS after each add() or remove().
FreeText Enable free text searching on literals over a model (see <B>findB>)

SEE ALSO

Digest(3) RDFStore(3) RDFStore::Digest::Digestable(3) RDFStore::Digest(3) RDFStore::RDFNode(3) RDFStore::Resource(3)

AUTHOR



        Alberto Reggiori <areggiori@webweaving.org>



POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 1468: ’=item’ outside of any ’=over’
Around line 1488: You forgot a ’=back’ before ’=head1’

You forgot a ’=back’ before ’=head1’

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RDFSTORE::MODEL (3) 2006-06-19

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.