[Versa] Issue 3

Chimezie Ogbuji chimezie at gmail.com
Fri Aug 12 07:34:16 MDT 2005


On 8/12/05, Michael Olson <Mike.Olson at fourthought.com> wrote:
> 
> Currently, in a traverse operation you can get back either the subject
> or object of the statement.  I would like to propose the ability to get
> the entire statement as I need to make queries like
> 
> some_node - all() -> eq(.'foo')
> 
> to find out all of the properties on a node that have the value foo.

Hmm.. For now the best you could do is:

some_node - properties(some_node) -> eq('foo')
 
or

all() |- properties(.) -> eq('foo')

but that would only give you the objects where the properties have a
value of foo (not the properties themselves) in the first case and
*all* the nodes that have such properties (not the properties
themselves) in the second.

> Executing this on the following graph:
> 
> some_node --> p1 --> foo
> some_node --> p2 --> foo
> 
> would tell me there are two foos, but I need to know the bigger
> picture.  Now, I could do this with map() and properties() (I think)
> but it seems wasteful.

Yeah, it twists my head to think how you would use either filter/map
in conjunction with properties to do this.  I don't think you can.
> 
> Maybe a slight modification to the query like
> 
> some_node -* all() -> eq(.'foo')
> 
> Which kind of leads to:
> 
> expression - expression -> filter     --> results in object
> expression -| expression -> filter   --> results in subject
> expression -* expression -> filter    ---> results in statement
> expression -& expression -> filter    ---> results in predicate????

So, 1 and 2 we have already.  3 would require promoting statements to
first class Versa datatypes (which I think would have benefits - but
how would statement data types work with the other data types for
conversion to and from, etc..).  4 would just be an extension of the
traversal syntax and would solve the original problem.

> maybe one for statement URI?

I think if you promote statements to first class objects then you also
expose statementUri's and Scopes/Context to Versa.  Currently I can
only expose (or filter by) scopes with the explicit use of a scope
function, however if you model statements as first class objects with
the following properties:

- subject
- predicate
- object
- statementUri
- context/scope

You can kill two birds with one stone.  But what would be the
semantics of working with statements as objects.  What would be the
kinds of things you would want to do with statements as a whole (as
opposed to just their parts)?

> 
> This means that statement would need to be added as a data type.  with
> conversion and a set of functions......

Ya...
> 
> Mike
> 
> 
> ------------------------------------------------------------------------
> -----------------
> Mike Olson                                                Principal
> Consultant
> mike.olson at fourthought.com                +1 720 253 4662
> Fourthought, Inc.
> http://Fourthought.com
> PO Box 270590,                                       http://4Suite.org
> Louisville, CO 80027-5009, USA
> XML strategy, XML tools, knowledge management
> 
> _______________________________________________
> Versa mailing list
> Versa at lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/versa
> 
>



More information about the Versa mailing list