Channel #semsol: Logs

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

10:06:33 kwijibo: bengee: in my code (which always uses ARC2 for parsing), I always convert RDFXML to the same data structure as RDF/JSON
10:06:34 kwijibo: and use that structure for working with the data
10:06:56 kwijibo: which is *almost* the same as your getSimpleIndex structure
10:07:49 kwijibo: would you consider another function, or an optional parameter to that function that output the same structure?
10:08:01 bengee: where do they differ?
10:08:29 kwijibo: 'val' instead of 'value' :)
10:08:34 kwijibo: I think that's it
10:08:59 bengee: ah, lazy me ;)
10:09:05 kwijibo: :D
10:09:29 kwijibo: are the other keys the same? the documentation example doesn't show
10:09:40 kwijibo: 'lang' and 'datatype'
10:10:21 bengee: it's "dt", I think
10:11:57 kwijibo: I could write a plugin to do the conversion, but it would be neater to have it from core ARC2
10:15:26 bengee: I could tweak the getSimpleIndex function, but then the serializers will all break
10:16:38 kwijibo: I could give you another function
10:16:42 bengee: "found 195 occurrences of 'val'"
10:17:21 kwijibo: or you could add an optional parameter to the getSimpleIndex
10:17:40 kwijibo: to keep compatibility with everything using it
10:18:45 kwijibo: and if you were feeling especially generous, a getResourcesIndex() wrapper function to simplify it for me ;)
10:19:01 bengee: I can't replace 'val' with 'value' for compatibility reasons, all I could do is set both 'val' and 'value', and 'dt' and 'datatype'
10:19:28 bengee: via a config setting
10:22:14 kwijibo: i was thinking something like function getSimpleIndex($triples, $flatten_objects = 1, $vals = '', $rdfjson_keys = false) {
10:22:32 bengee: getSimpleIndex has too many parameters already
10:23:19 kwijibo: yeah, true, though no-one need actually use them all
10:24:05 bengee: and you'd prolly have the json keys also when the index comes from a DESCRIBE or CONSTRUCT
10:24:18 bengee: *like to have*
10:24:26 kwijibo: you could have function getResourcesIndex($triples){ return ARC2::getSimpleIndex($triples, false, '', true) }
10:24:55 kwijibo: yeah
10:25:04 kwijibo: that's true
10:26:01 kwijibo: anyway, no worries, I can have a plugin do it ... just a suggestion ;)
10:26:05 bengee: so, what I can offer: support for a config setting "index_use_long_keys" (or similar) which will then ad 'value' and 'datatype'
10:26:45 bengee: that would then work everytime ARC creates an index structure
10:27:41 kwijibo: what about in your serialisers?
10:27:54 bengee: they would still use 'val'
10:28:11 bengee: 'value' would be an addition (not a replacement)
10:28:23 kwijibo: if I had to have a config, it'd be cleaner for me to do it via a plugin function i think
10:28:36 bengee: 'k
10:29:32 kwijibo: i'd use your keys, it's just I already have all this code, and I like to keep it consistent
10:29:51 bengee: bengee too ;)
10:30:58 kwijibo: I could just make my Converters classes a plugin I suppose
10:31:17 kwijibo: can you have more than one class in a plugin?
10:32:37 bengee: yes, but you should not use ARC2::getComponent for the 2nd one
10:33:11 bengee: as ARC won't find the class file
10:33:29 kwijibo: http://n2.talis.com/svn/playground/kwijibo/converters/converters.php <--- is what I have
10:33:57 kwijibo: basically, I have one wrapper Convert object
10:34:14 kwijibo: and that instantiates the other classes
10:35:05 bengee: that should work
10:35:11 kwijibo: so I'm imagining something like:
10:35:42 kwijibo: $Convert = ARC2::getComponent('Converter');
10:35:44 bengee: you may perhaps want to add some namespace/prefix to your class names to avoid naming collisions
10:36:04 kwijibo: $resources_index = $Convert->RDFXML->to_resources($rdfxml_string)->value();
10:36:15 kwijibo: yeah, I was worrying about that too
10:36:27 kwijibo: I have, eg: URI and Qname classes
10:36:36 bengee: yeah
10:37:02 kwijibo: I can namespace them no probs though I think
10:37:46 kwijibo: because they are only externally accessed by properties of the Converter object
10:40:24 danbri: mornin' all
10:40:35 danbri: some usecase fodder for sparqlpress here btw
10:40:36 danbri: http://lists.foaf-project.org/pipermail/foaf-dev/2008-January/008835.html
10:40:49 bengee: If you name the main plugin class ARC2_ConverterPlugin, put everything in /plugins/ARC2_ConverterPlugin.php, it should work
10:41:55 bengee: you can then get an instance via ARC2::getComponent('ConverterPlugin', $my_config);
10:42:03 bengee: morning danbri
10:42:11 kwijibo: morning
10:45:49 kwijibo: bengee: can you pass file uris to parse() ?
10:46:09 kwijibo: windows file uris in particular
10:46:19 kwijibo: (it's not for me, it's for a friend ;) )
10:50:07 bengee: haven't tried on windows, but the reader uses standard php functionality for local file paths
10:51:24 bengee: php *may* have problems with file:// vs. file:///
10:52:31 bengee: if it doesn't work for him, I'd be happy about a file uri that doesn't work, and I'll try to test/fix things
10:52:50 kwijibo: kwijibo trying to chase it down
10:54:53 kwijibo: ah it's all cool
10:55:03 kwijibo: he had something wrong with his unit test is all
10:55:15 bengee: ah, cool
10:56:23 danbri: I dropped some text from the mail into http://wiki.foaf-project.org/SparqlPress#Goal but feel free to rejig it if you don't think it core to sparqlpress goals
10:56:39 danbri: i just wanted some non-rdf-oriented user story in there
12:23:25 fresco: hi. quick question about parsing a string with ARC: where the docs say "$parser->parse($base, $data);", what should $base be?
12:24:30 bengee: hi fresco
12:24:46 bengee: $base is a URI
12:25:09 bengee: i.e. in case you parse from the web, you'd do parse($url)
12:25:39 fresco: I'm parsing a string
12:25:54 bengee: but if you want to parse a string, you can do parse($base, $data) or parse('', $data)
12:26:18 bengee: specifying a base can be useful when your strig contains relative paths
12:26:48 fresco: ok, probably '' then, i see. thanks.
12:26:54 bengee: yeah
12:26:57 bengee: yw
12:27:13 fresco: i'm having to fetch the RDF first with file_get_contents, because it needs authentication
12:27:14 bengee: maybe I should add a note to the docs
12:27:50 fresco: HTTP authentication, I mean
12:29:03 bengee: ARC's HTTP reader supports custom headers, but I'm not sure if that can be passed through via the parser
12:29:25 bengee: I'm going to need that sooner or later, though
12:29:59 fresco: if you could pass a context (from stream_context_create) to it like you can with file_get_contents, that might be useful. it's not a big deal though.
12:32:19 fresco: that ARC2_Reader class is pretty twisty
12:32:26 bengee: 'http_custom_headers' is the current config key
12:32:45 fresco: ah, ok
12:32:50 bengee: (it's a string, not an array)
12:35:24 bengee: the parser or store should hand it through to the reader
13:24:05 bengee: danbri, I'm just chatting with BenO about semantic markup for images in html
13:24:25 bengee: I remembered that you asked on the rdfa list re imagemaps
13:24:42 danbri: i did
13:24:53 danbri: it got blogged a bit too, including QA W3C blog
13:25:15 danbri: rdfa doesn't seem to access the path data, and i'm not persuaded that grddl is lightweight enough
13:25:33 danbri: which is the O in "Ben O"?
13:26:25 bengee: welcome, BenO
13:26:42 BenO: Hi
13:27:31 bengee: danbri was playing with structured imagemaps recently
13:27:46 danbri: hi BenO!
13:28:47 danbri: yep see http://danbri.org/words/2008/01/07/248 http://www.w3.org/QA/2008/01/rdfa_and_html_imagemap.html http://www.mail-archive.com/public-rdf-in-xhtml-tf@w3.org/msg02500.html
13:28:54 BenO: Hi, I am currently trying to sort out image annotation with bengee's help. I think I have something workable (for my uses) but was wondering about how you were doing with RDFa
13:29:11 bengee: btw, Ivan's response to "image-regions vocab on w3.org" sounded a bit "more work needed"-ish
13:29:24 danbri: I think I got the attention of the rdfa folks but didn't yet persuade them that the extra work is worthwhile
13:29:53 danbri: so if you've anything like an app that can show interesting visual re-use of image fragments, eg. for games or accessibility or image search , that might help persuade
13:30:30 BenO: Currently, I am intending on using something like this example http://pastebin.com/d4c3f5c22 to archive the information
13:30:53 BenO: (for Oxford University's institutional repository)
13:31:34 BenO: And a few of the 'whys' are here: http://pastebin.com/m50302970
13:31:51 BenO: scuse the pastebin links, but I am in the middle of writing this up :0
13:33:15 BenO: Note that the regions themselves are given a UUID to (hopefully) uniquely label them, for researchers to cite, or to encourage reuse.
13:37:56 BenO: As part of the web interface to the items in the repository, I will build in the conversion from this form into an imagemap to overlay the image in question. I would be interested in including rdfa as part of it.
13:38:40 bengee: bengee would like to have some UI thingy that dynamically created an annotated imagemap
13:38:59 bengee: that would be really handy
13:39:41 BenO: BenO would love to get his hands on one of those...
13:39:47 bengee: hm, plus suggest-as-you-type to ease linking of regions to resources I know
13:40:41 BenO: I am using Solr as the search appliance and setting up suggest as you type searching seems straightforward
13:41:07 BenO: (for indexed information anyway.)
13:41:27 bengee: bengee wonders if he could plug an image annotator in his grawiki thingy
13:43:08 BenO: extending the code in this, perhaps? http://www.speedingrhino.com/cropper.htm
13:44:40 bengee: I do actually have code for the region selection somewhere, back from w3photo
13:44:44 BenO: (it's GPL2 javascript code for 'cropping' images - UI in the browser for selecting a rectangular region of an image
13:45:00 BenO: Ah, okay.
13:45:44 bengee: it's cool what is possible with today's browsers
13:47:24 BenO: Indeed, splice in some fields to fill in and we'd have a basic annotation tool :)
13:48:28 BenO: BenO must not get distracted... must migrate repository first!
13:49:33 danbri: looking
13:50:01 danbri: " <dc:description>Location of the 1st burial site.</dc:description>" is interesting, I started playing with imagemaps for map fragments, that could be transformed into kml ie google earth
13:50:10 danbri: well i didn't get very far :)
13:51:19 danbri: danbri looks, can't find what he's after, but rediscovers http://danbri.org/words/2005/08/07/123
13:52:56 BenO: Geo data would be fantastic to add to that kind of info, but sadly, he knows the level of real information that some researchers retain...
13:53:14 BenO: I* (meant it as a /me :) )
14:01:59 danbri: yeah, i'd guess it would need adding by 3rd parties if at all
14:03:19 BenO: Some of the academics I have to 'coach' are hard pressed to remember to left-click instead of right-click
14:07:50 danbri: their minds are on higher things!
14:08:12 danbri: are you involved in http://swig.networkedplanet.com/ ?
14:08:42 BenO: Not currently, no
14:09:10 danbri: they have informal show-and-tell meetups in oxford from time to time
14:09:23 danbri: nothing seems scheduled but the one i went to was prettyi nteresting
14:09:39 danbri: bunch of lightning talks, then went for a drink
14:10:39 BenO: I am going to the Geek nights though, less focussed on semantic issues naturally
14:12:58 danbri: geeking's good too :)
14:14:13 BenO: Next one - http://upcoming.yahoo.com/event/382722/
14:56:55 bengee: bengee creates http://arc.semsol.org/sites