- From: Nathan <nathan@webr3.org>
- Date: Tue, 05 Oct 2010 23:37:37 +0100
- To: Toby Inkster <tai@g5n.co.uk>
- CC: Ivan Herman <ivan@w3.org>, RDFA Working Group <public-rdfa-wg@w3.org>, Tim Berners-Lee <timbl@w3.org>
Toby Inkster wrote: > On Tue, 05 Oct 2010 21:08:54 +0100 > Nathan <nathan@webr3.org> wrote: > >> indeed! don't have document.anything* on the server side or in other >> languages though.. > > Why not? check.rdfa.info uses an XML DOM all over the place at the > server end, in Perl. Plenty of $document->getElementsById('#foo') sort > of stuff going on. valid point, although I don't want to digress too much unless you're saying that we don't need any of the IndexedDataStore functionality discussed or methods like this outside of the document interface. > The RDFa API is mostly aimed at Javascript, and mostly in a browser > environment. If you're implementing it in another environment there is > always going to be the possibility that some things that need some > slight adjustments. agreed, would be nice to have core functionality implementable in most common languages though (imo of course). > Looking at an example from the RDFa API, store.forEach is essentially > passed a function as its argument. In some languages, like Java or PHP, > functions aren't first-class objects; they can't be passed as > arguments. A PHP implementation of the RDFa API would instead probably > be passed the name of a callback function as a string; a Java one would > use whatever convoluted workaround is currently popular in that world, > probably involving a dummy class with just a single method. just an aside, callbacks map to set interfaces, so given a callback interface: [NoInterfaceObject, Callback, Null=Null] interface RDFTripleFilter { boolean match (in RDFTriple triple); } then you can throw in a callback, or an object which implements this interface - i.e has a match() method. This covers most (all?) languages, certainly Java and JS have set mappings, and PHP can use both (or only object way prior to 5.3) > If, in your language/environment, document.getItemBySubject is > unworkable or would be an unexpected way of doing things, then do it > differently, but note the difference in your documentation. as above, valid point and agreed Best, Nathan :)
Received on Tuesday, 5 October 2010 22:45:12 UTC