RDF::R...alizer(3pm)
π RDF::Redland::Serializer β the Redland RDF Serializing to Syntax Class π
Okay so bestie, welcome to RDF::Redland::Serializer(3pm) β literally the glow-up station where your RDF graphs get turned into pretty syntax. This is the page for the serializing-to-syntax class in the RDF::Redland fam, and no cap, it's giving "make my triples look cute in every format" energy. π¦
β¨ SYNOPSIS β¨
Like, the whole vibe in four lines, okay?
use RDF::Redland;
...
my $serializer=new RDF::Redland::Serializer("ntriples");
$serializer->serialize_model_to_file("foo.rdf", $base_uri, $model);
Obsessed. You make a serializer, you hand it a model, it writes the file. Periodt. π
πΈ DESCRIPTION πΈ
So this class represents serializers β little machines that turn RDF graphs into various syntaxes. And where do the graphs come from? From an RDF::Redland::Model object, bestie. That's the source. That's the whole tea. π«
π CONSTRUCTORS π
new [NAME [MIME_TYPE [URI]]]β makes a brand-newRDF::Redland::Serializerobject for a syntax serializer that goes byNAME, with MIME TypeMIME_TYPEand/or URIURI. Now here's the flexible part: any of those fields can beundef, or you can just not pass them at all. And if you're feeling minimalist and omit all of them? The default serializer gets used, which currently is'ntriples'. β¨
π METHODS π
serialize_model_to_file FILENAME BASE_URI MODELβ serializes the RDF GraphMODELas syntax, using the baseRDF::Redland::URIBASE_URI, and writes it all out to the fileFILENAME. Model in, file out, iconic behavior. πserialize_model_to_string BASE-URI MODELβ serializes the RDF GraphMODELinto a syntax. And heads up, bestie: if no serializer name is given, the default serializerRDF/XMLis used. π§set_namespace PREFIX URIβ defines a namespaceURIwith thePREFIXyou supply, so it can be used when serializing an RDF Graph. Name your namespaces, they deserve it. π·οΈfeature URI [VALUE]β get or set a serializer feature. The feature is named via theRDF::Redland::URIURI, and the value is a string. If you passVALUE, the feature gets set to that value; if you don't, you just get the current value back. Get/set, the classic duality. β
π SEE ALSO π
Go read these next, iykyk:
RDF::Redland::ParserRDF::Redland::URI
π AUTHOR π
This legend right here:
- Dave Beckett - http://www.dajobe.org/
π Real talk: this whole page came from the perl v5.42.3 era, dated 2026-08-20, and the manpage title it lives under is the slightly-truncatedRDF::R...alizer(3pm)β but you and me both know her full name isRDF::Redland::Serializer(3pm). Slay. π
π¦ where this page comes from
- ubuntu stonking: librdf-perl 1.0.17.1+dfsg-9build1 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms