File: 09opendocument.t

package info (click to toggle)
librdf-rdfa-parser-perl 1.097-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,948 kB
  • sloc: perl: 6,582; makefile: 7; xml: 6; sh: 1
file content (30 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use Test::More;
use RDF::RDFa::Parser;

eval { require RDF::Query; require Archive::Zip; 'OK' }
	or plan skip_all => 'Need RDF::Query and Archive::Zip to run this test!';

plan tests => 1;

(my $file = __FILE__) =~ s/t$/odt/;
my $data  = do { local(@ARGV, $/) = $file; <> };
my $p     = RDF::RDFa::Parser->new(
	$data,
	'http://example.com/09opendocument.odt',
	RDF::RDFa::Parser::Config->new( RDF::RDFa::Parser::Config->HOST_OPENDOCUMENT_ZIP, '1.1', graph => 0 ),
);

my $query = RDF::Query->new(<<'SPARQL');
PREFIX dc: <http://purl.org/dc/elements/1.1/>
ASK WHERE {
	?u dc:example1 "B" .
	?u dc:example2 "EFG" .
	?u dc:example3 "FGH" .
	?u dc:example4 "GHI" .
	FILTER ( !isBlank(?u) )
}
SPARQL

my $result = $query->execute($p->graph);

ok($result->is_boolean and $result->get_boolean);