[redland-dev] Setting attrbutes of an RDF statement (in Ada bindings)
Dave Beckett
dave at dajobe.org
Fri Aug 22 00:45:35 EDT 2014
On 8/15/14, 3:45 PM, Victor Porton wrote:
> The following Ada code retrieves attributes of an RDF statements.
>
> function Get_Subject (Statement: Statement_Type_Without_Finalize) return RDF.Raptor.Term.Term_Type_Without_Finalize;
> function Get_Predicate (Statement: Statement_Type_Without_Finalize) return RDF.Raptor.Term.Term_Type_Without_Finalize;
> function Get_Object (Statement: Statement_Type_Without_Finalize) return RDF.Raptor.Term.Term_Type_Without_Finalize;
> function Get_Graph (Statement: Statement_Type_Without_Finalize) return RDF.Raptor.Term.Term_Type_Without_Finalize; -- may return null handle
>
> Should I also make code which would set the attributes?
>
> As for now all four attributes are set by:
>
> function New_Statement (World: RDF.Raptor.World.World_Type_Without_Finalize'Class;
> Subject, Predicate, Object, Graph: RDF.Raptor.Term.Term_Type_Without_Finalize)
> return Statement_Type;
>
> when a statement is created.
>
> Should there be code which sets them afterward (not when the statement is created, but later)?
Generally a statement should be created once and the fields not changed.
The reason for the accessors is when the library is returning a statement
such as from a parser. If your language prefers built in accessors to
fields/attributes of raptor_statement, you don't need the wrappers. It's
up to you.
Dave
More information about the redland-dev
mailing list