This is a public chat log generated from the #semsol IRC channel.
11:39:04
kwijibo, you didn't play with object-relational mappings for ARC (or RDF/PHP/JSON in general), did you?
11:39:47
what sort of thing you thinking of bengee ?
11:40:54
yvesr was wondering about things like $person = new Person($id); $name = $person->name; etc
11:41:17
yes, somehting in the lines of $person = new Person('http://moustaki.org/foaf.rdf#moustaki')
11:41:37
yeah, it can be done - mmmmmrob was experimenting with that kind of idiom
11:42:22
i preferred the less magic approach of $Resource->property(FOAF'name') personally
11:43:01
I ditched my earlier thoughts on OR mapping in favour of working with the arc triple array
11:43:30
I decided that attaching behaviour to the types (which is what the domain model is for) was not a great idea
11:44:20
likewise - though i do use an object wrapper to simplify searching through the graph
11:44:53
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
bengee: iand recently wrote a class for navigating via the fresnel graph path syntax
11:45:13
oha
11:45:29
bengee: I believe so
11:45:52
bengee: mmmmmrob wouldn't it be better to use __call() than exception handling?
11:46:47
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
kwijibo: that's what I was just looking back to see in old code
11:47:32
bengee: http://code.google.com/p/moriarty/source/browse/trunk/graphpath.class.php <-- iand's GraphPath class
11:47:46
heh - he's pinched some of your functions ;)
11:49:15
wow, that's a lot of code
11:49:20
mmmmmrob: hmm, sparta, mopy and activerdf do objectmapping without attaching "behaviors" to types
11:49:42
it think this is just another way of representing rdf
11:49:56
which seems to be easier to grasp for ruby/erb-types of people
11:51:47
yvesr: maybe - I guess I am not that kind of person, so I don't prefer it :)
11:52:12
ie, i prefer to be somehow closer to the triples
11:52:18
fair enough :)
11:52:26
kwijibo hugs some triples
11:52:30
bengee had a couple of requests for API-like access to resources
11:53:20
it can be helpful for people who are initially looking at certain vocabs, like FOAF, or DC
11:54:11
and I think ActiveRDF has some magic to detect the right predicates, even if you just ask for "name" or "title"
11:55:28
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
yvesr: if you don't attach behaviour (and don't do multiple inheritance) then what's the value?
11:56:14
so you have to do a lot of IFs anytime you access properties and things
11:56:35
mmmmmrob: syntactic preference?
11:56:48
mmmmmrob: yes, purely syntactic
11:56:53
kwijibo: indeed, the syntax is more 'familiar' but the downside is ambiguity
11:57:04
we need code that ERB-type developers can use
11:57:16
and, of course, everything should be an array response
11:57:29
as a predicate can recur
11:57:33
there are some things you can do by using OWL definitions
11:57:40
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
*constrain
11:58:10
and just ignore all other Persons ... but feels kinda sucky to do that
11:58:26
I guess I just see other ways of solving the problem
11:59:33
mmmmmrob: a lot of times you just want to assume you just want the first value though
11:59:59
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
kwijibo: yes, sometimes, but I'd rather that assumption was explicit in the language of the code
12:00:27
single item fields on objects don't give that clarity IMHO
12:00:59
bengee: that's what ActiveRDF does doesn't it?
12:01:43
i seem to remember the big problem with performance was every getter call triggered a sparql select query
12:01:51
could be, not sure how persistence is handled there
12:01:59
ah
12:02:03
eyal might have sorted that now though
12:02:26
i don't know why they did it like that :p
12:02:53
it might work ok-ish for setters
12:03:13
some wrapper around an ARC index structure
12:03:41
i must remember to ask iand for some sample GraphPath templating code
12:03:43
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
wonder how it looks
12:04:29
yvesr: its stricter than perhaps you're thinking as it creates Java POJOs
12:07:00
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
i've tried various approaches, but none yet that feel really really neat
12:09:09
kwijibo: yes indeed, the thing is that we do have quite a lot of control on the RDF we template
12:10:29
the template engine in knowee maintains an index of already rendered predicates, but it's not really elegant
12:11:52
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
bengee: exactly
12:13:16
yvesr: yes, in your sitaution then, where you can know what properties to expect, object mapping is probably pretty nice
12:14:30
bengee: and you don't always want the "other props" rendered beneath all the known props
12:15:23
yeah
12:15:51
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
but like i say, feels hacky rather than a real neat solution
12:17:05
(unsetting them from the index i mean)
12:19:09
I'm doing it similarly, just with a $this->rendered_predicates array
12:20:11
which can be set before calling getHTML(), so that you can retrieve certain sub-templates from the same caller
12:25:50
maybe the tricky thing is in php templating you typically start at the top and work down the sub templates procedurally
12:26:56
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
maybe that would just be tricky in a different way
12:27:39
heh
12:28:05
kwijibo is webdev Barbie
12:28:18
"programming is hard - lets go shopping!"
12:28:28
lol
12:28:58
kwijibo rebooting
