- From: Pēteris <peteris.caune@deri.org>
- Date: Tue, 10 Nov 2009 14:37:13 +0000
- To: Steve Cassidy <steve.cassidy@mq.edu.au>
- Cc: semantic-web@w3.org, cosmin.basca@gmail.com
O , 2009-11-10 17:48 +1100, Steve Cassidy wrote: > Interesting. I've been using RDFAlchemy for a while, replacing my > home-grown object mapper. I wonder if you're aware of this and whether > anyone might comment on the advantages or otherwise of one or other model. > > RDFAlchemy seems to have a little more machinery for pre-defining > classes and the meaning of properties (ie. this is a multiple valued > property). Yes, in RDFAlchemy case the code looks cleaner because you can have short attribute names and don't have to worry about multiplicity so much. In SuRF, attribute names are always in "namespace_predicate" form and attribute values are list-like objects (with "first" and "one" helper properties). In my opinion the ability to (optionally) predefine classes and have shortcut names for some attributes would be desirable. So I created an issue in SuRF's issue tracker with some more thoughts on this: http://code.google.com/p/surfrdf/issues/detail?id=18 > It lacks any kind of query optimisation though - does SuRF > have this - eg. delaying the evaluation of queries until as much as > possible is known...that is, does: > > FoafPerson.get_by(foaf_name='John').order(something).limit(10) > > get all the Johns and iterate over them or does it construct a bigger > query and let SPARQL do the work? (peeking at the code it looks like it > does which would be neat). Yes, it does. Just chaining the modifiers doesn't cause any queries to be executed. The query gets constructed and executed the moment you start iterating. Also, if the "full()" modifier is present and SuRF is allowed to use subqueries via configuration, resource attribute values will be eager-loaded with just one SPARQL query. We also plan to support this eager-loading of attributes with SPARQL DESCRIBE queries.
Received on Tuesday, 10 November 2009 14:38:00 UTC