[RDF] CVS update
Jonas Liljegren
jonas@liljegren.org
04 Oct 2000 21:21:44 +0200
Jonas Liljegren <jonas@liljegren.org> writes:
> Next on the list is to change some of the function names to be more
> equal to Sergey Melniks Java RDF API.
Uh. Forget about that. There arn't much that can be done equaly.
These are, in my opinion, the core classes:
http://www-db.stanford.edu/~melnik/rdf/api-doc/org/w3c/rdf/model/Model.html
http://www-db.stanford.edu/~melnik/rdf/api-doc/org/w3c/rdf/model/NodeFactory.html
Creating a literal:
Java: literal = factory.createLiteral("My string");
Perl: $lit = $model->create_literal("My string");
Wraf places the literal directly in the calling model.
Creating a resource:
Java: resource = factory.createResource("http://a.b/c");
Perl: $node = $model->get("http://a.b/c");
Wraf retrieve the node if it exists and creates it if it doesn't
exist. If no uri is specified, a unique uri is created, based on the
model uri. That would be the same as the java createUniqueResource().
Creating a statement:
Java: statement = factory.createStatement($subj, $pred, $obj);
Perl: $arc = $model->add_arc($arc_uri, $pred, $subj, $obj);
Let the $arc_uri be undefined to let the statement uri be
autogenerated. As with all statements, the arcs is directly placed in
the calling model.
The find() method will be implemented later. Some of the other methods
from the Model class can also be implemented.
--
/ Jonas - http://jonas.liljegren.org/myself/en/index.html