Redland 라이브러리와 펄에 대한 RDF : Redland 바인딩이 아주 잘가 켜짐 예를 here 및 here.저장된 RDF :: Redland 영구 저장소를 검색하는 방법은 무엇입니까?
를 들어, 영구 저장소와 모델을 만들고 그것을로의 RDF/XML 파일을 구문 분석에 관해서 설명되어 있습니다 다른 한편으로는, 영구 저장소에서 모델을 검색하는 방법에 대한 예제를 찾을 수 없으며 분명한 방법으로 작동하지 않습니다.
my $storage =
new RDF::Redland::Storage("hashes", "test",
"new='yes',hash-type='bdb',dir='data'")
or die "Failed to create RDF::Redland::Storage\n";
my $model = new RDF::Redland::Model($storage, "")
or die "Failed to create RDF::Redland::Model for storage\n";
my $uri = new RDF::Redland::URI("file:test.rdf");
my $parser = new RDF::Redland::Parser("rdfxml", "application/rdf+xml")
or die "Failed to find parser\n";
my $stream = $parser->parse_as_stream($uri, $uri);
my $count = 0;
while (!$stream->end) {
$model->add_statement($stream->current);
$count++;
$stream->next;
}
$stream = undef;
$storage = undef;
$model = undef;
print "Done. There were $count statements.\n";
이 작동 내가 300K-뭔가 문을 나에게 알려 :
이
내가 가게를 생성하는 방법이다.는 그럼 난 다른 스크립트와이 데이터를 검색하려고하지 :
my $storage =
new RDF::Redland::Storage("hashes", "test",
"hash-type='bdb',dir='data'")
or die "Failed to create RDF::Redland::Storage\n";
my $model = new RDF::Redland::Model($storage, "")
or die "Failed to create RDF::Redland::Model for storage\n";
$model->sync; # tried with and without this line
my $stream = $model->as_stream;
while (!$stream->end) {
print "Statement: ", $stream->current->as_string, "\n";
$stream->next;
}
이 인쇄 절대적으로 아무것도.
도움 주셔서 감사합니다.