Linux SoftwareProgrammingLibrariesRDFStore::Parser::SiRPAC 0.50

RDFStore::Parser::SiRPAC 0.50


RDFStore::Parser::SiRPAC is a Perl module that implements a streaming RDF Parser as a direct implementation of XML::Parser::Expat.
Developer:   Alberto Reggiori
      more software by author →
Price:  0.00
License:   GPL (GNU General Public License)
File size:   476K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


RDFStore::Parser::SiRPAC is a Perl module that implements a streaming RDF Parser as a direct implementation of XML::Parser::Expat.

SYNOPSIS

use RDFStore::Parser::SiRPAC;
use RDFStore::NodeFactory;
my $p=new RDFStore::Parser::SiRPAC(
ErrorContext => 2,
Handlers => {
Init => sub { print "INITn"; },
Final => sub { print "FINALn"; },
Assert => sub { print "STATEMENT - @_n"; }
},
NodeFactory => new RDFStore::NodeFactory() );

$p->parsefile('http://www.gils.net/bsr-gils.rdfs');
$p->parsefile('http://www.gils.net/rdf/bsr-gils.rdfs');
$p->parsefile('/some/where/my.rdf');
$p->parsefile('file:/some/where/my.rdf');
$p->parse(*STDIN); #parse stream but with *blocking* Expat (see below example for n-blocking parsing using XML::Parse::ExpatNB)

use RDFStore::Parser::SiRPAC;
use RDFStore::NodeFactory;
my $pstore=new RDFStore::Parser::SiRPAC(
ErrorContext => 2,
Style => 'RDFStore::Parser::Styles::RDFStore::Model',
NodeFactory => new RDFStore::NodeFactory(),
store => {
persistent => 1,
seevalues => 1,
options => { Name => '/tmp/test' }
}
);
my $rdfstore_model = $pstore->parsefile('http://www.gils.net/bsr-gils.rdfs');

#using the expat no-blocking feature (generally for large XML streams) - see XML::Parse::Expat(3)
my $rdfstore_stream_model = $pstore->parsestream(*STDIN);

This module implements a Resource Description Framework (RDF) streaming parser completely in Perl using the XML::Parser::Expat(3) module. The actual RDF parsing happens using an instance of XML::Parser::Expat with Namespaces option enabled and start/stop and char handlers set. The RDF specific code is based on the modified version of SiRPAC of Sergey Melnik in Java; a lot of changes and adaptations have been done to actually run it under Perl. Expat options may be provided when the RDFStore::Parser::SiRPAC object is created. These options are then passed on to the Expat object on each parse call.

Exactly like XML::Parser(3) the behavior of the parser is controlled either by the Style entry elsewhere in this document and/or the Handlers entry elsewhere in this document options, or by the setHandlers entry elsewhere in this document method. These all provide mechanisms for RDFStore::Parser::SiRPAC to set the handlers needed by Expat. If neither Style nor Handlers are specified, then parsing just checks the RDF document syntax against the W3C RDF Raccomandation . When underlying handlers get called, they receive as their first parameter the Expat object, not the Parser object.

To see some examples about how to use it look at the sections below and in the samples and utils directory coming with this software distribution.
E.g. With RDFStore::Parser::SiRPAC you can easily write an rdfingest.pl script to do something like this:

fetch -o - -q http://dmoz.org/rdf/content.rdf.u8.gz |
gunzip - |
sed -f dmoz.content.sed | rdfingest.pl -

Requirements:
  • Perl
    tags rdfstore parser  parser sirpac  use rdfstore  new rdfstore  xml parser  rdfstore nodefactory  www gils  gils net  bsr gils  gils rdfs  http www  parsefile http  the expat  

    Download RDFStore::Parser::SiRPAC 0.50


     http://mirrors.evolva.ro/CPAN/authors/id/A/AR/AREGGIORI/RDFStore-0.50.tar.gz


    Authors software

    RDFStore::Parser::SiRPAC 0.50 (by Alberto Reggiori)
    RDFStore::Parser::SiRPAC is a Perl module that implements a streaming RDF Parser as a direct implementation of XML::Parser::Expat.


    Similar software

    RDFStore::Parser::SiRPAC 0.50 (by Alberto Reggiori)
    RDFStore::Parser::SiRPAC is a Perl module that implements a streaming RDF Parser as a direct implementation of XML::Parser::Expat.

    XML::Parser 2.34 (by Larry Wall)
    XML::Parser is a perl module for parsing XML documents.

    SYNOPSIS

    use XML::Parser;

    $p1 = new XML::Parser(Style => 'Debu

    SVG::Parser 1.01 (by Peter Wainwright)
    SVG::Parser is a Perl module with XML Parser for SVG documents.

    SYNOPSIS

    #!/usr/bin/perl -w
    use strict;
    use SVG::Parser;

    d

    XML::Checker::Parser 1.02 (by Enno Derksen)
    XML::Checker::Parser is an XML::Parser that validates at parse time.

    SYNOPSIS

    use XML::Checker::Parser;

    my %expat_options

    Expat 2.0.0 (by James Clark)
    Expat is a stream-oriented XML parser written in C

    PXR::Parser 0.1.5 (by Nicholas Perez)
    PXR::Parser is a Pure Perl SAX XML Push Parser.

    SYNOPSIS

    use PXR::Parser;

    my $parser = PXR::Parser->new(

    XML::Parser::Style::Stream 2.34 (by Clark Cooper)
    XML::Parser::Style::Stream is a Stream style for XML::Parser.

    SYNOPSIS

    use XML::Parser;
    my $p = XML::Parser->new(Style =>

    XML::DOM 1.44 (by T.J. Mather)
    XML::DOM is a perl module for building DOM Level 1 compliant document structures.

    SYNOPSIS

    use XML::DOM;

    my $parser = new

    XML::Parser::PerlSAX 0.08 (by Ken MacLeod)
    XML::Parser::PerlSAX is a Perl SAX parser using XML::Parser.

    SYNOPSIS

    use XML::Parser::PerlSAX;

    $parser = XML::Parser::Per

    XML::SAX::Intro 0.14 (by Matt Sergeant)
    XML::SAX::Intro is an Introduction to SAX Parsing with Perl.

    XML::SAX is a new way to work with XML Parsers in Perl


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags