|
From: Jason I. H. <ja...@cs...> - 2002-11-11 07:29:43
|
Ok, the code is a little unsightly right now, but InfoSpaces now support XPath queries. I'm using the Jaxen XPath engine to do this. So now you can do local queries like: http://localhost:8080/infospace/jasonh?q=//ContextTuple[@type='location.room'] which means find all ContextTuple tags that have the type attribute equals to 'location.room' There's a nice XPath tutorial at: - http://www.w3schools.com/xpath/xpath_syntax.asp Some issues: - Be sure to use single quotes around String literals - I'm not sure if you can do wildcards, like @type='location.*' - I'm going to add some more URL parameters, like 'sort' and 'numdocs'. So a query might be something like: ...?q=//ContextTuple[@type='location.room']&sort=date-ascending&numdocs=10 - What should the query return internally? Right now it returns a List of Elements (org.w3c.dom.Element). They get transformed to XML Strings in the HTTP front end. What do you guys need for next week? Here's my current plan: - Cleaning up the code, adding more examples to the APIs - Creating regression test cases - Taking a whack at the .entity-*.xml files (like properties, security and privacy policies, etc) -- Jason I. Hong | Group for User Interface Research ja...@cs... | University of California, Berkeley http://www.cs.berkeley.edu/~jasonh | http://guir.cs.berkeley.edu |