Catmandu::Importer::RDF(3pm) | User Contributed Perl Documentation | Catmandu::Importer::RDF(3pm) |
Catmandu::Importer::RDF - parse RDF data
Command line client "catmandu":
catmandu convert RDF --url http://d-nb.info/gnd/4151473-7 to YAML catmandu convert RDF --file rdfdump.ttl to JSON # Parse the input into on JSON document per triplet. This is the # most memory efficient (and fastest) way to parse RDF input. catmandu convert RDF --triples 1 --file rdfdump.ttl to JSON # Transform back into NTriples (conversions to and from triples is the # most efficient way to process RDF) catmandu convert RDF --triples 1 --file rdfdump.ttl to RDF --type NTriples # Query a SPARQL endpoint catmandu convert RDF --url http://dbpedia.org/sparql --sparql "SELECT ?film WHERE { ?film dct:subject <http://dbpedia.org/resource/Category:French_films> }" catmandu convert RDF --url http://example.org/sparql --sparql query.rq # Query a Linked Data Fragment endpoint catmandu convert RDF --url http://fragments.dbpedia.org/2014/en --sparql "SELECT ?film WHERE { ?film dct:subject <http://dbpedia.org/resource/Category:French_films> }"
In Perl code:
use Catmandu::Importer::RDF; my $url = "http://dx.doi.org/10.2474/trol.7.147"; my $rdf = Catmandu::Importer::RDF->new( url => $url )->first;
This Catmandu::Importer can be use to import RDF data from URLs, files or input streams, SPARQL endpoints, and Linked Data Fragment endpoints.
By default an RDF graph is imported as single item in aREF format (see RDF::aREF).
Catamandu::Importer::RDF->new( ..., cache => 1, cache_options => { driver => 'Memory', global => 1, max_size => 1024*1024 });
See Catmandu::Importer.
RDF::Trine::Store, RDF::Trine::Parser
2022-12-06 | perl v5.36.0 |