|
Hi there, at home I'm using SMW as a personal log for my triathlon training where I can link anything I find about competitions, training etc. For each run/cycling/swimming training I create a page with all relevant information as properties (duration, kilometers, ...) However doing simple statistics, e.g. how many running kilometers in the last week/month/.., is not straightforward with SMW and I desparately searched for a query condition term like [[weekofyear(DateProperty)::12]] or [[month(DateProperty)::3]] which would allow to select pages within a certain time range without adding additional properties like "weekofyear" and "month". It's a feature well known from SQL and it seems to me that the SPARQL query language has it with the extension functions too. During easter holiday I took a few hours and dug into the SMW code and I came up with an implementation for the storage-independent part in SMW_Description by adding a class SMWFunction and a little parser code in SMW_QueryParser, but I got stuck when it came to SMW_SQLStore2_Queries.php. The first problem was my lack of knowledge about how the SQL query is being constructed :( and the second was that even though I could manage to hook into the processing of the SMW_Description "tree", at the moment it looks to me as if the "right side" of the query condition (the 12 or 3 in the examples above) is build by somehow utilizing the datatype of the queried property - but the first 12 lines in compileAttributeWhere are just "black magic" to me right now... I'd really like to see this functionality and I think with a general approach more applications might come up (e.g. selecting coordinates only by latitude ...) Or maybe its just time to give the triple store connector a try and use SPARQL here :) Good night, Stefan -- Stefan Harwarth Riezlerstraße 85g 85051 Ingolstadt Fon 0179 53 13 077 Mail [email protected] Please consider the environment before printing this email. |
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ Semediawiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
