[Versa] More on literal queries
Uche Ogbuji
uche.ogbuji at fourthought.com
Fri Sep 9 11:24:21 MDT 2005
On Tue, 2005-09-06 at 09:19 -0400, Chimezie Ogbuji wrote:
> Okay, I have a suggestion regarding the need to query for a resource
> by name and a literal by value. This came from an exchange Uche and I
> had on IRC. If we leave the current Versa data model as is, we have
> URI references (not 'resources' as we currently call them, which is
> misleading) -
I don't think it's misleading at all. Do we really want to replay years
of discussion about what an RDF (or more precisely URI) resource
"means"? I certainly don't. Surely you're not telling me that if I do
a Versa query for "http://4suite.org" that I should get back a magical
abstraction that can dispense representations, such as the Web page
itself or whatever else I may send in an HTTP Accept header.
No, what we get is the URI reference, which for the purpose of RDF *is*
the resource.
The closest I could come to agreeing on this is "resource name". Not
"URI reference".
> which may or may not refer to rdf resources in the
> underlying model - and literal values which only exist in the query
> space and may not have any corresponding literal value in the
> underlying model.
>
> There is a need to query or match resources by URI and match literals
> by value w/out having to resort to convoluted queries such as:
>
> filter(all(),type(rdfs:Literal),eq("3.0"))
> filter(all(),eq('<mailto:foo at yahoo.com>'))
Yes, and we all agree with that. My point has always been that there
are better ways of doing so.
> We could define a function that takes a set of Versa data types
> (resource or literal) and 'grounds' them to the underlying model.
>
> For each data type leave it in the set if there is a corresponding RDF
> resource in the graph (by identity operation). Otherwise, remove it
>
> So:
>
> filter(all(),type(rdfs:Literal),eq("3.0"))
>
> becomes
>
> ground("3.0") => empty set or set("3.0") - depending on if there
> is a "3.0" in the graph
>
> filter(all(),eq('<mailto:foo at yahoo.com>'))
>
> becomes
>
> ground(<mailto:foo at yahoo.com>) => empty set or set(<mailto:foo at yahoo.com>)
>
> I'm suggesting the term 'ground' because it is used to describe the
> process of assigning unused URIs to blank nodes in a graph, which is
> (somewhat) similar in some ways to what is being done here, resolving
> a URI reference or literal in the query space to actual
> resources/literals in the underlying graph.
>
> We probably would also need to make sure our definition of eq is clear
> about the semantics of comparing a resource in the underlying model
> with a URI ref. Do we mention that the model has the right to
> determine how it calculates the identity operation, since this
> apparently may involve more than just a string comparison of the
> URI's?
I'm fine with this.
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html
XML Output with 4Suite & Amara - http://www.xml.com/pub/a/2005/04/20/py-xml.html
Use XSLT to prepare XML for import into OpenOffice Calc - http://www.ibm.com/developerworks/xml/library/x-oocalc/
Schema standardization for top-down semantic transparency - http://www-128.ibm.com/developerworks/xml/library/x-think31.html
More information about the Versa
mailing list