[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-08-02 Thread noreply
The proposal to merge lp:~zeitgeist/zeitgeist/symbols into 
lp:~zeitgeist/zeitgeist/bluebird has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-08-01 Thread Michal Hruby
Review: Needs Fixing
My point is that the Symbol class itself shouldn't even be public, it should be 
something private to this source file.

Method that this file needs to expose are (all of them are static):

List Symbol.get_parents (string uri)
List Symbol.get_children (string uri)
List Symbol.get_all_children (string uri)
bool Symbol.is_a (string uri, string parent_uri)

string Symbol.get_display_name (string uri)
string Symbol.get_... (string uri)

and of course to make all of this usable:
void Symbol.register(string uri, string display_name, string[] parents, ...)
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-08-01 Thread Seif Lotfy
you can get the immidiate stuff by asking for the properties, parents and
children...
I will just change the names to get_all_parents

On Mon, Aug 1, 2011 at 1:55 PM, Michal Hruby  wrote:

> Review: Needs Fixing
> Since you made get_parents return all parents, there's now no way to get
> the immediate parents and therefore reconstruct the original ontology graph
> easily. Fix pls...
> --
> https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
> Your team Zeitgeist Framework Team is subscribed to branch
> lp:~zeitgeist/zeitgeist/bluebird.
>
> ___
> Mailing list: https://launchpad.net/~zeitgeist
> Post to : zeitgeist@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~zeitgeist
> More help   : https://help.launchpad.net/ListHelp
>

-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-08-01 Thread Michal Hruby
Review: Needs Fixing
Since you made get_parents return all parents, there's now no way to get the 
immediate parents and therefore reconstruct the original ontology graph easily. 
Fix pls...
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-07-31 Thread Seif Lotfy
>  - /* datamodel.vala
> ontology
> 
>  - public static HashTable SymbolsCollection = null;
> rename all_symbols, put it into Symbol (it's static), make it private
> 

why put it in symbol?

>  - displayName, allChildren
> display_name, all_children

ok

> 
>  - why are you messing with GenericArray<->List? (parents, etc.)
> they're the same, so use just one

ok i will go with string[]

> 
>  - doesn't work when it isn't a direct parent.
> you need to lookup the parent in all_symbols (formerly SymbolsCollection)
> then iterate over its all_children

what doesnt work? in case of get_parents it will work since upon construction u 
already pass the parent classes as an argument...

> 
>  - make the constructor private and let register take the uri/name/etc and
> instantiate (later we'll also hide register in some way, eg. making it
> protected).
> 
>  - we need a "static Symbol from_uri(sting uri)" which returns
> "all_symbols.lookup(uri)".

ok
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-07-31 Thread Michal Hruby
Review: Needs Fixing
I find the Symbol class just an implementation detail, there's no need to 
expose it at all, as RainCT said you'll want to use static functions with 
signature like `string[] Symbol.get_children (string uri)`, or `string 
Symbol.get_description (string uri)` (of course we can use different container, 
not just array of strings, but ultimately why not make it simple - the only 
reason that comes to mind would be API compatibility with current libzg).
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-07-31 Thread Siegfried Gevatter
Review: Needs Fixing
 - /* datamodel.vala
ontology

 - public static HashTable SymbolsCollection = null;
rename all_symbols, put it into Symbol (it's static), make it private

 - displayName, allChildren
display_name, all_children

 - why are you messing with GenericArray<->List? (parents, etc.)
they're the same, so use just one

 - doesn't work when it isn't a direct parent.
you need to lookup the parent in all_symbols (formerly SymbolsCollection)
then iterate over its all_children

 - make the constructor private and let register take the uri/name/etc and
instantiate (later we'll also hide register in some way, eg. making it
protected).

 - we need a "static Symbol from_uri(sting uri)" which returns
"all_symbols.lookup(uri)".
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/bluebird.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird

2011-07-31 Thread Seif Lotfy
Seif Lotfy has proposed merging lp:~zeitgeist/zeitgeist/symbols into 
lp:~zeitgeist/zeitgeist/bluebird.

Requested reviews:
  Zeitgeist Framework Team (zeitgeist)

For more details, see:
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927

Symbols class for generating symbols that will be used later for Interpretation 
and Manifestation
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/symbols/+merge/69927
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~zeitgeist/zeitgeist/symbols into lp:~zeitgeist/zeitgeist/bluebird.
=== modified file 'src/Makefile.am'
--- src/Makefile.am	2011-07-28 18:41:01 +
+++ src/Makefile.am	2011-07-31 16:01:20 +
@@ -25,6 +25,7 @@
 	constants.vala \
 	errors.vala \
 	table-lookup.vala \
+	ontology.vala \
 	$(NULL)
 
 bluebird_LDADD = \

=== added file 'src/ontology.vala'
--- src/ontology.vala	1970-01-01 00:00:00 +
+++ src/ontology.vala	2011-07-31 16:01:20 +
@@ -0,0 +1,92 @@
+/* datamodel.vala
+ *
+ * Copyright © 2011 Collabora Ltd.
+ * By Seif Lotfy 
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see .
+ *
+ */
+ 
+public static HashTable SymbolsCollection = null;
+
+public class Symbol
+{
+private GenericArray parents;
+private GenericArray children;
+private GenericArray allChildren;
+public string   name { get; private set; }
+public string   uri { get; private set; }
+public string   displayName { get; private set; }
+public string   doc { get; private set; }
+
+public Symbol(string uri, string name, string displayName, string doc, 
+GenericArray parents, GenericArray children, 
+GenericArray allChildren){
+this.name = name;
+this.uri = uri;
+this.displayName = displayName;
+this.doc = doc;
+this.parents = parents;
+this.children = children;
+this. allChildren = allChildren;
+}
+
+public List get_parents()
+{
+   var results = new List();
+   for (int i = 0; i < parents.length; i++){
+results.append(SymbolsCollection.lookup(parents[i]));
+   }
+   return results;
+}
+
+public List get_children()
+{
+var results = new List();
+for (int i = 0; i < children.length; i++){
+results.append(SymbolsCollection.lookup(children[i]));
+}
+return results;
+}
+
+public List get_all_children()
+{
+var results = new List();
+for (int i = 0; i < allChildren.length; i++){
+results.append(SymbolsCollection.lookup(allChildren[i]));
+}
+return results;
+}
+
+public bool is_a(Symbol symbol)
+{
+for (int i = 0; i < parents.length; i++){
+if (symbol.uri == parents[i])
+return true;
+}
+return false;
+}
+
+public string to_string()
+{
+return this.uri;
+}
+
+public void register()
+{
+if (SymbolsCollection == null)
+SymbolsCollection = new HashTable(str_hash, str_equal);
+SymbolsCollection.insert(uri, this);
+}
+}

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp