[Versa] More on literal queries

Chimezie Ogbuji chimezie at gmail.com
Sat Sep 3 08:31:16 MDT 2005


I had to sleep on this one.


> 
> "some string value"
> 
> should only return a result if there exists a literal in the form of:
> 
> "some string value"
> or
> "some string value"@some_language
> or
> "some string value"^^xsd:string
> 
> ??

I'm not sure, because it renders this query useless:

typ(rss:Item) |- rss:title -> contains('Versa')

Especially if the rdf store is like so:

_:a rdf:type rss:Item
_:a rss:title "Versa references"
_:a rss:title "Versa specifications"

I think you should still be able to 'create' strings (in the query
space) for reference in filters especially

> same concept for number and boolean literals.

I would say no for the same reason.

> resource-query :== node-query
>                                    | boolean-query
>                                    | string-query
>                                    | number-query
>                                    | literal-query

I wouldn't include literals as resource-queries

> and returns a set with 0 or more literals that match (there could be
> the same string in multiple languages, or datatypes)
> #NOTE: I'm thinking of adding the triple quoted strings as a way to add
> big strings without having to embed \n and \"

I think would be as useful to Versa as it is to programming languages
that use it (Python, for instance).

> I like how this feels, so for
> 
> all() - rdf:type -> <http://foo.com>
> 
> A parser would expand this to
> 
> [all resource in model] - [resource rdf:type if it exists] -> [resource
> http://foo.com if it exists]
> 
> Then, in python, your filter becomes something of
> 
> for st in statement:
>    if st.subject in expanded_subjects and
>       st.predicate in expanded_predicates and
>       st.object in expanded_objects:
>    res.append(st.subject)
> 
> I like how it brings together the concept of "filter-expression" and
> "set-expression" we currently have.
> 
> thoughts?



More information about the Versa mailing list