Channel #semsol: Logs

This is a public chat log generated from the #semsol IRC channel.

11:39:04 bengee: kwijibo, you didn't play with object-relational mappings for ARC (or RDF/PHP/JSON in general), did you?
11:39:47 kwijibo: what sort of thing you thinking of bengee ?
11:40:54 bengee: yvesr was wondering about things like $person = new Person($id); $name = $person->name; etc
11:41:17 yvesr: yes, somehting in the lines of $person = new Person('http://moustaki.org/foaf.rdf#moustaki')
11:41:37 kwijibo: yeah, it can be done - mmmmmrob was experimenting with that kind of idiom
11:42:22 kwijibo: i preferred the less magic approach of $Resource->property(FOAF'name') personally
11:43:01 mmmmmrob: I ditched my earlier thoughts on OR mapping in favour of working with the arc triple array
11:43:30 mmmmmrob: I decided that attaching behaviour to the types (which is what the domain model is for) was not a great idea
11:44:20 kwijibo: likewise - though i do use an object wrapper to simplify searching through the graph
11:44:53 bengee: I wonder if PHP5's exception handling could be used to implement stuff like $resoure->getInterests() w/o actually having that method predefined
11:45:01 kwijibo: bengee: iand recently wrote a class for navigating via the fresnel graph path syntax
11:45:13 bengee: oha
11:45:29 mmmmmrob: bengee: I believe so
11:45:52 kwijibo: bengee: mmmmmrob wouldn't it be better to use __call() than exception handling?
11:46:47 bengee: not sure if it'd be a recommended practice, I find that auto-loading of class files based on exceptions already a little hack-ish
11:47:03 mmmmmrob: kwijibo: that's what I was just looking back to see in old code
11:47:32 kwijibo: bengee: http://code.google.com/p/moriarty/source/browse/trunk/graphpath.class.php <-- iand's GraphPath class
11:47:46 kwijibo: heh - he's pinched some of your functions ;)
11:49:15 bengee: wow, that's a lot of code
11:49:20 yvesr: mmmmmrob: hmm, sparta, mopy and activerdf do objectmapping without attaching "behaviors" to types
11:49:42 yvesr: it think this is just another way of representing rdf
11:49:56 yvesr: which seems to be easier to grasp for ruby/erb-types of people
11:51:47 kwijibo: yvesr: maybe - I guess I am not that kind of person, so I don't prefer it :)
11:52:12 kwijibo: ie, i prefer to be somehow closer to the triples
11:52:18 yvesr: fair enough :)
11:52:26 kwijibo: kwijibo hugs some triples
11:52:30 bengee: bengee had a couple of requests for API-like access to resources
11:53:20 bengee: it can be helpful for people who are initially looking at certain vocabs, like FOAF, or DC
11:54:11 bengee: and I think ActiveRDF has some magic to detect the right predicates, even if you just ask for "name" or "title"
11:55:28 kwijibo: that's why i haven't really wanted it so far i think - most often want to do generic things rather than domain specific things - also, you need to bear in mind that RDF data will be more unpredictable than data enforced by a relational db schema
11:56:07 mmmmmrob: yvesr: if you don't attach behaviour (and don't do multiple inheritance) then what's the value?
11:56:14 kwijibo: so you have to do a lot of IFs anytime you access properties and things
11:56:35 kwijibo: mmmmmrob: syntactic preference?
11:56:48 yvesr: mmmmmrob: yes, purely syntactic
11:56:53 mmmmmrob: kwijibo: indeed, the syntax is more 'familiar' but the downside is ambiguity
11:57:04 yvesr: we need code that ERB-type developers can use
11:57:16 mmmmmrob: and, of course, everything should be an array response
11:57:29 mmmmmrob: as a predicate can recur
11:57:33 yvesr: there are some things you can do by using OWL definitions
11:57:40 kwijibo: I guess you can contrain the data at the query level - a Person is defined by the properties you demand of them in the sparql query
11:57:46 kwijibo: *constrain
11:58:10 kwijibo: and just ignore all other Persons ... but feels kinda sucky to do that
11:58:26 mmmmmrob: I guess I just see other ways of solving the problem
11:59:33 kwijibo: mmmmmrob: a lot of times you just want to assume you just want the first value though
11:59:59 bengee: some object that's tied to an ARC store could be cool, though, i.e. where attribute changes auto-trigger sparql queries
12:00:11 mmmmmrob: kwijibo: yes, sometimes, but I'd rather that assumption was explicit in the language of the code
12:00:27 mmmmmrob: single item fields on objects don't give that clarity IMHO
12:00:59 kwijibo: bengee: that's what ActiveRDF does doesn't it?
12:01:43 kwijibo: i seem to remember the big problem with performance was every getter call triggered a sparql select query
12:01:51 bengee: could be, not sure how persistence is handled there
12:01:59 bengee: ah
12:02:03 kwijibo: eyal might have sorted that now though
12:02:26 kwijibo: i don't know why they did it like that :p
12:02:53 bengee: it might work ok-ish for setters
12:03:13 bengee: some wrapper around an ARC index structure
12:03:41 kwijibo: i must remember to ask iand for some sample GraphPath templating code
12:03:43 mmmmmrob: yvesr: we have a fully functioning RDF object mapper in one of our products, was done for the reason you suggest - developer familiarty mainly
12:03:46 kwijibo: wonder how it looks
12:04:29 mmmmmrob: yvesr: its stricter than perhaps you're thinking as it creates Java POJOs
12:07:00 kwijibo: the tedious problems in RDF templating i find are: [1]you don't know if a property you want is going to exist or not and [2] you often want some way of iterating over the properties you haven't accessed individually already in the template
12:07:39 kwijibo: i've tried various approaches, but none yet that feel really really neat
12:09:09 yvesr: kwijibo: yes indeed, the thing is that we do have quite a lot of control on the RDF we template
12:10:29 bengee: the template engine in knowee maintains an index of already rendered predicates, but it's not really elegant
12:11:52 bengee: what I find most tricky that I don't want an all-or-nothing templater, i.e. I usually want a custom layout for a known set of preds, plus a flat list of all other props, with the option to incrementally define and provide predicate-level templates
12:12:06 kwijibo: bengee: exactly
12:13:16 kwijibo: yvesr: yes, in your sitaution then, where you can know what properties to expect, object mapping is probably pretty nice
12:14:30 kwijibo: bengee: and you don't always want the "other props" rendered beneath all the known props
12:15:23 bengee: yeah
12:15:51 kwijibo: my cludgy solution is to 'get' all the known properties into variables at the start of the template, unsetting them in the process
12:16:16 kwijibo: but like i say, feels hacky rather than a real neat solution
12:17:05 kwijibo: (unsetting them from the index i mean)
12:19:09 bengee: I'm doing it similarly, just with a $this->rendered_predicates array
12:20:11 bengee: which can be set before calling getHTML(), so that you can retrieve certain sub-templates from the same caller
12:25:50 kwijibo: maybe the tricky thing is in php templating you typically start at the top and work down the sub templates procedurally
12:26:56 kwijibo: if you did it the other way round -lowest level template first, outer template last, buffering the output or something, it might be easier
12:27:29 kwijibo: maybe that would just be tricky in a different way
12:27:39 bengee: heh
12:28:05 kwijibo: kwijibo is webdev Barbie
12:28:18 kwijibo: "programming is hard - lets go shopping!"
12:28:28 bengee: lol
12:28:58 kwijibo: kwijibo rebooting