RDF::Redland::Query(3pm) User Contributed Perl Documentation RDF::Redland::Query(3pm)NAME
RDF::Redland::Query - Redland RDF Syntax Query Class
SYNOPSIS
use RDF::Redland;
...
my $query=new RDF::Redland::Query($query_string); # default query language
my $results=$query->execute($model);
# or my $results=$model->query_execute($query);
while(!$results->finished) {
for (my $i=0; $i < $results->bindings_count(); $i++) {
my $name=$results->binding_name($i);
my $value=$results->binding_value($i);
# ... do something with the results
}
$results->next_result;
}
DESCRIPTION
This class represents queries of various syntaxes over an RDF::Redland::Model returning a sequence of results that (currently) bind
variable names to RDF::Redland::Node values.
CONSTRUCTORS
new QUERY-STRING [BASE-URI [QUERY-LANG-URI [QUERY-LANG]]]
Create a new RDF::Redland::Query object for a query string QUERY-STRING with optional base URI BASE-URI IN QUERY language QUERY-LANG or
query language URI QUERY-LANG-URI (both can be undef). If QUERY-LANG-URI is omitted, the current directory is used as the base URI.
If QUERY-LANG-NAME is undef, the default query language "rdql" is used. If BASE-URI is omitted, no base URI is used.
METHODS
execute MODEL
Run the query against model MODEL returning a RDF::Redland::QueryResults object or undef on failure.
SEE ALSO
RDF::Redland::QueryResults
AUTHOR
Dave Beckett - http://www.dajobe.org/
perl v5.14.2 2011-02-04 RDF::Redland::Query(3pm)
Check Out this Related Man Page
RDF::Redland::Parser(3pm) User Contributed Perl Documentation RDF::Redland::Parser(3pm)NAME
RDF::Redland::Parser - Redland RDF Syntax Parsers Class
SYNOPSIS
use RDF::Redland;
...
my $parser=new RDF::Redland::Parser("rdfxml");
my $parser2=new RDF::Redland::Parser(undef, "application/rdf+xml);
# Return as an RDF::Redland::Stream
my $stream=$parser->parse_as_stream($source_uri, $base_uri);
# Store in an RDF::Redland::Model
$parser->parse_into_model($source_uri, $base_uri, $model);
DESCRIPTION
This class represents parsers of various syntaxes that can deliver a RDF model either as a RDF::Redland::Stream of RDF::Redland::Statement
objects or directly into an RDF::Redland::Model object.
CONSTRUCTORS
new [NAME [MIME_TYPE [URI]]]
Create a new RDF::Redland::Parser object for a syntax parser named NAME, with MIME Type MIME_TYPE and/or URI URI. Any field can be
undef or omitted; if all are omitted, a parser that provides MIME Type application/rdf+xml will be requested.
METHODS
parse_as_stream SOURCE_URI BASE_URI
Parse the syntax at the RDF::Redland::URI SOURCE_URI with optional base RDF::Redland::URI BASE_URI. If the base URI is given then the
content is parsed as if it was at the base URI rather than the source URI.
Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure.
parse_into_model SOURCE_URI BASE_URI MODEL [HANDLER]
Parse the syntax at the RDF::Redland::URI SOURCE_URI with optional base RDF::Redland::URI BASE_URI into RDF::Redland::Model MODEL. If
the base URI is given then the content is parsed as if it was at the base URI rather than the source URI.
If the optional HANDLER is given, it is a reference to a sub with the signature
sub handler($$$$$$$$$) {
my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_;
...
} that receives errors in parsing.
parse_string_as_stream STRING BASE_URI
Parse the syntax in STRING with required base RDF::Redland::URI BASE_URI.
Returns an RDF::Redland::Stream of RDF::Redland::Statement objects or undef on failure.
parse_string_into_model STRING BASE_URI MODEL [HANDLER]
Parse the syntax in STRING with required base RDF::Redland::URI BASE_URI into RDF::Redfland::Model MODEL.
If the optional HANDLER is given, it is a reference to a sub with the signature
sub handler($$$$$$$$$) {
my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_;
...
} that receives errors in parsing.
feature URI [VALUE]
Get/set a parser feature. The feature is named via RDF::Redland::URI URI and the value is a RDF::Redland::Node. If VALUE is given,
the feature is set to that value, otherwise the current value is returned.
namespaces_seen
Get the set of namespace declarations seen during parsing as a hash of key:prefix string (may be ''), value: RDF::Redland::URI objects.
SEE ALSO
RDF::Redland::URI
AUTHOR
Dave Beckett - http://www.dajobe.org/
perl v5.14.2 2011-02-04 RDF::Redland::Parser(3pm)