On Tuesday 21 November 2006 02:42, Christopher Baker wrote:
> Im not sure what you mean by allowing one to manipulate the wiki as a
> database.  Could you clarify that for me?

He probably referred to the fact that 

>
> The problem with allowing direct PHP code to bde input would be security.
> One could easily execute malitous code. When I finish the extension, the
> code will basically be transformed into php code for execution.
>
> Any other thoughts or suggestions?

It is complicated. This is a problem for use in a wiki, which is supposed to 
be simple (it currently isn't so simple anyway). But there sure are 
technically inclined communities who like to have such additional power. One 
still should once ask the question: "If someone really tries hard, how 
cryptic does the current syntax allow the code to become?"

I also see a lot of work (which should not disencourage you!). Programmatic 
formatting is convenient to the programmer, but it can become a great burdon 
for implementation and practical maintenance. Security will be an issue, 
since the interpreter is more complex, and since there might be ways of 
sneaking unwanted PHP code and/or unwanted HTML code into the system.

As I see it, your approach mixes a formatting language for tables with a 
programmatic query language (actually, it seems to me that the principle 
computational complexity of the queries might even be higher for your 
approach than for the original ask). If you want to go this way, I would 
suggest you to take a step-wise approach: 

1) Think about what new tasks the language should allow you to solve; collect 
use-cases ("Where would I need which capability?"). Also think about what the 
language must avoid (e.g. "The language should not allow the encoding of 
infinite loops.")
2) Look at other query languages that may satisfy your requirements already 
(e.g. SPARQL would be suggestive as a base query language).
3) If you find that you need a new language, think about which fundamental 
operations are needed to achieve the above. This is a trade-off between power 
and unmaintainability.
4) Define a nice syntax. Either for your new language or for using the 
language that you found suitable in (2) within the wiki.

As I see it, you currently do (3) and (4) in parallel, but do not have a clear 
concept of (1). For instance, I notice that your language does not have 
conditionals. Is this by choice, since there are no use-cases interesting to 
you in which this is needed? Do you then provide any Template support for 
output formatting? What if a template contains conditional statements? What 
if one modifies a list while iterating over it? ...

Good luck,

Markus

