{
    "mode": "perldoc",
    "parameter": "RDF::Redland::Model",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/RDF%3A%3ARedland%3A%3AModel/json",
    "generated": "2026-07-05T13:37:32Z",
    "synopsis": "use RDF::Redland;\nmy $storage=new RDF::Redland::Storage(\"hashes\", \"test\", \"new='yes',hash-type='memory'\");\nmy $model=new RDF::Redland::Model($storage, \"\");\n...\nmy(@sources)=$model->targets($predicatenode, $objectnode);\n...",
    "sections": {
        "NAME": {
            "content": "RDF::Redland::Model - Redland RDF Model Class\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use RDF::Redland;\nmy $storage=new RDF::Redland::Storage(\"hashes\", \"test\", \"new='yes',hash-type='memory'\");\nmy $model=new RDF::Redland::Model($storage, \"\");\n...\n\nmy(@sources)=$model->targets($predicatenode, $objectnode);\n\n...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Manipulate the RDF model.\n",
            "subsections": []
        },
        "CONSTRUCTORS": {
            "content": "new STORAGE OPTIONSSTRING\nnewwithoptions STORAGE OPTIONSHASH\nCreate a new RDF::Redland::Model object using RDF::Redland::Storage object *STORAGE* with a\noptions. The options can be given either as a string in the first form as *OPTIONSSTRING*.\nThe options take the form key1='value1',key2='value2'. The quotes are required. In the\nsecond case *OPTIONSHASH* is a reference to a Perl hash of options.\n\nnewfrommodel MODEL\nCreate a new model from an existing RDF::Redland::Model *MODEL* (copy constructor).\n",
            "subsections": []
        },
        "METHODS": {
            "content": "size\nReturn the size of the model (number of statements).\n\nsync\nSynchronise the model to the underlying storage.\n\nadd SUBJECT PREDICATE OBJECT\nAdd a new statement to the model with *SUBJECT*, *PREDICATE* and *OBJECT*. These can be\nRDF::Redland::Node, RDF::Redland::URI or perl URI objects.\n\naddtypedliteralstatement SUBJECT PREDICATE STRING [XMLLANGUAGE [DATATYPE]]\nAdd a new statement to the model containing a typed literal string object *STRING* with\n(optional) XML language (xml:lang attribute) *XMLLANGUAGE* and (optional) datatype URI\n*DATATYPE*. *XMLLANGUAGE* or *DATATYPE* can either or both be set to undef.\n\naddstatement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]\nAdd RDF::Redland::Statement *STATEMENT* or the statement formed by *NODE NODE NODE* to the\nmodel. If the optional *CONTEXT* is given, associate it with that context. Any of *NODE* or\n*CONTEXT* can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object.\n\naddstatements STREAM [CONTEXT]\nAdd the statements from the RDF::Redland::Stream *STREAM* to the model. If the optional\n*CONTEXT* is given, associate it with that context. *CONTEXT* can be a RDF::Redland::Node,\nRDF::Redland::URI or perl URI object.\n\nremovestatement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT]\nRemove RDF::Redland::Statement *STATEMENT* or the statement formed by *NODE NODE NODE* from\nthe model. If the optional *CONTEXT* is given, remove only the statement stored with that\ncontext. Any of *NODE* or *CONTEXT* can be a RDF::Redland::Node, RDF::Redland::URI or perl\nURI object.\n\nremovecontextstatements CONTEXT\nRemove all RDF::Redland::Statement *STATEMENT*s from the model with the given *CONTEXT*\ncontext. *CONTEXT* can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object.\n\ncontainsstatement STATEMENT\nReturn non 0 if the model contains RDF::Redland::Statement *STATEMENT*.\n\nasstream [CONTEXT]\nReturn a new RDF::Redland::Stream object seralising the entire model, or just those\nstatements with *CONTEXT*, as RDF::Redland::Statement objects. If given, *CONTEXT* can be a\nRDF::Redland::Node, RDF::Redland::URI or perl URI object.\n\nfindstatements STATEMENT [CONTEXT]\nFind all matching statements in the model matching partial RDF::Redland::Statement\n*STATEMENT* (any of the subject, predicate, object RDF::Redland::Node can be undef). If\n*CONTEXT* is given, finds statements only in that context.\n\nIn an array context, returns an array of the matching RDF::Redland::Statement objects. In a\nscalar context, returns the RDF::Redland::Stream object representing the results.\n\nsources ARC TARGET\nGet all source RDF::Redland::Node objects for a given arc *ARC*, target *TARGET*>\nRDF::Redland::Node objects as a list of RDF::Redland::Node objects.\n\narcs SOURCE TARGET\nGet all arc RDF::Redland::Node objects for a given source *SOURCE*, target *TARGET*\nRDF::Redland::Node objects as a list of RDF::Redland::Node objects.\n\ntargets SOURCE ARC\nGet all target RDF::Redland::Node objects for a given source *SOURCE*, arc *ARC*\nRDF::Redland::Node objects as a list of RDF::Redland::Node objects.\n\nsourcesiterator ARC TARGET\nGet all source RDF::Redland::Node objects for a given arc *ARC*, target *TARGET*\nRDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure.\n\narcsiterator SOURCE TARGET\nGet all arc RDF::Redland::Node objects for a given source *SOURCE*, target *TARGET*\nRDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure.\n\ntargetsiterator SOURCE ARC\nGet all target RDF::Redland::Node objects for a given source *SOURCE*, arc *ARC*\nRDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure.\n\nsource ARC TARGET\nGet one source RDF::Redland::Node object that matches a given arc *ARC*, target *TARGET*\nRDF::Redland::Node objects or undef if there is no match.\n\narc SOURCE TARGET\nGet one arc RDF::Redland::Node object that matches a given source *SOURCE*, target *TARGET*\nRDF::Redland::Node objects or undef if there is no match.\n\ntarget SOURCE ARC\nGet one target RDF::Redland::Node object that matches a given source *SOURCE*, arc *ARC*\nRDF::Redland::Node objects or undef if there is no match.\n\ncontexts\nGet all context RDF::Redland::Node objects in the model\n\nfeature URI [VALUE]\nGet/set a model feature. The feature is named via RDF::Redland::URI *URI* and the value is a\nRDF::Redland::Node. If *VALUE* is given, the feature is set to that value, otherwise the\ncurrent value is returned.\n\nqueryexecute QUERY\nExecute the *QUERY* RDF::Redland::Query against the model returning a result set\nRDF::Redland::QueryResults or undef on failure.\n\nload URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI [HANDLER ]]]\nLoad content from *URI* into the model, guessing the parser.\n\ntostring [BASE-URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI]]]\nSerialize the model to a syntax. If no serializer name is given, the default serializer\nRDF/XML is used.\n",
            "subsections": []
        },
        "OLDER METHODS": {
            "content": "serialise\nserialize\nReturn a new RDF::Redland::Stream object seralising the model as RDF::Redland::Statement\nobjects. Replaced by asstream to reduce confusion with the RDF::Redland::Serializer class.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "RDF::Redland::Storage, RDF::Redland::Node and RDF::Redland::Statement\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Dave Beckett - http://www.dajobe.org/\n",
            "subsections": []
        }
    },
    "summary": "RDF::Redland::Model - Redland RDF Model Class",
    "flags": [],
    "examples": [],
    "see_also": []
}