>
> Christopher Baker
>
> On 11/20/06, Fernando Correia <[EMAIL PROTECTED]> wrote:
> > I'm just beginning to use Semantic MediaWiki. I think it improves very
> > much on MediaWiki.
> >
> > One thing that it does is to allow us to manipulate the wiki as a
> > database.
> >
> > Based on this point of view, I think your proposal will enhance the
> > product and allow the users to extract and manipulate information in a
> > richer way.
> >
> > Just a thought: have you considered allowing the user to express this
> > logic in PHP, and have one or more PHP classes to easily work with the
> > query? One more programming language in the world...
> >
> > Congratulations for the good work!
> >
> > 2006/11/19, Christopher Baker <[EMAIL PROTECTED]>:
> > > I realize the length of this email, but i would greatly appreciate it
> > > if anybody would add their input. anythnig would help, really.
> > >
> > >
> > > I was thinking recently about creating an element similar to ask
> > > (intended to work with the current ask, not replace it) that was of a
> > > more code-like nature, allowing for more control over display. It would
> > > have functions such as add, sub, div, and mult (each operating on two
> > > numbers) and also a sum, which would add up all the integer values.
> > >
> > > There would also be a "query" function, which would take several sets
> > > of parameters. (more on this later) and would return an object that was
> > > refered to via other functions (attribute, attributes, relation, and
> > > relations). Brief descriptions follow. (Q refers to the object that
> > > query(...) returned, S refers to a string, F refers to a float, (...)
> > > is a list, Lrefers to a list, D refers to a dictionary. functions are
> > > called with paranthesis. every line ends with a ";". if you wish a
> > > semicolon in the code, you must escape it as in many other languages
> > > (ie: "\;"). comments are shown with "//" and continue till the next
> > > unescaped semicolon. note that the bold is for demonstrating only and
> > > will not be in the final result.)
> > > (the "dictionary" refered to above is a python-esque dictionary. this
> > > means that there is a key (which is a string) which coresponds to a
> > > list (may be a list of strings or a list of floats, but must be all the
> > > same))
> > >
> > > the values of a dictionary may be refered to via D[S]=L, where S is the
> > > name of the key.
> > > queries are acceptable in place of dictionaries as parameters, but
> > > dictionaries are not acceptable as queries.
> > > extra whitespace at the begining and ending of lines will be ignored.
> > >
> > > D=query((S),(S),S); // the first list of strings is page names (using *
> > > for a wildcard). the last string (the one not in a list) is the sort.
> > > The second list is very similar to the current ask. the list might look
> > > somethnig like
> > > ("category:checkbook","date:=+","date:=*","amount:=*","who:=*","memo:=*
> > >","chnum:=+","chnum:=*");
> > >
> > > D=attribute(S,Q); // the given string is the name of an attribute
> > > (error if not extant in Q ). the keys of D are the names of pages and
> > > the lists are lists of the values of the attribute;
> > > D=attributes(S,Q); // the given string is the name of a page (error if
> > > not extant in Q). the keys of D are the names of attributes and the
> > > lists are lists of the values of the coresponding attribute;
> > > D=relation(S,Q); // the given string is the name of a relation (error
> > > if not extant in Q). the keys of D are the names of pages and the lists
> > > are lists of the values of the relation;
> > > D=relations(S,Q); // the given string is the name of a page (error if
> > > not extant in Q). the keys of D are the names of relations and the
> > > lists are lists of the values of the coresponding relations;
> > >
> > > F=add(F,F); // return the two added together;
> > > F=sub(F,F); // return the first minus the second;
> > > F=mult(F,F); // return the two multiplied together;
> > > F=div(F,F); // return the first divided by the second;
> > >
> > > F=sum(D); // adds up all the values. error if it entounters a string.
> > > the key is ignored. can be used on the output of attribute, attributes,
> > > or query.;
> > >
> > > F=length(D); // returns the number of keys in the dictionary or query;
> > >
> > > the following is an example: (note no boldface is used)
> > >
> > > // begin example;
> > >
> > > q=query(("+"),("category:checkbook","date:=+","date:=*","amount:=*","wh
> > >o:=*","memo:=*","chnum:=+","chnum:=*"),"chnum");
> > > print(sum(attribute("amount",q)));
> > > print("\n\n\n");
> > > bal=0;
> > > rowh(("No","Pay to the order of","Memo","Date","Amount","Balance")); //
> > > this will be explained later
> > > foreach(q,title) // this will be explained later
> > > {
> > >     a=attributes(title,q);
> > >     row((a["chnum"],a["who"],a["memo"],a["date"],a["amount"],bal)); //
> > > this will be explained later
> > >     bal=add(bal,a["amount"]);
> > > };
> > > row(("","","","","",bal));
> > > rowf(); // this will be explained later
> > > // end example;
> > >
> > > the following is an explaination of the new function, as well as a few
> > > more not used above (following the same conventions as above):
> > >
> > > rowh((S)); // creates a header for a table like the current ask does.
> > > the strings are the title of the columns;
> > > row((S or F)); // adds a row to the current table. the items will print
> > > in the same order as they appear;
> > > rowf(); // ends the current table;
> > >
> > > foreach(D,variable) {...}; // iterates through the query, assigning the
> > > variable (do not quote it) to the value of the key. also works with
> > > queries. the contents inside "{" and "}" are the same as elsewhere,
> > > except that they have another variable with which to work;
> > >
> > > print(S or F); // prints the string or float;
> > >
> > > table(Q); // print the query as the current ask would;
> > >
> > >
> > >
> > > To anybody who got this far, or gave input: Thank you very much!
> > >
> > > Christopher Baker
> > >
> > >
> > > -----------------------------------------------------------------------
> > >-- Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> > > your
> > > opinions on IT & business topics through brief surveys - and earn cash
> > >
> > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
> > >EV
> > >
> > > _______________________________________________
> > > Semediawiki-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user

-- 
Markus Krötzsch
Institute AIFB, University of Karlsruhe, D-76128 Karlsruhe
[EMAIL PROTECTED]        phone +49 (0)721 608 7362
www.aifb.uni-karlsruhe.de/WBS/     fax +49 (0)721 693  717

Attachment: pgpe9Jlx1Q2ja.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Semediawiki-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Reply via email to